NAME

statuslib

SYNOPSIS

A library that is used to retrieve system information.

DESCRIPTION

#inlcude <statuslib.h>;

methods and structures will return -1 if there was an error parsing the proc file

Structures

battery_struct
    int ac_status;          //boolean value 0 battery 1 ac-line
    int power_level;        //0 - 100
    int min_remaining       //minutes left of battery life

cpu_struct
    char* model;            //initaly is junk
    float load;             //cpu load over the last min
    int total_process;      //total number of processes running on the system
    int running_process;    //number of currently running processes
	
mem_struct
    int total_mem;          //total physical memory
    int free_mem;           //free physical memory
    int total_swap;
    int free_swap;

net_struct
    int is_connected;       //0 if not connected to network 1 if connected to network
    int is_wireless;        //0 if not wireless 1 if wireless
    int link_quality;       //only available when wireless else 0
    int sig_strength;       //only available when wireless else 0

system_struct 
    battery_struct battery;
    cpu_struct cpu;
    mem_struct mem;
    net_struct net;
	

API's

Battery Information
int get_battery_ac_status();
int get_battery_power_level();
int get_battery_min_remaining();

Backlight
int get_backlight_level();

CPU Information
char* get_cpu_model();
float get_cpu_load();
int get_cpu_total_process();
int get_cpu_running_process();

Memory Information
int get_mem_total();
int get_mem_free();
int get_mem_total_swap();
int get_mem_free_swap();

Network Information
int get_net_is_connected();
int get_net_is_wireless();
int get_net_link_quality(); -1 if hardwired
int get_net_sig_strength(); -1 if hardwired

Subsystem Struct Information
int get_battery_info(battery_struct*);
int get_cpu_info(cpu_struct*);
int get_net_info(net_struct*);
int get_mem_info(mem_struct*);
int get_system_info(system_struct*);
	

Hidden

    read_table_vert(file*, char*);                      //read tables w/ rows labled
    read_table_horz(file*, int row, int collumn);       //read tables w/ collumns labeled
    read_table_horz_named(file*, char*, int collumn);   //reade tables w/ both collums and rows labeled
	

Referances

Proc file structure
battery proc layout
cpu proc layout
memory proc layout
network proc layout