- missed file; bugfix
authorMartin Schanzenbach <mschanzenbach@posteo.de>
Mon, 2 May 2016 16:45:26 +0000 (16:45 +0000)
committerMartin Schanzenbach <mschanzenbach@posteo.de>
Mon, 2 May 2016 16:45:26 +0000 (16:45 +0000)
configure.ac
src/jsonapi/jsonapi.c

index 369ad99ee447e4be4aecf7e800a46b01f9a8f41f..e89f7befbb14035d0bdc863ff5d9665bf717d094 100644 (file)
@@ -1558,6 +1558,7 @@ src/identity/identity.conf
 src/include/Makefile
 src/integration-tests/Makefile
 src/json/Makefile
+src/jsonapi/Makefile
 src/hostlist/Makefile
 src/multicast/Makefile
 src/multicast/multicast.conf
index 7bc4c05e5d8ee161c68d0e07da9c183fb0ebcecd..6bd03e0ec8a1c9654fa69bf504bee3ee8f060cbe 100644 (file)
 #include "platform.h"
 #include "gnunet_json_lib.h"
 
-#define GNUNET_JSONAPI_JSONAPI_KEY_DATA "data"
+#define GNUNET_JSONAPI_KEY_DATA "data"
 
-#define GNUNET_JSONAPI_JSONAPI_KEY_ID "id"
+#define GNUNET_JSONAPI_KEY_ID "id"
 
-#define GNUNET_JSONAPI_JSONAPI_KEY_TYPE "type"
+#define GNUNET_JSONAPI_KEY_TYPE "type"
 
 struct GNUNET_JSONAPI_Resource
 {
@@ -93,8 +93,8 @@ GNUNET_JSONAPI_resource_new (const char *type, const char *id)
 
   res->res_obj = json_object ();
 
-  json_object_set_new (res->res_obj, GNUNET_JSONAPI_JSONAPI_KEY_ID, json_string (id));
-  json_object_set_new (res->res_obj, GNUNET_JSONAPI_JSONAPI_KEY_TYPE, json_string (type));
+  json_object_set_new (res->res_obj, GNUNET_JSONAPI_KEY_ID, json_string (id));
+  json_object_set_new (res->res_obj, GNUNET_JSONAPI_KEY_TYPE, json_string (type));
 
   return res;
 }
@@ -172,7 +172,7 @@ int
 GNUNET_JSONAPI_resource_check_id (const struct GNUNET_JSONAPI_Resource *resource,
                                        const char* id)
 {
-  return check_resource_attr_str (resource, GNUNET_JSONAPI_JSONAPI_KEY_ID, id);
+  return check_resource_attr_str (resource, GNUNET_JSONAPI_KEY_ID, id);
 }
 
 /**
@@ -184,7 +184,7 @@ GNUNET_JSONAPI_resource_check_id (const struct GNUNET_JSONAPI_Resource *resource
 json_t*
 GNUNET_JSONAPI_resource_get_id (const struct GNUNET_JSONAPI_Resource *resource)
 {
-  return GNUNET_JSONAPI_resource_read_attr (resource, GNUNET_JSONAPI_JSONAPI_KEY_ID);
+  return GNUNET_JSONAPI_resource_read_attr (resource, GNUNET_JSONAPI_KEY_ID);
 }
 
 /**
@@ -198,7 +198,7 @@ int
 GNUNET_JSONAPI_resource_check_type (const struct GNUNET_JSONAPI_Resource *resource,
                                          const char* type)
 {
-  return check_resource_attr_str (resource, GNUNET_JSONAPI_JSONAPI_KEY_TYPE, type);
+  return check_resource_attr_str (resource, GNUNET_JSONAPI_KEY_TYPE, type);
 }
 
 /**
@@ -285,7 +285,7 @@ GNUNET_JSONAPI_object_delete (struct GNUNET_JSONAPI_Object *resp)
  * @return a new JSON API resource or NULL on error.
  */
 struct GNUNET_JSONAPI_Object*
-GNUNET_JSONAPI_jsonapi_object_new ()
+GNUNET_JSONAPI_object_new ()
 {
   struct GNUNET_JSONAPI_Object *result;
 
@@ -320,7 +320,7 @@ add_json_resource (struct GNUNET_JSONAPI_Object *obj,
   const char *type_json;
 
   struct GNUNET_JSON_Specification dspec[] = {
-    GNUNET_JSON_spec_string (GNUNET_JSONAPI_JSONAPI_KEY_TYPE, &type_json),
+    GNUNET_JSON_spec_string (GNUNET_JSONAPI_KEY_TYPE, &type_json),
     GNUNET_JSON_spec_end()
   };
 
@@ -354,7 +354,7 @@ parse_jsonapiobject (void *cls,
   int i;
 
   struct GNUNET_JSON_Specification jsonapispec[] = {
-    GNUNET_JSON_spec_json (GNUNET_JSONAPI_JSONAPI_KEY_DATA, &data_json),
+    GNUNET_JSON_spec_json (GNUNET_JSONAPI_KEY_DATA, &data_json),
     GNUNET_JSON_spec_end()
   };
   if (GNUNET_OK !=
@@ -448,7 +448,7 @@ GNUNET_JSONAPI_data_serialize (const struct GNUNET_JSONAPI_Object *resp,
   {
     json_array_append (res_arr, res->res_obj);
   }
-  json_object_set (root_json, GNUNET_JSONAPI_JSONAPI_KEY_DATA, res_arr);
+  json_object_set (root_json, GNUNET_JSONAPI_KEY_DATA, res_arr);
   *result = json_dumps (root_json, JSON_INDENT(2));
   json_decref (root_json);
   json_decref (res_arr);