Initial dockapps git repo
[dockapps.git] / wmpower-0.4.3 / src / power_management / acpi / libacpi.h
blob3d1b3a8a147ba8335716329113ac07e304156a8a
1 /***************************************************************************
2 libacpi.h - description
3 -------------------
4 begin : Feb 10 2003
5 copyright : (C) 2003 by Noberasco Michele
6 e-mail : 2001s098@educ.disi.unige.it
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 * *
26 ***************************************************************************/
28 /***************************************************************************
29 Originally written by Costantino Pistagna for his wmacpimon
30 ***************************************************************************/
32 #define MAXBATT 8
33 #define MAXFANS 8
35 typedef enum
37 POWER, /* on AC, Battery charged */
38 DISCHARGING, /* on Battery, Discharging */
39 CHARGING, /* on AC, Charging */
40 UNKNOW /* unknown */
42 Charging;
44 typedef struct
46 /* /proc stuff */
47 int present; /* 1 if present, 0 if no battery */
48 Charging state; /* charging state enum */
49 int prate; /* present rate */
50 int rcapacity; /* rameining capacity */
51 int pvoltage; /* present voltage */
52 /* not present in /proc */
53 int rtime; /* remaining time */
54 int percentage; /* battery percentage (-1 if no battery) */
56 ACPIstate;
58 typedef struct
60 int present; /* 1 if present, 0 if no battery */
61 int design_capacity; /* design capacity */
62 int last_full_capacity; /* last_full_capacity */
63 int battery_technology; /* 1 non-rechargeable, 0 rechargeable */
64 int design_voltage; /* design voltage */
65 int design_capacity_warning; /* design capacity warning (critical) */
66 int design_capacity_low; /* design capacity low (low level) */
68 ACPIinfo;
70 char battery_type;
72 typedef struct
74 int state; /* 1 if online, 0 if offline */
76 ACADstate;
78 /* number of batteries detected */
79 int batt_count;
81 int check_acpi (void);
82 void read_acad_state (ACADstate *acadstate);
83 void read_acpi_info (ACPIinfo *acpiinfo, int battery);
84 void read_acpi_state (ACPIstate *acpistate, ACPIinfo *acpiinfo, int battery);
85 void acpi_get_temperature(int *temperature, int *temp_is_celsius);
86 int acpi_get_fan_status(void);