Modify iotcon_repr_foreach()
authoryoungman <yman.jung@samsung.com>
Thu, 9 Jul 2015 04:43:33 +0000 (13:43 +0900)
committeryoungman <yman.jung@samsung.com>
Tue, 3 Nov 2015 11:06:25 +0000 (20:06 +0900)
Change-Id: If74c4db2392d5f0189038ed3e995d8fae9a6fc98
Signed-off-by: youngman <yman.jung@samsung.com>
lib/icl-repr.c
lib/include/iotcon-representation.h

index f3f211e..de103f8 100644 (file)
@@ -201,14 +201,14 @@ API int iotcon_repr_get_nth_child(iotcon_repr_h parent, int pos, iotcon_repr_h *
 API int iotcon_repr_foreach(iotcon_repr_h repr, iotcon_repr_fn fn, void *user_data)
 {
        GHashTableIter iter;
-       gpointer key, value;
+       gpointer key;
 
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == fn, IOTCON_ERROR_INVALID_PARAMETER);
 
        g_hash_table_iter_init(&iter, repr->hash_table);
-       while (g_hash_table_iter_next(&iter, &key, &value)) {
-               if (IOTCON_FUNC_STOP == fn(key, value, user_data))
+       while (g_hash_table_iter_next(&iter, &key, NULL)) {
+               if (IOTCON_FUNC_STOP == fn(repr, key, user_data))
                        break;
        }
 
index 0218a0f..9d9d174 100644 (file)
@@ -108,7 +108,7 @@ int iotcon_repr_foreach_children(iotcon_repr_h parent, iotcon_children_fn fn,
 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_fn)(const char *key, const char *value, void *user_data);
+typedef int (*iotcon_repr_fn)(iotcon_repr_h repr, const char *key, 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);