2014-11-27 23:02:52 +00:00
|
|
|
#ifndef HEADER_Battery
|
|
|
|
#define HEADER_Battery
|
|
|
|
/*
|
|
|
|
htop - linux/Battery.h
|
|
|
|
(C) 2004-2014 Hisham H. Muhammad
|
|
|
|
Released under the GNU GPL, see the COPYING file
|
|
|
|
in the source distribution for its full text.
|
|
|
|
|
|
|
|
Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#endif
|
|
|
|
|
2015-01-23 05:08:21 +00:00
|
|
|
#define SYS_POWERSUPPLY_DIR "/sys/class/power_supply"
|
2014-11-27 23:02:52 +00:00
|
|
|
|
2015-01-23 05:08:21 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
// READ FROM /proc
|
|
|
|
// ----------------------------------------
|
2014-11-27 23:02:52 +00:00
|
|
|
|
2015-01-23 05:08:21 +00:00
|
|
|
// This implementation reading from from /proc/acpi is really inefficient,
|
|
|
|
// but I think this is on the way out so I did not rewrite it.
|
|
|
|
// The /sys implementation below does things the right way.
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// READ FROM /sys
|
|
|
|
// ----------------------------------------
|
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Battery_getData(double* level, ACPresence* isOnAC);
|
2014-11-27 23:02:52 +00:00
|
|
|
|
|
|
|
#endif
|