Data Structures | |
struct | LibHalPropertySet_s |
Represents a set of properties. More... | |
struct | LibHalProperty_s |
Device property class. More... | |
struct | LibHalContext_s |
Context for connection to the HAL daemon. More... | |
struct | LibHalFunctions_s |
Big convenience chunk for all callback function pointers. More... | |
struct | LibHalPropertySetIterator_s |
Iterator for inspecting all properties. More... | |
Typedefs | |
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. | |
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. | |
void | hal_ctx_set_user_data (LibHalContext *ctx, void *user_data) |
Set user data for the context. | |
void * | hal_ctx_get_user_data (LibHalContext *ctx) |
Get user data for the context. | |
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. | |
dbus_uint64_t | hal_psi_get_uint64 (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. | |
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. | |
dbus_uint64_t | hal_device_get_property_uint64 (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, dbus_uint64_t uint64_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_uint64 (LibHalContext *ctx, const char *udi, const char *key, dbus_uint64_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. | |
dbus_bool_t | hal_device_lock (LibHalContext *ctx, const char *udi, const char *reason_to_lock, char **reason_why_locked) |
Take an advisory lock on the device. | |
dbus_bool_t | hal_device_unlock (LibHalContext *ctx, const char *udi) |
Release an advisory lock on the device. | |
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 *property_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 | |
dbus_bool_t | hal_already_initialized_once = FALSE |
|
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(). |
|
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.
|
|
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.
|
|
Get user data for the context.
|
|
Set user data for the context.
|
|
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 164 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Get the value of a property of type bool.
|
|
Get the value of a property of type double.
|
|
Get the value of a property of type integer.
|
|
Get the value of a property of type string.
Definition at line 883 of file libhal.c. Referenced by hal_device_query_capability(), hal_drive_from_device_file(), and hal_drive_from_udi(). |
|
Query a property type of a device.
|
|
Get the value of a property of type integer.
|
|
Take an advisory lock on the device.
|
|
Print a device to stdout; useful for debugging.
Definition at line 2034 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_get_uint64(), 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.
|
|
Check if a device got a capability. The result is undefined if the device doesn't exist.
Definition at line 2230 of file libhal.c. References hal_device_get_property_string(). Referenced by hal_drive_from_device_file(), hal_drive_from_udi(), hal_volume_from_device_file(), and hal_volume_from_udi(). |
|
Remove a property.
Definition at line 1443 of file libhal.c. References hal_device_set_property_helper(). |
|
Remove a watch on a device.
|
|
Set a property of type bool.
Definition at line 1425 of file libhal.c. References hal_device_set_property_helper(). |
|
Set a property of type double.
Definition at line 1406 of file libhal.c. References hal_device_set_property_helper(). |
|
Definition at line 1244 of file libhal.c. Referenced by hal_device_remove_property(), hal_device_set_property_bool(), hal_device_set_property_double(), hal_device_set_property_int(), hal_device_set_property_string(), and hal_device_set_property_uint64(). |
|
Set a property of type integer.
Definition at line 1368 of file libhal.c. References hal_device_set_property_helper(). |
|
Set a property of type string.
Definition at line 1348 of file libhal.c. References hal_device_set_property_helper(). |
|
Set a property of type integer.
Definition at line 1387 of file libhal.c. References hal_device_set_property_helper(). |
|
Release an advisory lock on the device.
|
|
Find devices with a given capability.
|
|
Free a property set earlier obtained with hal_device_get_all_properties().
Definition at line 311 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Frees a nul-terminated string.
Definition at line 86 of file libhal.c. Referenced by hal_drive_free(), hal_drive_from_device_file(), hal_drive_from_udi(), hal_volume_free(), and hal_volume_from_udi(). |
|
Frees a NULL-terminated array of strings. If passed NULL, does nothing.
Definition at line 69 of file libhal.c. Referenced by hal_drive_from_device_file(), and hal_volume_from_device_file(). |
|
Get all devices in the Global Device List (GDL).
|
|
Initialize the HAL library.
Definition at line 608 of file libhal.c. References LibHalFunctions, and LibHalFunctions_s::main_loop_integration. |
|
Find a device in the GDL where a single string property matches a given value.
Definition at line 2092 of file libhal.c. Referenced by hal_drive_from_device_file(), and hal_volume_from_device_file(). |
|
Get the value of a property of type bool.
Definition at line 443 of file libhal.c. Referenced by hal_device_print(). |
|
Get the value of a property of type double.
Definition at line 432 of file libhal.c. Referenced by hal_device_print(). |
|
Get the value of a property of type integer.
Definition at line 410 of file libhal.c. Referenced by hal_device_print(). |
|
Get the key of a property.
Definition at line 385 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Get the value of a property of type string.
Definition at line 399 of file libhal.c. Referenced by hal_device_print(). |
|
Get type of property.
Definition at line 371 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Get the value of a property of type integer.
Definition at line 421 of file libhal.c. Referenced by hal_device_print(). |
|
Determine whether there are more properties to iterate over.
Definition at line 348 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Initialize a property set iterator.
Definition at line 335 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Advance iterator to next property.
Definition at line 358 of file libhal.c. Referenced by hal_device_print(), hal_drive_from_udi(), and hal_volume_from_udi(). |
|
Shutdown the HAL library. All resources allocated are freed.
|