40 TAILQ_INIT((*adapter)->devices);
61 TAILQ_INIT((*device)->services);
82 TAILQ_INIT((*service)->parameters);
90 (*service)->actions[method].method = method;
91 (*service)->actions[method].service = (*service);
134 LOG_RETURN(rc,
"Free function returned an error [code: %i]", rc);
151 LOG_RETURN(rc,
"Free function returned an error [code: %i]", rc);
168 LOG_RETURN(rc,
"Free function returned an error [code: %i]", rc);
320 (*data) = adapter->
data;
326 (*data) = device->
data;
332 (*data) = service->
data;
356 (*id) = parameter->
id;
383 const char *
key, **val;
385 while ((key = va_arg(vp,
const char *))) {
386 val = va_arg(vp,
const char **);
396 const char *
key, **val;
398 while ((key = va_arg(vp,
const char *))) {
399 val = va_arg(vp,
const char **);
409 const char *
key, **val;
411 while ((key = va_arg(vp,
const char *))) {
412 val = va_arg(vp,
const char **);
422 const char *
key, **val;
424 while ((key = va_arg(vp,
const char *))) {
425 val = va_arg(vp,
const char **);
434 (*method) = action->
method;
486 action_p->
method = method;
487 action_p->
action = action;
494 const char *
key, *val;
496 while ((key = va_arg(vp,
const char *))) {
498 val = va_arg(vp,
const char *);
507 const char *
key, *val;
509 while ((key = va_arg(vp,
const char *))) {
511 val = va_arg(vp,
const char *);
520 const char *
key, *val;
522 while ((key = va_arg(vp,
const char *))) {
524 val = va_arg(vp,
const char *);
533 const char *
key, *val;
535 while ((key = va_arg(vp,
const char *))) {
537 val = va_arg(vp,
const char *);
595 *device = TAILQ_FIRST(adapter->
devices);
609 *service = TAILQ_FIRST(device->
services);
620 (*device) = TAILQ_FIRST(adapter->
devices);
628 *service = TAILQ_FIRST(device->
services);
638 (*service) = TAILQ_FIRST(device->
services);
644 (*parameter) = TAILQ_FIRST(service->
parameters);
654 (*action) = &service->
actions[method];
697 *device = TAILQ_FIRST(adapter->
devices);
748 *service = TAILQ_FIRST(device->
services);
hpd_error_t discovery_set_service_attr(hpd_service_t *service, const char *key, const char *val)
hpd_error_t discovery_get_parameter_attr(hpd_parameter_t *parameter, const char *key, const char **val)
void(* hpd_free_f)(void *data)
[hpd_action_f]
hpd_error_t discovery_next_adapter_device(hpd_device_t **device)
#define LOG_RETURN_E_NULL()
hpd_error_t discovery_set_service_actions_v(hpd_service_t *service, va_list vp)
hpd_error_t discovery_free_service(hpd_service_t *service)
hpd_error_t discovery_free_adapter(hpd_adapter_t *adapter)
hpd_error_t discovery_alloc_device(hpd_device_t **device, const char *id)
hpd_error_t discovery_set_adapter_data(hpd_adapter_t *adapter, void *data, hpd_free_f on_free)
hpd_error_t discovery_next_device_attr(hpd_pair_t **pair)
hpd_error_t discovery_attach_service(hpd_device_t *device, hpd_service_t *service)
hpd_error_t discovery_set_service_data(hpd_service_t *service, void *data, hpd_free_f on_free)
#define HPD_STR_CPY(DST, SRC)
struct hpd_services hpd_services_t
hpd_error_t discovery_free_device(hpd_device_t *device)
hpd_error_t discovery_first_hpd_adapter(hpd_t *hpd, hpd_adapter_t **adapter)
hpd_error_t discovery_set_adapter_attr(hpd_adapter_t *adapter, const char *key, const char *val)
hpd_error_t discovery_first_adapter_attr(hpd_adapter_t *adapter, hpd_pair_t **pair)
hpd_error_t discovery_get_adapter_id(hpd_adapter_t *adapter, const char **id)
hpd_bool_t discovery_is_service_id_unique(hpd_device_t *device, hpd_service_t *service)
hpd_error_t discovery_detach_device(hpd_device_t *device)
#define LOG_RETURN_E_ALLOC()
hpd_error_t discovery_get_device_attr(hpd_device_t *device, const char *key, const char **val)
#define HPD_TAILQ_MAP_REMOVE(LIST, FUNC, TYPE, RC)
hpd_error_t event_inform_adapter_attached(hpd_adapter_t *adapter)
hpd_parameters_t * parameters
hpd_error_t discovery_free_parameter(hpd_parameter_t *parameter)
hpd_error_t hpd_map_set(hpd_map_t *map, const char *k, const char *v)
struct hpd_devices hpd_devices_t
hpd_error_t discovery_alloc_service(hpd_service_t **service, const char *id)
hpd_error_t hpd_map_next(hpd_pair_t **pair)
hpd_error_t discovery_next_adapter_service(hpd_service_t **service)
hpd_error_t discovery_get_adapter_attrs_v(hpd_adapter_t *adapter, va_list vp)
hpd_error_t discovery_set_service_action(hpd_service_t *service, const hpd_method_t method, hpd_action_f action)
hpd_error_t hpd_map_first(hpd_map_t *map, hpd_pair_t **pair)
hpd_error_t discovery_set_parameter_attr(hpd_parameter_t *parameter, const char *key, const char *val)
hpd_bool_t discovery_is_parameter_id_unique(hpd_service_t *service, hpd_parameter_t *parameter)
hpd_error_t hpd_map_free(hpd_map_t *map)
hpd_error_t discovery_next_hpd_service(hpd_service_t **service)
hpd_error_t discovery_next_action_in_service(hpd_action_t **action)
#define HPD_CALLOC(PTR, NUM, CAST)
Allocates and zeros a structure.
hpd_error_t discovery_first_device_attr(hpd_device_t *device, hpd_pair_t **pair)
hpd_error_t discovery_next_hpd_device(hpd_device_t **device)
hpd_bool_t discovery_has_service_action(hpd_service_t *service, const hpd_method_t method)
hpd_error_t discovery_alloc_parameter(hpd_parameter_t **parameter, const char *id)
hpd_error_t discovery_first_action_in_service(hpd_service_t *service, hpd_action_t **action)
hpd_error_t discovery_set_adapter_attrs_v(hpd_adapter_t *adapter, va_list vp)
hpd_error_t event_inform_adapter_detached(hpd_adapter_t *adapter)
hpd_error_t discovery_set_device_attr(hpd_device_t *device, const char *key, const char *val)
hpd_error_t discovery_get_parameter_id(hpd_parameter_t *parameter, const char **id)
hpd_configuration_t * configuration
hpd_error_t discovery_attach_parameter(hpd_service_t *service, hpd_parameter_t *parameter)
hpd_error_t discovery_set_device_data(hpd_device_t *device, void *data, hpd_free_f on_free)
hpd_error_t discovery_attach_device(hpd_adapter_t *adapter, hpd_device_t *device)
hpd_error_t discovery_next_device_service(hpd_service_t **service)
enum hpd_error hpd_error_t
hpd_services_t * services
#define LOG_RETURN(E, FMT,...)
hpd_error_t discovery_first_adapter_device(hpd_adapter_t *adapter, hpd_device_t **device)
hpd_error_t hpd_map_get(hpd_map_t *map, const char *k, const char **v)
hpd_error_t discovery_get_parameter_attrs_v(hpd_parameter_t *parameter, va_list vp)
hpd_bool_t discovery_is_device_id_unique(hpd_adapter_t *adapter, hpd_device_t *device)
hpd_error_t discovery_set_service_attrs_v(hpd_service_t *service, va_list vp)
hpd_error_t discovery_get_service_id(hpd_service_t *service, const char **id)
hpd_error_t discovery_get_device_data(hpd_device_t *device, void **data)
hpd_error_t discovery_detach_parameter(hpd_parameter_t *parameter)
hpd_bool_t discovery_is_adapter_id_unique(hpd_t *hpd, hpd_adapter_t *adapter)
hpd_error_t discovery_set_parameter_attrs_v(hpd_parameter_t *parameter, va_list vp)
hpd_status_t(* hpd_action_f)(void *data, hpd_request_t *req)
[hpd_module_def_t functions]
hpd_error_t discovery_alloc_adapter(hpd_adapter_t **adapter, const char *id)
struct hpd_parameters hpd_parameters_t
hpd_error_t discovery_get_adapter_data(hpd_adapter_t *adapter, void **data)
hpd_error_t discovery_detach_service(hpd_service_t *service)
hpd_error_t discovery_first_hpd_device(hpd_t *hpd, hpd_device_t **device)
hpd_error_t hpd_map_alloc(hpd_map_t **map)
hpd_error_t discovery_next_parameter_attr(hpd_pair_t **pair)
#define HPD_CPY_ALLOC(DST, SRC, CAST)
hpd_error_t discovery_first_service_attr(hpd_service_t *service, hpd_pair_t **pair)
hpd_error_t discovery_get_service_attr(hpd_service_t *service, const char *key, const char **val)
hpd_error_t event_inform_device_attached(hpd_device_t *device)
hpd_error_t discovery_set_device_attrs_v(hpd_device_t *device, va_list vp)
hpd_error_t discovery_next_hpd_adapter(hpd_adapter_t **adapter)
hpd_error_t discovery_first_service_parameter(hpd_service_t *service, hpd_parameter_t **parameter)
hpd_error_t discovery_attach_adapter(hpd_t *hpd, hpd_adapter_t *adapter)
hpd_error_t discovery_get_adapter_attr(hpd_adapter_t *adapter, const char *key, const char **val)
hpd_configuration_t * configuration
hpd_error_t discovery_first_hpd_service(hpd_t *hpd, hpd_service_t **service)
hpd_error_t discovery_first_parameter_attr(hpd_parameter_t *parameter, hpd_pair_t **pair)
hpd_error_t discovery_first_adapter_service(hpd_adapter_t *adapter, hpd_service_t **service)
hpd_error_t discovery_get_service_attrs_v(hpd_service_t *service, va_list vp)
hpd_action_t actions[HPD_M_COUNT]
hpd_error_t discovery_get_device_attrs_v(hpd_device_t *device, va_list vp)
hpd_error_t event_inform_device_detached(hpd_device_t *device)
hpd_error_t discovery_get_device_id(hpd_device_t *device, const char **id)
hpd_error_t discovery_next_service_attr(hpd_pair_t **pair)
hpd_error_t discovery_first_device_service(const hpd_device_t *device, hpd_service_t **service)
enum hpd_method hpd_method_t
[hpd_log_level_t]
hpd_error_t discovery_get_service_data(hpd_service_t *service, void **data)
hpd_error_t discovery_get_action_method(const hpd_action_t *action, hpd_method_t *method)
hpd_error_t discovery_detach_adapter(hpd_adapter_t *adapter)
hpd_error_t discovery_next_service_parameter(hpd_parameter_t **parameter)
hpd_error_t discovery_next_adapter_attr(hpd_pair_t **pair)