Lines Matching defs:hal_ctx

71 int dump_devices(LibHalContext *hal_ctx, char *arg);
72 int remove_udi(LibHalContext *hal_ctx, char *arg);
73 int add_udi(LibHalContext *hal_ctx, char *arg);
74 void process_property(LibHalContext *hal_ctx, char *buf, lh_prop_t **prop);
75 int add_properties(LibHalContext *hal_ctx, new_dev_t *nd, lh_prop_t *prop);
104 LibHalContext *hal_ctx;
140 if (!(hal_ctx = libhal_ctx_new())) return 3;
141 if (!libhal_ctx_set_dbus_connection(hal_ctx, conn)) return 4;
142 if (!libhal_ctx_init(hal_ctx, &error)) {
154 err = dump_devices(hal_ctx, argv[optind]);
156 err = remove_udi(hal_ctx, opt.udi);
158 err = add_udi(hal_ctx, opt.udi);
162 libhal_ctx_shutdown(hal_ctx, &error);
163 libhal_ctx_free(hal_ctx);
188 int dump_devices(LibHalContext *hal_ctx, char *arg)
213 if (!(device_names = libhal_get_all_devices(hal_ctx, &num_devices, &error))) {
229 if (!(props = libhal_device_get_all_properties(hal_ctx, device_names[i], &error))) {
304 int remove_udi(LibHalContext *hal_ctx, char *arg)
326 if (!libhal_remove_device(hal_ctx, udi, &error)) {
340 int add_udi(LibHalContext *hal_ctx, char *arg)
368 dev_exists = libhal_device_exists(hal_ctx, udi, &error);
373 new_dev.real_udi = libhal_new_device(hal_ctx, &error);
389 process_property(hal_ctx, buf, &prop);
392 err = add_properties(hal_ctx, &new_dev, prop);
397 if (!libhal_device_commit_to_gdl(hal_ctx, new_dev.real_udi, new_dev.udi, &error)) {
447 void process_property(LibHalContext *hal_ctx, char *buf, lh_prop_t **prop)
545 int add_properties(LibHalContext *hal_ctx, new_dev_t *nd, lh_prop_t *prop)
560 old_type = libhal_device_get_property_type(hal_ctx, nd->real_udi, p->key, &error);
565 if (!libhal_device_remove_property(hal_ctx, nd->real_udi, p->key, &error)) {
576 if (!libhal_device_set_property_bool(hal_ctx, nd->real_udi, p->key, p->v.bool_value, &error)) {
583 if (!libhal_device_set_property_int(hal_ctx, nd->real_udi, p->key, p->v.int_value, &error)) {
590 if (!libhal_device_set_property_uint64(hal_ctx, nd->real_udi, p->key, p->v.uint64_value, &error)) {
597 if (!libhal_device_set_property_double(hal_ctx, nd->real_udi, p->key, p->v.double_value, &error)) {
605 if (!libhal_device_set_property_string(hal_ctx, nd->real_udi, p->key, p->v.str_value, &error)) {
613 if (!libhal_device_property_strlist_append(hal_ctx, nd->real_udi, p->key, *s, &error)) {