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