wmSMPmon: Solaris support, load aggregation
[dockapps.git] / wmacpi / wmacpi.h
blobe9c15a55374d1bb4fde8cedb8942c702da776da7
1 #ifndef _WMACPI_H_
2 #define _WMACPI_H_
4 #ifdef PRO
5 #define eprint(level, fmt, arg...) \
6 switch (level) { \
7 case 0: \
8 break; \
9 case 1: \
10 fprintf(stderr, __FUNCTION__": " fmt, ##arg); \
11 fprintf(stderr, "\n"); \
12 break; \
14 #else
15 #define eprint(level, fmt, arg...) \
16 do { } while (0)
17 #endif
19 typedef enum {
20 REMAIN,
21 TIMER
22 } DspMode;
24 typedef enum {
25 BLINK,
26 OFF
27 } Mode;
29 typedef enum {
30 POWER, /* on AC, Battery charged */
31 CHARGING, /* on AC, Charging */
32 HIGH, /* on Battery, HIGH */
33 LOW, /* on Battery, LOW */
34 CRIT /* on Battery, CRIT */
35 } State;
37 typedef struct {
38 State power; /* power state: Battery levels or AC */
39 int percentage; /* battery percentage (-1 if no battery) */
40 int rtime; /* remaining time */
41 int timer; /* how long been on battery? */
42 int crit_level; /* anything below this is critical low */
43 } APMInfo;
45 /* detect plugin events */
46 void process_plugin_timer(void);
47 /* check if apm/acpi is enabled, etc */
48 int power_init(void);
49 /* fill APMInfo with data */
50 void acquire_info(void);
52 #endif /* _WMACPI_H_ */