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