powerlib_local.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *                         Powersave Daemon                                *
00004  *                                                                         *
00005  *          Copyright (C) 2004,2005 SUSE Linux Products GmbH               *
00006  *                                                                         *
00007  *             Author(s): Holger Macht <hmacht@suse.de>                    *
00008  *                                                                         *
00009  * This program is free software; you can redistribute it and/or modify it *
00010  * under the terms of the GNU General Public License as published by the   *
00011  * Free Software Foundation; either version 2 of the License, or (at you   *
00012  * option) any later version.                                              *
00013  *                                                                         *
00014  * This program is distributed in the hope that it will be useful, but     *
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of              *
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
00017  * General Public License for more details.                                *
00018  *                                                                         *
00019  * You should have received a copy of the GNU General Public License along *
00020  * with this program; if not, write to the Free Software Foundation, Inc., *
00021  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 #ifndef POWERSAVE_POWERLIB_LOCAL_H
00026 #define POWERSAVE_POWERLIB_LOCAL_H
00027 
00033 #include <string.h>
00034 #include <time.h>
00035 
00036 #include "powerlib.h"
00037 
00039 typedef struct apm_info {
00040         char driver_version[10];
00041         int apm_version_major;
00042         int apm_version_minor;
00043         int apm_flags;
00044         int ac_line_status;
00045         int battery_status;
00046         int battery_flags;
00047         int battery_percentage;
00048         int battery_time;
00049         int using_minutes;
00050 } apm_info;
00051 
00054 typedef struct capacity_snapshot {
00055         time_t measure_point;
00056         int remaining_capacity;
00057 } capacity_snapshot;
00058 
00068 int getDevicesNum(const char *dir_name);
00069 
00086 int getColonValue(FILE * file, char *value, const size_t value_size, char *def, const size_t def_size);
00087 
00106 int getDirEntry(const int num, char *file, const size_t size_file, const char *dir_in);
00107 
00118 int _write_line(const char *filename, const char *fmt, ...);
00119 
00129 int read_apm_info(apm_info * i);
00130 
00138 int check_ACPI_dir(const char *dir);
00139 
00140 #endif /* POWERSAVE_POWERLIB_LOCAL_H */
00141 // end of libpower_local group

Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6