root/lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.h @ 4668

Revision 4668, 2.8 KB (checked in by khali, 6 years ago)

Pass structures by reference in sensors and sensord, again for a
small performance gain and better consistency with the new
libsensors API.

  • 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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#define version "0.6.3"
24
25#include "lib/sensors.h"
26
27extern void sensorLog (int priority, const char *fmt, ...);
28
29/* from args.c */
30
31extern int isDaemon;
32extern const char *sensorsCfgFile;
33extern const char *pidFile;
34extern const char *rrdFile;
35extern const char *cgiDir;
36extern int scanTime;
37extern int logTime;
38extern int rrdTime;
39extern int rrdNoAverage;
40extern int syslogFacility;
41extern int doScan;
42extern int doSet;
43extern int doCGI;
44extern int doLoad;
45extern int debug;
46extern sensors_chip_name chipNames[];
47extern int numChipNames;
48
49extern int parseArgs (int argc, char **argv);
50extern int parseChips (int argc, char **argv);
51
52/* from lib.c */
53
54extern int initLib (void);
55extern int loadLib (void);
56extern int reloadLib (void);
57extern int unloadLib (void);
58
59/* from sense.c */
60
61extern int getValid (const sensors_chip_name *name, int feature, int *valid);
62extern int getLabel (const sensors_chip_name *name, int feature, char **label);
63extern int getRawLabel (const sensors_chip_name *name, int feature, const char **label);
64
65extern int readChips (void);
66extern int scanChips (void);
67extern int setChips (void);
68extern int rrdChips (void);
69
70/* from rrd.c */
71
72extern char rrdBuff[];
73extern int rrdInit (void);
74extern int rrdUpdate (void);
75extern int rrdCGI (void);
76
77/* from chips.c */
78
79#define MAX_DATA 5
80
81typedef const char * (*FormatterFN) (const double values[], int alarm, int beep);
82
83typedef const char * (*RRDFN) (const double values[]);
84
85typedef enum {
86  DataType_voltage = 0,
87  DataType_rpm,
88  DataType_temperature,
89  DataType_mhz,
90  DataType_other = -1
91} DataType;
92
93typedef struct {
94  FormatterFN format;
95  RRDFN rrd;
96  DataType type;
97  int alarmMask;
98  int beepMask;
99  const int dataNumbers[MAX_DATA + 1]; /* First entry is used for the label */
100} FeatureDescriptor;
101
102typedef struct {
103  const char * const *names;
104  const FeatureDescriptor *features;
105  int alarmNumber;
106  int beepNumber;
107} ChipDescriptor;
108
109extern const ChipDescriptor * const knownChips[];
Note: See TracBrowser for help on using the browser.