File: sensord.h

package info (click to toggle)
lm-sensors 1%3A3.3.2-2%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,912 kB
  • sloc: perl: 5,743; ansic: 5,093; sh: 2,218; lex: 372; yacc: 296; makefile: 274
file content (90 lines) | stat: -rw-r--r-- 2,249 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * sensord
 *
 * A daemon that periodically logs sensor information to syslog.
 *
 * Copyright (c) 1999-2002 Merlin Hughes <merlin@merlin.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA.
 */

#include "lib/sensors.h"

#define ARRAY_SIZE(arr)	(int)(sizeof(arr) / sizeof((arr)[0]))

extern void sensorLog(int priority, const char *fmt, ...);

/* from args.c */

extern int parseArgs(int argc, char **argv);
extern int parseChips(int argc, char **argv);
extern void freeChips(void);

/* from lib.c */

extern int loadLib(const char *cfgPath);
extern int reloadLib(const char *cfgPath);
extern int unloadLib(void);

/* from sense.c */

extern int readChips(void);
extern int scanChips(void);
extern int setChips(void);
extern int rrdChips(void);

/* from rrd.c */

extern char rrdBuff[];
extern int rrdInit(void);
extern int rrdUpdate(void);
extern int rrdCGI(void);

/* from chips.c */

#define MAX_DATA 5

typedef const char *(*FormatterFN) (const double values[], int alrm,
				     int beep);

typedef const char *(*RRDFN) (const double values[]);

typedef enum {
	DataType_voltage = 0,
	DataType_rpm,
	DataType_temperature,
	DataType_loadavg,
	DataType_other = -1
} DataType;

typedef struct {
	FormatterFN format;
	RRDFN rrd;
	DataType type;
	int alarmNumber;
	int beepNumber;
	const sensors_feature *feature;
	int dataNumbers[MAX_DATA + 1];
} FeatureDescriptor;

typedef struct {
	const sensors_chip_name *name;
	FeatureDescriptor *features;
} ChipDescriptor;

extern ChipDescriptor * knownChips;
extern int initKnownChips(void);
extern void freeKnownChips(void);