libacpi-0.2/0000755000175000017500000000000010653101606011444 5ustar nionnionlibacpi-0.2/libacpi.30000644000175000017500000002546410653101576013154 0ustar nionnion.hy 0 .TH libacpi 3 LIBACPI "" .ds n 5 .ds d /etc/terminfo .SH NAME \fBlibacpi\fR \- general purpose library for ACPI .SH SYNOPSIS \fB#include \fR .br .SH DESCRIPTION The \fBlibacpi\fR library routines provide its users a method of reading ACPI values in a comfortable way. This includes battery information, fan states, thermal zones and AC states. .PP A program using these routines must be linked with \fB\-lacpi\fR option. .PP To initialize this functionality you have to first allocate space for a global_t structure .sp \fBglobal_t *global = malloc (sizeof (global_t));\fR .sp Now use the \fBcheck_acpi_support()\fR function to check if the system actually supports ACPI. In case it does the function will return \fBSUCCESS\fR or \fBNOT_SUPPORTED\fR on failure. .sp Now you can use the following functions to initialize the values you get from the ACPI interface: .sp \fBinit_acpi_batt(global);\fR \fBinit_acpi_acadapt(global);\fR \fBinit_acpi_fan(global);\fR \fBinit_acpi_thermal(global);\fR .sp To know if some of the features is not supported it is a good idea to store the return values in some variable. .sp If you want to read non\-static values the ACPI interface provides (for example battery percentage), use the following functions to do this: .sp \fBread_acpi_batt(int num)\fR \fBread_acpi_zone(int num, global_t *globals);\fR \fBread_acpi_fan(int num)\fR \fBread_acpi_acstate(global_t *globals);\fR .sp Since you can have more than one battery, fan and thermal zone, num is the number you want to read, for example in a loop. .sp \fBthermal_t *tp;\fR .... \fBfor(i=0; ithermal_count; i++){\fR \fB read_acpi_zone(i, global);\fR \fB tp = &thermals[i];\fR ... \fB}\fR .SS "Structures" .in +1c .ti -1c .RI "struct \fBfan_t\fP" .br .RI "\fIfan data \fP" .ti -1c .RI "struct \fBbattery_t\fP" .br .RI "\fIinformation found about battery \fP" .ti -1c .RI "struct \fBthermal_t\fP" .br .RI "\fIinformation about thermal zone \fP" .ti -1c .RI "struct \fBadapter_t\fP" .br .RI "\fIinformation about ac adapater \fP" .ti -1c .RI "struct \fBglobal_t\fP" .br .RI "\fIglobal acpi structure \fP" .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBinit_acpi_batt\fP (\fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBinit_acpi_acadapt\fP (\fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBinit_acpi_thermal\fP (\fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBinit_acpi_fan\fP (\fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBcheck_acpi_support\fP (void)" .br .ti -1c .RI "int \fBread_acpi_batt\fP (const int num)" .br .ti -1c .RI "void \fBread_acpi_acstate\fP (\fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBread_acpi_zone\fP (const int num, \fBglobal_t\fP *globals)" .br .ti -1c .RI "int \fBread_acpi_fan\fP (const int num)" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "\fBbattery_t\fP \fBbatteries\fP [MAX_ITEMS]" .br .ti -1c .RI "\fBthermal_t\fP \fBthermals\fP [MAX_ITEMS]" .br .ti -1c .RI "\fBfan_t\fP \fBfans\fP [MAX_ITEMS]" .br .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum { \fBITEM_EXCEED\fP = \-5, \fBDISABLED\fP = \-4, \fBNOT_PRESENT\fP = \-3, \fBALLOC_ERR\fP = \-2, \fBNOT_SUPPORTED\fP = \-1, \fBSUCCESS\fP }" .br .ti -1c .RI "enum \fBpower_state_t\fP { \fBP_AC\fP, \fBP_BATT\fP, \fBP_ERR\fP }" .br .ti -1c .RI "enum \fBthermal_state_t\fP { \fBT_CRIT\fP, \fBT_HOT\fP, \fBT_PASS\fP, \fBT_ACT\fP, \fBT_OK\fP, \fBT_ERR\fP }" .br .ti -1c .RI "enum \fBcharge_state_t\fP { \fBC_CHARGE\fP, \fBC_DISCHARGE\fP, \fBC_CHARGED\fP, \fBC_NOINFO\fP, \fBC_ERR\fP }" .br .ti -1c .RI "enum \fBbatt_state_t\fP { \fBB_HIGH\fP, \fBB_MED\fP, \fBB_LOW\fP, \fBB_CRIT\fP, \fBB_HARD_CRIT\fP, \fBB_ERR\fP }" .br .ti -1c .RI "enum \fBthermal_mode_t\fP { \fBCO_ACT\fP, \fBCO_PASS\fP, \fBCO_CRIT\fP, \fBCO_ERR\fP }" .br .ti -1c .RI "enum \fBfan_state_t\fP { \fBF_ON\fP, \fBF_OFF\fP, \fBF_ERR\fP }" .br .in -1c .SH "Detailed Description" .PP Now follows a more detailed description of functions, structures and enums. Definition in file \fBlibacpi.h\fP. .SH "Function Documentation" .PP .SS "int check_acpi_support (void)" .PP Checks if the system does support ACPI or not. .PP \fBReturns:\fP .RS 4 SUCCESS if the system supports ACPI or, NOT_SUPPORTED. .RE .SS "int init_acpi_acadapt (\fBglobal_t\fP * globals)" .PP Finds existing ac adapter and fills the adapt (in globa struct) structure with the paths of the important files to parse. .PP \fBParameters:\fP .RS 4 \fIglobals\fP pointer to global acpi structure .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, NOT_SUPPORTED if no information can be found, ALLOC_ERR on allocation errors. .RE .PP .SS "int init_acpi_batt (\fBglobal_t\fP * globals)" .PP Finds existing batteries and fills the corresponding batteries structures with the paths of the important files to parse. .PP \fBParameters:\fP .RS 4 \fIglobals\fP pointer to global acpi structure .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, NOT_SUPPORTED if no information can be found, ALLOC_ERR on allocation errors and ITEM_EXCEED if there are more batteries found than MAX_ITEMS, this should never happen. .RE .PP .SS "int init_acpi_fan (\fBglobal_t\fP * globals)" .PP Finds existing fans and fills corresponding fan structures with the paths of the important files to parse for fan information. .PP \fBParameters:\fP .RS 4 \fIglobals\fP pointer to global acpi structure .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, NOT_SUPPORTED if no information can be found, ALLOC_ERR on allocation errors and ITEM_EXCEED if there are more fans found than MAX_ITEMS, this should never happen. .RE .PP .SS "int init_acpi_thermal (\fBglobal_t\fP * globals)" .PP Finds existing thermal zones and fills corresponding thermal structures with the paths of the important files to parse for thermal information. .PP \fBParameters:\fP .RS 4 \fIglobals\fP pointer to global acpi structure .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, NOT_SUPPORTED if no information can be found, ALLOC_ERR on allocation errors and ITEM_EXCEED if there are more thermal zones found than MAX_ITEMS, this should never happen. .RE .PP .SS "void read_acpi_acstate (\fBglobal_t\fP * globals)" .PP Looks up if the ac adapter is plugged in or not and sets the values in a struct .PP \fBParameters:\fP .RS 4 \fIglobals\fP pointer to the global acpi structure .RE .PP Referenced by init_acpi_acadapt(). .SS "int read_acpi_batt (const int num)" .PP Gathers all information of a given battery and filling a struct with it. .PP \fBParameters:\fP .RS 4 \fInum\fP number of battery .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok or ITEM_EXCEED if there is not battery num. .SS "int read_acpi_fan (const int num)" .PP Gathers all information about given fan and sets the corresponding values in a struct. .PP \fBParameters:\fP .RS 4 \fInum\fP number for the fan to read .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, ITEM_EXCEED if there is not fan num or NOT_SUPPORTED if the values can't be read. This should not happen if the init function returned SUCCESS if the ACPI implementation. .SS "int read_acpi_zone (const int num, \fBglobal_t\fP * globals)" .PP Gathers all information of a given thermal zone and sets the corresponding values in a struct. .PP \fBParameters:\fP .RS 4 \fInum\fP zone .br \fIglobals\fP pointer to global acpi struct, needed if there is just one zone .PP \fBReturns:\fP .Rs 4 SUCCESS if everything is ok, ITEM_EXCEED if there is not thermal zone num or NOT_SUPPORTED if the values can't be read. This should not happen if the init function returned SUCCESS if the ACPI implementation. .SH "Enumeration Type Documentation" .PP .SS "possible function return values" .PP \fBEnumerator: \fP .in +1c .TP \fB\fIITEM_EXCEED \fP\fP maximum item count reached .TP \fB\fIDISABLED \fP\fP features is disabled .TP \fB\fINOT_PRESENT \fP\fP something is not present .TP \fB\fIALLOC_ERR \fP\fP an error occurred while allocating space .TP \fB\fINOT_SUPPORTED \fP\fP a feature is not supported .TP \fB\fISUCCESS \fP\fP everything was fine .SS "enum \fBbatt_state_t\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fIB_HIGH \fP\fP remaining battery life is high .TP \fB\fIB_MED \fP\fP remaining battery life is medium .TP \fB\fIB_LOW \fP\fP remaining battery life is low .TP \fB\fIB_CRIT \fP\fP remaining battery life is critical .TP \fB\fIB_HARD_CRIT \fP\fP remaining battery life is hard critical, you have a few minutes to charge .TP \fB\fIB_ERR \fP\fP some error occurred while reading the battery state .SS "enum \fBcharge_state_t\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fIC_CHARGE \fP\fP battery is currently charging .TP \fB\fIC_DISCHARGE \fP\fP battery is currently discharging .TP \fB\fIC_CHARGED \fP\fP battery is charged .TP \fB\fIC_NOINFO \fP\fP hardware doesn't give information about the state .TP \fB\fIC_ERR \fP\fP some error occurred while reading the charge state .SS "enum \fBfan_state_t\fP" .PP fan states .PP \fBEnumerator: \fP .in +1c .TP \fB\fIF_ON \fP\fP fan is on .TP \fB\fIF_OFF \fP\fP fan is off .TP \fB\fIF_ERR \fP\fP some error occurred with this fan .SS "enum \fBpower_state_t\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fIP_AC \fP\fP if computer runs on AC .TP \fB\fIP_BATT \fP\fP if computer runs on battery .TP \fB\fIP_ERR \fP\fP no information can be found .SS "enum \fBthermal_mode_t\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fICO_ACT \fP\fP fans will be turned after the temperature passes a critical point .TP \fB\fICO_PASS \fP\fP devices will be put in a lower power state after a critical point .TP \fB\fICO_CRIT \fP\fP system goes into suspend to disk if possible after a critical temperature .TP \fB\fICO_ERR \fP\fP some error occurred while reading the cooling mode .SS "enum \fBthermal_state_t\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fIT_CRIT \fP\fP zone reports critical temperature, will cause system to go to S4 .TP \fB\fIT_HOT \fP\fP zone reports high temperature, will cause system to shutdown immediately .TP \fB\fIT_PASS \fP\fP zone is on passive cooling .TP \fB\fIT_ACT \fP\fP zone is on active cooling, more power consumption .TP \fB\fIT_OK \fP\fP zone is ok .TP \fB\fIT_ERR \fP\fP some error occurred while reading the state of the zone .SH "Variable Documentation" .PP .SS "\fBbattery_t\fP \fBbatteries\fP[MAX_ITEMS]" .PP Array for existing batteries, loop until globals\->battery_count .SS "\fBfan_t\fP \fBfans\fP[MAX_ITEMS]" .PP Array for existing fans, loop until globals\->fan_count .SS "\fBthermal_t\fP \fBthermals\fP[MAX_ITEMS]" .PP Array for existing thermal zones, loop until globals\->thermal_count .SH "Additional information" .PP The package ships a test\-libacpi.c file which should be pretty self explanatory. Also have a look into libacpi.h file and the doxygen documentation in the doc/ directory. .SH "Homepage" See http://www.ngolde.de/libacpi.html .SH "Author" .PP Write to nico (at) ngolde (dot) de for suggestions, hardware donations (very welcome, my notebook doesn't support all features and I could need a second battery), questions, fixes, bug reports, thanks, etc. :) libacpi-0.2/test-libacpi.c0000644000175000017500000000615010653101576014200 0ustar nionnion/* * Author: Nico Golde * Fr Mai 25 13:12:35 CEST 2007 * small test program for libacpi (http://www.ngolde.de/libacpi.html) * the include needs to be changed to link against the share lib, just didn't do * it because I don't want to install it every time before testing :) */ #include "libacpi.h" #include #include int main(void){ int i=0; int acstate, battstate, thermstate, fanstate; /* the global structure is _the_ acpi structure here */ global_t *global = malloc (sizeof (global_t)); battery_t *binfo; adapter_t *ac = &global->adapt; thermal_t *tp; fan_t *fa; if(check_acpi_support() == NOT_SUPPORTED){ printf("No acpi support for your system?\n"); return -1; } /* initialize battery, thermal zones, fans and ac state */ battstate = init_acpi_batt(global); thermstate = init_acpi_thermal(global); fanstate = init_acpi_fan(global); acstate = init_acpi_acadapt(global); if(acstate == SUCCESS && ac->ac_state == P_BATT) printf("AC adapter: off-line\n"); else if(acstate == SUCCESS && ac->ac_state == P_AC) printf("AC adapter: on-line\n"); else printf("AC information:\t\tnot supported\n"); if(battstate == SUCCESS){ for(i=0;ibatt_count;i++){ binfo = &batteries[i]; /* read current battery values */ read_acpi_batt(i); if(binfo->present) printf("\n%s:\tpresent: %d\n" "\tdesign capacity: %d\n" "\tlast full capacity: %d\n" "\tdesign voltage: %d\n" "\tpresent rate: %d\n" "\tremaining capacity: %d\n" "\tpresent voltage: %d\n" "\tcharge state: %d\n" "\tbattery state: %d\n" "\tpercentage: %d%%\n" "\tremaining charge time: %02d:%02d h\n" "\tremaining time: %02d:%02d h\n", binfo->name, binfo->present, binfo->design_cap, binfo->last_full_cap, binfo->design_voltage, binfo->present_rate, binfo->remaining_cap, binfo->present_voltage, binfo->charge_state, binfo->batt_state, binfo->percentage, binfo->charge_time / 60, binfo->charge_time % 60, binfo->remaining_time / 60, binfo->remaining_time % 60); } } else printf("Battery information:\tnot supported\n"); if(thermstate == SUCCESS){ for(i=0; ithermal_count; i++){ /* read current thermal zone values */ read_acpi_zone(i, global); tp = &thermals[i]; if(tp->frequency == DISABLED) printf("\n%s:\ttemperature: %d C\n" "\tfrequency: disabled\n" "\tmode: %d\n" "\tstate: %d\n", tp->name, tp->temperature, tp->therm_mode, tp->therm_state); else printf("\n%s:\ttemperature: %d C\n" "\tfrequency: %d seconds\n" "\tmode: %d\n" "\tstate: %d\n", tp->name, tp->temperature,tp->frequency, tp->therm_mode, tp->therm_state); } if(global->thermal_count == 1) printf("Temperature: %d C\n", global->temperature); } else printf("Thermal information not supported\n"); if(fanstate == SUCCESS){ for(i=0; ifan_count; i++){ /* read fan state */ read_acpi_fan(i); fa = &fans[i]; printf("\n%s:\tstate: %d\n", fa->name, fa->fan_state); } } else printf("Fan information:\tnot supported\n"); free(global); return 0; } libacpi-0.2/libacpi.h0000644000175000017500000002113310653101576013226 0ustar nionnion/* * (C)opyright 2007 Nico Golde * See LICENSE file for license details */ /** * \file libacpi.h * \brief libacpi structures */ #ifndef __LIBACPI_H__ #define __LIBACPI_H__ #define PROC_ACPI "/proc/acpi/" #define LINE_MAX 256 #define MAX_NAME 512 #define MAX_BUF 1024 #define MAX_ITEMS 10 /** * \enum return values * \brief return values of internal functions */ enum { ITEM_EXCEED = -5, /**< maximum item count reached */ DISABLED = -4, /**< feature is disabled */ NOT_PRESENT = -3, /**< something is not present */ ALLOC_ERR = -2, /**< an error occurred while allocating space */ NOT_SUPPORTED = -1, /**< a feature is not supported */ SUCCESS /**< everything was fine */ }; /** * \struct power_state_t * \brief power states */ typedef enum { P_AC, /**< if computer runs on AC */ P_BATT, /**< if computer runs on battery */ P_ERR /**< no information can be found */ } power_state_t; /** * \struct thermal_state_t * \brief thermal zone states */ typedef enum { T_CRIT, /**< zone reports critical temperature, will cause system to go to S4 */ T_HOT, /**< zone reports high temperature, will cause system to shutdown immediately */ T_PASS, /**< zone is on passive cooling */ T_ACT, /**< zone is on active cooling, more power consumption */ T_OK, /**< zone is ok */ T_ERR /**< some error occurred while reading the state of the zone */ } thermal_state_t; /** * \struct charge_state_t * \brief charge state of battery */ typedef enum { C_CHARGE, /**< battery is currently charging */ C_DISCHARGE, /**< battery is currently discharging */ C_CHARGED, /**< battery is charged */ C_NOINFO, /**< hardware doesn't give information about the state */ C_ERR /**< some error occurred while reading the charge state */ } charge_state_t; /** * \struct batt_state_t * \brief battery life status */ typedef enum { B_HIGH, /**< remaining battery life is high */ B_MED, /**< remaining battery life is medium */ B_LOW, /**< remaining battery life is low */ B_CRIT, /**< remaining battery life is critical */ B_HARD_CRIT, /**< remaining battery life is hard critical, you have a few minutes to charge */ B_ERR /**< some error occurred while reading the battery state */ } batt_state_t; /** * \struct thermal_mode_t * \brief cooling mode */ typedef enum { CO_ACT, /**< fans will be turned after the temperature passes a critical point */ CO_PASS, /**< devices will be put in a lower power state after a critical point */ CO_CRIT, /**< system goes into suspend to disk if possible after a critical temperature */ CO_ERR /**< some error occurred while reading the cooling mode */ } thermal_mode_t; /** * \enum fan_state_t * \brief fan states */ typedef enum { F_ON, /**< fan is on */ F_OFF, /**< fan is off */ F_ERR /**< some error occurred with this fan */ } fan_state_t; /** * \struct fan_t * \brief fan data */ typedef struct { char name[MAX_NAME]; /**< name of the fan found in proc vfs */ char state_file[MAX_NAME]; /**< state file for the fan */ fan_state_t fan_state; /**< current status of the found fan */ } fan_t; /** * \struct battery_t * \brief information found about battery */ typedef struct { char name[MAX_NAME]; /**< name of the battery found in proc vfs */ char state_file[MAX_NAME]; /**< corresponding state file name + path */ char info_file[MAX_NAME]; /**< corresponding info file + path */ char alarm_file[MAX_NAME]; /**< corresponding alarm file + path */ int present; /**< battery slot is currently used by a battery or not? 0 if not, 1 if yes */ int design_cap; /**< assuming capacity in mAh*/ int last_full_cap; /**< last full capacity when the battery was fully charged */ int design_voltage; /**< design voltage in mV */ int present_rate; /**< present rate consuming the battery */ int remaining_cap; /**< remaining capacity, used to calculate percentage */ int present_voltage; /**< present voltage */ int design_warn; /**< specifies how many mAh need to be left to have a hardware warning */ int design_low; /**< specifies how many mAh need to be left before the battery is low */ int design_level1; /**< capacity granularity 1 */ int design_level2; /**< capacity granularity 2 */ int alarm; /**< generate hardware alarm in alarm "units" */ /* calculated states */ int percentage; /**< remaining battery percentage */ int charge_time; /**< remaining time to fully charge the battery in minutes */ int remaining_time; /**< remaining battery life time in minutes */ /* state info */ charge_state_t charge_state; /**< charge state of battery */ batt_state_t batt_state; /**< battery capacity state */ } battery_t; /** * \struct thermal_t * \brief information about thermal zone */ typedef struct { char name[MAX_NAME]; /**< name of the thermal zone */ int temperature; /**< current temperature of the zone */ int frequency; /**< polling frequency for this zone */ char state_file[MAX_NAME]; /**< state file + path of the zone */ char cooling_file[MAX_NAME]; /**< cooling mode file + path */ char freq_file[MAX_NAME]; /**< polling frequency file + path */ char trips_file[MAX_NAME]; /**< trip points file + path */ char temp_file[MAX_NAME]; /**< temperature file + path */ thermal_mode_t therm_mode; /**< current cooling mode */ thermal_state_t therm_state; /**< current thermal state */ } thermal_t; /** * \struct adapter_t * \brief information about ac adapater */ typedef struct { char *name; /**< ac adapter name */ char state_file[MAX_NAME]; /**< state file for adapter + path */ power_state_t ac_state; /**< current ac state, on-line or off-line */ } adapter_t; /** * \struct global_t * \brief global acpi structure */ typedef struct { int batt_count; /**< number of found batteries */ int thermal_count; /**< number of found thermal zones */ int fan_count; /**< number of found fans */ int temperature; /**< system temperature if we only have on thermal zone */ adapter_t adapt; /**< ac adapter */ } global_t; /** * Array for existing batteries, loop until * globals->battery_count */ battery_t batteries[MAX_ITEMS]; /** * Array for existing thermal zones, loop until * globals->thermal_count */ thermal_t thermals[MAX_ITEMS]; /** * Array for existing fans, loop until * globals->fan_count */ fan_t fans[MAX_ITEMS]; /** * Finds existing batteries and fills the * corresponding batteries structures with the paths * of the important to parse files * @param globals pointer to global acpi structure */ int init_acpi_batt(global_t *globals); /** * Finds existing ac adapter and fills the * adapt structure with the paths * of the important to parse files * @param globals pointer to global acpi structure */ int init_acpi_acadapt(global_t *globals); /** * Finds existing thermal zones and fills * corresponding thermal structures with the paths * of the important to parse files for thermal information * @param globals pointer to global acpi structure */ int init_acpi_thermal(global_t *globals); /** * Finds existing fans and fills * corresponding fan structures with the paths * of the important to parse files for fan information * @param globals pointer to global acpi structure */ int init_acpi_fan(global_t *globals); /** * Checks if the system does support ACPI or not * @return SUCCESS if the system supports ACPI or, NOT_SUPPORTED */ int check_acpi_support(void); /** * Gathers all information of a given battery and filling * a struct with it * @param num number of battery */ int read_acpi_batt(const int num); /** * Looks up if the ac adapter is plugged in or not * and sets the values in a struct * @param globals pointer to the global acpi structure */ void read_acpi_acstate(global_t *globals); /** * Gathers all information of a given thermal zone * and sets the corresponding values in a struct * @param num zone * @param globals pointer to global acpi struct, needed if there is just one zone */ int read_acpi_zone(const int num, global_t *globals); /** * Gathers all information about given fan * and sets the corresponding values in a struct * @param num number for the fan to read */ int read_acpi_fan(const int num); #endif /* !__LIBACPI_H__ */ libacpi-0.2/list.c0000644000175000017500000000270510653101576012575 0ustar nionnion/* * (C)opyright 2007 Nico Golde * See LICENSE file for license details * This is no complete linked list implementation, it is just used * to get a list of directory entries and delete the list */ #include #include #include #include #include "list.h" /* create a new list */ static list_t * new_list(void){ list_t *l = malloc(sizeof(list_t)); if(!l) return NULL; l->top = l->last = NULL; l->length = 0; return l; } static void append_node(list_t *lst, char *name){ node_t *n; if(!lst) return; if((n = malloc(sizeof(node_t))) == NULL) return; if((n->name = strdup(name)) == NULL) { free(n); return; } n->next = NULL; if(lst->top){ lst->last->next = n; lst->last = lst->last->next; } else { lst->top = lst->last = n; } lst->length++; } /* delete the whole list */ void delete_list(list_t *lst){ node_t *tmp; tmp = lst->top; while(tmp != NULL){ lst->top = tmp->next; if(tmp->name) free(tmp->name); free(tmp); tmp = lst->top; } lst->top = lst->last = NULL; free(lst); } /* return a linked list with directory entries or NULL on error */ list_t * dir_list(char *dir){ list_t *list = new_list(); DIR *rddir = NULL; struct dirent *rd; if((rddir = opendir(dir)) == NULL) return NULL; while((rd = readdir(rddir))){ if(!strncmp(".", rd->d_name, 1) || !strncmp("..", rd->d_name, 2)) continue; append_node(list, rd->d_name); } closedir(rddir); return list; } libacpi-0.2/config.mk0000644000175000017500000000047110653101576013252 0ustar nionnionVERSION = 0.2 SOVERSION = 0 SONAME = libacpi.so.${SOVERSION} # customize below to fit your system PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man # flags SOFLAGS = -shared -Wl,-soname,${SONAME} CFLAGS += -fPIC -g --pedantic -Wall -Wextra # Compiler and linker CC = cc LD = ${CC} AR = ar cr RANLIB = ranlib libacpi-0.2/CHANGES0000644000175000017500000000021410653101576012442 0ustar nionnion0.2 (2007-07-29): * Fixed memleaks * Prevent double header inclusion, thanks Julien Blache 0.1 (2007-06-14): * Initial release libacpi-0.2/libacpi.c0000644000175000017500000004071510653101576013230 0ustar nionnion/* * (C)opyright 2007 Nico Golde * See LICENSE file for license details */ #include #include #include #include #include #include #include #include "libacpi.h" #include "list.h" static int read_acpi_battinfo(const int num); static int read_acpi_battalarm(const int num); static int read_acpi_battstate(const int num); static void read_acpi_thermalzones(global_t *globals); typedef struct { char * value; size_t offset; } acpi_value_t; static acpi_value_t battinfo_values[] = { { "last full capacity:", offsetof(battery_t, last_full_cap) }, { "design voltage:", offsetof(battery_t, design_voltage) }, { "design capacity warning:", offsetof(battery_t, design_warn) }, { "design capacity low:", offsetof(battery_t, design_low) }, { "capacity granularity 1:", offsetof(battery_t, design_level1) }, { "capacity granularity 2:", offsetof(battery_t, design_level2) }, { NULL, 0 } }; static acpi_value_t battstate_values[] = { { "present rate:", offsetof(battery_t, present_rate) }, { "remaining capacity:", offsetof(battery_t, remaining_cap) }, { "present voltage:", offsetof(battery_t, present_voltage) }, { NULL, 0 } }; /* given a buffer for example from a file, search for key * and return a pointer to the value of it. On error return NULL*/ static char * scan_acpi_value(const char *buf, const char *key){ char *ptr = NULL; char *tmpbuf = NULL; char *tmpkey = NULL; char *tmpval = NULL; if((tmpbuf = strdup(buf)) == NULL) return NULL; /* jump to the key in buffer */ if((tmpkey = strstr(tmpbuf, key))) { /* jump behind the key, whitespaces and tabs */ for(tmpkey += strlen(key); *tmpkey && (*tmpkey == ' ' || *tmpkey == '\t'); tmpkey++); for(tmpval = tmpkey; *tmpval && *tmpval != ' ' && *tmpval != '\t' && *tmpval != '\n' && *tmpval != '\r'; tmpval++); if(tmpval) *tmpval = '\0'; if((ptr = strdup(tmpkey)) == NULL) { free(tmpbuf); return NULL; } } free(tmpbuf); return ptr; } /* reads a file into a buffer and returns a pointer to it, or NULL on error */ static char * get_acpi_content(const char *file){ FILE *input = NULL; char *buf = NULL; int read = 0; if((buf = malloc(MAX_BUF + 1)) == NULL) return NULL; if((input = fopen(file, "r")) == NULL) return NULL; read = fread(buf, 1, MAX_BUF, input); if(read > 0) buf[read - 1] = '\0'; else buf[0] = '\0'; /* I would consider it a kernel bug if that happens */ fclose(input); return buf; } /* returns the acpi version or NOT_SUPPORTED(negative value) on failure */ static int get_acpi_version(void){ long ret = -1; char *tmp = get_acpi_content(PROC_ACPI "info"); char *version = NULL; if(!tmp) { tmp = get_acpi_content("/sys/module/acpi/parameters/acpica_version"); if (tmp) { long ret = strtol(tmp, NULL, 10); free(tmp); return ret; } else { return NOT_SUPPORTED; } } if((version = scan_acpi_value(tmp, "version:")) == NULL){ free(tmp); return NOT_SUPPORTED; } ret = strtol(version, NULL, 10); free(tmp); free(version); return ret; } /* check if acpi is supported on the system, return 0 on success * and -1 if not */ int check_acpi_support(void){ int version = get_acpi_version(); /* we don't support 2.4 kernel versions TODO */ if(version == NOT_SUPPORTED || version < 20020214) return NOT_SUPPORTED; return SUCCESS; } /* reads existent battery directories and starts to fill the battery * structure. Returns 0 on success, negative values on error */ int init_acpi_batt(global_t *globals){ char *names[MAX_ITEMS]; battery_t *binfo; list_t *lst = NULL; node_t *node = NULL; int i = 0; globals->batt_count = 0; if((lst = dir_list(PROC_ACPI "battery")) == NULL || !lst->top) return NOT_SUPPORTED; for(node = lst->top; node; node=node->next){ if((names[globals->batt_count] = strdup(node->name)) == NULL){ delete_list(lst); return ALLOC_ERR; } globals->batt_count++; } if(globals->batt_count > MAX_ITEMS) return ITEM_EXCEED; /* A quick insertion sort, to sort battery names */ { char *tmp1, *tmp2; int x,y; for (x = 1; x < globals->batt_count; x++) { tmp1 = names[x]; y = x - 1; while ((y >= 0) && ((strcmp (tmp1, names[y])) < 0)) { tmp2 = names[y + 1]; names[y + 1] = names[y]; names[y] = tmp2; } } } for (i=0; i < globals->batt_count && i < MAX_ITEMS; i++){ binfo = &batteries[i]; snprintf(binfo->name, MAX_NAME, "%s", names[i]); snprintf(binfo->state_file, MAX_NAME, PROC_ACPI "battery/%s/state", names[i]); snprintf(binfo->info_file, MAX_NAME, PROC_ACPI "battery/%s/info", names[i]); snprintf(binfo->alarm_file, MAX_NAME, PROC_ACPI "battery/%s/alarm", names[i]); read_acpi_battinfo(i); read_acpi_battalarm(i); free(names[i]); } delete_list(lst); return SUCCESS; } /* reads the acpi state and writes it into the globals structure, void */ void read_acpi_acstate(global_t *globals){ adapter_t *ac = &globals->adapt; char *buf = NULL; char *tmp = NULL; if(ac->state_file && (buf = get_acpi_content(ac->state_file)) == NULL){ ac->ac_state = P_ERR; return; } if((tmp = scan_acpi_value(buf, "state:")) && !strncmp(tmp, "on-line", 7)) ac->ac_state = P_AC; else if(tmp && !strncmp(tmp, "off-line", 8)) ac->ac_state = P_BATT; else ac->ac_state = P_ERR; free(buf); free(tmp); } /* reads the name of the ac-adapter directory and fills the adapter_t * structure with the name and the state-file. Return 0 on success, negative values on errors */ int init_acpi_acadapt(global_t *globals){ list_t *lst = NULL; adapter_t *ac = &globals->adapt; if((lst = dir_list(PROC_ACPI "ac_adapter")) == NULL || !lst->top) return NOT_SUPPORTED; if((!lst->top->name || ((ac->name = strdup(lst->top->name)) == NULL))){ delete_list(lst); return ALLOC_ERR; } snprintf(ac->state_file, MAX_NAME, PROC_ACPI "ac_adapter/%s/state", ac->name); delete_list(lst); read_acpi_acstate(globals); return SUCCESS; } /* read acpi information for fan num, returns 0 on success and negative values on errors */ int read_acpi_fan(const int num){ char *buf = NULL; char *tmp = NULL; fan_t *info = &fans[num]; if(num > MAX_ITEMS) return ITEM_EXCEED; /* scan state file */ if((buf = get_acpi_content(info->state_file)) == NULL) info->fan_state = F_ERR; if(!buf || (tmp = scan_acpi_value(buf, "status:")) == NULL){ info->fan_state = F_ERR; return NOT_SUPPORTED; } if (tmp[0] == 'o' && tmp[1] == 'n') info->fan_state = F_ON; else if(tmp[0] == 'o' && tmp[1] == 'f') info->fan_state = F_OFF; else info->fan_state = F_ERR; free(buf); free(tmp); return SUCCESS; } /* read all fans, fill the fan structures */ static void read_acpi_fans(global_t *globals){ int i; for(i = 0; i < globals->fan_count; i++) read_acpi_fan(i); } /* reads the names of the fan directories, fills fan_t, * return 0 on success, negative values on errors */ int init_acpi_fan(global_t *globals){ char *names[MAX_ITEMS]; list_t *lst = NULL; node_t *node = NULL; int i = 0; fan_t *finfo = NULL; globals->fan_count = 0; if((lst = dir_list(PROC_ACPI "fan")) == NULL || !lst->top) return NOT_SUPPORTED; for(node = lst->top; node; node = node->next){ if((names[globals->fan_count] = strdup(node->name)) == NULL){ delete_list(lst); return ALLOC_ERR; } globals->fan_count++; } if(globals->fan_count > MAX_ITEMS) return ITEM_EXCEED; for (; i < globals->fan_count && i < MAX_ITEMS; i++){ finfo = &fans[i]; snprintf(finfo->name, MAX_NAME, "%s", names[i]); snprintf(finfo->state_file, MAX_NAME, PROC_ACPI "fan/%s/state", names[i]); free(names[i]); } delete_list(lst); read_acpi_fans(globals); return SUCCESS; } /* reads the name of the thermal-zone directory and fills the adapter_t * structure with the name and the state-file. Return 0 on success, negative values on errors */ int init_acpi_thermal(global_t *globals){ char *names[MAX_ITEMS]; list_t *lst = NULL; node_t *node = NULL; thermal_t *tinfo = NULL; int i = 0; globals->thermal_count = 0; if((lst = dir_list(PROC_ACPI "thermal_zone")) == NULL) return NOT_SUPPORTED; for(node = lst->top; node; node = node->next){ if((names[globals->thermal_count] = strdup(node->name)) == NULL){ delete_list(lst); return ALLOC_ERR; } globals->thermal_count++; } if(globals->thermal_count > MAX_ITEMS) return ITEM_EXCEED; for (; i < globals->thermal_count && i < MAX_ITEMS; i++){ tinfo = &thermals[i]; snprintf(tinfo->name, MAX_NAME, "%s", names[i]); snprintf(tinfo->state_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/state", names[i]); snprintf(tinfo->temp_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/temperature", names[i]); snprintf(tinfo->cooling_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/cooling_mode", names[i]); snprintf(tinfo->freq_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/polling_frequency", names[i]); snprintf(tinfo->trips_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/trip_points", names[i]); free(names[i]); } delete_list(lst); read_acpi_thermalzones(globals); return SUCCESS; } /* checks the string state and sets the thermal state, returns void */ static void thermal_state(const char *state, thermal_t *info){ if(state[0] == 'o') info->therm_state = T_OK; else if(!strncmp (state, "crit", 4)) info->therm_state = T_CRIT; else if (!strncmp (state, "hot", 3)) info->therm_state = T_HOT; else if (!strncmp (state, "pas", 3)) info->therm_state = T_PASS; else info->therm_state = T_ACT; } /* checks the string tmp and sets the cooling mode */ static void fill_cooling_mode(const char *tmp, thermal_t *info){ if(tmp[0] == 'a') info->therm_mode = CO_ACT; else if(tmp[0] == 'p') info->therm_mode = CO_PASS; else info->therm_mode = CO_CRIT; } /* reads values for thermal_zone num, return 0 on success, negative values on error */ int read_acpi_zone(const int num, global_t *globals){ char *buf = NULL; char *tmp = NULL; thermal_t *info = &thermals[num]; if(num > MAX_ITEMS) return ITEM_EXCEED; /* scan state file */ if((buf = get_acpi_content(info->state_file)) == NULL) info->therm_state = T_ERR; if(buf && (tmp = scan_acpi_value(buf, "state:"))) thermal_state(tmp, info); free(tmp); free(buf); /* scan temperature file */ if((buf = get_acpi_content(info->temp_file)) == NULL) info->temperature = NOT_SUPPORTED; if(buf && (tmp = scan_acpi_value(buf, "temperature:"))){ info->temperature = strtol(tmp, NULL, 10); /* if we just have one big thermal zone, this will be the global temperature */ if(globals->thermal_count == 1) globals->temperature = info->temperature; } free(tmp); free(buf); /* scan cooling mode file */ if((buf = get_acpi_content(info->cooling_file)) == NULL) info->therm_mode = CO_ERR; if(buf && (tmp = scan_acpi_value(buf, "cooling mode:"))) fill_cooling_mode(tmp, info); else info->therm_mode = CO_ERR; free(tmp); free(buf); /* scan polling_frequencies file */ if((buf = get_acpi_content(info->freq_file)) == NULL) info->frequency = DISABLED; if(buf && (tmp = scan_acpi_value(buf, "polling frequency:"))) info->frequency = strtol(tmp, NULL, 10); else info->frequency = DISABLED; free(tmp); free(buf); /* TODO: IMPLEMENT TRIP POINTS FILE */ return SUCCESS; } /* read all thermal zones, fill the thermal structures */ static void read_acpi_thermalzones(global_t *globals){ int i; for(i = 0; i < globals->thermal_count; i++) read_acpi_zone(i, globals); } /* fill battery_state for given battery, return 0 on success or negative values on error */ static void batt_charge_state(battery_t *info){ int high = info->last_full_cap / 2; int med = high / 2; if(info->remaining_cap > high) info->batt_state = B_HIGH; else if(info->remaining_cap <= high && info->remaining_cap > med) info->batt_state = B_MED; else if(info->remaining_cap <= med && info->remaining_cap > info->design_warn) info->batt_state = B_LOW; else if(info->remaining_cap <= info->design_warn && info->remaining_cap > info->design_low) info->batt_state = B_CRIT; else info->batt_state = B_HARD_CRIT; } /* fill charge_state of a given battery num, return 0 on success or negative values on error */ static void fill_charge_state(const char *state, battery_t *info){ if(state[0] == 'u') info->charge_state = C_ERR; else if(!strncmp (state, "disch", 5)) info->charge_state = C_DISCHARGE; else if (!strncmp (state, "charge", 6)) info->charge_state = C_CHARGED; else if (!strncmp (state, "chargi", 6)) info->charge_state = C_CHARGE; else info->charge_state = C_NOINFO; } /* read alarm capacity, return 0 on success, negative values on error */ static int read_acpi_battalarm(const int num){ char *buf = NULL; char *tmp = NULL; battery_t *info = &batteries[num]; if((buf = get_acpi_content(info->alarm_file)) == NULL) return NOT_SUPPORTED; if((tmp = scan_acpi_value(buf, "alarm:")) && tmp[0] != 'u') info->alarm = strtol(tmp, NULL, 10); else info->alarm = NOT_SUPPORTED; free(buf); free(tmp); return SUCCESS; } /* reads static values for a battery (info file), returns SUCCESS */ static int read_acpi_battinfo(const int num){ char *buf = NULL; char *tmp = NULL; battery_t *info = &batteries[num]; int i = 0; if((buf = get_acpi_content(info->info_file)) == NULL) return NOT_SUPPORTED; /* you have to read the present value always since a battery can be taken away while * refreshing the data */ if((tmp = scan_acpi_value(buf, "present:")) && !strncmp(tmp, "yes", 3)) { free(tmp); info->present = 1; } else { info->present = 0; free(buf); return NOT_PRESENT; } if((tmp = scan_acpi_value(buf, "design capacity:")) && tmp[0] != 'u'){ info->design_cap = strtol(tmp, NULL, 10); /* workaround ACPI's broken way of reporting no battery */ if(info->design_cap == 655350) info->design_cap = NOT_SUPPORTED; free(tmp); } else info->design_cap = NOT_SUPPORTED; for (;battinfo_values[i].value; i++) { if ((tmp = scan_acpi_value(buf, battinfo_values[i].value)) && tmp[0] != 'u') { *((int *)(((char *)info) + battinfo_values[i].offset)) = strtol(tmp, NULL, 10); free(tmp); } else { *((int *)(((char *)info) + battinfo_values[i].offset)) = NOT_SUPPORTED; } } /* TODO remove debug */ /* printf("%s\n", buf); */ free(buf); return SUCCESS; } /* read information for battery num, return 0 on success or negative values on error */ static int read_acpi_battstate(const int num){ char *buf = NULL; char *tmp = NULL; battery_t *info = &batteries[num]; unsigned int i = 0; if((buf = get_acpi_content(info->state_file)) == NULL) return NOT_SUPPORTED; if((tmp = scan_acpi_value(buf, "present:")) && !strncmp(tmp, "yes", 3)) { info->present = 1; free(tmp); } else { info->present = 0; free(buf); return NOT_PRESENT; } /* TODO REMOVE DEBUG */ /* printf("%s\n\n", buf); */ if((tmp = scan_acpi_value(buf, "charging state:")) && tmp[0] != 'u') { fill_charge_state(tmp, info); free(tmp); } else { info->charge_state = C_NOINFO; } for (;battstate_values[i].value; i++) { if ((tmp = scan_acpi_value(buf, battstate_values[i].value)) && tmp[0] != 'u') { *((int *)(((char *)info) + battstate_values[i].offset)) = strtol(tmp, NULL, 10); free(tmp); } else { *((int *)(((char *)info) + battstate_values[i].offset)) = NOT_SUPPORTED; } } /* get information from the info file */ batt_charge_state(info); free(buf); return SUCCESS; } /* calculate percentage of battery capacity num */ static void calc_remain_perc(const int num){ float lfcap; battery_t *info = &batteries[num]; int perc; if(info->remaining_cap < 0){ info->percentage = NOT_SUPPORTED; return; } else{ lfcap = info->last_full_cap; if(lfcap <= 0) lfcap = 1; perc = (int) ((info->remaining_cap / lfcap) * 100.0); } info->percentage = perc > 100 ? 100 : perc; } /* calculate remaining charge time for battery num */ static void calc_remain_chargetime(const int num){ battery_t *info = &batteries[num]; if(info->present_rate < 0 || info->charge_state != C_CHARGE){ info->charge_time = 0; return; } info->charge_time = (int) ((((float)info->last_full_cap - (float)info->remaining_cap) / info->present_rate) * 60.0); } /* calculate remaining time for battery num */ static void calc_remain_time(const int num){ battery_t *info = &batteries[num]; if(info->present_rate < 0 || info->charge_state != C_DISCHARGE){ info->remaining_time = 0; return; } info->remaining_time = (int) (((float)info->remaining_cap / (float)info->present_rate) * 60.0); } /* read/refresh information about a given battery num * returns 0 on SUCCESS, negative values on errors */ int read_acpi_batt(const int num){ if(num > MAX_ITEMS) return ITEM_EXCEED; read_acpi_battstate(num); read_acpi_battalarm(num); calc_remain_perc(num); calc_remain_chargetime(num); calc_remain_time(num); return SUCCESS; } libacpi-0.2/Makefile0000644000175000017500000000601510653101576013114 0ustar nionnion# libacpi - general purpose acpi library # (C)opyright 2007 Nico Golde include config.mk SRC = libacpi.c list.c SRC_test = test-libacpi.c libacpi.c list.c OBJ = ${SRC:.c=.o} OBJ_test = ${SRC_test:.c=.o} all: options libacpi.a libacpi.so test-libacpi options: @echo libacpi build options: @echo "CFLAGS = ${CFLAGS}" @echo "CC = ${CC}" @echo "SOFLAGS = ${SOFLAGS}" @echo "LD = ${LD}" .c.o: @echo CC $< @${CC} -c ${CFLAGS} $< ${OBJ}: config.mk libacpi.h libacpi.a: ${OBJ} @echo AR $@ @${AR} $@ ${OBJ} @${RANLIB} $@ libacpi.so: ${OBJ} @echo LD $@ @${LD} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ} test-libacpi: ${OBJ_test} @echo LD $@ @${LD} -o $@ ${OBJ_test} ${LDFLAGS} @strip $@ install: all @echo installing header to ${DESTDIR}${PREFIX}/include @mkdir -p ${DESTDIR}${PREFIX}/include @cp -f libacpi.h ${DESTDIR}${PREFIX}/include @chmod 644 ${DESTDIR}${PREFIX}/include/libacpi.h @echo installing library to ${DESTDIR}${PREFIX}/lib @mkdir -p ${DESTDIR}${PREFIX}/lib @cp -f libacpi.a ${DESTDIR}${PREFIX}/lib @chmod 644 ${DESTDIR}${PREFIX}/lib/libacpi.a @cp -f ${SONAME} ${DESTDIR}${PREFIX}/lib/ @chmod 644 ${DESTDIR}${PREFIX}/lib/${SONAME} @ln -s ${SONAME} ${DESTDIR}${PREFIX}/lib/libacpi.so @echo installing test-libacpi to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @cp -f test-libacpi ${DESTDIR}${PREFIX}/bin @chmod 755 ${DESTDIR}${PREFIX}/bin/test-libacpi @echo installing manual page to ${DESTDIR}${MANPREFIX}/man3 @mkdir -p ${DESTDIR}${MANPREFIX}/man3 @cp libacpi.3 ${DESTDIR}${MANPREFIX}/man3 @echo installing documentation and misc files to ${DESTDIR}${PREFIX}/share/doc/libacpi @mkdir -p ${DESTDIR}${PREFIX}/share/doc/libacpi @cp -r AUTHORS CHANGES README LICENSE doc ${DESTDIR}${PREFIX}/share/doc/libacpi @echo finished installation uninstall: @echo removing header file from ${DESTDIR}${PREFIX}/include @rm -f ${DESTDIR}${PREFIX}/include/libacpi.h @echo removing library file from ${DESTDIR}${PREFIX}/lib @rm -f ${DESTDIR}${PREFIX}/lib/libacpi.a @echo removing shared object file from ${DESTDIR}${PREFIX}/lib @rm -f ${DESTDIR}${PREFIX}/lib/libacpi.so @rm -f ${DESTDIR}${PREFIX}/lib/${SONAME} @echo removing test-libacpi client from ${DESTDIR}${PREFIX}/bin @rm -f ${DESTDIR}${PREFIX}/bin/test-libacpi @echo removing manual page from ${DESTDIR}${MANPREFIX}/man3 @rm -f ${DESTDIR}${MANPREFIX}/man3/libacpi.3 @echo removing documentation and misc files from ${DESTDIR}${PREFIX}/share/doc/libacpi @rm -rf ${DESTDIR}${PREFIX}/share/doc/libacpi @echo uninstalled everything dist: @echo creating dist tarball @mkdir -p libacpi-${VERSION} @cp libacpi.3 TODO AUTHORS CHANGES config.mk Makefile *.c *.h README LICENSE Doxyfile libacpi-${VERSION} @(cd libacpi-${VERSION}; doxygen) @rm -f libacpi-${VERSION}/Doxyfile @tar -cf libacpi-${VERSION}.tar libacpi-${VERSION} @gzip libacpi-${VERSION}.tar @rm -rf libacpi-${VERSION} clean: @echo cleaning @rm -f libacpi.a libacpi.so* test-libacpi ${OBJ_test} libacpi-${VERSION}.tar.gz .PHONY: all options clean dist install uninstall libacpi-0.2/AUTHORS0000644000175000017500000000021410653101576012517 0ustar nionnionAuthors: Nico Golde Contributors: Federico 'Derfel' Stella - patches for missing free calls libacpi-0.2/LICENSE0000644000175000017500000000211010653101576012451 0ustar nionnionMIT/X Consortium License (C)opyright 2007 Nico Golde Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libacpi-0.2/TODO0000644000175000017500000000022510653101576012141 0ustar nionnionTODO for libacpi ================ - use trip points data somehow? - put the acpi version into the structure, some people may use it -> SONAME bump libacpi-0.2/README0000644000175000017500000000263710653101576012342 0ustar nionnionREADME for libacpi - a general purpose ACPI library =================================================== Introduction: ============= libacpi is a general purpose shared library for programs gathering ACPI data like battery status, thermal zones, fans and ac status. Downloading: ============ You can download the latest version of libacpi from the following website: http://www.ngolde.de/libacpi.html Alternatively you can check out the latest version from the libacpi mercurial repository using: hg clone http://hg.modprobe.de/libacpi/ Dependencies: ============= None apart from libc development files and a C compiler. Installation: ============= Compiling and installing libacpi is as simple as: $ make As root: $ make install You may want to modify config.mk After installing, link your source files with -lacpi Documentation: ============== See http://www.ngolde.de/libacpi.html, doc/, man 3 libacpi and test-libacpi.c Programs using libacpi: ======================= xbattbar-acpi (>=0.3): http://www.senzanome.org/xbattbar-acpi/ acpitail: http://www.vanheusden.com/acpitail/ If you want to see your program listed here please see "Contact" and write me a mail. Contact: ======== Nico Golde Donations are always welcome since I can't test every feature with my notebook (Asus m6800nb). License: ======== libacpi is licensed under the terms of the MIT/X Consortium license, see LICENSE for further details libacpi-0.2/list.h0000644000175000017500000000146210653101576012601 0ustar nionnion/* * (C)opyright 2007 Nico Golde * See LICENSE file for license details */ /** * \file list.h * \brief linked list */ /** * \struct node_t * \brief node for linked list */ typedef struct node{ char *name; /**< node name */ struct node *next; /**< pointer to the next node */ } node_t; /** * \struct list_t * \brief linked list */ typedef struct{ int length; /**< list length */ node_t *top; /**< pointer to top node */ node_t *last; /**< pointer to last node */ } list_t; /** * Lists contents (for libacpi directories) of a directory * and return them in a linked list * @param dir directory to list * @return linked list */ list_t *dir_list(char *dir); /** * Delete linked list * @param lst list to delete */ void delete_list(list_t *lst); libacpi-0.2/doc/0000755000175000017500000000000010653101606012211 5ustar nionnionlibacpi-0.2/doc/html/0000755000175000017500000000000010653101606013155 5ustar nionnionlibacpi-0.2/doc/html/structthermal__t__coll__graph.png0000644000175000017500000000343210653101606021740 0ustar nionnionPNG  IHDRz7PLTE2Ϳ|.tRNS@fIDATxa ^"ۙWYn hU$FbBy/_%8ǡ~࢟MP~1s=UU>  VXw3ڷT ov¶ٶ[*si ̟BK}%Vf7؋v^p\* .nL]FQ<Ӟa埻˾Mc=,bnTˇ9_4yYM# uj9qp{7R8TpOե%쓆W+.)\ Wp+\ Wxp+\ Wυ,X~y,~_5[7xʼnn]jS 7r_ZtZ~{u7>m{co*an?a?:+4_n` j6BK>j/L:QU[~]' XlK&~{8 p$gOJGq@f+qM*/J^Ϭ0--8py:1x@FNWӥ ~UT0Hbݟ瀺c5m~ wOWl7[Z<4^p9_+'g\xi޽(\ 8͐3?eTp`C>NU}#|` ->h0XRu2(9nXGp#}n+ U b[7iK~]+\ W|%Wm%S|e^59jb_Z.'.ݹLp+Gp^OF \tЄ{ѤAl_ 2ў5`8x M2cO}M]S Epjp{"V|}Jw*|(\EInTy{.G xM\&80|SɤB87vO\p9lWg4i O.$)'GslWmq2"i U382aoa!q r(VhX=u#m힛#yWW"vRdwd3|IJ%7rU 燣)G^Zp܀f]`|3xhI~(\+"yuw^ՠ7|(½q ?3pMjMQߟGQχW^َYp{ŧ֜|L'}lWUy.vx;8jd*}11G7@U4NA8_9oO|.oq .S߱jI  libacpi: node_t Struct Reference

