HalDevice
3
HAL Library

# HalDevice

## Synopsis

                HalDevice;
    void        (*HalDeviceAsyncCallback)       (HalDevice *device,
                                                 gpointer user_data,
                                                 gboolean prop_exists);
    gboolean    (*HalDevicePropertyForeachFn)   (HalDevice *device,
                                                 HalProperty *property,
                                                 gpointer user_data);
    HalDevice*  hal_device_new                  (void);
    void        hal_device_merge                (HalDevice *target,
                                                 HalDevice *source);
    void        hal_device_merge_with_rewrite   (HalDevice *target,
                                                 HalDevice *source,
                                                 const char *target_namespace,
                                                 const char *source_namespace);
    gboolean    hal_device_matches              (HalDevice *device1,
                                                 HalDevice *device2,
                                                 const char *namespace);
    const char* hal_device_get_udi              (HalDevice *device);
    void        hal_device_set_udi              (HalDevice *device,
                                                 const char *udi);
    void        hal_device_add_capability       (HalDevice *device,
                                                 const char *capability);
    gboolean    hal_device_has_capability       (HalDevice *device,
                                                 const char *capability);
    gboolean    hal_device_has_property         (HalDevice *device,
                                                 const char *key);
    HalProperty* hal_device_property_find       (HalDevice *device,
                                                 const char *key);
    int         hal_device_num_properties       (HalDevice *device);
    char*       hal_device_property_to_string   (HalDevice *device,
                                                 const char *key);
    void        hal_device_property_foreach     (HalDevice *device,
                                                 HalDevicePropertyForeachFn callback,
                                                 gpointer user_data);
    int         hal_device_property_get_type    (HalDevice *device,
                                                 const char *key);
    const char* hal_device_property_get_as_string
                                                (HalDevice *device,
                                                 const char *key,
                                                 char *buf,
                                                 size_t bufsize);
    const char* hal_device_property_get_string  (HalDevice *device,
                                                 const char *key);
    dbus_int32_t hal_device_property_get_int    (HalDevice *device,
                                                 const char *key);
    dbus_uint64_t hal_device_property_get_uint64
                                                (HalDevice *device,
                                                 const char *key);
    dbus_bool_t hal_device_property_get_bool    (HalDevice *device,
                                                 const char *key);
    double      hal_device_property_get_double  (HalDevice *device,
                                                 const char *key);
    GSList*     hal_device_property_get_strlist (HalDevice *device,
                                                 const char *key);
    const char* hal_device_property_get_strlist_elem
                                                (HalDevice *device,
                                                 const char *key,
                                                 guint index);
    gboolean    hal_device_property_set_string  (HalDevice *device,
                                                 const char *key,
                                                 const char *value);
    gboolean    hal_device_property_set_int     (HalDevice *device,
                                                 const char *key,
                                                 dbus_int32_t value);
    gboolean    hal_device_property_set_uint64  (HalDevice *device,
                                                 const char *key,
                                                 dbus_uint64_t value);
    gboolean    hal_device_property_set_bool    (HalDevice *device,
                                                 const char *key,
                                                 dbus_bool_t value);
    gboolean    hal_device_property_set_double  (HalDevice *device,
                                                 const char *key,
                                                 double value);
    gboolean    hal_device_property_strlist_append
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);
    gboolean    hal_device_property_strlist_prepend
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);
    gboolean    hal_device_property_strlist_remove_elem
                                                (HalDevice *device,
                                                 const char *key,
                                                 guint index);
    gboolean    hal_device_property_strlist_clear
                                                (HalDevice *device,
                                                 const char *key);
    gboolean    hal_device_property_strlist_add (HalDevice *device,
                                                 const char *key,
                                                 const char *value);
    gboolean    hal_device_property_strlist_remove
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);
    gboolean    hal_device_property_remove      (HalDevice *device,
                                                 const char *key);
    gboolean    hal_device_copy_property        (HalDevice *from_device,
                                                 const char *from,
                                                 HalDevice *to_device,
                                                 const char *to);
    void        hal_device_print                (HalDevice *device);
    void        hal_device_async_wait_property  (HalDevice *device,
                                                 const char *key,
                                                 HalDeviceAsyncCallback callback,
                                                 gpointer user_data,
                                                 int timeout);
    void        hal_device_callouts_finished    (HalDevice *device);
    void        hal_device_cancel               (HalDevice *device);
    gboolean    hal_device_property_set_attribute
                                                (HalDevice *device,
                                                 const char *key);

## Description

## Details

### HalDevice

    typedef struct {
    	GObject parent;

    	char *udi;

    	GSList *properties;
    } HalDevice;

### HalDeviceAsyncCallback ()

    void        (*HalDeviceAsyncCallback)       (HalDevice *device,
                                                 gpointer user_data,
                                                 gboolean prop_exists);

`device` :

`user_data` :

`prop_exists` :

### HalDevicePropertyForeachFn ()

    gboolean    (*HalDevicePropertyForeachFn)   (HalDevice *device,
                                                 HalProperty *property,
                                                 gpointer user_data);

`device` :

`property` :

`user_data` :

Returns :

### hal_device_new ()

    HalDevice*  hal_device_new                  (void);

Returns :

### hal_device_merge ()

    void        hal_device_merge                (HalDevice *target,
                                                 HalDevice *source);

`target` :

