Data Structures | |
struct | LibHalPropertySet_s |
Represents a set of properties. More... | |
struct | LibHalProperty_s |
Device property class. More... | |
struct | LibHalContext_s |
Context for library instance. More... | |
struct | LibHalFunctions_s |
Big convenience chunk for all callback function pointers. More... | |
struct | LibHalPropertySetIterator_s |
Iterator for inspecting all properties. More... | |
Typedefs | |
typedef LibHalContext_s | LibHalContext |
typedef void(* | LibHalIntegrateDBusIntoMainLoop )(LibHalContext *ctx, DBusConnection *dbus_connection) |
Type for function in application code that integrates a #DBusConnection object into it's own mainloop. | |
typedef void(* | LibHalDeviceAdded )(LibHalContext *ctx, const char *udi) |
Type for callback when a device is added. | |
typedef void(* | LibHalDeviceRemoved )(LibHalContext *ctx, const char *udi) |
Type for callback when a device is removed. | |
typedef void(* | LibHalNewCapability )(LibHalContext *ctx, const char *udi, const char *capability) |
Type for callback when a device got a new capability. | |
typedef void(* | LibHalLostCapability )(LibHalContext *ctx, const char *udi, const char *capability) |
Type for callback when a device lost a capability. | |
typedef void(* | LibHalDevicePropertyModified )(LibHalContext *ctx, 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 )(LibHalContext *ctx, 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 (LibHalContext *ctx, 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) |
LibHalContext * | hal_initialize (const LibHalFunctions *cb_functions, dbus_bool_t use_cache) |
Initialize the HAL library. | |
int | hal_shutdown (LibHalContext *ctx) |
Shutdown the HAL library. | |
char ** | hal_get_all_devices (LibHalContext *ctx, int *num_devices) |
Get all devices in the Global Device List (GDL). | |
int | hal_device_get_property_type (LibHalContext *ctx, const char *udi, const char *key) |
Query a property type of a device. | |
char * | hal_device_get_property_string (LibHalContext *ctx, const char *udi, const char *key) |
Get the value of a property of type string. | |
dbus_int32_t | hal_device_get_property_int (LibHalContext *ctx, const char *udi, const char *key) |
Get the value of a property of type integer. | |
double | hal_device_get_property_double (LibHalContext *ctx, const char *udi, const char *key) |
Get the value of a property of type double. | |
dbus_bool_t | hal_device_get_property_bool (LibHalContext *ctx, const char *udi, const char *key) |
Get the value of a property of type bool. | |
int | hal_device_set_property_helper (LibHalContext *ctx, 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 (LibHalContext *ctx, const char *udi, const char *key, const char *value) |
Set a property of type string. | |
dbus_bool_t | hal_device_set_property_int (LibHalContext *ctx, const char *udi, const char *key, dbus_int32_t value) |
Set a property of type integer. | |
dbus_bool_t | hal_device_set_property_double (LibHalContext *ctx, const char *udi, const char *key, double value) |
Set a property of type double. | |
dbus_bool_t | hal_device_set_property_bool (LibHalContext *ctx, const char *udi, const char *key, dbus_bool_t value) |
Set a property of type bool. | |
dbus_bool_t | hal_device_remove_property (LibHalContext *ctx, const char *udi, const char *key) |
Remove a property. | |
char * | hal_agent_new_device (LibHalContext *ctx) |
Create a new device object which will be hidden from applications until the CommitToGdl(), ie. | |
dbus_bool_t | hal_agent_commit_to_gdl (LibHalContext *ctx, 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 (LibHalContext *ctx, const char *udi) |
This method can be invoked when a device is removed. | |
dbus_bool_t | hal_device_exists (LibHalContext *ctx, const char *udi) |
Determine if a device exists. | |
dbus_bool_t | hal_device_property_exists (LibHalContext *ctx, const char *udi, const char *key) |
Determine if a property on a device exists. | |
dbus_bool_t | hal_agent_merge_properties (LibHalContext *ctx, const char *target_udi, const char *source_udi) |
Merge properties from one device to another. | |
dbus_bool_t | hal_agent_device_matches (LibHalContext *ctx, const char *udi1, const char *udi2, const char *namespace) |
Check a set of properties for two devices matches. | |
void | hal_device_print (LibHalContext *ctx, const char *udi) |
Print a device to stdout; useful for debugging. | |
char ** | hal_manager_find_device_string_match (LibHalContext *ctx, 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 (LibHalContext *ctx, const char *udi, const char *capability) |
Assign a capability to a device. | |
dbus_bool_t | hal_device_query_capability (LibHalContext *ctx, const char *udi, const char *capability) |
Check if a device got a capability. | |
char ** | hal_find_device_by_capability (LibHalContext *ctx, const char *capability, int *num_devices) |
Find devices with a given capability. | |
int | hal_device_property_watch_all (LibHalContext *ctx) |
Watch all devices, ie. | |
int | hal_device_add_property_watch (LibHalContext *ctx, 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 (LibHalContext *ctx, const char *udi) |
Remove a watch on a device. | |
Variables | |
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 lost a capability.
|
|
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.
Definition at line 1316 of file libhal.c. References LibHalContext_s::connection. |
|
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.
Definition at line 1610 of file libhal.c. References LibHalContext_s::connection. |
|
Merge properties from one device to another.
Definition at line 1545 of file libhal.c. References LibHalContext_s::connection. |
|
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.
Definition at line 1235 of file libhal.c. References LibHalContext_s::connection. |
|
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.
Definition at line 1373 of file libhal.c. References LibHalContext_s::connection. |
|
Assign a capability to a device.
Definition at line 1810 of file libhal.c. References LibHalContext_s::connection. Referenced by block_class_pre_process(), input_class_pre_process(), pcmcia_socket_class_pre_process(), printer_class_pre_process(), scsi_generic_class_pre_process(), and usb_add_caps_from_class(). |
|
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.
Definition at line 1995 of file libhal.c. References LibHalContext_s::connection. |
|
Determine if a device exists.
Definition at line 1420 of file libhal.c. References LibHalContext_s::connection. |
|
Retrieve all the properties on a device.
Definition at line 117 of file libhal.c. References LibHalContext_s::connection, 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 979 of file libhal.c. References LibHalContext_s::connection. Referenced by main(), and print_property(). |
|
Get the value of a property of type double.
Definition at line 909 of file libhal.c. References LibHalContext_s::connection. Referenced by main(), and print_property(). |
|
Get the value of a property of type integer.
Definition at line 838 of file libhal.c. References LibHalContext_s::connection. Referenced by main(), and print_property(). |
|
Get the value of a property of type string.
Definition at line 759 of file libhal.c. References LibHalContext_s::connection. Referenced by hal_device_query_capability(), main(), and print_property(). |
|
Query a property type of a device.
Definition at line 703 of file libhal.c. References LibHalContext_s::connection. Referenced by main(), and print_property(). |
|
Print a device to stdout; useful for debugging.
Definition at line 1673 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(). Referenced by rename_and_merge(). |
|
Determine if a property on a device exists.
Definition at line 1483 of file libhal.c. References LibHalContext_s::connection. |
|
Watch all devices, ie. the device_property_changed callback is invoked when the properties on any device changes.
Definition at line 1964 of file libhal.c. References LibHalContext_s::connection. Referenced by main(). |
|
Check if a device got a capability. The result is undefined if the device doesn't exist.
Definition at line 1861 of file libhal.c. References hal_device_get_property_string(). |
|
Remove a property.
Definition at line 1215 of file libhal.c. References hal_device_set_property_helper(). Referenced by main(). |
|
Remove a watch on a device.
Definition at line 2025 of file libhal.c. References LibHalContext_s::connection. |
|
Set a property of type bool.
Definition at line 1198 of file libhal.c. References hal_device_set_property_helper(). Referenced by main(). |
|
Set a property of type double.
Definition at line 1180 of file libhal.c. References hal_device_set_property_helper(). Referenced by main(). |
|
Definition at line 1045 of file libhal.c. References LibHalContext_s::connection. Referenced by hal_device_remove_property(), hal_device_set_property_bool(), hal_device_set_property_double(), hal_device_set_property_int(), and hal_device_set_property_string(). |
|
Set a property of type integer.
Definition at line 1162 of file libhal.c. References hal_device_set_property_helper(). Referenced by main(). |
|
Set a property of type string.
Definition at line 1143 of file libhal.c. References hal_device_set_property_helper(). Referenced by main(). |
|
Find devices with a given capability.
Definition at line 1883 of file libhal.c. References LibHalContext_s::connection. |
|
Free a property set earlier obtained with hal_device_get_all_properties().
Definition at line 260 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 50 of file libhal.c. Referenced by dump_devices(). |
|
Get all devices in the Global Device List (GDL).
Definition at line 618 of file libhal.c. References LibHalContext_s::connection. Referenced by dump_devices(). |
|
Initialize the HAL library.
Definition at line 530 of file libhal.c. References LibHalContext_s::cache_enabled, LibHalContext_s::connection, LibHalContext_s::functions, 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.
Definition at line 1725 of file libhal.c. References LibHalContext_s::connection. |
|
Get the value of a property of type bool.
Definition at line 378 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 367 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 356 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 331 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 345 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 317 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 294 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 281 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 304 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 599 of file libhal.c. References LibHalContext_s::is_initialized. Referenced by main(). |
|
Initial value: { NULL , NULL , NULL , NULL , NULL , NULL , NULL } |