3 #ifdef HAVE_MACHINE_APM_BIOS_H /* for FreeBSD */
4 #include <machine/apm_bios.h>
7 #ifdef HAVE_I386_APMVAR_H /* for NetBSD and OpenBSD */
8 #include <i386/apmvar.h>
15 /* Symbolic constants for apm may be in system apm.h, or may not. */
16 #ifndef AC_LINE_STATUS_ON
17 #define AC_LINE_STATUS_OFF (0)
18 #define AC_LINE_STATUS_ON (1)
19 #define AC_LINE_STATUS_BACKUP (2)
20 #define AC_LINE_STATUS_UNKNOWN (0xff)
22 #define BATTERY_STATUS_HIGH (0)
23 #define BATTERY_STATUS_LOW (1)
24 #define BATTERY_STATUS_CRITICAL (2)
25 #define BATTERY_STATUS_CHARGING (3)
26 #define BATTERY_STATUS_ABSENT (4)
27 #define BATTERY_STATUS_UNKNOWN (0xff)
29 #define BATTERY_FLAGS_HIGH (0x1)
30 #define BATTERY_FLAGS_LOW (0x2)
31 #define BATTERY_FLAGS_CRITICAL (0x4)
32 #define BATTERY_FLAGS_CHARGING (0x8)
33 #define BATTERY_FLAGS_ABSENT (0x80)
35 #define BATTERY_PERCENTAGE_UNKNOWN (-1)
37 #define BATTERY_TIME_UNKNOWN (-1)
38 #endif /* AC_LINE_STATUS_ON */
40 #if !defined(HAVE_LIBAPM)
42 const char driver_version
[10];
43 int apm_version_major
;
44 int apm_version_minor
;
49 int battery_percentage
;
54 int apm_read(apm_info
*i
);