API int iotcon_options_foreach(iotcon_options_h options,
- iotcon_options_foreach_cb cb, void *user_data)
+ iotcon_options_foreach_fn fn, void *user_data)
{
GHashTableIter iter;
gpointer key, value;
RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == fn, IOTCON_ERROR_INVALID_PARAMETER);
g_hash_table_iter_init(&iter, options->hash);
while (g_hash_table_iter_next(&iter, &key, &value)) {
- if (false == cb(GPOINTER_TO_UINT(key), value, user_data))
+ if (false == fn(GPOINTER_TO_UINT(key), value, user_data))
break;
}
return ret;
}
-API int iotcon_query_foreach(iotcon_query_h query, iotcon_query_foreach_cb cb,
+API int iotcon_query_foreach(iotcon_query_h query, iotcon_query_foreach_fn fn,
void *user_data)
{
GHashTableIter iter;
gpointer key, value;
RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == fn, IOTCON_ERROR_INVALID_PARAMETER);
g_hash_table_iter_init(&iter, query->hash);
while (g_hash_table_iter_next(&iter, &key, &value)) {
- if (false == cb(key, value, user_data))
+ if (false == fn(key, value, user_data))
break;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_repr_foreach_keys(iotcon_repr_h repr, iotcon_repr_key_fn fn,
- void *user_data)
+API int iotcon_repr_foreach(iotcon_repr_h repr, iotcon_repr_fn fn, void *user_data)
{
GHashTableIter iter;
gpointer key, value;
API int iotcon_resource_types_foreach(iotcon_resource_types_h types,
- iotcon_resource_types_foreach_cb cb, void *user_data)
+ iotcon_resource_types_foreach_fn fn, void *user_data)
{
GList *node;
RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == fn, IOTCON_ERROR_INVALID_PARAMETER);
for (node = types->type_list; node; node = node->next) {
- if (IOTCON_FUNC_STOP == cb((const char*)node->data, user_data))
+ if (IOTCON_FUNC_STOP == fn((const char*)node->data, user_data))
break;
}
FN_CALL;
int ret;
- RETVM_IF(true == icl_is_init, IOTCON_ERROR_INVALID_PARAMETER, "already initialized");
+ RETVM_IF(true == icl_is_init, IOTCON_ERROR_ALREADY, "already initialized");
#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
}
resource->handle = icl_dbus_register_resource(uri, res_types, ifaces,
- properties, cb, NULL);
+ properties, cb, user_data);
if (NULL == resource->handle) {
ERR("icl_dbus_register_resource() Fail");
free(resource);
unsigned int iotcon_repr_get_children_count(iotcon_repr_h parent);
int iotcon_repr_get_nth_child(iotcon_repr_h parent, int pos, iotcon_repr_h *child);
-typedef int (*iotcon_repr_key_fn)(iotcon_repr_h repr, const char *key, void *user_data);
-int iotcon_repr_foreach_keys(iotcon_repr_h repr, iotcon_repr_key_fn fn, void *user_data);
+typedef int (*iotcon_repr_fn)(const char *key, const char *value, void *user_data);
+int iotcon_repr_foreach(iotcon_repr_h repr, iotcon_repr_fn fn, void *user_data);
unsigned int iotcon_repr_get_keys_count(iotcon_repr_h repr);
char* iotcon_repr_generate_json(iotcon_repr_h repr);
const char *data);
int iotcon_options_delete(iotcon_options_h options, unsigned short id);
const char* iotcon_options_lookup(iotcon_options_h options, unsigned short id);
-typedef int (*iotcon_options_foreach_cb)(unsigned short id, const char *data,
+typedef int (*iotcon_options_foreach_fn)(unsigned short id, const char *data,
void *user_data);
-int iotcon_options_foreach(iotcon_options_h options, iotcon_options_foreach_cb cb,
+int iotcon_options_foreach(iotcon_options_h options, iotcon_options_foreach_fn fn,
void *user_data);
int iotcon_query_insert(iotcon_query_h query, const char *key, const char *value);
int iotcon_query_delete(iotcon_query_h query, const char *key);
const char* iotcon_query_lookup(iotcon_query_h query, const char *key);
-typedef int (*iotcon_query_foreach_cb)(const char *key, const char *value,
+typedef int (*iotcon_query_foreach_fn)(const char *key, const char *value,
void *user_data);
-int iotcon_query_foreach(iotcon_query_h query, iotcon_query_foreach_cb cb,
+int iotcon_query_foreach(iotcon_query_h query, iotcon_query_foreach_fn fn,
void *user_data);
void iotcon_resource_types_free(iotcon_resource_types_h types);
int iotcon_resource_types_insert(iotcon_resource_types_h types, const char *type);
int iotcon_resource_types_delete(iotcon_resource_types_h types, const char *type);
-typedef int (*iotcon_resource_types_foreach_cb)(const char *type, void *user_data);
+typedef int (*iotcon_resource_types_foreach_fn)(const char *type, void *user_data);
int iotcon_resource_types_foreach(iotcon_resource_types_h types,
- iotcon_resource_types_foreach_cb cb, void *user_data);
+ iotcon_resource_types_foreach_fn fn, void *user_data);
iotcon_resource_types_h iotcon_resource_types_clone(iotcon_resource_types_h types);
iotcon_repr_free(resp_repr);
}
-static int _query_cb(const char *key, const char *value, void *user_data)
+static int _query_fn(const char *key, const char *value, void *user_data)
{
INFO("key : %s", key);
INFO("value : %s", value);
return;
}
if (query)
- iotcon_query_foreach(query, _query_cb, NULL);
+ iotcon_query_foreach(query, _query_fn, NULL);
ret = iotcon_request_get_types(request, &types);
if (IOTCON_ERROR_NONE != ret) {
iotcon_repr_free(resp_repr);
}
-static int _query_foreach_cb(const char *key, const char *value, void *user_data)
+static int _query_foreach_fn(const char *key, const char *value, void *user_data)
{
char **interface_str = user_data;
return;
}
if (query)
- iotcon_query_foreach(query, _query_foreach_cb, &query_str);
+ iotcon_query_foreach(query, _query_foreach_fn, &query_str);
if (query_str && (TEST_STR_EQUAL == strcmp("oc.mi.b", query_str))) {
DBG("operation for BATCH interface");