From 04ce678969ab4e9e86f945f2c3f9920eac9faf8d Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Wed, 14 Jun 2023 19:52:10 +0100 Subject: [PATCH] iwym: json.h --- include/json.h | 6 ------ include/n2n.h | 2 -- src/json.c | 2 ++ tools/n2n-portfwd.c | 3 ++- tools/n2n-route.c | 3 ++- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/json.h b/include/json.h index aabdbb1..585a7bf 100644 --- a/include/json.h +++ b/include/json.h @@ -27,17 +27,11 @@ #define JSON_H -#include -#include - #define json_str_is_whitespace(x) x == '\r' || x == '\n' || x == '\t' || x == ' ' #define json_str_is_numeral(x) (x >= '0' && x <= '9') || x == 'e' || x == 'E' \ || x == '.' || x == '+' || x == '-' #define json_str_remove_whitespace_calc_offset(x, y) while(json_str_is_whitespace(*x)) { x++; y++; } -struct _jsonobject; -struct _jsonpair; -union _jsonvalue; typedef enum { JSON_STRING = 0, diff --git a/include/n2n.h b/include/n2n.h index 8c52927..bab521a 100644 --- a/include/n2n.h +++ b/include/n2n.h @@ -151,8 +151,6 @@ #include "n2n_port_mapping.h" -#include "json.h" - /* ************************************** */ #include "tf.h" diff --git a/src/json.c b/src/json.c index d048b36..1aaab41 100644 --- a/src/json.c +++ b/src/json.c @@ -23,6 +23,8 @@ // https://github.com/forkachild/C-Simple-JSON-Parser/issues/3#issuecomment-1073520808 +#include // for malloc, free, NULL, atof, realloc +#include // for memcpy #include "json.h" diff --git a/tools/n2n-portfwd.c b/tools/n2n-portfwd.c index b06e6e4..6bfba95 100644 --- a/tools/n2n-portfwd.c +++ b/tools/n2n-portfwd.c @@ -17,7 +17,8 @@ */ -#include "n2n.h" +#include "json.h" // for _jsonpair, json_object_t, json_free +#include "n2n.h" // for traceEvent, setTraceLevel, getTraceLevel #define WITH_PORT 1 diff --git a/tools/n2n-route.c b/tools/n2n-route.c index 4740f9a..3cd0880 100644 --- a/tools/n2n-route.c +++ b/tools/n2n-route.c @@ -17,7 +17,8 @@ */ -#include "n2n.h" +#include "json.h" // for _jsonpair, json_object_t, _jsonvalue +#include "n2n.h" // for inaddrtoa, traceEvent, TRACE_WARNING #if defined (__linux__) || defined(WIN32) /* currently, Linux and Windows only */