summaryrefslogtreecommitdiff
path: root/examples/c-json-stdout/c-json-stdout.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-09-26 00:44:29 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-09-26 00:49:34 +0200
commitadce2272dc75d91b0dd3a9a5c502de99d828eca2 (patch)
tree297c12c8980e1b83471846f82858ee26329be4a2 /examples/c-json-stdout/c-json-stdout.c
parentd3bb1ccf33abf1fb1d32e848f9578bb3ae85c641 (diff)
Removed DISABLE_JSMN define for c-json-stdout (built-in per default).
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-json-stdout/c-json-stdout.c')
-rw-r--r--examples/c-json-stdout/c-json-stdout.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/examples/c-json-stdout/c-json-stdout.c b/examples/c-json-stdout/c-json-stdout.c
index 18c50a491..eb56470e7 100644
--- a/examples/c-json-stdout/c-json-stdout.c
+++ b/examples/c-json-stdout/c-json-stdout.c
@@ -8,9 +8,7 @@
#include <unistd.h>
#include "config.h"
-#ifdef USE_JSON
-#include "jsmn/jsmn.h"
-#endif
+#include "jsmn.h"
static char serv_listen_addr[INET_ADDRSTRLEN] = DISTRIBUTOR_HOST;
static uint16_t serv_listen_port = DISTRIBUTOR_PORT;
@@ -24,10 +22,8 @@ int main(void)
size_t buf_used = 0;
size_t json_start = 0;
unsigned long long int json_bytes = 0;
-#ifdef USE_JSON
jsmn_parser parser;
jsmntok_t tokens[128];
-#endif
if (sockfd < 0)
{
@@ -100,7 +96,6 @@ int main(void)
exit(1);
}
-#ifdef USE_JSON
int r;
jsmn_init(&parser);
r = jsmn_parse(&parser,
@@ -127,9 +122,6 @@ int main(void)
}
}
printf("EoF\n");
-#else
- printf("RECV[%llu,%zd]: '%.*s'\n\n", buf_wanted, bytes_read, (int)buf_wanted, buf);
-#endif
memmove(buf, buf + json_bytes, buf_used - json_bytes);
buf_used -= json_bytes;