node_t Struct Reference

node for linked list More...

#include <list.h>


Detailed Description

node for linked list


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structacpi__value__t-members.html0000644000175000017500000000315710653101604021675 0ustar nionnion libacpi: Member List

acpi_value_t Member List

This is the complete list of members for acpi_value_t, including all inherited members.

offsetacpi_value_t
valueacpi_value_t


Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structadapter__t__coll__graph.map0000644000175000017500000000035310653101604021712 0ustar nionnion libacpi-0.2/doc/html/list_8c_8779934af9269ac85b5eda546da2285c_icgraph.md50000644000175000017500000000004010653101603023226 0ustar nionnion88d3bb7ba8b6d159c51649274ff209a9libacpi-0.2/doc/html/files.html0000644000175000017500000000340510653101606015147 0ustar nionnion libacpi: File Index

libacpi File List

Here is a list of all files with brief descriptions:
libacpi.c [code]
libacpi.h [code]Libacpi structures
list.c [code]
list.h [code]Linked list

Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structglobal__t.html0000644000175000017500000001705310653101605017237 0ustar nionnion libacpi: global_t Struct Reference

global_t Struct Reference

global acpi structure More...

#include <libacpi.h>

Collaboration diagram for global_t:

Collaboration graph
[legend]
List of all members.

Public Attributes

