Several of my projects use a common acpi file that's best described as "a not-yet-general-purpose ACPI library". I've since discovered others using it, so it's best to have a page of its own even if the code is just being copied around from one project to another in an ad-hoc manner.

acpi.c provides a simple interface to querying linux's ACPI /proc files. It's intended to make it very easy to drop it in to add ACPI support to programs that support apm via libapm, so it uses the same data structure for battery information, and provides an acpi_read() function that is very similar to apm_read(). It also offers a more general purpose interface for querying ACPI battery, line, and thermal information.

I've never turned this into a proper library package because a) I have little interest in maintaining a general-purpose acpi library an b) I was sorta hoping something better would eventually come along. However, linux's /proc/acpi is a bit of a pain to work with, and this certianly does make it easier, and maybe I should make it a proper C library already.

The license is currently GPL, though I'd be happy to change that to LGPL.


Currently the only place to get it is the acpi.c and acpi.h files in wmbattery or sleepd.


I will try to remember to post news about changes to acpi.c here, so if you use it in your program, you should subscribe to the rss feed.

RSS Add a new post titled:
I suppose it's time acpi.c has a web page, so here goes.

acpi.c users