86 int retval = amxd_status_unknown_error;
87 amxc_var_t* args = NULL;
88 amxc_string_t full_path;
89 amxd_object_t* root = amxd_dm_get_root(
bus_ctx->
dm);
91 amxc_string_init(&full_path, 0);
93 amxc_var_set_type(args, AMXC_VAR_ID_HTABLE);
95 if(search_path != NULL) {
96 amxc_var_add_key(cstring_t, args,
"rel_path", search_path);
98 amxc_var_add_key(int32_t, args,
"depth", depth);
102 when_failed(retval, exit);
103 retval =
amxb_invoke(invoke_ctx, args, ret, NULL, NULL, timeout);
104 when_true(!islocal, exit);
105 when_true(retval == 0, exit);
107 amxc_string_setf(&full_path,
"%s%s",
object, search_path);
108 if(amxd_object_is_supported(root, amxc_string_get(&full_path, 0))) {
109 amxc_var_set_type(ret, AMXC_VAR_ID_LIST);
110 amxc_var_add(amxc_htable_t, ret, NULL);
111 retval = amxd_status_ok;
115 amxc_string_clean(&full_path);
116 amxc_var_delete(&args);
int amxb_new_invoke(amxb_invoke_t **invoke_ctx, amxb_bus_ctx_t *const ctx, const char *object, const char *interface, const char *method)
Prepares a remote function invocation.
void amxb_free_invoke(amxb_invoke_t **invoke_ctx)
Deletes a function invoke context, and frees allocated memory.
int amxb_invoke(amxb_invoke_t *invoke_ctx, amxc_var_t *args, amxc_var_t *ret, amxb_be_cb_fn_t fn, void *priv, int timeout)
Invokes a remote function, as defined by the function invoke context.
static amxb_bus_ctx_t * bus_ctx