int batt_count
int thermal_count
int fan_count
int temperature
adapter_t adapt

Detailed Description

global acpi structure

Definition at line 174 of file libacpi.h.


Member Data Documentation

number of found batteries

Definition at line 175 of file libacpi.h.

Referenced by init_acpi_batt().

number of found thermal zones

Definition at line 176 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().

number of found fans

Definition at line 177 of file libacpi.h.

Referenced by init_acpi_fan().

system temperature if we only have on thermal zone

Definition at line 178 of file libacpi.h.

Referenced by read_acpi_zone().

ac adapter

Definition at line 179 of file libacpi.h.

Referenced by init_acpi_acadapt(), and read_acpi_acstate().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h__dep__incl.md50000644000175000017500000000004010653101604017261 0ustar nionnion0e008b063742fcf12a042a01cb0a1b13libacpi-0.2/doc/html/libacpi_8h_027286cd397157bdbf9e551ef510cb59_cgraph.png0000644000175000017500000000212110653101603023574 0ustar nionnionPNG  IHDR%tAPLTEpA^tRNS@fIDATxk 6rHpl !f(IFŚ) v`rﯫ Ҙ3 K̩L"R)Tc+՘J5R1~XX?.eO;4gށ]d3+Ι2MMZ315`N2y< .ד# 8\Ĕl:s}C&2 R)ԇ1u]׻1u4ӭTPQ/O%՘&B$-i,4X& libacpi-0.2/doc/html/libacpi_8h__dep__incl.md50000644000175000017500000000004010653101603017710 0ustar nionnion89771313fb9fa35a5428836fd414901clibacpi-0.2/doc/html/tab_r.gif0000644000175000017500000000503110653101602014726 0ustar nionnionGIF89a,薴ŝɯͻ,,@pH,Ȥrl:ШtJZجv h d@L"F:򑐌$9 (8&Nz (GFB^!˨)WVl)1 w̥.wY0Ib|Hpf:e pJ}Ȧ6nz 80%"8v~ @JЂMBІ:D'ZPKF ּ&16юz HGJRb L5Җ0LgJӚ#(e>Ӟ@ PJԢHMRԦ:PTJժ&5;%Uծz` XJVCjYֶp\Uxͫ^׾i)$Mb:v, ಘͬf7z hGKҚMjWֺ*$SPͭnwm +Mr:E?9Zͮv9" xKbLz^A|ͯ0/LN(; n0'LaJ0{/{ؘG|(SCr. v1wc6@LdHNd/PLeOXp|+s2L_153M5t3_:wsgʹπp?/FFЎt!-JҖ1NӞuA-Pԝ>53UWծ4cYZѶsA׀5,aƶ3=e3~-3Sc6mo2Mq>7ӭn$D~7,y1m}v\/N3#S\gu-mO0C\'_S^|.c.0ל49~s=3d:u)?F;ˮW|;W)vt˽w|=xA;libacpi-0.2/doc/html/libacpi_8h_027286cd397157bdbf9e551ef510cb59_cgraph.md50000644000175000017500000000004010653101603023473 0ustar nionnionb54f55516ec84a161302ca871600cf91libacpi-0.2/doc/html/tab_b.gif0000644000175000017500000000004310653101602014704 0ustar nionnionGIF89a,D;libacpi-0.2/doc/html/globals_defs.html0000644000175000017500000000405510653101606016473 0ustar nionnion libacpi: Class Members  


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.png0000644000175000017500000000242710653101604023715 0ustar nionnionPNG  IHDRO12PLTEpA^tRNS@fIDATx wypUQT`dJދm8gQ~^U"\8*uuW}WT8LիNŌBuT aM4>Ea_Ta[X U܋=?xڊfR[]U]s;qPQ5]~2lq< tub{0t,0qU_B qxe(^ZVP (_l2ՙy$.Q(K%MY*#ԑUNM*%3QF)*' h$ߓ(jT=oy^9M wP^7C \ XI0XhEhj, Taf͹caxݴ!Ԥ:T©0<,.TSWu6#% 0 gu/gۆOsj_:P0|(Vu ս\YRU G4`Gx֫@Eֆ2Z~u96 uŠ7'M:mhGZuԜ3KjwĀQY;Rjjh6@ӪAm#bVl7|3m{.̄ǟW*Dz^jjGUDŽ /cTT1j:J3>DžBWU[j eC:s9O]Z&>p4N#~f 6e@/ZUXy**AkhԸGg#@UWQ tO" W6UX4CZnp_;vPu䅾+ fkx>1+V#lqvQ=boPiPmL_RƲJiQ\}:uG{)ϴON-%J3Yj^8gwQY~۰gKQR2EO{JR5~i%ߊKW}W}u?c\.As?]n%r~0VAypD~[j$]~0TH'Ay}T~  %`:P2*qʫ.g]eUsIENDB`libacpi-0.2/doc/html/libacpi_8c_baf0f122878f23b4cc8a5cb2dea8bf71_icgraph.map0000644000175000017500000000020410653101603024267 0ustar nionnion libacpi-0.2/doc/html/list_8c__incl.md50000644000175000017500000000004010653101603016264 0ustar nionnion05ac872c7681bc4a6e753ba684484da3libacpi-0.2/doc/html/globals_type.html0000644000175000017500000000323010653101606016525 0ustar nionnion libacpi: Class Members  


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_b63d686528f867234559a0bd829f9a33_cgraph.map0000644000175000017500000000036410653101603023365 0ustar nionnion libacpi-0.2/doc/html/graph_legend.png0000644000175000017500000000545010653101606016306 0ustar nionnionPNG  IHDRw6yH!PLTE2dp0ntRNS@f IDATxKr6 ^f^֫z6>YNs$5.h?JS)#l,_POZ4U}ںX!ǐc߷+SGG$PT1  ikUڌ̲вjMOȯz :(l]B0xCCP ;)%ICŨM^mH>8G m>W=Fx=- :i /QcxamyޞH7+z;"x0,_\Ѷy)<4b^r)̘BoExJ6T~dE;ދa{27}0W:5<)MȎCƃ c>x҄L'8^]YAEa/L -3͍x1 RO2خay^m#>Ro<;ş͏[<

