powersave_hal.c File Reference

#include "config.h"
#include "powersave_hal.h"
#include <string.h>

Functions

int ps_hal_init ()
 inits the access to hal
void ps_hal_free ()
 frees the access to hal
LibHalContext * ps_hal_context ()
 get the hal context used
DBusError * ps_hal_dbus_error ()
 get the dbus error used
int ps_hal_get_property_int (char *device, char *property)
int ps_hal_get_property_bool (char *device, char *property)
char * ps_hal_get_property_string (char *device, char *property)
int ps_hal_query_capability (char *device, char *capability)
 query a capability of a device

Variables

DBusError dbus_error
LibHalContext * hal_ctx = NULL
DBusConnection * dbus_connection = NULL

Function Documentation

LibHalContext* ps_hal_context void   ) 
 

get the hal context used

Returns:
the hal context

DBusError* ps_hal_dbus_error void   ) 
 

get the dbus error used

Returns:
the dbus error

void ps_hal_free void   ) 
 

frees the access to hal

the free includes any dbus connection, dbus errors or hal contexts call this inside your application as soon as the hal service disappears

int ps_hal_get_property_bool char *  device,
char *  property
 

brief get bool property through hal

fetches one bool value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
-1 on error

int ps_hal_get_property_int char *  device,
char *  property
 

brief get integer property through hal

fetches one interger value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
-1 on error

char* ps_hal_get_property_string char *  device,
char *  property
 

brief get string property through hal

fetches one string value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
requested value or NULL on error (string must be freed)

int ps_hal_init void   ) 
 

inits the access to hal

if hal context is already initialized, does nothing.

Return values:
true if already initialized connection could be set up
false false if connection could not be established

int ps_hal_query_capability char *  device,
char *  capability
 

query a capability of a device

Parameters:
device the device usi
capability the capability to query for
Returns:
< 0 on error


Variable Documentation

DBusConnection* dbus_connection = NULL
 

DBusError dbus_error
 

LibHalContext* hal_ctx = NULL
 


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