5 #define LIBACPI_VER "0.91"
7 /* Here because we need it for definitions in this file . . . */
47 /* these two are conveniences */
48 char info_file
[MAX_NAME
];
49 char state_file
[MAX_NAME
];
51 int design_cap
; /* assuming mAh */
53 int design_voltage
; /* in mV */
55 cap_state_t capacity_state
;
56 charge_state_t charge_state
;
57 int present_rate
; /* in mAh */
58 int remaining_cap
; /* in mAh */
59 int present_voltage
; /* in mV */
60 /* calculated states */
62 int percentage
; /* stored here because this is a per battery thing */
63 int charge_time
; /* time left to charge this battery */
64 /* and a flag to indicate that this is valid . . . */
70 char state_file
[MAX_NAME
];
74 /* how to calculate the time remaining */
76 RT_RATE
, /* using the current rate, as per the ACPI spec */
77 RT_CAP
, /* using the remaining capacity over time */
81 int rtime
; /* remaining time */
82 int timer
; /* how long been on battery? */
83 int crit_level
; /* anything below this is critical low */
84 int battery_count
; /* number of batteries found */
85 enum rtime_mode rt_mode
;
86 battery_t
*binfo
; /* pointer to the battery being monitored */
91 * Moving percentage to the battery is right, but I think we need a global
92 * remaining capacity somewhere, too . . .
96 * To provide a convenient debugging function . . .
98 * It's a macro because I'm too lazy to deal with varargs.
101 #define pdebug(fmt, arg...) \
104 fprintf(stderr, fmt, ##arg); \
107 #define pinfo(fmt, arg...) \
110 fprintf(stderr, fmt, ##arg); \
113 #define perr(fmt, arg...) \
116 fprintf(stderr, fmt, ##arg); \
119 #define pfatal(fmt, arg...) \
120 fprintf(stderr, fmt, ##arg) \
123 /* Since these /are/ needed here . . . */
124 battery_t batteries
[MAXBATT
];
127 /* check if apm/acpi is enabled, etc */
128 int power_init(global_t
*globals
);
129 /* reinitialise everything */
130 int power_reinit(global_t
*globals
);
131 int reinit_ac_adapters(global_t
*globals
);
132 int reinit_batteries(global_t
*globals
);
134 /* fill global_t with data */
135 void acquire_batt_info(global_t
*globals
, int batt
);
136 void acquire_all_batt_info(global_t
*globals
);
137 void acquire_global_info(global_t
*globals
);
138 void acquire_all_info(global_t
*globals
);
140 #endif /* _WMACPI_H_ */