x$ѬGWez]iFx$QۢfG1)nz.G1z]##X^WWW7얀W7_^=nV`5zux]eHn^-nk+c]A-z5uKKsS-f2=&J-b2rV%UWW^dvfՐ_"6,~xHe^ǀG[.v _+R37,wZ^|z%ur;듰<. 1uӛ‹}m{q[;حZU [ojx^^]XT<,<.c/Vqg}vk=ג^.jWg*C-ح /3fn5f Z]m [C͇CסD]&[wf=xw6.F o#vBm yom3F-/a{AC̗^q[|<| ޸Jn=tKo8zM٥&m /16+6^\xcv(n#vMAnL/^15g =nKdN>5bE~]vz7bAzYxHMoWi?1Xo`}Px&׮z!nǖvo0@/dr% }kȠݦk?x}>W8>mtiii4yK1$x <C6n-1'SxJU <= <н libacpi: Member List

thermal_t Member List

This is the complete list of members for thermal_t, including all inherited members.

cooling_filethermal_t
freq_filethermal_t
frequencythermal_t
namethermal_t
state_filethermal_t
temp_filethermal_t
temperaturethermal_t
therm_modethermal_t
therm_statethermal_t
trips_filethermal_t


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8c__incl.png0000644000175000017500000000243410653101603016374 0ustar nionnionPNG  IHDRRnPLTEpA^tRNS@fIDATx n ]!Or)*/@~[jհMK%ץwn^ꇩˬ{<*=oFS|vcw>c/[z|8z#{P =4؟|+R?R5#"Ӧd:MӠYh-ԾXTŮ>ꀾs@=vPJkŮ6>Gt]U**T$T\D\V*'Hn?Du :tњWUqV$T0B A߬Tƈjjj'H;n3VC-%HR ?ֽjj 9f}Z /V1êaAĨj!R?X >^[Q%uWXW8T>jfƠt4P Zj|CcbVP'T-5p6xr*ށ뀺:iTuU%Nf&Ԫ1ev0T+Gz5VTՏU?T*ZVQhQ=;-j-G]hIUChACD CN@6%!Y~"] R/5-HQ4T7pT0k N<*SI*꭭ガ}`6v'2܌=!|Sib"9W8ztX-Tm5WWR]XtmTz*{ꮛ҇j-c9 >ҵeΈ>|WyUG"c)gMfL(3~k 02-87̹2 L($cgez L#Of9ri,״gT5] Y/pqm05#J_B>J^ĩԕS]%i_=X`Jn Jk=jOc4CY~XuʔC=kjZEG jiі[A<tڦDTtI=*"4*_#lFSD,QX@^6d1Fޝ5֤G'Lf漻_Ek{fSmd#;u2,z.kTW#6&^jp:CTj <+j'ְ+_jv84:"jwR<4IENDB`libacpi-0.2/doc/html/structadapter__t__coll__graph.md50000644000175000017500000000004010653101604021613 0ustar nionnion1e28e97d9f22fc2858a980be93c76a89libacpi-0.2/doc/html/list_8c_8779934af9269ac85b5eda546da2285c_icgraph.map0000644000175000017500000000102010653101604023316 0ustar nionnion libacpi-0.2/doc/html/structbattery__t__coll__graph.png0000644000175000017500000000513310653101605021755 0ustar nionnionPNG  IHDR*>IPLTE2Ϳ|.tRNS@f IDATxo, WE^'=@g_UH (Jpm2kkէA$JO=Ul杂 4)whpֲcwx4H?·-<#xrYhm?L\,,JDݖN)p6-kqyx%bw[\{v- E1piK#mB"wސ8a{ވ^p4cBK"4 ^Y~\ ~sKBKBp /Eh c WZKW[):rb佾dTV\iJSҔ4)MiJ{ޙ+MiJSҔ4)MiyZʛ2Ey~{ôwMI}t=~a=vHy.ڡkE{W=zX-vh3k*-h Zx"CJCawIҔOk3mۺ[2@&ڣ5MUuA*V+P%Z*K m*SnUjV/PEy4Th|-_:l~'񻕶+FZvJM6{[iJNZL[FghX)MiEߠ)^V~4 oYyaW"-5zmE*!&zP+hR (y>HޞKiJKhdpD?d!U˲7B;6lhԚ)ߘnZ{-`fԵx M( `mt=yۧ0 #pmY*%Yٞ(Miжl1.C ͬ6Yj4_-9 ߼X-06bƣ=oUh)MiVLz ɿ j8ÊJÉ@|eX8ψ~Kb% ]?mg% ]D,1QڷBlH (G~ ٷ~Zk'Aط|0gi#q<)rXK֒^o^bV#~$eiIMu(&JNZ&ht0Zj X:?vBe-NjVGK3b,ݖ$C`Vs4w74]^cВ\KϿhV46v di*(hآEip\ȾľŖ?9IK%ɢ1ӂ}Ʒ{Iޗ_SetT%*Ojҍhh|Ri_Nd0U4њ0'٩8N69IkM2x>Wu~7u?ːֺ2; yؚn[{IaJO3skCD7=E5FF-~>B+o,h)|”ѓ7 S\|$&sJ S >迹RQMiFkt$i8..Dh_F 6^Zo4Sfΰ s>Ha;o1g5lҴX3l4zɄ?Q4lBT)O഼nJSҔ4)MiJSZ{14) |2IENDB`libacpi-0.2/doc/html/libacpi_8c__incl.md50000644000175000017500000000004010653101602016713 0ustar nionnion9f52d2c6ee9dd2c648a553af39b0ec86libacpi-0.2/doc/html/libacpi_8h_b63d686528f867234559a0bd829f9a33_cgraph.map0000644000175000017500000000036410653101603023372 0ustar nionnion libacpi-0.2/doc/html/list_8h_8779934af9269ac85b5eda546da2285c_icgraph.md50000644000175000017500000000004010653101604023234 0ustar nionnion88d3bb7ba8b6d159c51649274ff209a9libacpi-0.2/doc/html/libacpi_8h_3ee17a37e660f31b7b7e5f2f0896851b_cgraph.map0000644000175000017500000000036410653101603023575 0ustar nionnion libacpi-0.2/doc/html/libacpi_8h_baf0f122878f23b4cc8a5cb2dea8bf71_icgraph.map0000644000175000017500000000020410653101603024274 0ustar nionnion libacpi-0.2/doc/html/libacpi_8h_b63d686528f867234559a0bd829f9a33_cgraph.md50000644000175000017500000000004010653101603023271 0ustar nionnion6bd91281092bdc64f76687454284aab1libacpi-0.2/doc/html/libacpi_8h_b46f89c7d7ff338842d7619c7392c0bf_cgraph.png0000644000175000017500000000127010653101603023623 0ustar nionnionPNG  IHDRW=^GPLTEpA^tRNS@fTIDATh[ rbca.\ƃMʟ1#7TE2j|S|%>Q?ѡ:|)&NoT3be&3,pX ԰k|#A|lE~]u*CC0 2Qu?tpAzP"f?=| JOmYȼsp?)=[2ݷC{4ņć b=F|G/xr#E4kUa" AޭUgWO8RuH=SsT)#v6JڗE1z%o,x!oo~ϴ?R7QO9 2kLBVad3Zp*Ge~ %9$KC++[AiKA{ We X/ćzLQOkƅT^`,?;i+[|eCZ)tB5u0u_:Q7;UWC}=u(l^IENDB`libacpi-0.2/doc/html/libacpi_8c_baf0f122878f23b4cc8a5cb2dea8bf71_icgraph.md50000644000175000017500000000004010653101603024175 0ustar nionnion577d1261c0780c760dfc4920f03bd6cclibacpi-0.2/doc/html/structfan__t.html0000644000175000017500000001160010653101605016533 0ustar nionnion libacpi: fan_t Struct Reference

fan_t Struct Reference

fan data More...

#include <libacpi.h>

List of all members.

Public Attributes

char name [MAX_NAME]
char state_file [MAX_NAME]
fan_state_t fan_state


Detailed Description

fan data

Definition at line 106 of file libacpi.h.


Member Data Documentation

char fan_t::name[MAX_NAME]

name of the fan found in proc vfs

Definition at line 107 of file libacpi.h.

Referenced by init_acpi_fan().

char fan_t::state_file[MAX_NAME]

state file for the fan

Definition at line 108 of file libacpi.h.

Referenced by init_acpi_fan(), and read_acpi_fan().

current status of the found fan

Definition at line 109 of file libacpi.h.

Referenced by read_acpi_fan().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8c_8779934af9269ac85b5eda546da2285c_icgraph.png0000644000175000017500000000250310653101604023334 0ustar nionnionPNG  IHDRCfPLTEpA^tRNS@fIDATxkn {HllGFJ 06VC^3qyc|,~Yi-19gXeF ADكkg`w1{~-#,_&fz/m T.ǀMlω@V7:`U7W{%Lw?`~?:4P 'e+Օ?{/ɟR[//"//yR|/g| ><>qx_2bD ~gv)oʿjt/~C!oƿis[VA7y5%[ED}sݼ+"]+.[6=hlnS'`/b_ \B>H\<>? ϙ_Eԑyi^e-cqĘ]aH.s\rprO[>~~.YYUo_WQo_\5߰V>?#T-˕}|`~?[M7jꛂ5mw۟o?{_N ?B5к*g 2P2x p SB5~bB56{Z /E(~V9oUSg$DC빖Q(81L/(yBkX04#.@n ="D~|Sv-?ZsPoQrPXCҢP_(b57_ۡK3В%@Sb )/%@G?EX\+={ / @ϱC?! libacpi: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

graph_legend.png

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.

Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h__dep__incl.map0000644000175000017500000000027010653101604017356 0ustar nionnion libacpi-0.2/doc/html/globals.html0000644000175000017500000002546310653101606015500 0ustar nionnion libacpi: Class Members

Here is a list of all file members with links to the files they belong to:

- a -

- b -

- c -

- d -

- f -

- i -

- l -

- m -

- n -

- p -

- r -

- s -

- t -


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h_8779934af9269ac85b5eda546da2285c_icgraph.map0000644000175000017500000000102010653101604023323 0ustar nionnion libacpi-0.2/doc/html/doxygen.png0000644000175000017500000000240110653101602015331 0ustar nionnionPNG  IHDRd-ok>gAMAOX2tEXtSoftwareAdobe ImageReadyqe<]PLTEǾ"&ﶻޠ{ԍ눙נED9hg]_X<@:#mhU1tRNSvIDATxbC: d#h` @X",***LK.], X@t b @BD6%""  % B:Hf@ RPy"K`\PbC(!II!h(!Cąl!0[X\J\$TM(>a$S @ Ш@R.$LJBRAG1 (FPhhT%!`&q%u P    CT$B|Wl!B`R$( @A%%@,(%$RPmB U`1IYB  99\1 yCCCf"[N'=TGȒl8^K5<SRɤ%@@  b1qAXH&BR y nP4A j>  t!+(.WQA2MU܂ `1%`19F< 3cZ`e!\ D+. 83!lYYA -6EJV @XXX 4 @86`RdB4I " "@xrʌHA`f ȰC"XV0C b@2H ȓ p)!( 04)(%R $Tʀbb,s@7 Ѱ?f֗\PIx!I"Ȉ3 QYt^^gv- }>WJOAV`$&#88\FF SFJ$ƀƊ 4 - Hf ?5 k1d, ."FˀI"4Hgx|fm)))9. aMD& X@t b @%DK.], X@t b @d`ɽSOIENDB`libacpi-0.2/doc/html/libacpi_8c_b63d686528f867234559a0bd829f9a33_cgraph.png0000644000175000017500000000124610653101603023374 0ustar nionnionPNG  IHDRW OfPLTEpA^tRNS@fBIDAThQr \!3xRvYNNA Ĭ2׏KCzIQM< mgfGۣC<_Y (0۷5xX5aa %BPĨhL%)T{Y@utM$|>wP+i~1Բ)Q}* ЮטG-'Z dP>&VDd<ޟ' |tZ-}d av䠷3`v'͆VC!l!>C}t(4%~˷( 8Fn5TY>ܪ6+Ϡ-JfڌYԨ⾃B/S,ǰE}&6="k1Wpe~w c4 l[=KLoʢT]wѨ^qytݩ}|g"ʯدMs+E&J/vGSucZˑTe@uzN]W;Q%uP*Qy7|Ϡ邺ѭpv>:>* 5tv#Ui"͊)x)Qpx mhxۊAav&ukIENDB`libacpi-0.2/doc/html/list_8h_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.md50000644000175000017500000000004010653101604023603 0ustar nionnion61ba45e6816e7d66b55b723513c65048libacpi-0.2/doc/html/libacpi_8h_3ee17a37e660f31b7b7e5f2f0896851b_cgraph.png0000644000175000017500000000123210653101603023577 0ustar nionnionPNG  IHDRW [PLTEpA^tRNS@f6IDAThKr s9@3>H# *Eq< v$6ه Ŕ 3//S‹ى0dƃЖg+#6ȥޡ 6,i;9JGÜu50c>beTbj77IIaNh1m4ˤD̙3I^efL0L'flLNå8d(ġ \$vNӁ/a~$OXOCLJ3c9n%#w{9"!\--Œ-g3Ef)(va>ch3[5&u }&5n\S JO)Ì ̕%j>JX*L:G: 3+ֽ[_R8"N WjE1fn`0s05:03m 5IENDB`libacpi-0.2/doc/html/globals_vars.html0000644000175000017500000000354310653101606016526 0ustar nionnion libacpi: Class Members  


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/globals_eval.html0000644000175000017500000001560510653101606016504 0ustar nionnion libacpi: Class Members

 

- a -

- b -

- c -

- d -

- f -

- i -

- n -

- p -

- s -

- t -


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_027286cd397157bdbf9e551ef510cb59_cgraph.png0000644000175000017500000000212110653101603023567 0ustar nionnionPNG  IHDR%tAPLTEpA^tRNS@fIDATxk 6rHpl !f(IFŚ) v`rﯫ Ҙ3 K̩L"R)Tc+՘J5R1~XX?.eO;4gށ]d3+Ι2MMZ315`N2y< .ד# 8\Ĕl:s}C&2 R)ԇ1u]׻1u4ӭTPQ/O%՘&B$-i,4X& libacpi: adapter_t Struct Reference

adapter_t Struct Reference

information about ac adapater More...

#include <libacpi.h>

Collaboration diagram for adapter_t:

Collaboration graph
[legend]
List of all members.

Public Attributes

char * name
char state_file [MAX_NAME]
power_state_t ac_state

Detailed Description

information about ac adapater

Definition at line 164 of file libacpi.h.


Member Data Documentation

ac adapter name

Definition at line 165 of file libacpi.h.

Referenced by init_acpi_acadapt().

char adapter_t::state_file[MAX_NAME]

state file for adapter + path

Definition at line 166 of file libacpi.h.

Referenced by init_acpi_acadapt(), and read_acpi_acstate().

current ac state, on-line or off-line

Definition at line 167 of file libacpi.h.

Referenced by read_acpi_acstate().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structthermal__state__t.html0000644000175000017500000000310410653101606020763 0ustar nionnion libacpi: thermal_state_t Struct Reference

thermal_state_t Struct Reference

thermal zone states More...

#include <libacpi.h>


Detailed Description

thermal zone states


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structlist__t__coll__graph.map0000644000175000017500000000035410653101605021247 0ustar nionnion libacpi-0.2/doc/html/libacpi_8h_b63d686528f867234559a0bd829f9a33_cgraph.png0000644000175000017500000000124610653101603023401 0ustar nionnionPNG  IHDRW OfPLTEpA^tRNS@fBIDAThQr \!3xRvYNNA Ĭ2׏KCzIQM< mgfGۣC<_Y (0۷5xX5aa %BPĨhL%)T{Y@utM$|>wP+i~1Բ)Q}* ЮטG-'Z dP>&VDd<ޟ' |tZ-}d av䠷3`v'͆VC!l!>C}t(4%~˷( 8Fn5TY>ܪ6+Ϡ-JfڌYԨ⾃B/S,ǰE}&6="k1Wpe~w c4 l[=KLoʢT]wѨ^qytݩ}|g"ʯدMs+E&J/vGSucZˑTe@uzN]W;Q%uP*Qy7|Ϡ邺ѭpv>:>* 5tv#Ui"͊)x)Qpx mhxۊAav&ukIENDB`libacpi-0.2/doc/html/structbattery__t-members.html0000644000175000017500000001252310653101605021076 0ustar nionnion libacpi: Member List

battery_t Member List

This is the complete list of members for battery_t, including all inherited members.

alarmbattery_t
alarm_filebattery_t
batt_statebattery_t
charge_statebattery_t
charge_timebattery_t
design_capbattery_t
design_level1battery_t
design_level2battery_t
design_lowbattery_t
design_voltagebattery_t
design_warnbattery_t
info_filebattery_t
last_full_capbattery_t
namebattery_t
percentagebattery_t
presentbattery_t
present_ratebattery_t
present_voltagebattery_t
remaining_capbattery_t
remaining_timebattery_t
state_filebattery_t


Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/graph_legend.dot0000644000175000017500000000430610653101606016307 0ustar nionniondigraph G { edge [fontname="FreeSans.ttf",fontsize=10,labelfontname="FreeSans.ttf",labelfontsize=10]; node [fontname="FreeSans.ttf",fontsize=10,shape=record]; Node9 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",fillcolor="grey75",style="filled" fontcolor="black"]; Node10 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node10 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classPublicBase.html"]; Node11 -> Node10 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node11 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="red",URL="$classTruncated.html"]; Node13 -> Node9 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node13 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classProtectedBase.html"]; Node14 -> Node9 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node14 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classPrivateBase.html"]; Node15 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node15 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="grey75"]; Node16 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="FreeSans.ttf"]; Node16 [shape="box",label="Templ< int >",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classTempl.html"]; Node17 -> Node16 [dir=back,color="orange",fontsize=10,style="dashed",label="< int >",fontname="FreeSans.ttf"]; Node17 [shape="box",label="Templ< T >",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classTempl.html"]; Node18 -> Node9 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="FreeSans.ttf"]; Node18 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="FreeSans.ttf",color="black",URL="$classUsed.html"]; } libacpi-0.2/doc/html/list_8c__incl.map0000644000175000017500000000013010653101603016354 0ustar nionnion libacpi-0.2/doc/html/structbattery__t.html0000644000175000017500000005303510653101605017451 0ustar nionnion libacpi: battery_t Struct Reference

