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] | 
Definition in file libacpi.h.
| #define MAX_ITEMS 10 | 
Definition at line 18 of file libacpi.h.
Referenced by init_acpi_batt(), init_acpi_fan(), init_acpi_thermal(), read_acpi_batt(), read_acpi_fan(), and read_acpi_zone().
| #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().
| anonymous enum | 
| enum batt_state_t | 
| enum charge_state_t | 
| enum fan_state_t | 
| enum power_state_t | 
| enum thermal_mode_t | 
| enum thermal_state_t | 
| int check_acpi_support | ( | void | ) | 
Checks if the system does support ACPI or not
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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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.
Array for existing batteries, loop until globals->battery_count
Definition at line 186 of file libacpi.h.
Referenced by init_acpi_batt().
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().
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().
 1.5.2
 1.5.2