File: acpi.h

package info (click to toggle)
acpi 1.7-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 444 kB
  • sloc: sh: 1,267; ansic: 810; makefile: 14
file content (72 lines) | stat: -rw-r--r-- 2,091 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* provides a simple client program that reads ACPI status from the /proc 
 * filesystem
 *
 * Copyright (C) 2001  Grahame Bowland <grahame@angrygoats.net>
 *                     Michael Meskes <meskes@debian.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef _ACPI_H
#define _APCI_H

#include "config.h"

/* remember to update this when making new releases */
#define ACPI_VERSION_STRING "acpi " VERSION

#define ACPI_PATH_PROC   "/proc/acpi"
#define ACPI_PATH_SYS   "/sys/class"
#define BUF_SIZE    1024

#define TEMP_KELVIN     0
#define TEMP_CELSIUS    1
#define TEMP_FAHRENHEIT 2
#define ABSOLUTE_ZERO   273.1

#ifndef FALSE
#define FALSE           0
#endif
#ifndef TRUE
#define TRUE            !(FALSE)
#endif

#define BATTERY 0
#define AC_ADAPTER 1
#define THERMAL_ZONE 2
#define COOLING_DEV 3

extern struct device
{
	int type;
	char *proc;
	char *sys;
	char *sys_dev;
} device[4];

struct list *find_devices(char *acpi_path, int device_nr, int proc_interface);

void free_devices(struct list *devices);

void print_battery_information(struct list *batteries, int show_empty_slots, int show_capacity);

void print_ac_adapter_information(struct list *batteries, int show_empty_slots);

void print_thermal_information(struct list *batteries, int show_empty_slots, int temp_units, int show_trip_points);

void print_cooling_information(struct list *batteries, int show_empty_slots);

#endif