battery_t Struct Reference

information found about battery More...

#include <libacpi.h>

Collaboration diagram for battery_t:

Collaboration graph
[legend]
List of all members.

Public Attributes

char name [MAX_NAME]
char state_file [MAX_NAME]
char info_file [MAX_NAME]
char alarm_file [MAX_NAME]
int present
int design_cap
int last_full_cap
int design_voltage
int present_rate
int remaining_cap
int present_voltage
int design_warn
int design_low
int design_level1
int design_level2
int alarm
int percentage
int charge_time
int remaining_time
charge_state_t charge_state
batt_state_t batt_state

Detailed Description

information found about battery

Definition at line 116 of file libacpi.h.


Member Data Documentation

char battery_t::name[MAX_NAME]

name of the battery found in proc vfs

Definition at line 117 of file libacpi.h.

Referenced by init_acpi_batt().

char battery_t::state_file[MAX_NAME]

corresponding state file name + path

Definition at line 118 of file libacpi.h.

Referenced by init_acpi_batt().

char battery_t::info_file[MAX_NAME]

corresponding info file + path

Definition at line 119 of file libacpi.h.

Referenced by init_acpi_batt().

char battery_t::alarm_file[MAX_NAME]

corresponding alarm file + path

Definition at line 120 of file libacpi.h.

Referenced by init_acpi_batt().

battery slot is currently used by a battery or not? 0 if not, 1 if yes

Definition at line 121 of file libacpi.h.

assuming capacity in mAh

Definition at line 122 of file libacpi.h.

last full capacity when the battery was fully charged

Definition at line 123 of file libacpi.h.

design voltage in mV

Definition at line 124 of file libacpi.h.

present rate consuming the battery

Definition at line 125 of file libacpi.h.

remaining capacity, used to calculate percentage

Definition at line 126 of file libacpi.h.

present voltage

Definition at line 127 of file libacpi.h.

specifies how many mAh need to be left to have a hardware warning

Definition at line 128 of file libacpi.h.

specifies how many mAh need to be left before the battery is low

Definition at line 129 of file libacpi.h.

capacity granularity 1

Definition at line 130 of file libacpi.h.

capacity granularity 2

Definition at line 131 of file libacpi.h.

generate hardware alarm in alarm "units"

Definition at line 132 of file libacpi.h.

remaining battery percentage

Definition at line 134 of file libacpi.h.

remaining time to fully charge the battery in minutes

Definition at line 135 of file libacpi.h.

remaining battery life time in minutes

Definition at line 136 of file libacpi.h.

charge state of battery

Definition at line 139 of file libacpi.h.

battery capacity state

Definition at line 140 of file libacpi.h.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_baf0f122878f23b4cc8a5cb2dea8bf71_icgraph.png0000644000175000017500000000075010653101603024304 0ustar nionnionPNG  IHDR%%>PLTEpA^tRNS@fIDATXKn! s9@GE>#1J R,96|1&(m1ٴLvLۨbZLȴ L1:ˤ4a1t0o3E4ZL $s 2 &tGh5)[P%L: 1CLqDINXa*vWu libacpi: Class Members - Variables

 

- a -

- b -

- c -

- d -

- f -

- i -

- l -

- n -

- o -

- p -

- r -

- s -

- t -

