powersave.cpp File Reference

#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "powerlib.h"
#include "config.h"
#include "powersave_dbus.h"
#include <string>
#include <iostream>

Defines

#define MAX_OPT_LEN   20
#define MAX_PARAM_LENGTH   50

Functions

void general_error ()
void no_connect_no_rights_error ()
void no_connect_no_daemon_error ()
void no_cpufreq_error ()
void usage ()
void checkArgs ()
void getArgs (int argc, char **argv)
int get_bat_info (int ext)
int main (int argc, char **argv)
 main function

Variables

static int option = -1
static int verbose = 0
static char schemeName [MAX_PARAM_LENGTH+1] = ""
static char dpmDeviceClass [MAX_PARAM_LENGTH+1] = ""
static int BATT_INFO = 0
static int BAT_STATE = 0
static int THROT_INFO = 0
static int SET_THROT_PERC = 0
static int AC_INFO = 0
static int APM_ACPI = 0
static int CPUFREQ_INFO = 0
static int REAL_CPU_SPEED = 0
static int EXT_BATT_INFO = 0
static int THERMAL_INFO = 0
static int FAN_INFO = 0
static int PERFORMANCE_SPEED = 0
static int POWERSAVE_SPEED = 0
static int DYNAMIC_SPEED = 0
static int SUSPEND_TO_DISK = 0
static int SUSPEND_TO_RAM = 0
static int STANDBY = 0
static int VERSION_INFO = 0
static int LIST_SCHEMES = 0
static int SET_ACTIVE_SCHEME = 0
static int GET_SCHEME_DESCRIPTION = 0
static int GET_BRIGHTNESS = 0
static int GET_BRIGHTNESS_LEVELS = 0
static int SET_BRIGHTNESS = 0
static int DPM_SUSPEND = 0
static int DPM_RESUME = 0
static int DPM_NUMBER = 0
static int DPM_GET_DEVICES = 0
static int DPM_GET_CLASSES = 0
static int CPU_ENABLE = 0
static int CPU_DISABLE = 0
static int GET_CLIENTS = 0

Define Documentation

#define MAX_OPT_LEN   20
 

#define MAX_PARAM_LENGTH   50
 


Function Documentation

void checkArgs  ) 
 

void general_error  ) 
 

int get_bat_info int  ext  ) 
 

void getArgs int  argc,
char **  argv
 

int main int  argc,
char **  argv
 

main function

errors:

  • -1 for parameter specific error
  • -2 if user has no rights to connect to daemon
  • -3 if socket conn could not be established (no daemon...)

void no_connect_no_daemon_error  ) 
 

void no_connect_no_rights_error  ) 
 

void no_cpufreq_error  ) 
 

void usage  ) 
 


Variable Documentation

int AC_INFO = 0 [static]
 

int APM_ACPI = 0 [static]
 

int BAT_STATE = 0 [static]
 

int BATT_INFO = 0 [static]
 

int CPU_DISABLE = 0 [static]
 

int CPU_ENABLE = 0 [static]
 

int CPUFREQ_INFO = 0 [static]
 

int DPM_GET_CLASSES = 0 [static]
 

int DPM_GET_DEVICES = 0 [static]
 

int DPM_NUMBER = 0 [static]
 

int DPM_RESUME = 0 [static]
 

int DPM_SUSPEND = 0 [static]
 

char dpmDeviceClass[MAX_PARAM_LENGTH+1] = "" [static]
 

int DYNAMIC_SPEED = 0 [static]
 

int EXT_BATT_INFO = 0 [static]
 

int FAN_INFO = 0 [static]
 

int GET_BRIGHTNESS = 0 [static]
 

int GET_BRIGHTNESS_LEVELS = 0 [static]
 

int GET_CLIENTS = 0 [static]
 

int GET_SCHEME_DESCRIPTION = 0 [static]
 

int LIST_SCHEMES = 0 [static]
 

int option = -1 [static]
 

int PERFORMANCE_SPEED = 0 [static]
 

int POWERSAVE_SPEED = 0 [static]
 

int REAL_CPU_SPEED = 0 [static]
 

char schemeName[MAX_PARAM_LENGTH+1] = "" [static]
 

int SET_ACTIVE_SCHEME = 0 [static]
 

int SET_BRIGHTNESS = 0 [static]
 

int SET_THROT_PERC = 0 [static]
 

int STANDBY = 0 [static]
 

int SUSPEND_TO_DISK = 0 [static]
 

int SUSPEND_TO_RAM = 0 [static]
 

int THERMAL_INFO = 0 [static]
 

int THROT_INFO = 0 [static]
 

int verbose = 0 [static]
 

int VERSION_INFO = 0 [static]
 


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