Lines Matching refs:ctx
59 sss_sifp_ctx *ctx = NULL;
70 ctx = alloc_func(sizeof(sss_sifp_ctx), alloc_pvt);
71 if (ctx == NULL) {
76 ctx->conn = NULL;
77 ctx->alloc_fn = alloc_func;
78 ctx->free_fn = free_func;
79 ctx->alloc_pvt = alloc_pvt;
80 ctx->io_error = alloc_func(sizeof(DBusError), alloc_pvt);
81 if (ctx->io_error == NULL) {
86 *_ctx = ctx;
88 dbus_error_init(ctx->io_error);
92 sss_sifp_set_io_error(ctx, &dbus_error);
97 ctx->conn = conn;
103 sss_sifp_free(&ctx);
111 sss_sifp_get_last_io_error_name(sss_sifp_ctx *ctx)
113 if (ctx == NULL) {
117 if (!dbus_error_is_set(ctx->io_error)) {
121 return ctx->io_error->name;
125 sss_sifp_get_last_io_error_message(sss_sifp_ctx *ctx)
127 if (ctx == NULL) {
131 if (!dbus_error_is_set(ctx->io_error)) {
135 return ctx->io_error->message;
168 sss_sifp_fetch_attr(sss_sifp_ctx *ctx,
179 if (ctx == NULL || object_path == NULL || interface == NULL
204 ret = sss_sifp_send_message(ctx, msg, &reply);
209 ret = sss_sifp_parse_attr(ctx, name, reply, _attrs);
224 sss_sifp_fetch_all_attrs(sss_sifp_ctx *ctx,
234 if (ctx == NULL || object_path == NULL || interface == NULL
252 ret = sss_sifp_send_message(ctx, msg, &reply);
257 ret = sss_sifp_parse_attr_list(ctx, reply, _attrs);
272 sss_sifp_fetch_object(sss_sifp_ctx *ctx,
282 if (ctx == NULL || object_path == NULL || interface == NULL
287 ret = sss_sifp_fetch_all_attrs(ctx, object_path, interface, &attrs);
297 object = _alloc_zero(ctx, sss_sifp_object, 1);
305 object->name = sss_sifp_strdup(ctx, name);
311 object->object_path = sss_sifp_strdup(ctx, object_path);
317 object->interface = sss_sifp_strdup(ctx, interface);
329 sss_sifp_free_object(ctx, &object);
338 sss_sifp_ctx *ctx = NULL;
344 ctx = *_ctx;
346 if (ctx->conn != NULL) {
347 dbus_connection_unref(ctx->conn);
350 if (ctx->io_error != NULL) {
351 dbus_error_free(ctx->io_error);
352 _free(ctx, ctx->io_error);
355 _free(ctx, ctx);
362 sss_sifp_free_attrs(sss_sifp_ctx *ctx,
377 _free(ctx, attrs[i]->data.boolean);
380 _free(ctx, attrs[i]->data.int16);
383 _free(ctx, attrs[i]->data.uint16);
386 _free(ctx, attrs[i]->data.int32);
389 _free(ctx, attrs[i]->data.uint32);
392 _free(ctx, attrs[i]->data.int64);
395 _free(ctx, attrs[i]->data.uint64);
399 _free(ctx, attrs[i]->data.str[j]);
401 _free(ctx, attrs[i]->data.str);
410 _free(ctx, attrs[i]->name);
411 _free(ctx, attrs[i]);
414 _free(ctx, attrs);
420 sss_sifp_free_object(sss_sifp_ctx *ctx,
431 sss_sifp_free_attrs(ctx, &object->attrs);
432 _free(ctx, object->object_path);
433 _free(ctx, object->interface);
434 _free(ctx, object->name);
435 _free(ctx, object);
441 sss_sifp_free_string(sss_sifp_ctx *ctx,
448 _free(ctx, *_str);
454 sss_sifp_free_string_array(sss_sifp_ctx *ctx,
467 _free(ctx, str_array[i]);
470 _free(ctx, str_array);