Data Structures | |
struct | LibHalFunctions_s |
Big convenience chunk for all callback function pointers. More... | |
struct | LibHalProperty_s |
Device property class. More... | |
struct | LibHalPropertySet_s |
Represents a set of properties. More... | |
struct | LibHalPropertySetIterator_s |
Iterator for inspecting all properties. More... | |
Typedefs | |
typedef void(* | LibHalIntegrateDBusIntoMainLoop )(DBusConnection *dbus_connection) |
Type for function in application code that integrates a #DBusConnection object into it's own mainloop. | |
typedef void(* | LibHalDeviceAdded )(const char *udi) |
Type for callback when a device is added. | |
typedef void(* | LibHalDeviceRemoved )(const char *udi) |
Type for callback when a device is removed. | |
typedef void(* | LibHalNewCapability )(const char *udi, const char *capability) |
Type for callback when a device got a new capability. | |
typedef void(* | LibHalDevicePropertyModified )(const char *udi, const char *key, dbus_bool_t is_removed, dbus_bool_t is_added) |
Type for callback when a property of a device changes. | |
typedef void(* | LibHalDeviceCondition )(const char *udi, const char *condition_name, DBusMessage *message) |
Type for callback when a non-continuos condition occurs on a device. | |
typedef LibHalFunctions_s | LibHalFunctions |
Big convenience chunk for all callback function pointers. | |
typedef LibHalProperty_s | LibHalProperty |
typedef LibHalPropertySet_s | LibHalPropertySet |
typedef LibHalPropertySetIterator_s | LibHalPropertySetIterator |
Functions | |
void | hal_free_string_array (char **str_array) |
Frees a #NULL-terminated array of strings. | |
void | hal_free_string (char *str) |
Frees a nul-terminated string. | |
LibHalPropertySet * | hal_device_get_all_properties (const char *udi) |
Retrieve all the properties on a device. | |
void | hal_free_property_set (LibHalPropertySet *set) |
Free a property set earlier obtained with hal_device_get_all_properties(). | |
void | hal_psi_init (LibHalPropertySetIterator *iter, LibHalPropertySet *set) |
Initialize a property set iterator. | |
dbus_bool_t | hal_psi_has_more (LibHalPropertySetIterator *iter) |
Determine whether there are more properties to iterate over. | |
void | hal_psi_next (LibHalPropertySetIterator *iter) |
Advance iterator to next property. | |
int | hal_psi_get_type (LibHalPropertySetIterator *iter) |
Get type of property. | |
char * | hal_psi_get_key (LibHalPropertySetIterator *iter) |
Get the key of a property. | |
char * | hal_psi_get_string (LibHalPropertySetIterator *iter) |
Get the value of a property of type string. | |
dbus_int32_t | hal_psi_get_int (LibHalPropertySetIterator *iter) |
Get the value of a property of type integer. | |
double | hal_psi_get_double (LibHalPropertySetIterator *iter) |
Get the value of a property of type double. | |
dbus_bool_t | hal_psi_get_bool (LibHalPropertySetIterator *iter) |
Get the value of a property of type bool. | |
DBusHandlerResult | filter_func (DBusConnection *connection, DBusMessage *message, void *user_data) |
int | hal_initialize (const LibHalFunctions *cb_functions, dbus_bool_t use_cache) |
Initialize the HAL library. | |
int | hal_shutdown () |
Shutdown the HAL library. | |
char ** | hal_get_all_devices (int *num_devices) |
Get all devices in the Global Device List (GDL). | |
int | hal_device_get_property_type (const char *udi, const char *key) |
Query a property type of a device. | |
char * | hal_device_get_property_string (const char *udi, const char *key) |
Get the value of a property of type string. | |
dbus_int32_t | hal_device_get_property_int (const char *udi, const char *key) |
Get the value of a property of type integer. | |
double | hal_device_get_property_double (const char *udi, const char *key) |
Get the value of a property of type double. | |
dbus_bool_t | hal_device_get_property_bool (const char *udi, const char *key) |
Get the value of a property of type bool. | |
int | hal_device_set_property_helper (const char *udi, const char *key, int type, const char *str_value, dbus_int32_t int_value, double double_value, dbus_bool_t bool_value) |
dbus_bool_t | hal_device_set_property_string (const char *udi, const char *key, const char *value) |
Set a property of type string. | |
dbus_bool_t | hal_device_set_property_int (const char *udi, const char *key, dbus_int32_t value) |
Set a property of type integer. | |
dbus_bool_t | hal_device_set_property_double (const char *udi, const char *key, double value) |
Set a property of type double. | |
dbus_bool_t | hal_device_set_property_bool (const char *udi, const char *key, dbus_bool_t value) |
Set a property of type bool. | |
dbus_bool_t | hal_device_remove_property (const char *udi, const char *key) |
Remove a property. | |
char * | hal_agent_new_device () |
Create a new device object which will be hidden from applications until the CommitToGdl(), ie. | |
dbus_bool_t | hal_agent_commit_to_gdl (const char *temp_udi, const char *udi) |
When a hidden device have been built using the NewDevice method, ie. | |
dbus_bool_t | hal_agent_remove_device (const char *udi) |
This method can be invoked when a device is removed. | |
dbus_bool_t | hal_device_exists (const char *udi) |
Determine if a device exists. | |
dbus_bool_t | hal_device_property_exists (const char *udi, const char *key) |
Determine if a property on a device exists. | |
dbus_bool_t | hal_agent_merge_properties (const char *target_udi, const char *source_udi) |
Merge properties from one device to another. | |
dbus_bool_t | hal_agent_device_matches (const char *udi1, const char *udi2, const char *namespace) |
Check a set of properties for two devices matches. | |
void | hal_device_print (const char *udi) |
Print a device to stdout; useful for debugging. | |
char ** | hal_manager_find_device_string_match (const char *key, const char *value, int *num_devices) |
Find a device in the GDL where a single string property matches a given value. | |
dbus_bool_t | hal_device_add_capability (const char *udi, const char *capability) |
Assign a capability to a device. | |
dbus_bool_t | hal_device_query_capability (const char *udi, const char *capability) |
Check if a device got a capability. | |
char ** | hal_find_device_by_capability (const char *capability, int *num_devices) |
Find devices with a given capability. | |
int | hal_device_property_watch_all () |
Watch all devices, ie. | |
int | hal_device_add_property_watch (const char *udi) |
Add a watch on a device, so the device_property_changed callback is invoked when the properties on the given device changes. | |
int | hal_device_remove_property_watch (const char *udi) |
Remove a watch on a device. | |
Variables | |
DBusConnection * | connection |
dbus_bool_t | is_initialized = FALSE |
dbus_bool_t | cache_enabled = FALSE |
const LibHalFunctions * | functions |
LibHalFunctions | hal_null_functions |
|
Type for callback when a device is added.
|
|
Type for callback when a non-continuos condition occurs on a device.
|
|
Type for callback when a property of a device changes.
|
|
Type for callback when a device is removed.
|
|
Big convenience chunk for all callback function pointers. Every function pointer can be set to #NULL to indicate that the callback is not requested. Referenced by hal_initialize(), and main(). |
|
Type for function in application code that integrates a #DBusConnection object into it's own mainloop.
|
|
Type for callback when a device got a new capability.
|
|
When a hidden device have been built using the NewDevice method, ie. hal_agent_new_device(), and the org.freedesktop.Hal.Device interface this function will commit it to the global device list. This means that the device object will be visible to applications and the HAL daemon will possibly attempt to boot the device (depending on the property RequireEnable). Note that the program invoking this method needs to run with super user privileges.
|
|
Check a set of properties for two devices matches. Checks that all properties where keys, starting with a given value (namespace), of the first device is in the second device and that they got the same value and type. Note that the other inclusion isn't tested, so there could be properties (from the given namespace) in the second device not present in the first device.
|
|
Merge properties from one device to another.
|
|
Create a new device object which will be hidden from applications until the CommitToGdl(), ie. hal_agent_commit_to_gdl(), method is called. Note that the program invoking this method needs to run with super user privileges.
|
|
This method can be invoked when a device is removed. The HAL daemon will shut down the device. Note that the device may still be in the device list if the Persistent property is set to true. Note that the program invoking this method needs to run with super user privileges.
|
|
Assign a capability to a device.
|
|
Add a watch on a device, so the device_property_changed callback is invoked when the properties on the given device changes. The application itself is responsible for deleting the watch, using hal_device_remove_property_watch, if the device is removed.
|
|
Determine if a device exists.
|
|
Retrieve all the properties on a device.
Definition at line 112 of file libhal.c. References LibHalProperty_s::next, LibHalPropertySet_s::num_properties, and LibHalPropertySet_s::properties_head. Referenced by dump_devices(), and hal_device_print(). |
|
Get the value of a property of type bool.
Definition at line 957 of file libhal.c. Referenced by main(), and print_property(). |
|
Get the value of a property of type double.
Definition at line 887 of file libhal.c. Referenced by main(), and print_property(). |
|
Get the value of a property of type integer.
Definition at line 817 of file libhal.c. Referenced by main(), and print_property(). |
|
Get the value of a property of type string.
Definition at line 737 of file libhal.c. Referenced by hal_device_query_capability(), main(), and print_property(). |
|
Query a property type of a device.
Definition at line 680 of file libhal.c. Referenced by main(), and print_property(). |
|
Print a device to stdout; useful for debugging.
Definition at line 1655 of file libhal.c. References hal_device_get_all_properties(), hal_free_property_set(), hal_psi_get_bool(), hal_psi_get_double(), hal_psi_get_int(), hal_psi_get_key(), hal_psi_get_string(), hal_psi_get_type(), hal_psi_has_more(), hal_psi_init(), and hal_psi_next(). |
|
Determine if a property on a device exists.
|
|
Watch all devices, ie. the device_property_changed callback is invoked when the properties on any device changes.
Definition at line 1941 of file libhal.c. Referenced by main(). |
|
Check if a device got a capability. The result is undefined if the device doesn't exist.
Definition at line 1840 of file libhal.c. References hal_device_get_property_string(). |
|
Remove a property.
Definition at line 1194 of file libhal.c. Referenced by main(). |
|
Remove a watch on a device.
|
|
Set a property of type bool.
Definition at line 1177 of file libhal.c. Referenced by main(). |
|
Set a property of type double.
Definition at line 1159 of file libhal.c. Referenced by main(). |
|
Set a property of type integer.
Definition at line 1141 of file libhal.c. Referenced by main(). |
|
Set a property of type string.
Definition at line 1123 of file libhal.c. Referenced by main(). |
|
Find devices with a given capability.
|
|
Free a property set earlier obtained with hal_device_get_all_properties().
Definition at line 251 of file libhal.c. References LibHalProperty_s::key, LibHalProperty_s::next, LibHalPropertySet_s::properties_head, LibHalProperty_s::str_value, and LibHalProperty_s::type. Referenced by dump_devices(), and hal_device_print(). |
|
Frees a nul-terminated string.
Definition at line 67 of file libhal.c. Referenced by main(), and print_property(). |
|
Frees a #NULL-terminated array of strings. If passed #NULL, does nothing.
Definition at line 49 of file libhal.c. Referenced by dump_devices(). |
|
Get all devices in the Global Device List (GDL).
Definition at line 595 of file libhal.c. Referenced by dump_devices(). |
|
Initialize the HAL library.
Definition at line 509 of file libhal.c. References LibHalFunctions, and LibHalFunctions_s::main_loop_integration. Referenced by main(). |
|
Find a device in the GDL where a single string property matches a given value.
|
|
Get the value of a property of type bool.
Definition at line 361 of file libhal.c. References LibHalProperty_s::bool_value, and LibHalPropertySetIterator_s::cur_prop. Referenced by dump_devices(), and hal_device_print(). |
|
Get the value of a property of type double.
Definition at line 351 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, and LibHalProperty_s::double_value. Referenced by dump_devices(), and hal_device_print(). |
|
Get the value of a property of type integer.
Definition at line 341 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, and LibHalProperty_s::int_value. Referenced by dump_devices(), and hal_device_print(). |
|
Get the key of a property.
Definition at line 318 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, and LibHalProperty_s::key. Referenced by dump_devices(), and hal_device_print(). |
|
Get the value of a property of type string.
Definition at line 331 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, and LibHalProperty_s::str_value. Referenced by dump_devices(), and hal_device_print(). |
|
Get type of property.
Definition at line 305 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, and LibHalProperty_s::type. Referenced by dump_devices(), and hal_device_print(). |
|
Determine whether there are more properties to iterate over.
Definition at line 284 of file libhal.c. References LibHalPropertySetIterator_s::index, LibHalPropertySet_s::num_properties, and LibHalPropertySetIterator_s::set. Referenced by dump_devices(), and hal_device_print(). |
|
Initialize a property set iterator.
Definition at line 272 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, LibHalPropertySetIterator_s::index, LibHalPropertySet_s::properties_head, and LibHalPropertySetIterator_s::set. Referenced by dump_devices(), and hal_device_print(). |
|
Advance iterator to next property.
Definition at line 293 of file libhal.c. References LibHalPropertySetIterator_s::cur_prop, LibHalPropertySetIterator_s::index, and LibHalProperty_s::next. Referenced by dump_devices(), and hal_device_print(). |
|
Shutdown the HAL library. All resources allocated are freed.
Definition at line 576 of file libhal.c. Referenced by main(). |
|
Initial value: { NULL , NULL , NULL , NULL , NULL , NULL } |