- v -


Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structthermal__t__coll__graph.map0000644000175000017500000000076010653101606021732 0ustar nionnion libacpi-0.2/doc/html/libacpi_8c_3ee17a37e660f31b7b7e5f2f0896851b_cgraph.png0000644000175000017500000000123210653101603023572 0ustar nionnionPNG  IHDRW [PLTEpA^tRNS@f6IDAThKr s9@3>H# *Eq< v$6ه Ŕ 3//S‹ى0dƃЖg+#6ȥޡ 6,i;9JGÜu50c>beTbj77IIaNh1m4ˤD̙3I^efL0L'flLNå8d(ġ \$vNӁ/a~$OXOCLJ3c9n%#w{9"!\--Œ-g3Ef)(va>ch3[5&u }&5n\S JO)Ì ̕%j>JX*L:G: 3+ֽ[_R8"N WjE1fn`0s05:03m 5IENDB`libacpi-0.2/doc/html/structfan__t-members.html0000644000175000017500000000335210653101605020170 0ustar nionnion libacpi: Member List

fan_t Member List

This is the complete list of members for fan_t, including all inherited members.

fan_statefan_t
namefan_t
state_filefan_t


Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8h_b46f89c7d7ff338842d7619c7392c0bf_cgraph.md50000644000175000017500000000004010653101603023516 0ustar nionnion2c574c4994cc480646dfc85143a11b40libacpi-0.2/doc/html/structbatt__state__t.html0000644000175000017500000000307310653101605020265 0ustar nionnion libacpi: batt_state_t Struct Reference

batt_state_t Struct Reference

battery life status More...

#include <libacpi.h>


Detailed Description

battery life status


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h.html0000644000175000017500000002030210653101604015410 0ustar nionnion libacpi: list.h File Reference

list.h File Reference

linked list More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  node
struct  list_t
 linked list More...

Typedefs

typedef node node_t

Functions

list_tdir_list (char *dir)
void delete_list (list_t *lst)


Detailed Description

linked list

Definition in file list.h.


Typedef Documentation

typedef struct node node_t


Function Documentation

void delete_list ( list_t lst  ) 

Delete linked list

Parameters:
lst list to delete

Definition at line 46 of file list.c.

References list_t::last, and list_t::top.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

Here is the caller graph for this function:

list_t* dir_list ( char *  dir  ) 

Lists contents (for libacpi directories) of a directory and return them in a linked list

Parameters:
dir directory to list
Returns:
linked list

Definition at line 61 of file list.c.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

Here is the caller graph for this function:


Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c.html0000644000175000017500000006070410653101603016044 0ustar nionnion libacpi: libacpi.c File Reference

libacpi.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <dirent.h>
#include <ctype.h>
#include <stddef.h>
#include "libacpi.h"
#include "list.h"

Include dependency graph for libacpi.c:

Go to the source code of this file.

Classes

struct  acpi_value_t

Functions

int check_acpi_support (void)
int init_acpi_batt (global_t *globals)
void read_acpi_acstate (global_t *globals)
int init_acpi_acadapt (global_t *globals)
int read_acpi_fan (const int num)
int init_acpi_fan (global_t *globals)
int init_acpi_thermal (global_t *globals)
int read_acpi_zone (const int num, global_t *globals)
int read_acpi_batt (const int num)


Function Documentation

int check_acpi_support ( void   ) 

Checks if the system does support ACPI or not

Returns:
SUCCESS if the system supports ACPI or, NOT_SUPPORTED

Definition at line 127 of file libacpi.c.

References NOT_SUPPORTED, and SUCCESS.

int init_acpi_acadapt ( global_t globals  ) 

Finds existing ac adapter and fills the adapt structure with the paths of the important to parse files

Parameters:
globals pointer to global acpi structure

Definition at line 211 of file libacpi.c.

References global_t::adapt, ALLOC_ERR, delete_list(), dir_list(), MAX_NAME, adapter_t::name, NOT_SUPPORTED, PROC_ACPI, read_acpi_acstate(), adapter_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_batt ( global_t globals  ) 

Finds existing batteries and fills the corresponding batteries structures with the paths of the important to parse files

Parameters:
globals pointer to global acpi structure

Definition at line 139 of file libacpi.c.

References battery_t::alarm_file, ALLOC_ERR, global_t::batt_count, batteries, delete_list(), dir_list(), battery_t::info_file, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, battery_t::name, NOT_SUPPORTED, PROC_ACPI, battery_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_fan ( global_t globals  ) 

Finds existing fans and fills corresponding fan structures with the paths of the important to parse files for fan information

Parameters:
globals pointer to global acpi structure

Definition at line 264 of file libacpi.c.

References ALLOC_ERR, delete_list(), dir_list(), global_t::fan_count, fans, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, fan_t::name, NOT_SUPPORTED, PROC_ACPI, fan_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_thermal ( global_t globals  ) 

Finds existing thermal zones and fills corresponding thermal structures with the paths of the important to parse files for thermal information

Parameters:
globals pointer to global acpi structure

Definition at line 298 of file libacpi.c.

References ALLOC_ERR, thermal_t::cooling_file, delete_list(), dir_list(), thermal_t::freq_file, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, thermal_t::name, NOT_SUPPORTED, PROC_ACPI, thermal_t::state_file, SUCCESS, thermal_t::temp_file, global_t::thermal_count, thermals, list_t::top, and thermal_t::trips_file.

Here is the call graph for this function:

void read_acpi_acstate ( global_t globals  ) 

Looks up if the ac adapter is plugged in or not and sets the values in a struct

Parameters:
globals pointer to the global acpi structure

Definition at line 190 of file libacpi.c.

References adapter_t::ac_state, global_t::adapt, P_AC, P_BATT, P_ERR, and adapter_t::state_file.

Referenced by init_acpi_acadapt().

Here is the caller graph for this function:

int read_acpi_batt ( const int  num  ) 

Gathers all information of a given battery and filling a struct with it

Parameters:
num number of battery

Definition at line 608 of file libacpi.c.

References ITEM_EXCEED, MAX_ITEMS, and SUCCESS.

int read_acpi_fan ( const int  num  ) 

Gathers all information about given fan and sets the corresponding values in a struct

Parameters:
num number for the fan to read

Definition at line 230 of file libacpi.c.

References F_ERR, F_OFF, F_ON, fan_t::fan_state, fans, ITEM_EXCEED, MAX_ITEMS, NOT_SUPPORTED, fan_t::state_file, and SUCCESS.

int read_acpi_zone ( const int  num,
global_t globals 
)

Gathers all information of a given thermal zone and sets the corresponding values in a struct

Parameters:
num zone
globals pointer to global acpi struct, needed if there is just one zone

Definition at line 359 of file libacpi.c.

References CO_ERR, thermal_t::cooling_file, DISABLED, thermal_t::freq_file, thermal_t::frequency, ITEM_EXCEED, MAX_ITEMS, NOT_SUPPORTED, thermal_t::state_file, SUCCESS, T_ERR, thermal_t::temp_file, thermal_t::temperature, global_t::temperature, thermal_t::therm_mode, thermal_t::therm_state, global_t::thermal_count, and thermals.


Generated on Sun Jul 29 14:09:39 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/annotated.html0000644000175000017500000000612610653101604016023 0ustar nionnion libacpi: Class List

libacpi Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
acpi_value_t
adapter_tInformation about ac adapater
batt_state_tBattery life status
battery_tInformation found about battery
charge_state_tCharge state of battery
fan_tFan data
global_tGlobal acpi structure
list_tLinked list
node
node_tNode for linked list
power_state_tPower states
thermal_mode_tCooling mode
thermal_state_tThermal zone states
thermal_tInformation about thermal zone

Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8h_b46f89c7d7ff338842d7619c7392c0bf_cgraph.map0000644000175000017500000000036410653101603023617 0ustar nionnion libacpi-0.2/doc/html/list_8c-source.html0000644000175000017500000002112510653101602016703 0ustar nionnion libacpi: list.c Source File

list.c

Go to the documentation of this file.
00001 /*
00002  * (C)opyright 2007 Nico Golde <nico@ngolde.de>
00003  * See LICENSE file for license details
00004  * This is no complete linked list implementation, it is just used
00005  * to get a list of directory entries and delete the list
00006  */
00007 
00008 #include <stdio.h>
00009 #include <string.h>
00010 #include <stdlib.h>
00011 #include <dirent.h>
00012 
00013 #include "list.h"
00014 
00015 /* create a new list */
00016 static list_t *
00017 new_list(void){
00018         list_t *l = malloc(sizeof(list_t));
00019         if(!l) return NULL;
00020         l->top = l->last = NULL;
00021         l->length = 0;
00022         return l;
00023 }
00024 
00025 static void
00026 append_node(list_t *lst, char *name){
00027         node_t *n;
00028         if(!lst) return;
00029         if((n = malloc(sizeof(node_t))) == NULL) return;
00030         if((n->name = strdup(name)) == NULL) {
00031                 free(n);
00032                 return;
00033         }
00034         n->next = NULL;
00035         if(lst->top){
00036                 lst->last->next = n;
00037                 lst->last = lst->last->next;
00038         } else {
00039                 lst->top = lst->last = n;
00040         }
00041         lst->length++;
00042 }
00043 
00044 /* delete the whole list */
00045 void
00046 delete_list(list_t *lst){
00047         node_t *tmp;
00048         tmp = lst->top;
00049         while(tmp != NULL){
00050                 lst->top = tmp->next;
00051                 if(tmp->name) free(tmp->name);
00052                 free(tmp);
00053                 tmp = lst->top;
00054         }
00055         lst->top = lst->last = NULL;
00056         free(lst);
00057 }
00058 
00059 /* return a linked list with directory entries or NULL on error */
00060 list_t *
00061 dir_list(char *dir){
00062         list_t *list = new_list();
00063         DIR *rddir = NULL;
00064         struct dirent *rd;
00065 
00066         if((rddir = opendir(dir)) == NULL)
00067                 return NULL;
00068         while((rd = readdir(rddir))){
00069                 if(!strncmp(".", rd->d_name, 1) || !strncmp("..", rd->d_name, 2))
00070                         continue;
00071 
00072                 append_node(list, rd->d_name);
00073         }
00074         closedir(rddir);
00075         return list;
00076 }

Generated on Sun Jul 29 14:09:38 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8c_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.map0000644000175000017500000000102010653101604023665 0ustar nionnion libacpi-0.2/doc/html/structnode-members.html0000644000175000017500000000303210653101606017663 0ustar nionnion libacpi: Member List

node Member List

This is the complete list of members for node, including all inherited members.

namenode
nextnode


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8c.html0000644000175000017500000001543510653101604015416 0ustar nionnion libacpi: list.c File Reference

list.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include "list.h"

Include dependency graph for list.c:

Go to the source code of this file.

Functions

void delete_list (list_t *lst)
list_tdir_list (char *dir)


Function Documentation

void delete_list ( list_t lst  ) 

Delete linked list

Parameters:
lst list to delete

Definition at line 46 of file list.c.

References list_t::last, and list_t::top.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

Here is the caller graph for this function:

list_t* dir_list ( char *  dir  ) 

Lists contents (for libacpi directories) of a directory and return them in a linked list

Parameters:
dir directory to list
Returns:
linked list

Definition at line 61 of file list.c.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

Here is the caller graph for this function:


Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structglobal__t-members.html0000644000175000017500000000423710653101605020667 0ustar nionnion libacpi: Member List

global_t Member List

This is the complete list of members for global_t, including all inherited members.

adaptglobal_t
batt_countglobal_t
fan_countglobal_t
temperatureglobal_t
thermal_countglobal_t


Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/doxygen.css0000644000175000017500000001761510653101602015352 0ustar nionnionBODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { font-family: Geneva, Arial, Helvetica, sans-serif; } BODY,TD { font-size: 90%; } H1 { text-align: center; font-size: 160%; } H2 { font-size: 120%; } H3 { font-size: 100%; } CAPTION { font-weight: bold } DIV.qindex { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.nav { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navtab { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } TD.navtab { font-size: 70%; } A.qindex { text-decoration: none; font-weight: bold; color: #1A419D; } A.qindex:visited { text-decoration: none; font-weight: bold; color: #1A419D } A.qindex:hover { text-decoration: none; background-color: #ddddff; } A.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} A.codeRef:link { font-weight: normal; color: #0000FF} A.codeRef:visited { font-weight: normal; color: #0000FF} A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } .fragment { font-family: monospace, fixed; font-size: 95%; } PRE.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; margin-right: 20px; margin-left: 20px; } TD.indexkey { background-color: #e8eef2; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TD.indexvalue { background-color: #e8eef2; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TR.memlist { background-color: #f0f0f0; } P.formulaDsp { text-align: center; } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle; } SPAN.keyword { color: #008000 } SPAN.keywordtype { color: #604020 } SPAN.keywordflow { color: #e08000 } SPAN.comment { color: #800000 } SPAN.preprocessor { color: #806020 } SPAN.stringliteral { color: #002080 } SPAN.charliteral { color: #008080 } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } FORM.search { margin-bottom: 0px; margin-top: 0px; } INPUT.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } TD.tiny { font-size: 75%; } a { color: #1A41A8; } a:visited { color: #2A3798; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } TH.dirtab { background: #e8eef2; font-weight: bold; } HR { height: 1px; border: none; border-top: 1px solid black; } /* Style for detailed member documentation */ .memtemplate { font-size: 80%; color: #606060; font-weight: normal; } .memnav { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .memitem { padding: 4px; background-color: #eef3f5; border-width: 1px; border-style: solid; border-color: #dedeee; -moz-border-radius: 8px 8px 8px 8px; } .memname { white-space: nowrap; font-weight: bold; } .memdoc{ padding-left: 10px; } .memproto { background-color: #d5e1e8; width: 100%; border-width: 1px; border-style: solid; border-color: #84b0c7; font-weight: bold; -moz-border-radius: 8px 8px 8px 8px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; font-style: italic; white-space: nowrap; } /* End Styling for detailed member documentation */ /* for the tree view */ .ftvtree { font-family: sans-serif; margin:0.5em; } .directory { font-size: 9pt; font-weight: bold; } .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory > h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } libacpi-0.2/doc/html/libacpi_8h_027286cd397157bdbf9e551ef510cb59_cgraph.map0000644000175000017500000000057310653101603023576 0ustar nionnion libacpi-0.2/doc/html/structacpi__value__t.html0000644000175000017500000000656110653101604020247 0ustar nionnion libacpi: acpi_value_t Struct Reference

acpi_value_t Struct Reference

List of all members.

Public Attributes

char * value
size_t offset

Detailed Description

Definition at line 22 of file libacpi.c.


Member Data Documentation

Definition at line 23 of file libacpi.c.

Definition at line 24 of file libacpi.c.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structglobal__t__coll__graph.png0000644000175000017500000000260210653101605021541 0ustar nionnionPNG  IHDRw=PLTE2Ϳ|.tRNS@fIDATxmΛ0 wJL_%UF'8EەWiClB_ C,^:*3ux.j>{`f(e ބTl]`g$X{&o{`WĢtKxNV lH9-7`LPzX=4\_^YY8yޥ9~ާ9zOz+x8Nl(cAᯀGbN'I阅S2)0`濚)WL` w*: gol0¨Ыy˚w[ga`~~mD5咎wzn~,!ݰ9*>Ձ9m Nf>*#fG9]6fpY3clc0PpGUaYHLB!DGKb K/ƒj&,wNK2<MaFdtb]5@K2{z`Ǹt۹nr3 vIf֓$3bbcঅzƑkW73Jcsv!vp+d5bژ8a.>fWSHKmK&n-[oOi ^Mp z D,h䢙(تJAƨD`1̝[B(tZ6%8{@aҠ;J y0XiH rXiH g5}k`ypÛo~p_6G iHIENDB`libacpi-0.2/doc/html/list_8c_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.md50000644000175000017500000000004010653101604023576 0ustar nionnion61ba45e6816e7d66b55b723513c65048libacpi-0.2/doc/html/structlist__t.html0000644000175000017500000001271310653101605016750 0ustar nionnion libacpi: list_t Struct Reference

list_t Struct Reference

linked list More...

#include <list.h>

Collaboration diagram for list_t:

Collaboration graph
[legend]
List of all members.

Public Attributes

int length
node_ttop
node_tlast

Detailed Description

linked list

Definition at line 24 of file list.h.


Member Data Documentation

list length

Definition at line 25 of file list.h.

pointer to top node

Definition at line 26 of file list.h.

Referenced by delete_list(), init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

pointer to last node

Definition at line 27 of file list.h.

Referenced by delete_list().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/functions.html0000644000175000017500000001747610653101604016070 0ustar nionnion libacpi: Class Members

Here is a list of all class members with links to the classes they belong to:

- a -

- b -

- c -

- d -

- f -

- i -

- l -

- n -

- o -

- p -

- r -

- s -

- t -

- v -


Generated on Sun Jul 29 14:09:40 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structnode__coll__graph.map0000644000175000017500000000017210653101606020536 0ustar nionnion libacpi-0.2/doc/html/libacpi_8c_3ee17a37e660f31b7b7e5f2f0896851b_cgraph.md50000644000175000017500000000004010653101603023467 0ustar nionnion1df3f031d1d9903dc25769ed80175dd1libacpi-0.2/doc/html/structcharge__state__t.html0000644000175000017500000000311110653101605020555 0ustar nionnion libacpi: charge_state_t Struct Reference

charge_state_t Struct Reference

charge state of battery More...

#include <libacpi.h>


Detailed Description

charge state of battery


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/tabs.css0000644000175000017500000000333610653101602014621 0ustar nionnion/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ DIV.tabs { float : left; width : 100%; background : url("tab_b.gif") repeat-x bottom; margin-bottom : 4px; } DIV.tabs UL { margin : 0px; padding-left : 10px; list-style : none; } DIV.tabs LI, DIV.tabs FORM { display : inline; margin : 0px; padding : 0px; } DIV.tabs FORM { float : right; } DIV.tabs A { float : left; background : url("tab_r.gif") no-repeat right top; border-bottom : 1px solid #84B0C7; font-size : x-small; font-weight : bold; text-decoration : none; } DIV.tabs A:hover { background-position: 100% -150px; } DIV.tabs A:link, DIV.tabs A:visited, DIV.tabs A:active, DIV.tabs A:hover { color: #1A419D; } DIV.tabs SPAN { float : left; display : block; background : url("tab_l.gif") no-repeat left top; padding : 5px 9px; white-space : nowrap; } DIV.tabs INPUT { float : right; display : inline; font-size : 1em; } DIV.tabs TD { font-size : x-small; font-weight : bold; text-decoration : none; } /* Commented Backslash Hack hides rule from IE5-Mac \*/ DIV.tabs SPAN {float : none;} /* End IE5-Mac hack */ DIV.tabs A:hover SPAN { background-position: 0% -150px; } DIV.tabs LI.current A { background-position: 100% -150px; border-width : 0px; } DIV.tabs LI.current SPAN { background-position: 0% -150px; padding-bottom : 6px; } DIV.nav { background : none; border : none; border-bottom : 1px solid #84B0C7; } libacpi-0.2/doc/html/libacpi_8c-source.html0000644000175000017500000024070110653101602017336 0ustar nionnion libacpi: libacpi.c Source File

libacpi.c

Go to the documentation of this file.
00001 /*
00002  * (C)opyright 2007 Nico Golde <nico@ngolde.de>
00003  * See LICENSE file for license details
00004  */
00005 
00006 #include <stdio.h>
00007 #include <stdlib.h>
00008 #include <unistd.h>
00009 #include <string.h>
00010 #include <dirent.h>
00011 #include <ctype.h>
00012 #include <stddef.h>
00013 
00014 #include "libacpi.h"
00015 #include "list.h"
00016 
00017 static int read_acpi_battinfo(const int num);
00018 static int read_acpi_battalarm(const int num);
00019 static int read_acpi_battstate(const int num);
00020 static void read_acpi_thermalzones(global_t *globals);
00021 
00022 typedef struct {
00023         char * value;
00024         size_t offset;
00025 } acpi_value_t;
00026 
00027 static acpi_value_t
00028 battinfo_values[] = {
00029         { "last full capacity:", offsetof(battery_t, last_full_cap) },
00030         { "design voltage:", offsetof(battery_t, design_voltage) },
00031         { "design capacity warning:", offsetof(battery_t, design_warn) },
00032         { "design capacity low:", offsetof(battery_t, design_low) },
00033         { "capacity granularity 1:", offsetof(battery_t, design_level1) },
00034         { "capacity granularity 2:", offsetof(battery_t, design_level2) },
00035         { NULL, 0 }
00036 };
00037 
00038 static acpi_value_t
00039 battstate_values[] = {
00040         { "present rate:", offsetof(battery_t, present_rate) },
00041         { "remaining capacity:", offsetof(battery_t, remaining_cap) },
00042         { "present voltage:", offsetof(battery_t, present_voltage) },
00043         { NULL, 0 }
00044 };
00045 
00046 /* given a buffer for example from a file, search for key
00047  * and return a pointer to the value of it. On error return NULL*/
00048 static char *
00049 scan_acpi_value(const char *buf, const char *key){
00050         char *ptr = NULL;
00051         char *tmpbuf = NULL;
00052         char *tmpkey = NULL;
00053         char *tmpval = NULL;
00054 
00055         if((tmpbuf = strdup(buf)) == NULL)
00056                 return NULL;
00057 
00058         /* jump to the key in buffer */
00059         if((tmpkey = strstr(tmpbuf, key))) {
00060                 /* jump behind the key, whitespaces and tabs */
00061                 for(tmpkey += strlen(key); *tmpkey && (*tmpkey == ' ' || *tmpkey == '\t'); tmpkey++);
00062                 for(tmpval = tmpkey; *tmpval && *tmpval != ' ' &&
00063                                 *tmpval != '\t' && *tmpval != '\n' &&
00064                                 *tmpval != '\r'; tmpval++);
00065                 if(tmpval)
00066                         *tmpval = '\0';
00067 
00068                 if((ptr = strdup(tmpkey)) == NULL) {
00069                         free(tmpbuf);
00070                         return NULL;
00071                 }
00072         }
00073         free(tmpbuf);
00074         return ptr;
00075 }
00076 
00077 /* reads a file into a buffer and returns a pointer to it, or NULL on error */
00078 static char *
00079 get_acpi_content(const char *file){
00080         FILE *input = NULL;
00081         char *buf = NULL;
00082         int read = 0;
00083 
00084         if((buf = malloc(MAX_BUF + 1)) == NULL)
00085                 return NULL;
00086         if((input = fopen(file, "r")) == NULL)
00087                 return NULL;
00088 
00089         read = fread(buf, 1, MAX_BUF, input);
00090         if(read > 0) buf[read - 1] = '\0';
00091         else buf[0] = '\0'; /* I would consider it a kernel bug if that happens */
00092 
00093         fclose(input);
00094         return buf;
00095 }
00096 
00097 /* returns the acpi version or NOT_SUPPORTED(negative value) on failure */
00098 static int
00099 get_acpi_version(void){
00100         long ret = -1;
00101         char *tmp = get_acpi_content(PROC_ACPI "info");
00102         char *version = NULL;
00103         
00104         if(!tmp) {
00105                 tmp = get_acpi_content("/sys/module/acpi/parameters/acpica_version");
00106                 if (tmp) {
00107                         long ret = strtol(tmp, NULL, 10);
00108                         free(tmp);
00109                         return ret;
00110                 } else {
00111                         return NOT_SUPPORTED;
00112                 }
00113         }
00114         if((version = scan_acpi_value(tmp, "version:")) == NULL){
00115                 free(tmp);
00116                 return NOT_SUPPORTED;
00117         }
00118         ret = strtol(version, NULL, 10);
00119         free(tmp);
00120         free(version);
00121         return ret;
00122 }
00123 
00124 /* check if acpi is supported on the system, return 0 on success
00125  * and -1 if not */
00126 int
00127 check_acpi_support(void){
00128         int version = get_acpi_version();
00129 
00130         /* we don't support 2.4 kernel versions TODO */
00131         if(version == NOT_SUPPORTED || version < 20020214)
00132                 return NOT_SUPPORTED;
00133         return SUCCESS;
00134 }
00135 
00136 /* reads existent battery directories and starts to fill the battery
00137  * structure. Returns 0 on success, negative values on error */
00138 int
00139 init_acpi_batt(global_t *globals){
00140         char *names[MAX_ITEMS];
00141         battery_t *binfo;
00142         list_t *lst = NULL;
00143         node_t *node = NULL;
00144         int i = 0;
00145 
00146         globals->batt_count = 0;
00147         if((lst = dir_list(PROC_ACPI "battery")) == NULL || !lst->top)
00148                 return NOT_SUPPORTED;
00149         for(node = lst->top; node; node=node->next){
00150                 if((names[globals->batt_count] = strdup(node->name)) == NULL){
00151                         delete_list(lst);
00152                         return ALLOC_ERR;
00153                 }
00154                 globals->batt_count++;
00155         }
00156 
00157         if(globals->batt_count > MAX_ITEMS) return ITEM_EXCEED;
00158 
00159         /* A quick insertion sort, to sort battery names */
00160         {
00161                 char *tmp1, *tmp2;
00162                 int x,y;
00163                 for (x = 1; x < globals->batt_count; x++) {
00164                         tmp1 = names[x];
00165                         y = x - 1;
00166                         while ((y >= 0) && ((strcmp (tmp1, names[y])) < 0)) {
00167                                 tmp2 = names[y + 1];
00168                                 names[y + 1] = names[y];
00169                                 names[y] = tmp2;
00170                         }
00171                 }
00172         }
00173 
00174         for (i=0; i < globals->batt_count && i < MAX_ITEMS; i++){
00175                 binfo = &batteries[i];
00176                 snprintf(binfo->name, MAX_NAME, "%s", names[i]);
00177                 snprintf(binfo->state_file, MAX_NAME, PROC_ACPI "battery/%s/state", names[i]);
00178                 snprintf(binfo->info_file, MAX_NAME, PROC_ACPI "battery/%s/info", names[i]);
00179                 snprintf(binfo->alarm_file, MAX_NAME, PROC_ACPI "battery/%s/alarm", names[i]);
00180                 read_acpi_battinfo(i);
00181                 read_acpi_battalarm(i);
00182                 free(names[i]);
00183         }
00184         delete_list(lst);
00185         return SUCCESS;
00186 }
00187 
00188 /* reads the acpi state and writes it into the globals structure, void */
00189 void
00190 read_acpi_acstate(global_t *globals){
00191         adapter_t *ac = &globals->adapt;
00192         char *buf = NULL;
00193         char *tmp = NULL;
00194 
00195         if(ac->state_file && (buf = get_acpi_content(ac->state_file)) == NULL){
00196                 ac->ac_state = P_ERR;
00197                 return;
00198         }
00199         if((tmp = scan_acpi_value(buf, "state:")) && !strncmp(tmp, "on-line", 7))
00200                 ac->ac_state = P_AC;
00201         else if(tmp && !strncmp(tmp, "off-line", 8))
00202                 ac->ac_state = P_BATT;
00203         else ac->ac_state = P_ERR;
00204         free(buf);
00205         free(tmp);
00206 }
00207 
00208 /* reads the name of the ac-adapter directory and fills the adapter_t
00209  * structure with the name and the state-file. Return 0 on success, negative values on errors */
00210 int
00211 init_acpi_acadapt(global_t *globals){
00212         list_t *lst = NULL;
00213         adapter_t *ac = &globals->adapt;
00214 
00215         if((lst = dir_list(PROC_ACPI "ac_adapter")) == NULL || !lst->top)
00216                 return NOT_SUPPORTED;
00217 
00218         if((!lst->top->name || ((ac->name = strdup(lst->top->name)) == NULL))){
00219                 delete_list(lst);
00220                 return ALLOC_ERR;
00221         }
00222         snprintf(ac->state_file, MAX_NAME, PROC_ACPI "ac_adapter/%s/state", ac->name);
00223         delete_list(lst);
00224         read_acpi_acstate(globals);
00225         return SUCCESS;
00226 }
00227 
00228 /* read acpi information for fan num, returns 0 on success and negative values on errors */
00229 int
00230 read_acpi_fan(const int num){
00231         char *buf = NULL;
00232         char *tmp = NULL;
00233         fan_t *info = &fans[num];
00234 
00235         if(num > MAX_ITEMS) return ITEM_EXCEED;
00236 
00237         /* scan state file */
00238         if((buf = get_acpi_content(info->state_file)) == NULL)
00239                 info->fan_state = F_ERR;
00240 
00241         if(!buf || (tmp = scan_acpi_value(buf, "status:")) == NULL){
00242                 info->fan_state = F_ERR;
00243                 return NOT_SUPPORTED;
00244         }
00245         if (tmp[0] == 'o' && tmp[1] == 'n') info->fan_state = F_ON;
00246         else if(tmp[0] == 'o' && tmp[1] == 'f') info->fan_state = F_OFF;
00247         else info->fan_state = F_ERR;
00248         free(buf);
00249         free(tmp);
00250         return SUCCESS;
00251 }
00252 
00253 /* read all fans, fill the fan structures */
00254 static void
00255 read_acpi_fans(global_t *globals){
00256         int i;
00257         for(i = 0; i < globals->fan_count; i++)
00258                 read_acpi_fan(i);
00259 }
00260 
00261 /* reads the names of the fan directories, fills fan_t,
00262  * return 0 on success, negative values on errors */
00263 int
00264 init_acpi_fan(global_t *globals){
00265         char *names[MAX_ITEMS];
00266         list_t *lst = NULL;
00267         node_t *node = NULL;
00268         int i = 0;
00269         fan_t *finfo = NULL;
00270         globals->fan_count = 0;
00271 
00272         if((lst = dir_list(PROC_ACPI "fan")) == NULL || !lst->top)
00273                 return NOT_SUPPORTED;
00274         for(node = lst->top; node; node = node->next){
00275                 if((names[globals->fan_count] = strdup(node->name)) == NULL){
00276                         delete_list(lst);
00277                         return ALLOC_ERR;
00278                 }
00279                 globals->fan_count++;
00280         }
00281 
00282         if(globals->fan_count > MAX_ITEMS) return ITEM_EXCEED;
00283 
00284         for (; i < globals->fan_count && i < MAX_ITEMS; i++){
00285                 finfo = &fans[i];
00286                 snprintf(finfo->name, MAX_NAME, "%s", names[i]);
00287                 snprintf(finfo->state_file, MAX_NAME, PROC_ACPI "fan/%s/state", names[i]);
00288                 free(names[i]);
00289         }
00290         delete_list(lst);
00291         read_acpi_fans(globals);
00292         return SUCCESS;
00293 }
00294 
00295 /* reads the name of the thermal-zone directory and fills the adapter_t
00296  * structure with the name and the state-file. Return 0 on success, negative values on errors */
00297 int
00298 init_acpi_thermal(global_t *globals){
00299         char *names[MAX_ITEMS];
00300         list_t *lst = NULL;
00301         node_t *node = NULL;
00302         thermal_t *tinfo = NULL;
00303         int i = 0;
00304         globals->thermal_count = 0;
00305 
00306         if((lst = dir_list(PROC_ACPI "thermal_zone")) == NULL)
00307                 return NOT_SUPPORTED;
00308         for(node = lst->top; node; node = node->next){
00309                 if((names[globals->thermal_count] = strdup(node->name)) == NULL){
00310                         delete_list(lst);
00311                         return ALLOC_ERR;
00312                 }
00313                 globals->thermal_count++;
00314         }
00315 
00316         if(globals->thermal_count > MAX_ITEMS) return ITEM_EXCEED;
00317 
00318         for (; i < globals->thermal_count && i < MAX_ITEMS; i++){
00319                 tinfo = &thermals[i];
00320                 snprintf(tinfo->name, MAX_NAME, "%s", names[i]);
00321                 snprintf(tinfo->state_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/state", names[i]);
00322                 snprintf(tinfo->temp_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/temperature", names[i]);
00323                 snprintf(tinfo->cooling_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/cooling_mode", names[i]);
00324                 snprintf(tinfo->freq_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/polling_frequency", names[i]);
00325                 snprintf(tinfo->trips_file, MAX_NAME, PROC_ACPI "thermal_zone/%s/trip_points", names[i]);
00326                 free(names[i]);
00327         }
00328         delete_list(lst);
00329         read_acpi_thermalzones(globals);
00330         return SUCCESS;
00331 }
00332 
00333 /* checks the string state and sets the thermal state, returns void */
00334 static void
00335 thermal_state(const char *state, thermal_t *info){
00336         if(state[0] == 'o')
00337                 info->therm_state = T_OK;
00338         else if(!strncmp (state, "crit", 4))
00339                 info->therm_state = T_CRIT;
00340         else if (!strncmp (state, "hot", 3))
00341                 info->therm_state = T_HOT; else if (!strncmp (state, "pas", 3))
00342                 info->therm_state = T_PASS;
00343         else
00344                 info->therm_state = T_ACT;
00345 }
00346 
00347 /* checks the string tmp and sets the cooling mode */
00348 static void
00349 fill_cooling_mode(const char *tmp, thermal_t *info){
00350         if(tmp[0] == 'a')
00351                 info->therm_mode = CO_ACT;
00352         else if(tmp[0]  == 'p')
00353                 info->therm_mode = CO_PASS;
00354         else info->therm_mode = CO_CRIT;
00355 }
00356 
00357 /* reads values for thermal_zone num, return 0 on success, negative values on error */
00358 int
00359 read_acpi_zone(const int num, global_t *globals){
00360         char *buf = NULL;
00361         char *tmp = NULL;
00362         thermal_t *info = &thermals[num];
00363 
00364         if(num > MAX_ITEMS) return ITEM_EXCEED;
00365 
00366         /* scan state file */
00367         if((buf = get_acpi_content(info->state_file)) == NULL)
00368                 info->therm_state = T_ERR;
00369 
00370         if(buf && (tmp = scan_acpi_value(buf, "state:")))
00371                         thermal_state(tmp, info);
00372         free(tmp);
00373         free(buf);
00374 
00375         /* scan temperature file */
00376         if((buf = get_acpi_content(info->temp_file)) == NULL)
00377                 info->temperature = NOT_SUPPORTED;
00378 
00379         if(buf && (tmp = scan_acpi_value(buf, "temperature:"))){
00380                 info->temperature = strtol(tmp, NULL, 10);
00381                 /* if we just have one big thermal zone, this will be the global temperature */
00382                 if(globals->thermal_count == 1)
00383                         globals->temperature = info->temperature;
00384         }
00385         free(tmp);
00386         free(buf);
00387 
00388         /* scan cooling mode file */
00389         if((buf = get_acpi_content(info->cooling_file)) == NULL)
00390                 info->therm_mode = CO_ERR;
00391         if(buf && (tmp = scan_acpi_value(buf, "cooling mode:")))
00392                 fill_cooling_mode(tmp, info);
00393         else info->therm_mode = CO_ERR;
00394         free(tmp);
00395         free(buf);
00396 
00397         /* scan polling_frequencies file */
00398         if((buf = get_acpi_content(info->freq_file)) == NULL)
00399                 info->frequency = DISABLED;
00400         if(buf && (tmp = scan_acpi_value(buf, "polling frequency:")))
00401                 info->frequency = strtol(tmp, NULL, 10);
00402         else info->frequency = DISABLED;
00403         free(tmp);
00404         free(buf);
00405 
00406         /* TODO: IMPLEMENT TRIP POINTS FILE */
00407 
00408         return SUCCESS;
00409 }
00410 
00411 /* read all thermal zones, fill the thermal structures */
00412 static void
00413 read_acpi_thermalzones(global_t *globals){
00414         int i;
00415         for(i = 0; i < globals->thermal_count; i++)
00416                 read_acpi_zone(i, globals);
00417 }
00418 
00419 /* fill battery_state for given battery, return 0 on success or negative values on error */
00420 static void
00421 batt_charge_state(battery_t *info){
00422         int high = info->last_full_cap / 2;
00423         int med = high / 2;
00424 
00425         if(info->remaining_cap > high)
00426                 info->batt_state = B_HIGH;
00427         else if(info->remaining_cap <= high && info->remaining_cap > med)
00428                 info->batt_state = B_MED;
00429         else if(info->remaining_cap <= med && info->remaining_cap > info->design_warn)
00430                 info->batt_state = B_LOW;
00431         else if(info->remaining_cap <= info->design_warn && info->remaining_cap > info->design_low)
00432                 info->batt_state = B_CRIT;
00433         else info->batt_state = B_HARD_CRIT;
00434 }
00435 
00436 /* fill charge_state of a given battery num, return 0 on success or negative values on error */
00437 static void
00438 fill_charge_state(const char *state, battery_t *info){
00439         if(state[0] == 'u')
00440                 info->charge_state = C_ERR;
00441         else if(!strncmp (state, "disch", 5))
00442                 info->charge_state = C_DISCHARGE;
00443         else if (!strncmp (state, "charge", 6))
00444                 info->charge_state = C_CHARGED;
00445         else if (!strncmp (state, "chargi", 6))
00446                 info->charge_state = C_CHARGE;
00447         else
00448                 info->charge_state = C_NOINFO;
00449 }
00450 
00451 /* read alarm capacity, return 0 on success, negative values on error */
00452 static int
00453 read_acpi_battalarm(const int num){
00454         char *buf = NULL;
00455         char *tmp = NULL;
00456         battery_t *info = &batteries[num];
00457 
00458         if((buf = get_acpi_content(info->alarm_file)) == NULL)
00459                 return NOT_SUPPORTED;
00460 
00461         if((tmp = scan_acpi_value(buf, "alarm:")) && tmp[0] != 'u')
00462                 info->alarm = strtol(tmp, NULL, 10);
00463         else
00464                 info->alarm = NOT_SUPPORTED;
00465         free(buf);
00466         free(tmp);
00467         return SUCCESS;
00468 }
00469 
00470 /* reads static values for a battery (info file), returns SUCCESS */
00471 static int
00472 read_acpi_battinfo(const int num){
00473         char *buf = NULL;
00474         char *tmp = NULL;
00475         battery_t *info = &batteries[num];
00476         int i = 0;
00477 
00478         if((buf = get_acpi_content(info->info_file)) == NULL)
00479                 return NOT_SUPPORTED;
00480 
00481         /* you have to read the present value always since a battery can be taken away while
00482          * refreshing the data */
00483         if((tmp = scan_acpi_value(buf, "present:")) && !strncmp(tmp, "yes", 3)) {
00484                 free(tmp);
00485                 info->present = 1;
00486         } else {
00487                 info->present = 0;
00488                 free(buf);
00489                 return NOT_PRESENT;
00490         }
00491 
00492         if((tmp = scan_acpi_value(buf, "design capacity:")) && tmp[0] != 'u'){
00493                 info->design_cap = strtol(tmp, NULL, 10);
00494                 /* workaround ACPI's broken way of reporting no battery */
00495                 if(info->design_cap == 655350) info->design_cap = NOT_SUPPORTED;
00496                 free(tmp);
00497         }
00498         else info->design_cap = NOT_SUPPORTED;
00499 
00500         for (;battinfo_values[i].value; i++) {
00501                 if ((tmp = scan_acpi_value(buf, battinfo_values[i].value)) && tmp[0] != 'u') {
00502                         *((int *)(((char *)info) + battinfo_values[i].offset)) = strtol(tmp, NULL, 10);
00503                         free(tmp);
00504                 } else {
00505                         *((int *)(((char *)info) + battinfo_values[i].offset)) = NOT_SUPPORTED;
00506                 }
00507         }
00508 
00509         /* TODO remove debug */
00510         /* printf("%s\n", buf); */
00511         free(buf);
00512 
00513         return SUCCESS;
00514 }
00515 
00516 /* read information for battery num, return 0 on success or negative values on error */
00517 static int
00518 read_acpi_battstate(const int num){
00519         char *buf = NULL;
00520         char *tmp = NULL;
00521         battery_t *info = &batteries[num];
00522         unsigned int i = 0;
00523 
00524         if((buf = get_acpi_content(info->state_file)) == NULL)
00525                 return NOT_SUPPORTED;
00526         
00527         if((tmp = scan_acpi_value(buf, "present:")) && !strncmp(tmp, "yes", 3)) {
00528                 info->present = 1;
00529                 free(tmp);
00530         } else {
00531                 info->present = 0;
00532                 free(buf);
00533                 return NOT_PRESENT;
00534         }
00535 
00536         /* TODO REMOVE DEBUG */
00537         /* printf("%s\n\n", buf); */
00538 
00539         if((tmp = scan_acpi_value(buf, "charging state:")) && tmp[0] != 'u') {
00540                 fill_charge_state(tmp, info);
00541                 free(tmp);
00542         } else {
00543                 info->charge_state = C_NOINFO;
00544         }
00545 
00546         for (;battstate_values[i].value; i++) {
00547                 if ((tmp = scan_acpi_value(buf, battstate_values[i].value)) && tmp[0] != 'u') {
00548                         *((int *)(((char *)info) + battstate_values[i].offset)) = strtol(tmp, NULL, 10);
00549                         free(tmp);
00550                 } else {
00551                         *((int *)(((char *)info) + battstate_values[i].offset)) = NOT_SUPPORTED;
00552                 }
00553         }
00554 
00555         /* get information from the info file */
00556         batt_charge_state(info);
00557         
00558         free(buf);
00559         return SUCCESS;
00560 }
00561 
00562 /* calculate percentage of battery capacity num */
00563 static void
00564 calc_remain_perc(const int num){
00565         float lfcap;
00566         battery_t *info = &batteries[num];
00567         int perc;
00568 
00569         if(info->remaining_cap < 0){
00570                 info->percentage = NOT_SUPPORTED;
00571                 return;
00572         }
00573         else{
00574                 lfcap = info->last_full_cap;
00575                 if(lfcap <= 0) lfcap = 1;
00576                 perc = (int) ((info->remaining_cap / lfcap) * 100.0);
00577         }
00578         info->percentage = perc > 100 ? 100 : perc;
00579 }
00580 
00581 /* calculate remaining charge time for battery num */
00582 static void
00583 calc_remain_chargetime(const int num){
00584         battery_t *info = &batteries[num];
00585 
00586         if(info->present_rate < 0 || info->charge_state != C_CHARGE){
00587                 info->charge_time = 0;
00588                 return;
00589         }
00590         info->charge_time = (int) ((((float)info->last_full_cap - (float)info->remaining_cap) / info->present_rate) * 60.0);
00591 }
00592 
00593 /* calculate remaining time for battery num */
00594 static void
00595 calc_remain_time(const int num){
00596         battery_t *info = &batteries[num];
00597 
00598         if(info->present_rate < 0 || info->charge_state != C_DISCHARGE){
00599                 info->remaining_time = 0;
00600                 return;
00601         }
00602         info->remaining_time = (int) (((float)info->remaining_cap / (float)info->present_rate) * 60.0);
00603 }
00604 
00605 /* read/refresh information about a given battery num
00606  * returns 0 on SUCCESS, negative values on errors */
00607 int
00608 read_acpi_batt(const int num){
00609         if(num > MAX_ITEMS) return ITEM_EXCEED;
00610         read_acpi_battstate(num);
00611         read_acpi_battalarm(num);
00612         calc_remain_perc(num);
00613         calc_remain_chargetime(num);
00614         calc_remain_time(num);
00615         return SUCCESS;
00616 }

Generated on Sun Jul 29 14:09:38 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.map0000644000175000017500000000102010653101604023672 0ustar nionnion libacpi-0.2/doc/html/structthermal__t.html0000644000175000017500000003144710653101606017437 0ustar nionnion libacpi: thermal_t Struct Reference

thermal_t Struct Reference

information about thermal zone More...

#include <libacpi.h>

Collaboration diagram for thermal_t:

Collaboration graph
[legend]
List of all members.

Public Attributes

char name [MAX_NAME]
int temperature
int frequency
char state_file [MAX_NAME]
char cooling_file [MAX_NAME]
char freq_file [MAX_NAME]
char trips_file [MAX_NAME]
char temp_file [MAX_NAME]
thermal_mode_t therm_mode
thermal_state_t therm_state

Detailed Description

information about thermal zone

Definition at line 147 of file libacpi.h.


Member Data Documentation

char thermal_t::name[MAX_NAME]

name of the thermal zone

Definition at line 148 of file libacpi.h.

Referenced by init_acpi_thermal().

current temperature of the zone

Definition at line 149 of file libacpi.h.

Referenced by read_acpi_zone().

polling frequency for this zone

Definition at line 150 of file libacpi.h.

Referenced by read_acpi_zone().

char thermal_t::state_file[MAX_NAME]

state file + path of the zone

Definition at line 151 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().

char thermal_t::cooling_file[MAX_NAME]

cooling mode file + path

Definition at line 152 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().

char thermal_t::freq_file[MAX_NAME]

polling frequency file + path

Definition at line 153 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().

char thermal_t::trips_file[MAX_NAME]

trip points file + path

Definition at line 154 of file libacpi.h.

Referenced by init_acpi_thermal().

char thermal_t::temp_file[MAX_NAME]

temperature file + path

Definition at line 155 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().

current cooling mode

Definition at line 156 of file libacpi.h.

Referenced by read_acpi_zone().

current thermal state

Definition at line 157 of file libacpi.h.

Referenced by read_acpi_zone().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8h__dep__incl.png0000644000175000017500000000105610653101604017370 0ustar nionnionPNG  IHDRWPLTEpA^tRNS@fIDATX]n ^`QE}HpIi񖱦'τp"ݫJϹş{:A7}}^' -5-XŜe7JT_t|pY|i賣:xqݵkDF 5[RKHqI5յD9jQ\LsHhVWhN蚳g؊*ŝy%=;2.̨@p;]>ZY]_b 7Rn&v}xGv[3 :.͐iynwweqNG`VǦ̌&eNw-H.>{."ֵו70un7S\rhҍi.\u1wWm>ovcQ'e&h&ōIENDB`libacpi-0.2/doc/html/globals_enum.html0000644000175000017500000000425610653101606016521 0ustar nionnion libacpi: Class Members  


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structlist__t__coll__graph.png0000644000175000017500000000121610653101605021254 0ustar nionnionPNG  IHDRJDPLTE2Ϳ|.tRNS@f*IDAThm {Y'U$|hq%>D -S$(ɏ_rk@CDfpˣD,go0L_EuT ЩNݓ M2d舂4#D_+Qei'Ay\ۍQ]W([̡A eb}]M9Pp5QEQMNSCʋH \) D9*U%Jm ?2Ņ>`jW_R^^5WA^~EjBE1T_YjHЯE2B•P2\9_E XĭLqCaԽk>~tS& P7'sIENDB`libacpi-0.2/doc/html/structbattery__t__coll__graph.map0000644000175000017500000000077110653101605021751 0ustar nionnion libacpi-0.2/doc/html/list_8h-source.html0000644000175000017500000000722610653101602016716 0ustar nionnion libacpi: list.h Source File

list.h

Go to the documentation of this file.
00001 /*
00002  * (C)opyright 2007 Nico Golde <nico@ngolde.de>
00003  * See LICENSE file for license details
00004  */
00005 
00015 typedef struct node{
00016         char *name;         
00017         struct node *next;  
00018 } node_t;
00019 
00024 typedef struct{
00025         int length;         
00026         node_t *top;        
00027         node_t *last;       
00028 } list_t;
00029 
00036 list_t *dir_list(char *dir);
00037 
00042 void delete_list(list_t *lst);

Generated on Sun Jul 29 14:09:38 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_027286cd397157bdbf9e551ef510cb59_cgraph.map0000644000175000017500000000057310653101603023571 0ustar nionnion libacpi-0.2/doc/html/index.html0000644000175000017500000000162310653101602015150 0ustar nionnion libacpi: Main Page

libacpi Documentation

0


Generated on Sun Jul 29 14:09:38 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_b46f89c7d7ff338842d7619c7392c0bf_cgraph.map0000644000175000017500000000036410653101603023612 0ustar nionnion libacpi-0.2/doc/html/libacpi_8h__dep__incl.map0000644000175000017500000000014410653101603020005 0ustar nionnion libacpi-0.2/doc/html/structthermal__t__coll__graph.md50000644000175000017500000000004010653101606021631 0ustar nionnion0f30b608748ffc3c4c8067a976b10443libacpi-0.2/doc/html/libacpi_8h_3ee17a37e660f31b7b7e5f2f0896851b_cgraph.md50000644000175000017500000000004010653101603023474 0ustar nionnion1df3f031d1d9903dc25769ed80175dd1libacpi-0.2/doc/html/structadapter__t__coll__graph.png0000644000175000017500000000136710653101604021727 0ustar nionnionPNG  IHDRj JPLTE2Ϳ|.tRNS@fIDAThk {Y&U$< tw$m'H0},{)T!R,P(RYt `Zv|D-&7%+S! [Z;8l))4`MyEMYw k;X)XYP8]e+(Qn?҈RJ))FlRJޟjdP2j˨aX*j~΋81W/5 쥞h&&R7W׼R*ԕTl[f:LgݖPYr<LSRt{(yeRԛgIxʨQRB(U'0Cok[v k-n`Bahkb<7,ް4P:];{/:y)Te[8(qDm?D!dCխĕB#!{kjش4xAZPP#@ j+2Y𲧃ۊ9 Ǖr;[>mAQ驍0 TmI? ܑ zdWxX"(,l!I>vPJ3%DcP_)24VN4`RBD0޿ vQ <SġRJ)u=RS}uRYIENDB`libacpi-0.2/doc/html/structglobal__t__coll__graph.md50000644000175000017500000000004010653101605021434 0ustar nionnion5d54d1bdb7b1692d441693e98dd85faflibacpi-0.2/doc/html/libacpi_8h.html0000644000175000017500000015475310653101603016061 0ustar nionnion libacpi: libacpi.h File Reference

libacpi.h File Reference

libacpi structures More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fan_t
 fan data More...
struct  battery_t
 information found about battery More...
struct  thermal_t
 information about thermal zone More...
struct  adapter_t
 information about ac adapater More...
struct  global_t
 global acpi structure More...

Defines

#define PROC_ACPI   "/proc/acpi/"
#define LINE_MAX   256
#define MAX_NAME   512
#define MAX_BUF   1024
#define MAX_ITEMS   10

Enumerations

enum  {
  ITEM_EXCEED = -5, DISABLED = -4, NOT_PRESENT = -3, ALLOC_ERR = -2,
  NOT_SUPPORTED = -1, SUCCESS
}
enum  power_state_t { P_AC, P_BATT, P_ERR }
enum  thermal_state_t {
  T_CRIT, T_HOT, T_PASS, T_ACT,
  T_OK, T_ERR
}
enum  charge_state_t {
  C_CHARGE, C_DISCHARGE, C_CHARGED, C_NOINFO,
  C_ERR
}
enum  batt_state_t {
  B_HIGH, B_MED, B_LOW, B_CRIT,
  B_HARD_CRIT, B_ERR
}
enum  thermal_mode_t { CO_ACT, CO_PASS, CO_CRIT, CO_ERR }
enum  fan_state_t { F_ON, F_OFF, F_ERR }
 fan states More...

Functions

int init_acpi_batt (global_t *globals)
int init_acpi_acadapt (global_t *globals)
int init_acpi_thermal (global_t *globals)
int init_acpi_fan (global_t *globals)
int check_acpi_support (void)
int read_acpi_batt (const int num)
void read_acpi_acstate (global_t *globals)
int read_acpi_zone (const int num, global_t *globals)
int read_acpi_fan (const int num)

Variables

battery_t batteries [MAX_ITEMS]
thermal_t thermals [MAX_ITEMS]
fan_t fans [MAX_ITEMS]


Detailed Description

libacpi structures

Definition in file libacpi.h.


Define Documentation

#define LINE_MAX   256

Definition at line 15 of file libacpi.h.

#define MAX_BUF   1024

Definition at line 17 of file libacpi.h.

#define MAX_ITEMS   10

#define MAX_NAME   512

Definition at line 16 of file libacpi.h.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().

#define PROC_ACPI   "/proc/acpi/"

Definition at line 14 of file libacpi.h.

Referenced by init_acpi_acadapt(), init_acpi_batt(), init_acpi_fan(), and init_acpi_thermal().


Enumeration Type Documentation

anonymous enum

Enumerator:
ITEM_EXCEED  maximum item count reached
DISABLED  feature is disabled
NOT_PRESENT  something is not present
ALLOC_ERR  an error occurred while allocating space
NOT_SUPPORTED  a feature is not supported
SUCCESS  everything was fine

Definition at line 24 of file libacpi.h.

Enumerator:
B_HIGH  remaining battery life is high
B_MED  remaining battery life is medium
B_LOW  remaining battery life is low
B_CRIT  remaining battery life is critical
B_HARD_CRIT  remaining battery life is hard critical, you have a few minutes to charge
B_ERR  some error occurred while reading the battery state

Definition at line 72 of file libacpi.h.

Enumerator:
C_CHARGE  battery is currently charging
C_DISCHARGE  battery is currently discharging
C_CHARGED  battery is charged
C_NOINFO  hardware doesn't give information about the state
C_ERR  some error occurred while reading the charge state

Definition at line 60 of file libacpi.h.

fan states

Enumerator:
F_ON  fan is on
F_OFF  fan is off
F_ERR  some error occurred with this fan

Definition at line 96 of file libacpi.h.

Enumerator:
P_AC  if computer runs on AC
P_BATT  if computer runs on battery
P_ERR  no information can be found

Definition at line 37 of file libacpi.h.

Enumerator:
CO_ACT  fans will be turned after the temperature passes a critical point
CO_PASS  devices will be put in a lower power state after a critical point
CO_CRIT  system goes into suspend to disk if possible after a critical temperature
CO_ERR  some error occurred while reading the cooling mode

Definition at line 85 of file libacpi.h.

Enumerator:
T_CRIT  zone reports critical temperature, will cause system to go to S4
T_HOT  zone reports high temperature, will cause system to shutdown immediately
T_PASS  zone is on passive cooling
T_ACT  zone is on active cooling, more power consumption
T_OK  zone is ok
T_ERR  some error occurred while reading the state of the zone

Definition at line 47 of file libacpi.h.


Function Documentation

int check_acpi_support ( void   ) 

Checks if the system does support ACPI or not

Returns:
SUCCESS if the system supports ACPI or, NOT_SUPPORTED

Definition at line 127 of file libacpi.c.

References NOT_SUPPORTED, and SUCCESS.

int init_acpi_acadapt ( global_t globals  ) 

Finds existing ac adapter and fills the adapt structure with the paths of the important to parse files

Parameters:
globals pointer to global acpi structure

Definition at line 211 of file libacpi.c.

References global_t::adapt, ALLOC_ERR, delete_list(), dir_list(), MAX_NAME, adapter_t::name, NOT_SUPPORTED, PROC_ACPI, read_acpi_acstate(), adapter_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_batt ( global_t globals  ) 

Finds existing batteries and fills the corresponding batteries structures with the paths of the important to parse files

Parameters:
globals pointer to global acpi structure

Definition at line 139 of file libacpi.c.

References battery_t::alarm_file, ALLOC_ERR, global_t::batt_count, batteries, delete_list(), dir_list(), battery_t::info_file, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, battery_t::name, NOT_SUPPORTED, PROC_ACPI, battery_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_fan ( global_t globals  ) 

Finds existing fans and fills corresponding fan structures with the paths of the important to parse files for fan information

Parameters:
globals pointer to global acpi structure

Definition at line 264 of file libacpi.c.

References ALLOC_ERR, delete_list(), dir_list(), global_t::fan_count, fans, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, fan_t::name, NOT_SUPPORTED, PROC_ACPI, fan_t::state_file, SUCCESS, and list_t::top.

Here is the call graph for this function:

int init_acpi_thermal ( global_t globals  ) 

Finds existing thermal zones and fills corresponding thermal structures with the paths of the important to parse files for thermal information

Parameters:
globals pointer to global acpi structure

Definition at line 298 of file libacpi.c.

References ALLOC_ERR, thermal_t::cooling_file, delete_list(), dir_list(), thermal_t::freq_file, ITEM_EXCEED, MAX_ITEMS, MAX_NAME, thermal_t::name, NOT_SUPPORTED, PROC_ACPI, thermal_t::state_file, SUCCESS, thermal_t::temp_file, global_t::thermal_count, thermals, list_t::top, and thermal_t::trips_file.

Here is the call graph for this function:

void read_acpi_acstate ( global_t globals  ) 

Looks up if the ac adapter is plugged in or not and sets the values in a struct

Parameters:
globals pointer to the global acpi structure

Definition at line 190 of file libacpi.c.

References adapter_t::ac_state, global_t::adapt, P_AC, P_BATT, P_ERR, and adapter_t::state_file.

Referenced by init_acpi_acadapt().

Here is the caller graph for this function:

int read_acpi_batt ( const int  num  ) 

Gathers all information of a given battery and filling a struct with it

Parameters:
num number of battery

Definition at line 608 of file libacpi.c.

References ITEM_EXCEED, MAX_ITEMS, and SUCCESS.

int read_acpi_fan ( const int  num  ) 

Gathers all information about given fan and sets the corresponding values in a struct

Parameters:
num number for the fan to read

Definition at line 230 of file libacpi.c.

References F_ERR, F_OFF, F_ON, fan_t::fan_state, fans, ITEM_EXCEED, MAX_ITEMS, NOT_SUPPORTED, fan_t::state_file, and SUCCESS.

int read_acpi_zone ( const int  num,
global_t globals 
)

Gathers all information of a given thermal zone and sets the corresponding values in a struct

Parameters:
num zone
globals pointer to global acpi struct, needed if there is just one zone

Definition at line 359 of file libacpi.c.

References CO_ERR, thermal_t::cooling_file, DISABLED, thermal_t::freq_file, thermal_t::frequency, ITEM_EXCEED, MAX_ITEMS, NOT_SUPPORTED, thermal_t::state_file, SUCCESS, T_ERR, thermal_t::temp_file, global_t::temperature, thermal_t::temperature, thermal_t::therm_mode, thermal_t::therm_state, global_t::thermal_count, and thermals.


Variable Documentation

battery_t batteries[MAX_ITEMS]

Array for existing batteries, loop until globals->battery_count

Definition at line 186 of file libacpi.h.

Referenced by init_acpi_batt().

fan_t fans[MAX_ITEMS]

Array for existing fans, loop until globals->fan_count

Definition at line 196 of file libacpi.h.

Referenced by init_acpi_fan(), and read_acpi_fan().

thermal_t thermals[MAX_ITEMS]

Array for existing thermal zones, loop until globals->thermal_count

Definition at line 191 of file libacpi.h.

Referenced by init_acpi_thermal(), and read_acpi_zone().


Generated on Sun Jul 29 14:09:39 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structnode__coll__graph.png0000644000175000017500000000071210653101605020544 0ustar nionnionPNG  IHDRvjPLTE2Ϳ|.tRNS@ffIDATXa ]EH9* lN !1~+V\{ܮgg(GѪbLz\m AQg;C' pSU iټO:s^=D)[$imuT>OcOXv׵:/:Zw;AXþWz466˞J9 켜wPkm0x\ k-"3f[+zsMܥ2oM|{lo=Tsn0L/3m*e3!eyeưÖ͖_2{<찕㿂F_?ުJjcIENDB`libacpi-0.2/doc/html/structthermal__mode__t.html0000644000175000017500000000306310653101606020573 0ustar nionnion libacpi: thermal_mode_t Struct Reference

thermal_mode_t Struct Reference

cooling mode More...

#include <libacpi.h>


Detailed Description

cooling mode


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/list_8c_ac821e6d16d9494f9b8ffc3f9cd0aec4_icgraph.png0000644000175000017500000000242710653101604023710 0ustar nionnionPNG  IHDRO12PLTEpA^tRNS@fIDATx wypUQT`dJދm8gQ~^U"\8*uuW}WT8LիNŌBuT aM4>Ea_Ta[X U܋=?xڊfR[]U]s;qPQ5]~2lq< tub{0t,0qU_B qxe(^ZVP (_l2ՙy$.Q(K%MY*#ԑUNM*%3QF)*' h$ߓ(jT=oy^9M wP^7C \ XI0XhEhj, Taf͹caxݴ!Ԥ:T©0<,.TSWu6#% 0 gu/gۆOsj_:P0|(Vu ս\YRU G4`Gx֫@Eֆ2Z~u96 uŠ7'M:mhGZuԜ3KjwĀQY;Rjjh6@ӪAm#bVl7|3m{.̄ǟW*Dz^jjGUDŽ /cTT1j:J3>DžBWU[j eC:s9O]Z&>p4N#~f 6e@/ZUXy**AkhԸGg#@UWQ tO" W6UX4CZnp_;vPu䅾+ fkx>1+V#lqvQ=boPiPmL_RƲJiQ\}:uG{)ϴON-%J3Yj^8gwQY~۰gKQR2EO{JR5~i%ߊKW}W}u?c\.As?]n%r~0VAypD~[j$]~0TH'Ay}T~  %`:P2*qʫ.g]eUsIENDB`libacpi-0.2/doc/html/structnode.html0000644000175000017500000000763110653101606016244 0ustar nionnion libacpi: node Struct Reference

node Struct Reference

#include <list.h>

Collaboration diagram for node:

Collaboration graph
[legend]
List of all members.

Public Attributes

char * name
nodenext

Detailed Description

Definition at line 15 of file list.h.


Member Data Documentation

char* node::name

node name

Definition at line 16 of file list.h.

struct node* node::next [read]

pointer to the next node

Definition at line 17 of file list.h.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/structlist__t-members.html0000644000175000017500000000335410653101605020401 0ustar nionnion libacpi: Member List

list_t Member List

This is the complete list of members for list_t, including all inherited members.

lastlist_t
lengthlist_t
toplist_t


Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8h-source.html0000644000175000017500000006635310653101602017354 0ustar nionnion libacpi: libacpi.h Source File

libacpi.h

Go to the documentation of this file.
00001 /*
00002  * (C)opyright 2007 Nico Golde <nico@ngolde.de>
00003  * See LICENSE file for license details
00004  */
00005 
00011 #ifndef __LIBACPI_H__
00012 #define __LIBACPI_H__
00013 
00014 #define PROC_ACPI "/proc/acpi/"
00015 #define LINE_MAX 256
00016 #define MAX_NAME 512
00017 #define MAX_BUF 1024
00018 #define MAX_ITEMS 10
00019 
00024 enum {
00025         ITEM_EXCEED = -5,    
00026         DISABLED = -4,       
00027         NOT_PRESENT = -3,    
00028         ALLOC_ERR = -2,      
00029         NOT_SUPPORTED = -1,  
00030         SUCCESS              
00031 };
00032 
00037 typedef enum {
00038         P_AC,                
00039         P_BATT,              
00040         P_ERR                
00041 } power_state_t;
00042 
00047 typedef enum {
00048         T_CRIT,              
00049         T_HOT,               
00050         T_PASS,              
00051         T_ACT,               
00052         T_OK,                
00053         T_ERR                
00054 } thermal_state_t;
00055 
00060 typedef enum {
00061         C_CHARGE,     
00062         C_DISCHARGE,  
00063         C_CHARGED,    
00064         C_NOINFO,     
00065         C_ERR         
00066 } charge_state_t;
00067 
00072 typedef enum {
00073         B_HIGH,       
00074         B_MED,        
00075         B_LOW,        
00076         B_CRIT,       
00077         B_HARD_CRIT,  
00078         B_ERR         
00079 } batt_state_t;
00080 
00085 typedef enum {
00086         CO_ACT,       
00087         CO_PASS,      
00088         CO_CRIT,      
00089         CO_ERR        
00090 } thermal_mode_t;
00091 
00096 typedef enum {
00097         F_ON,         
00098         F_OFF,        
00099         F_ERR         
00100 } fan_state_t;
00101 
00106 typedef struct {
00107         char name[MAX_NAME];         
00108         char state_file[MAX_NAME];   
00109         fan_state_t fan_state;       
00110 } fan_t;
00111 
00116 typedef struct {
00117         char name[MAX_NAME];         
00118         char state_file[MAX_NAME];   
00119         char info_file[MAX_NAME];    
00120         char alarm_file[MAX_NAME];   
00121         int present;                 
00122         int design_cap;              
00123         int last_full_cap;           
00124         int design_voltage;          
00125         int present_rate;            
00126         int remaining_cap;           
00127         int present_voltage;         
00128         int design_warn;             
00129         int design_low;              
00130         int design_level1;           
00131         int design_level2;           
00132         int alarm;                   
00133         /* calculated states */
00134         int percentage;              
00135         int charge_time;             
00136         int remaining_time;          
00138         /* state info */
00139         charge_state_t charge_state; 
00140         batt_state_t batt_state;     
00141 } battery_t;
00142 
00147 typedef struct {
00148         char name[MAX_NAME];          
00149         int temperature;              
00150         int frequency;                
00151         char state_file[MAX_NAME];    
00152         char cooling_file[MAX_NAME];  
00153         char freq_file[MAX_NAME];     
00154         char trips_file[MAX_NAME];    
00155         char temp_file[MAX_NAME];     
00156         thermal_mode_t therm_mode;    
00157         thermal_state_t therm_state;  
00158 } thermal_t;
00159 
00164 typedef struct {
00165         char *name;                   
00166         char state_file[MAX_NAME];    
00167         power_state_t ac_state;       
00168 } adapter_t;
00169 
00174 typedef struct {
00175         int batt_count;               
00176         int thermal_count;            
00177         int fan_count;                
00178         int temperature;              
00179         adapter_t adapt;              
00180 } global_t;
00181 
00186 battery_t batteries[MAX_ITEMS];
00191 thermal_t thermals[MAX_ITEMS];
00196 fan_t fans[MAX_ITEMS];
00203 int init_acpi_batt(global_t *globals);
00210 int init_acpi_acadapt(global_t *globals);
00217 int init_acpi_thermal(global_t *globals);
00224 int init_acpi_fan(global_t *globals);
00225 
00230 int check_acpi_support(void);
00231 
00237 int read_acpi_batt(const int num);
00243 void read_acpi_acstate(global_t *globals);
00250 int read_acpi_zone(const int num, global_t *globals);
00256 int read_acpi_fan(const int num);
00257 #endif /* !__LIBACPI_H__ */

Generated on Sun Jul 29 14:09:38 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_b46f89c7d7ff338842d7619c7392c0bf_cgraph.png0000644000175000017500000000127010653101603023616 0ustar nionnionPNG  IHDRW=^GPLTEpA^tRNS@fTIDATh[ rbca.\ƃMʟ1#7TE2j|S|%>Q?ѡ:|)&NoT3be&3,pX ԰k|#A|lE~]u*CC0 2Qu?tpAzP"f?=| JOmYȼsp?)=[2ݷC{4ņć b=F|G/xr#E4kUa" AޭUgWO8RuH=SsT)#v6JڗE1z%o,x!oo~ϴ?R7QO9 2kLBVad3Zp*Ge~ %9$KC++[AiKA{ We X/ćzLQOkƅT^`,?;i+[|eCZ)tB5u0u_:Q7;UWC}=u(l^IENDB`libacpi-0.2/doc/html/structlist__t__coll__graph.md50000644000175000017500000000004010653101605021147 0ustar nionnion059251e372db4506069c7c80ffa7da12libacpi-0.2/doc/html/libacpi_8h_baf0f122878f23b4cc8a5cb2dea8bf71_icgraph.png0000644000175000017500000000075010653101603024311 0ustar nionnionPNG  IHDR%%>PLTEpA^tRNS@fIDATXKn! s9@GE>#1J R,96|1&(m1ٴLvLۨbZLȴ L1:ˤ4a1t0o3E4ZL $s 2 &tGh5)[P%L: 1CLqDINXa*vWu libacpi-0.2/doc/html/structnode__coll__graph.md50000644000175000017500000000004010653101605020437 0ustar nionnionff3e5d27e705ccd1d01f8b179adb048flibacpi-0.2/doc/html/structbattery__t__coll__graph.md50000644000175000017500000000004010653101605021646 0ustar nionniona7d6c3a274f0f55fb7ff20163c21a495libacpi-0.2/doc/html/structpower__state__t.html0000644000175000017500000000306010653101606020464 0ustar nionnion libacpi: power_state_t Struct Reference

power_state_t Struct Reference

power states More...

#include <libacpi.h>


Detailed Description

power states


The documentation for this struct was generated from the following file:
Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c_b63d686528f867234559a0bd829f9a33_cgraph.md50000644000175000017500000000004010653101603023264 0ustar nionnion6bd91281092bdc64f76687454284aab1libacpi-0.2/doc/html/libacpi_8c_027286cd397157bdbf9e551ef510cb59_cgraph.md50000644000175000017500000000004010653101603023466 0ustar nionnionb54f55516ec84a161302ca871600cf91libacpi-0.2/doc/html/structadapter__t-members.html0000644000175000017500000000343110653101605021042 0ustar nionnion libacpi: Member List

adapter_t Member List

This is the complete list of members for adapter_t, including all inherited members.

ac_stateadapter_t
nameadapter_t
state_fileadapter_t


Generated on Sun Jul 29 14:09:41 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/libacpi_8c__incl.map0000644000175000017500000000026610653101603017016 0ustar nionnion libacpi-0.2/doc/html/list_8h_8779934af9269ac85b5eda546da2285c_icgraph.png0000644000175000017500000000250310653101604023341 0ustar nionnionPNG  IHDRCfPLTEpA^tRNS@fIDATxkn {HllGFJ 06VC^3qyc|,~Yi-19gXeF ADكkg`w1{~-#,_&fz/m T.ǀMlω@V7:`U7W{%Lw?`~?:4P 'e+Օ?{/ɟR[//"//yR|/g| ><>qx_2bD ~gv)oʿjt/~C!oƿis[VA7y5%[ED}sݼ+"]+.[6=hlnS'`/b_ \B>H\<>? ϙ_Eԑyi^e-cqĘ]aH.s\rprO[>~~.YYUo_WQo_\5߰V>?#T-˕}|`~?[M7jꛂ5mw۟o?{_N ?B5к*g 2P2x p SB5~bB56{Z /E(~V9oUSg$DC빖Q(81L/(yBkX04#.@n ="D~|Sv-?ZsPoQrPXCҢP_(b57_ۡK3В%@Sb )/%@G?EX\+={ / @ϱC?!nyxamU g K:J9K IX j$$d +4I8$K_&\! Mj Ew G3&z3 b1 C¦K(S@c ULO %\"E}!"D!c}E8B%LE8Gp~B%mz#.ԮÇk:ncH5 MHb$ i{l:UV%f2k*\j]#Kį%.&¥U\eW2 YcWR‹[˂*\JȠNRIP 3E 8 I @"Z56 ` C%88 h~_K+[@%$e6ib܇P !mqt3B9H?m ln'6IڄZV ADo  Jb=H NdH^N]n#@yI#[%f",H&B )X-ӄb5)Xkޚ!G -r|0sB50XSl֧ rR!OH]7Cfնk[(:@\5}joJb}8DtBȊ˻k]vt0MHs%R. !7M(J9E"  ?TU U_U q5d.HWM+n 4!%x M.T>f B@0.ZDb+ [-\ m&d tAL@:C2X m4( 띌(HUm]_"Q:NG"-܊Z?NTZ 6{';a]_o*Ө ee[b '@P%N} u}*ЖN oLmCMBaC,+7F8+1җ4abzp(*6Jmp1{?cjOMΦ }wp[0o[> v9t8#C7 +!<PhUv+g[HY#gm_o_v'>K r~QV{+hPbC.dSڧ\| @ l^D؋PCi;H=TWTiнyp'C< 0oj$!zJyT{L,k Wg]䈄l.5@t==.܅ ܉)BbVC(h@PQ5mgF̊R6V< Y,4vb|YH*2IϬ !ﰇo5#-sֶXS c咀JE8%:&[*f $FA(ht߬m ZfmKabk'!:޽xnbk_@T Tje@脚.B`SUU6)O0  L'YTLD_~GjJ&doN욣00!Kr+%1|dU qw$Da)! !t⮄0LB !B!uſ0]=)cˉp O0Dpjҕ 煸SF0! މ`d2yu! !D]6#U*!spM,S;[ >zhB(I (a'h'ʈ@* +) VZ48_# J8_ LX5PFM@@ 9W*\\hnNGY4„i¾.6``3wa?{({ܠKf•(EdQ)B07 e qQwk<@(cLVyO޸.IENDB`libacpi-0.2/doc/html/globals_func.html0000644000175000017500000000716210653101606016507 0ustar nionnion libacpi: Class Members  


Generated on Sun Jul 29 14:09:42 2007 for libacpi by  doxygen 1.5.2
libacpi-0.2/doc/html/tab_l.gif0000644000175000017500000000130210653101602014715 0ustar nionnionGIF89a ,薴ŝɯͻ, ,@P`H$!%CqVe2XJ(Ġ+3 2$ kv-u*"}|}|~q(" $f 'l(&&$r & !){rƲεҽͼиP?Bm A%V܈!k/Đ;^$Ɩ#Mf)f͇(WLK҄ I)L:eD Cx*4 Uh %A^NKbeXkx!2t !5t]$%X.i[]YfEkg`:zҞ;}jaaM׸c瞽vۺ8ȋ'?9積G_>yu_ߞ]zw߭Ǿm浏G~თ/>٫|W}v;