]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: require json-c 5130/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 11 Oct 2019 16:15:38 +0000 (16:15 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 11 Oct 2019 16:16:37 +0000 (16:16 +0000)
We have unsigned 4 byte integrals in the codebase that end up in json
output, so we need to force a json library that can handle these.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/json.c
lib/json.h

index efc3794040aad4f49af50747a9c28c09e09dc37c..991240639a7d898d568eb7014193a53b323a923f 100644 (file)
@@ -47,11 +47,7 @@ void json_object_string_add(struct json_object *obj, const char *key,
 
 void json_object_int_add(struct json_object *obj, const char *key, int64_t i)
 {
-#if defined(HAVE_JSON_C_JSON_H)
        json_object_object_add(obj, key, json_object_new_int64(i));
-#else
-       json_object_object_add(obj, key, json_object_new_int((int)i));
-#endif
 }
 
 void json_object_boolean_false_add(struct json_object *obj, const char *key)
@@ -78,16 +74,3 @@ void json_object_free(struct json_object *obj)
 {
        json_object_put(obj);
 }
-
-#if !defined(HAVE_JSON_C_JSON_H)
-int json_object_object_get_ex(struct json_object *obj, const char *key,
-                             struct json_object **value)
-{
-       *value = json_object_object_get(obj, key);
-
-       if (*value)
-               return 1;
-
-       return 0;
-}
-#endif
index c4d566b3189c8059af6cfe7a01f3537513feed80..c8866c524acfa13f1b0d9362b95fd90f8dc39faa 100644 (file)
@@ -25,7 +25,7 @@
 extern "C" {
 #endif
 
-#if defined(HAVE_JSON_C_JSON_H)
+#include "command.h"
 #include <json-c/json.h>
 
 /*
@@ -41,21 +41,6 @@ extern "C" {
             json_object_iter_equal(&(joi), &(join)) == 0;                     \
             json_object_iter_next(&(joi)))
 
-#else
-#include <json/json.h>
-
-/*
- * json_object_to_json_string_ext is only available for json-c
- * so let's just turn it back to the original usage.
- */
-#define json_object_to_json_string_ext(A, B) json_object_to_json_string (A)
-
-extern int json_object_object_get_ex(struct json_object *obj, const char *key,
-                                    struct json_object **value);
-#endif
-
-#include "command.h"
-
 extern bool use_json(const int argc, struct cmd_token *argv[]);
 extern void json_object_string_add(struct json_object *obj, const char *key,
                                   const char *s);