"Fossies" - the Fresh Open Source Software Archive

Member "procmeter3-3.6+svn387/modules/acpi.h" (24 Dec 2010, 1946 Bytes) of package /linux/misc/procmeter3-3.6+svn387.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "acpi.h" see the Fossies "Dox" file reference documentation.

    1 /* 
    2  * A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net>
    3  */
    4 
    5 /* Define ACPI_THERMAL to make the library support finding info about thermal
    6  * sources. */
    7 //#define ACPI_THERMAL 1
    8 
    9 /* Define ACPI_APM to get the acpi_read function, which is like apm_read. */
   10 //#define ACPI_APM 1
   11 
   12 /* The lowest version of ACPI proc files supported. */
   13 #define ACPI_VERSION 20011018
   14 
   15 /* The number of acpi items of each class supported. */
   16 #define ACPI_MAXITEM 8
   17 
   18 int acpi_supported (void);
   19 #ifdef ACPI_APM
   20 int acpi_read (int battery, apm_info *info);
   21 #endif
   22 char *get_acpi_file (const char *file);
   23 int scan_acpi_num (const char *buf, const char *key);
   24 char *scan_acpi_value (const char *buf, const char *key);
   25 char *get_acpi_value (const char *file, const char *key);
   26 int get_acpi_batt_capacity(int battery);
   27 
   28 extern int acpi_batt_count;
   29 /* Filenames of the battery info files for each system battery. */
   30 extern char acpi_batt_info[ACPI_MAXITEM][128];
   31 /* Filenames of the battery status files for each system battery. */
   32 extern char acpi_batt_status[ACPI_MAXITEM][128];
   33 /* Stores battery capacity, or 0 if the battery is absent. */
   34 extern int acpi_batt_capacity[ACPI_MAXITEM];
   35 
   36 extern int acpi_ac_count;
   37 extern char acpi_ac_adapter_info[ACPI_MAXITEM][128];
   38 extern char acpi_ac_adapter_status[ACPI_MAXITEM][128];
   39 
   40 #if ACPI_THERMAL
   41 extern int acpi_thermal_count;
   42 extern char acpi_thermal_info[ACPI_MAXITEM][128];
   43 extern char acpi_thermal_status[ACPI_MAXITEM][128];
   44 #endif
   45 
   46 /* This enum is used to index into the acpi_labels */
   47 enum acpi_labels_items {
   48     label_info,
   49     label_status,
   50     label_battery,
   51     label_ac_adapter,
   52     label_online,
   53     label_design_capacity,
   54     label_present,
   55     label_remaining_capacity,
   56     label_present_rate,
   57     label_charging_state,
   58 #if ACPI_THERMAL
   59     label_thermal,
   60 #endif
   61     label_ac_state,
   62     label_last_full_capacity,
   63 };
   64 
   65 /* This is set to point to a list of strings used for the given acpi
   66  *  * version. */
   67 extern char **acpi_labels;