| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _SYSFSPARSER_H |
| 18 |
#define _SYSFSPARSER_H |
| 19 |
|
| 20 |
#include <dirent.h> |
| 21 |
#include <limits.h> |
| 22 |
#include "system.h" |
| 23 |
|
| 24 |
#define PATH_SYS "/sys" |
| 25 |
|
| 26 |
#ifdef __cplusplus |
| 27 |
extern "C" |
| 28 |
{ |
| 29 |
#endif |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
void sysfsparser_check_for_sysfs(void); |
| 34 |
bool sysfsparser_path_exist (const char *path, ...) |
| 35 |
_attribute_format_printf_(1, 2); |
| 36 |
void sysfsparser_opendir(DIR **dirp, const char *path, ...) |
| 37 |
_attribute_format_printf_(2, 3); |
| 38 |
void sysfsparser_closedir(DIR *dirp); |
| 39 |
struct dirent *sysfsparser_readfilename(DIR *dirp, unsigned int flags); |
| 40 |
|
| 41 |
char *sysfsparser_getline (const char *filename, ...) |
| 42 |
_attribute_format_printf_(1, 2); |
| 43 |
int sysfsparser_getvalue (unsigned long long *value, const char *filename, ...) |
| 44 |
_attribute_format_printf_(2, 3); |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
int sysfsparser_linelookup_numeric (char *line, char *pattern, |
| 51 |
long long *value); |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
int sysfsparser_cpufreq_get_hardware_limits (unsigned int cpu, |
| 56 |
unsigned long *min, |
| 57 |
unsigned long *max); |
| 58 |
unsigned long sysfsparser_cpufreq_get_freq_kernel (unsigned int cpu); |
| 59 |
unsigned long sysfsparser_cpufreq_get_transition_latency (unsigned int cpu); |
| 60 |
|
| 61 |
char *sysfsparser_cpufreq_get_available_freqs (unsigned int cpu); |
| 62 |
char *sysfsparser_cpufreq_get_driver (unsigned int cpu); |
| 63 |
char *sysfsparser_cpufreq_get_governor (unsigned int cpu); |
| 64 |
char *sysfsparser_cpufreq_get_available_governors (unsigned int cpu); |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
# define ALL_THERMAL_ZONES UINT_MAX |
| 69 |
|
| 70 |
bool sysfsparser_thermal_kernel_support (void); |
| 71 |
const char *sysfsparser_thermal_sysfs_path (); |
| 72 |
int sysfsparser_thermal_get_temperature (unsigned int selected_zone, |
| 73 |
unsigned int *zone, char **type); |
| 74 |
int sysfsparser_thermal_get_critical_temperature (unsigned int thermal_zone); |
| 75 |
const char *sysfsparser_thermal_get_device (unsigned int thermal_zone); |
| 76 |
void sysfsparser_thermal_listall (); |
| 77 |
|
| 78 |
#ifdef __cplusplus |
| 79 |
} |
| 80 |
#endif |
| 81 |
|
| 82 |
#endif |