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 | 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 its 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(* | LibHalDeviceNewCapability )(LibHalContext *ctx, const char *udi, const char *capability) |
Type for callback when a device gains a new capability. | |
typedef void(* | LibHalDeviceLostCapability )(LibHalContext *ctx, const char *udi, const char *capability) |
Type for callback when a device loses 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, const char *condition_detail) |
Type for callback when a non-continuous condition occurs on a device. | |
Enumerations | |
enum | LibHalPropertyType { LIBHAL_PROPERTY_TYPE_INVALID = DBUS_TYPE_INVALID, LIBHAL_PROPERTY_TYPE_INT32 = DBUS_TYPE_INT32, LIBHAL_PROPERTY_TYPE_UINT64 = DBUS_TYPE_UINT64, LIBHAL_PROPERTY_TYPE_DOUBLE = DBUS_TYPE_DOUBLE, LIBHAL_PROPERTY_TYPE_BOOLEAN = DBUS_TYPE_BOOLEAN, LIBHAL_PROPERTY_TYPE_STRING = DBUS_TYPE_STRING, LIBHAL_PROPERTY_TYPE_STRLIST = ((int) (DBUS_TYPE_STRING<<8)+('l')) } |
Possible types for properties on hal device objects. More... | |
Functions | |
void | libhal_free_string_array (char **str_array) |
Frees a NULL-terminated array of strings. | |
static char ** | libhal_get_string_array_from_iter (DBusMessageIter *iter, int *num_elements) |
Creates a NULL terminated array of strings from a dbus message iterator. | |
void | libhal_free_string (char *str) |
Frees a nul-terminated string. | |
dbus_bool_t | libhal_ctx_set_user_data (LibHalContext *ctx, void *user_data) |
Set user data for the context. | |
void * | libhal_ctx_get_user_data (LibHalContext *ctx) |
Get user data for the context. | |
static dbus_bool_t | libhal_property_fill_value_from_variant (LibHalProperty *p, DBusMessageIter *var_iter) |
Fills in the value for the LibHalProperty given a variant iterator. | |
LibHalPropertySet * | libhal_device_get_all_properties (LibHalContext *ctx, const char *udi, DBusError *error) |
Retrieve all the properties on a device. | |
void | libhal_free_property_set (LibHalPropertySet *set) |
Free a property set earlier obtained with libhal_device_get_all_properties(). | |
unsigned int | libhal_property_set_get_num_elems (LibHalPropertySet *set) |
Get the number of properties in a property set. | |
void | libhal_psi_init (LibHalPropertySetIterator *iter, LibHalPropertySet *set) |
Initialize a property set iterator. | |
dbus_bool_t | libhal_psi_has_more (LibHalPropertySetIterator *iter) |
Determine whether there are more properties to iterate over. | |
void | libhal_psi_next (LibHalPropertySetIterator *iter) |
Advance iterator to next property. | |
LibHalPropertyType | libhal_psi_get_type (LibHalPropertySetIterator *iter) |
Get type of property. | |
char * | libhal_psi_get_key (LibHalPropertySetIterator *iter) |
Get the key of a property. | |
char * | libhal_psi_get_string (LibHalPropertySetIterator *iter) |
Get the value of a property of type string. | |
dbus_int32_t | libhal_psi_get_int (LibHalPropertySetIterator *iter) |
Get the value of a property of type signed integer. | |
dbus_uint64_t | libhal_psi_get_uint64 (LibHalPropertySetIterator *iter) |
Get the value of a property of type unsigned integer. | |
double | libhal_psi_get_double (LibHalPropertySetIterator *iter) |
Get the value of a property of type double. | |
dbus_bool_t | libhal_psi_get_bool (LibHalPropertySetIterator *iter) |
Get the value of a property of type bool. | |
char ** | libhal_psi_get_strlist (LibHalPropertySetIterator *iter) |
Get the value of a property of type string list. | |
char ** | libhal_get_all_devices (LibHalContext *ctx, int *num_devices, DBusError *error) |
Get all devices in the Global Device List (GDL). | |
LibHalPropertyType | libhal_device_get_property_type (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Query a property type of a device. | |
char ** | libhal_device_get_property_strlist (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type string list. | |
char * | libhal_device_get_property_string (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type string. | |
dbus_int32_t | libhal_device_get_property_int (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type integer. | |
dbus_uint64_t | libhal_device_get_property_uint64 (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type signed integer. | |
double | libhal_device_get_property_double (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type double. | |
dbus_bool_t | libhal_device_get_property_bool (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Get the value of a property of type bool. | |
static dbus_bool_t | libhal_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, DBusError *error) |
dbus_bool_t | libhal_device_set_property_string (LibHalContext *ctx, const char *udi, const char *key, const char *value, DBusError *error) |
Set a property of type string. | |
dbus_bool_t | libhal_device_set_property_int (LibHalContext *ctx, const char *udi, const char *key, dbus_int32_t value, DBusError *error) |
Set a property of type signed integer. | |
dbus_bool_t | libhal_device_set_property_uint64 (LibHalContext *ctx, const char *udi, const char *key, dbus_uint64_t value, DBusError *error) |
Set a property of type unsigned integer. | |
dbus_bool_t | libhal_device_set_property_double (LibHalContext *ctx, const char *udi, const char *key, double value, DBusError *error) |
Set a property of type double. | |
dbus_bool_t | libhal_device_set_property_bool (LibHalContext *ctx, const char *udi, const char *key, dbus_bool_t value, DBusError *error) |
Set a property of type bool. | |
dbus_bool_t | libhal_device_remove_property (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Remove a property. | |
dbus_bool_t | libhal_device_property_strlist_append (LibHalContext *ctx, const char *udi, const char *key, const char *value, DBusError *error) |
Append to a property of type strlist. | |
dbus_bool_t | libhal_device_property_strlist_prepend (LibHalContext *ctx, const char *udi, const char *key, const char *value, DBusError *error) |
Prepend to a property of type strlist. | |
dbus_bool_t | libhal_device_property_strlist_remove_index (LibHalContext *ctx, const char *udi, const char *key, unsigned int index, DBusError *error) |
Remove a specified string from a property of type strlist. | |
dbus_bool_t | libhal_device_property_strlist_remove (LibHalContext *ctx, const char *udi, const char *key, const char *value, DBusError *error) |
Remove a specified string from a property of type strlist. | |
dbus_bool_t | libhal_device_lock (LibHalContext *ctx, const char *udi, const char *reason_to_lock, char **reason_why_locked, DBusError *error) |
Take an advisory lock on the device. | |
dbus_bool_t | libhal_device_unlock (LibHalContext *ctx, const char *udi, DBusError *error) |
Release an advisory lock on the device. | |
char * | libhal_new_device (LibHalContext *ctx, DBusError *error) |
Create a new device object which will be hidden from applications until the CommitToGdl(), ie. | |
dbus_bool_t | libhal_device_commit_to_gdl (LibHalContext *ctx, const char *temp_udi, const char *udi, DBusError *error) |
When a hidden device has been built using the NewDevice method, ie. | |
dbus_bool_t | libhal_remove_device (LibHalContext *ctx, const char *udi, DBusError *error) |
This method can be invoked when a device is removed. | |
dbus_bool_t | libhal_device_exists (LibHalContext *ctx, const char *udi, DBusError *error) |
Determine if a device exists. | |
dbus_bool_t | libhal_device_property_exists (LibHalContext *ctx, const char *udi, const char *key, DBusError *error) |
Determine if a property on a device exists. | |
dbus_bool_t | libhal_merge_properties (LibHalContext *ctx, const char *target_udi, const char *source_udi, DBusError *error) |
Merge properties from one device to another. | |
dbus_bool_t | libhal_device_matches (LibHalContext *ctx, const char *udi1, const char *udi2, const char *property_namespace, DBusError *error) |
Check a set of properties for two devices matches. | |
dbus_bool_t | libhal_device_print (LibHalContext *ctx, const char *udi, DBusError *error) |
Print a device to stdout; useful for debugging. | |
char ** | libhal_manager_find_device_string_match (LibHalContext *ctx, const char *key, const char *value, int *num_devices, DBusError *error) |
Find a device in the GDL where a single string property matches a given value. | |
dbus_bool_t | libhal_device_add_capability (LibHalContext *ctx, const char *udi, const char *capability, DBusError *error) |
Assign a capability to a device. | |
dbus_bool_t | libhal_device_query_capability (LibHalContext *ctx, const char *udi, const char *capability, DBusError *error) |
Check if a device has a capability. | |
char ** | libhal_find_device_by_capability (LibHalContext *ctx, const char *capability, int *num_devices, DBusError *error) |
Find devices with a given capability. | |
dbus_bool_t | libhal_device_property_watch_all (LibHalContext *ctx, DBusError *error) |
Watch all devices, ie. | |
dbus_bool_t | libhal_device_add_property_watch (LibHalContext *ctx, const char *udi, DBusError *error) |
Add a watch on a device, so the device_property_changed callback is invoked when the properties on the given device changes. | |
dbus_bool_t | libhal_device_remove_property_watch (LibHalContext *ctx, const char *udi, DBusError *error) |
Remove a watch on a device. | |
LibHalContext * | libhal_ctx_new (void) |
Create a new LibHalContext. | |
dbus_bool_t | libhal_ctx_set_cache (LibHalContext *ctx, dbus_bool_t use_cache) |
Enable or disable caching. | |
dbus_bool_t | libhal_ctx_set_dbus_connection (LibHalContext *ctx, DBusConnection *conn) |
Set DBus connection to use to talk to hald. | |
DBusConnection * | libhal_ctx_get_dbus_connection (LibHalContext *ctx) |
Get DBus connection to use to talk to hald. | |
dbus_bool_t | libhal_ctx_init (LibHalContext *ctx, DBusError *error) |
Initialize the connection to hald. | |
LibHalContext * | libhal_ctx_init_direct (DBusError *error) |
Create an already initialized connection to hald. | |
dbus_bool_t | libhal_ctx_shutdown (LibHalContext *ctx, DBusError *error) |
Shut down a connection to hald. | |
dbus_bool_t | libhal_ctx_free (LibHalContext *ctx) |
Free a LibHalContext resource. | |
dbus_bool_t | libhal_ctx_set_device_added (LibHalContext *ctx, LibHalDeviceAdded callback) |
Set the callback for when a device is added. | |
dbus_bool_t | libhal_ctx_set_device_removed (LibHalContext *ctx, LibHalDeviceRemoved callback) |
Set the callback for when a device is removed. | |
dbus_bool_t | libhal_ctx_set_device_new_capability (LibHalContext *ctx, LibHalDeviceNewCapability callback) |
Set the callback for when a device gains a new capability. | |
dbus_bool_t | libhal_ctx_set_device_lost_capability (LibHalContext *ctx, LibHalDeviceLostCapability callback) |
Set the callback for when a device loses a capability. | |
dbus_bool_t | libhal_ctx_set_device_property_modified (LibHalContext *ctx, LibHalDevicePropertyModified callback) |
Set the callback for when a property is modified on a device. | |
dbus_bool_t | libhal_ctx_set_device_condition (LibHalContext *ctx, LibHalDeviceCondition callback) |
Set the callback for when a device emits a condition. | |
unsigned int | libhal_string_array_length (char **str_array) |
Get the length of an array of strings. | |
dbus_bool_t | libhal_device_rescan (LibHalContext *ctx, const char *udi, DBusError *error) |
dbus_bool_t | libhal_device_reprobe (LibHalContext *ctx, const char *udi, DBusError *error) |
dbus_bool_t | libhal_device_emit_condition (LibHalContext *ctx, const char *udi, const char *condition_name, const char *condition_details, DBusError *error) |
Emit a condition from a device. | |
Variables | |
static dbus_bool_t | libhal_already_initialized_once = FALSE |
|
Type for callback when a device is added.
|
|
Type for callback when a non-continuous condition occurs on a device.
|
|
Type for callback when a device loses a capability.
|
|
Type for callback when a device gains a new capability.
|
|
Type for callback when a property of a device changes.
|
|
Type for callback when a device is removed.
|
|
Type for function in application code that integrates a DBusConnection object into its own mainloop.
|
|
|
Free a LibHalContext resource.
Definition at line 3077 of file libhal.c. Referenced by libhal_ctx_init_direct(). |
|
Get DBus connection to use to talk to hald.
|
|
Get user data for the context.
|
|
Initialize the connection to hald.
|
|
Create an already initialized connection to hald.
Definition at line 2998 of file libhal.c. References libhal_ctx_free(), and libhal_ctx_new(). |
|
Create a new LibHalContext.
Definition at line 2863 of file libhal.c. References libhal_already_initialized_once. Referenced by libhal_ctx_init_direct(). |
|
Enable or disable caching.
|
|
Set DBus connection to use to talk to hald.
|
|
Set the callback for when a device is added.
|
|
Set the callback for when a device emits a condition.
|
|
Set the callback for when a device loses a capability.
|
|
Set the callback for when a device gains a new capability.
|
|
Set the callback for when a property is modified on a device.
|
|
Set the callback for when a device is removed.
|
|
Set user data for the context.
|
|
Shut down a connection to hald.
|
|
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 libhal_device_remove_property_watch, if the device is removed.
|
|
When a hidden device has been built using the NewDevice method, ie. libhal_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.
|
|
Emit a condition from a device.
|
|
Determine if a device exists.
|
|
Retrieve all the properties on a device.
Definition at line 341 of file libhal.c. References libhal_property_fill_value_from_variant(). Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
Get the value of a property of type bool.
Definition at line 1391 of file libhal.c. Referenced by libhal_drive_policy_default_use_managed_keyword(). |
|
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 1111 of file libhal.c. Referenced by libhal_drive_from_device_file(), libhal_drive_policy_default_get_managed_keyword_primary(), libhal_drive_policy_default_get_managed_keyword_secondary(), and libhal_drive_policy_default_get_mount_root(). |
|
Get the value of a property of type string list.
Definition at line 1042 of file libhal.c. References libhal_get_string_array_from_iter(). Referenced by libhal_device_query_capability(). |
|
Query a property type of a device.
Definition at line 981 of file libhal.c. References LIBHAL_PROPERTY_TYPE_INVALID. |
|
Get the value of a property of type signed integer.
|
|
Take an advisory lock on the device.
|
|
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.
|
|
Print a device to stdout; useful for debugging.
Definition at line 2475 of file libhal.c. References libhal_device_get_all_properties(), LIBHAL_PROPERTY_TYPE_BOOLEAN, LIBHAL_PROPERTY_TYPE_DOUBLE, LIBHAL_PROPERTY_TYPE_INT32, LIBHAL_PROPERTY_TYPE_STRING, LIBHAL_PROPERTY_TYPE_STRLIST, LIBHAL_PROPERTY_TYPE_UINT64, libhal_psi_get_bool(), libhal_psi_get_double(), libhal_psi_get_int(), libhal_psi_get_key(), libhal_psi_get_string(), libhal_psi_get_strlist(), libhal_psi_get_type(), libhal_psi_get_uint64(), libhal_psi_has_more(), libhal_psi_init(), and libhal_psi_next(). |
|
Determine if a property on a device exists.
|
|
Append to a property of type strlist.
|
|
Prepend to a property of type strlist.
|
|
Remove a specified string from a property of type strlist.
|
|
Remove a specified string from a property of type strlist.
|
|
Watch all devices, ie. the device_property_changed callback is invoked when the properties on any device changes.
|
|
Check if a device has a capability. The result is undefined if the device doesn't exist.
Definition at line 2682 of file libhal.c. References libhal_device_get_property_strlist(). Referenced by libhal_drive_from_device_file(), libhal_drive_from_udi(), libhal_volume_from_device_file(), and libhal_volume_from_udi(). |
|
Remove a property.
Definition at line 1664 of file libhal.c. References libhal_device_set_property_helper(). |
|
Remove a watch on a device.
|
|
Set a property of type bool.
Definition at line 1644 of file libhal.c. References libhal_device_set_property_helper(). |
|
Set a property of type double.
Definition at line 1623 of file libhal.c. References libhal_device_set_property_helper(). |
|
Definition at line 1452 of file libhal.c. Referenced by libhal_device_remove_property(), libhal_device_set_property_bool(), libhal_device_set_property_double(), libhal_device_set_property_int(), libhal_device_set_property_string(), and libhal_device_set_property_uint64(). |
|
Set a property of type signed integer.
Definition at line 1581 of file libhal.c. References libhal_device_set_property_helper(). |
|
Set a property of type string.
Definition at line 1557 of file libhal.c. References libhal_device_set_property_helper(). |
|
Set a property of type unsigned integer.
Definition at line 1602 of file libhal.c. References libhal_device_set_property_helper(). |
|
Release an advisory lock on the device.
|
|
Find devices with a given capability.
Definition at line 2717 of file libhal.c. References libhal_get_string_array_from_iter(). |
|
Free a property set earlier obtained with libhal_device_get_all_properties().
Definition at line 475 of file libhal.c. References libhal_free_string_array(), and LIBHAL_PROPERTY_TYPE_STRLIST. |
|
Frees a nul-terminated string.
Definition at line 150 of file libhal.c. Referenced by libhal_drive_free(), libhal_drive_from_device_file(), and libhal_volume_free(). |
|
Frees a NULL-terminated array of strings. If passed NULL, does nothing.
Definition at line 75 of file libhal.c. Referenced by libhal_drive_free(), libhal_free_property_set(), and libhal_volume_crypto_get_clear_volume_udi(). |
|
Get all devices in the Global Device List (GDL).
Definition at line 915 of file libhal.c. References libhal_get_string_array_from_iter(). |
|
Creates a NULL terminated array of strings from a dbus message iterator.
Definition at line 95 of file libhal.c. Referenced by libhal_device_get_property_strlist(), libhal_find_device_by_capability(), libhal_get_all_devices(), libhal_manager_find_device_string_match(), and libhal_property_fill_value_from_variant(). |
|
Find a device in the GDL where a single string property matches a given value.
Definition at line 2558 of file libhal.c. References libhal_get_string_array_from_iter(). Referenced by libhal_drive_find_all_volumes(), libhal_drive_from_device_file(), libhal_volume_crypto_get_clear_volume_udi(), and libhal_volume_from_device_file(). |
|
Merge properties from one device to another.
|
|
Create a new device object which will be hidden from applications until the CommitToGdl(), ie. libhal_device_commit_to_gdl(), method is called. Note that the program invoking this method needs to run with super user privileges.
|
|
Fills in the value for the LibHalProperty given a variant iterator.
Definition at line 252 of file libhal.c. References libhal_get_string_array_from_iter(), LIBHAL_PROPERTY_TYPE_BOOLEAN, LIBHAL_PROPERTY_TYPE_DOUBLE, LIBHAL_PROPERTY_TYPE_INT32, LIBHAL_PROPERTY_TYPE_STRING, LIBHAL_PROPERTY_TYPE_STRLIST, and LIBHAL_PROPERTY_TYPE_UINT64. Referenced by libhal_device_get_all_properties(). |
|
Get the number of properties in a property set.
|
|
Get the value of a property of type bool.
Definition at line 635 of file libhal.c. Referenced by libhal_device_print(), and mopts_collect(). |
|
Get the value of a property of type double.
Definition at line 624 of file libhal.c. Referenced by libhal_device_print(). |
|
Get the value of a property of type signed integer.
Definition at line 602 of file libhal.c. Referenced by libhal_device_print(). |
|
Get the key of a property.
Definition at line 577 of file libhal.c. Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
Get the value of a property of type string.
Definition at line 591 of file libhal.c. Referenced by libhal_device_print(). |
|
Get the value of a property of type string list.
Definition at line 646 of file libhal.c. Referenced by libhal_device_print(). |
|
Get type of property.
Definition at line 563 of file libhal.c. Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
Get the value of a property of type unsigned integer.
Definition at line 613 of file libhal.c. Referenced by libhal_device_print(). |
|
Determine whether there are more properties to iterate over.
Definition at line 541 of file libhal.c. Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
Initialize a property set iterator.
Definition at line 523 of file libhal.c. Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
Advance iterator to next property.
Definition at line 551 of file libhal.c. Referenced by libhal_device_print(), libhal_drive_from_udi(), libhal_volume_from_udi(), and mopts_collect(). |
|
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 the length of an array of strings.
|