Various fixes.
[monky] / src / apcupsd.h
1 /* apcupsd.h:  conky module for APC UPS daemon monitoring
2  *
3  * Copyright (C) 2009 Jaromir Smrcek <jaromir.smrcek@zoner.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
18  * USA. */
19
20 #ifndef APCUPSD_H_
21 #define APCUPSD_H_
22
23 enum _apcupsd_items {
24         APCUPSD_NAME,
25         APCUPSD_MODEL,
26         APCUPSD_UPSMODE,
27         APCUPSD_CABLE,
28         APCUPSD_STATUS,
29         APCUPSD_LINEV,
30         APCUPSD_LOAD,
31         APCUPSD_CHARGE,
32         APCUPSD_TIMELEFT,
33         APCUPSD_TEMP,
34         APCUPSD_LASTXFER,
35         _APCUPSD_COUNT,
36 };
37
38 /* type for data exchange with main thread */
39 #define APCUPSD_MAXSTR 32
40 typedef struct apcupsd_s {
41         char items[_APCUPSD_COUNT][APCUPSD_MAXSTR+1];   /* e.g. items[APCUPSD_STATUS] */
42         char host[64];
43         int  port;
44 } APCUPSD_S, *PAPCUPSD_S;
45
46 /* Service routine for the conky main thread */
47 void update_apcupsd(void);
48
49 /* fill in the default values */
50 void init_apcupsd(void);
51
52 #endif /*APCUPSD_H_*/