root/lm-sensors/trunk/prog/sensord/sensord.h

Revision 5797, 2.2 KB (checked in by khali, 3 years ago)

"alarm" is a glibc function, don't use this identifier for our own
variables to prevent any confusion.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * sensord
3 *
4 * A daemon that periodically logs sensor information to syslog.
5 *
6 * Copyright (c) 1999-2002 Merlin Hughes <merlin@merlin.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 * MA 02110-1301 USA.
22 */
23
24#include "lib/sensors.h"
25
26#define ARRAY_SIZE(arr) (int)(sizeof(arr) / sizeof((arr)[0]))
27
28extern void sensorLog(int priority, const char *fmt, ...);
29
30/* from args.c */
31
32extern int parseArgs(int argc, char **argv);
33extern int parseChips(int argc, char **argv);
34extern void freeChips(void);
35
36/* from lib.c */
37
38extern int loadLib(const char *cfgPath);
39extern int reloadLib(const char *cfgPath);
40extern int unloadLib(void);
41
42/* from sense.c */
43
44extern int readChips(void);
45extern int scanChips(void);
46extern int setChips(void);
47extern int rrdChips(void);
48
49/* from rrd.c */
50
51extern char rrdBuff[];
52extern int rrdInit(void);
53extern int rrdUpdate(void);
54extern int rrdCGI(void);
55
56/* from chips.c */
57
58#define MAX_DATA 5
59
60typedef const char *(*FormatterFN) (const double values[], int alrm,
61                                     int beep);
62
63typedef const char *(*RRDFN) (const double values[]);
64
65typedef enum {
66        DataType_voltage = 0,
67        DataType_rpm,
68        DataType_temperature,
69        DataType_other = -1
70} DataType;
71
72typedef struct {
73        FormatterFN format;
74        RRDFN rrd;
75        DataType type;
76        int alarmNumber;
77        int beepNumber;
78        const sensors_feature *feature;
79        int dataNumbers[MAX_DATA + 1];
80} FeatureDescriptor;
81
82typedef struct {
83        const sensors_chip_name *name;
84        FeatureDescriptor *features;
85} ChipDescriptor;
86
87extern ChipDescriptor * knownChips;
88extern int initKnownChips(void);
89extern void freeKnownChips(void);
Note: See TracBrowser for help on using the browser.