`source` :

### hal_device_merge_with_rewrite ()

    void        hal_device_merge_with_rewrite   (HalDevice *target,
                                                 HalDevice *source,
                                                 const char *target_namespace,
                                                 const char *source_namespace);

`target` :

`source` :

`target_namespace` :

`source_namespace` :

### hal_device_matches ()

    gboolean    hal_device_matches              (HalDevice *device1,
                                                 HalDevice *device2,
                                                 const char *namespace);

`device1` :

`device2` :

`namespace` :

Returns :

### hal_device_get_udi ()

    const char* hal_device_get_udi              (HalDevice *device);

`device` :

Returns :

### hal_device_set_udi ()

    void        hal_device_set_udi              (HalDevice *device,
                                                 const char *udi);

`device` :

`udi` :

### hal_device_add_capability ()

    void        hal_device_add_capability       (HalDevice *device,
                                                 const char *capability);

`device` :

`capability` :

### hal_device_has_capability ()

    gboolean    hal_device_has_capability       (HalDevice *device,
                                                 const char *capability);

`device` :

`capability` :

Returns :

### hal_device_has_property ()

    gboolean    hal_device_has_property         (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_find ()

    HalProperty* hal_device_property_find       (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_num_properties ()

    int         hal_device_num_properties       (HalDevice *device);

`device` :

Returns :

### hal_device_property_to_string ()

    char*       hal_device_property_to_string   (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_foreach ()

    void        hal_device_property_foreach     (HalDevice *device,
                                                 HalDevicePropertyForeachFn callback,
                                                 gpointer user_data);

`device` :

`callback` :

`user_data` :

### hal_device_property_get_type ()

    int         hal_device_property_get_type    (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_as_string ()

    const char* hal_device_property_get_as_string
                                                (HalDevice *device,
                                                 const char *key,
                                                 char *buf,
                                                 size_t bufsize);

`device` :

`key` :

`buf` :

`bufsize` :

Returns :

### hal_device_property_get_string ()

    const char* hal_device_property_get_string  (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_int ()

    dbus_int32_t hal_device_property_get_int    (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_uint64 ()

    dbus_uint64_t hal_device_property_get_uint64
                                                (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_bool ()

    dbus_bool_t hal_device_property_get_bool    (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_double ()

    double      hal_device_property_get_double  (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_strlist ()

    GSList*     hal_device_property_get_strlist (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_get_strlist_elem ()

    const char* hal_device_property_get_strlist_elem
                                                (HalDevice *device,
                                                 const char *key,
                                                 guint index);

`device` :

`key` :

`index` :

Returns :

### hal_device_property_set_string ()

    gboolean    hal_device_property_set_string  (HalDevice *device,
                                                 const char *key,
                                                 const char *value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_set_int ()

    gboolean    hal_device_property_set_int     (HalDevice *device,
                                                 const char *key,
                                                 dbus_int32_t value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_set_uint64 ()

    gboolean    hal_device_property_set_uint64  (HalDevice *device,
                                                 const char *key,
                                                 dbus_uint64_t value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_set_bool ()

    gboolean    hal_device_property_set_bool    (HalDevice *device,
                                                 const char *key,
                                                 dbus_bool_t value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_set_double ()

    gboolean    hal_device_property_set_double  (HalDevice *device,
                                                 const char *key,
                                                 double value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_strlist_append ()

    gboolean    hal_device_property_strlist_append
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_strlist_prepend ()

    gboolean    hal_device_property_strlist_prepend
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_strlist_remove_elem ()

    gboolean    hal_device_property_strlist_remove_elem
                                                (HalDevice *device,
                                                 const char *key,
                                                 guint index);

`device` :

`key` :

`index` :

Returns :

### hal_device_property_strlist_clear ()

    gboolean    hal_device_property_strlist_clear
                                                (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_property_strlist_add ()

    gboolean    hal_device_property_strlist_add (HalDevice *device,
                                                 const char *key,
                                                 const char *value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_strlist_remove ()

    gboolean    hal_device_property_strlist_remove
                                                (HalDevice *device,
                                                 const char *key,
                                                 const char *value);

`device` :

`key` :

`value` :

Returns :

### hal_device_property_remove ()

    gboolean    hal_device_property_remove      (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

Returns :

### hal_device_copy_property ()

    gboolean    hal_device_copy_property        (HalDevice *from_device,
                                                 const char *from,
                                                 HalDevice *to_device,
                                                 const char *to);

`from_device` :

`from` :

`to_device` :

`to` :

Returns :

### hal_device_print ()

    void        hal_device_print                (HalDevice *device);

`device` :

### hal_device_async_wait_property ()

    void        hal_device_async_wait_property  (HalDevice *device,
                                                 const char *key,
                                                 HalDeviceAsyncCallback callback,
                                                 gpointer user_data,
                                                 int timeout);

`device` :

`key` :

`callback` :

`user_data` :

`timeout` :

### hal_device_callouts_finished ()

    void        hal_device_callouts_finished    (HalDevice *device);

`device` :

### hal_device_cancel ()

    void        hal_device_cancel               (HalDevice *device);

`device` :

### hal_device_property_set_attribute ()

    gboolean    hal_device_property_set_attribute
                                                (HalDevice *device,
                                                 const char *key);

`device` :

`key` :

`attr` :

`persistence` :

Returns :