summaryrefslogtreecommitdiff
path: root/wsutil/wsjsmn.c
diff options
context:
space:
mode:
Diffstat (limited to 'wsutil/wsjsmn.c')
-rw-r--r--wsutil/wsjsmn.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/wsutil/wsjsmn.c b/wsutil/wsjsmn.c
index e18bd45a4e..949b983efc 100644
--- a/wsutil/wsjsmn.c
+++ b/wsutil/wsjsmn.c
@@ -23,6 +23,8 @@
*/
#include "wsjsmn.h"
+
+#include <string.h>
#include <wsutil/jsmn.h>
#include "log.h"
@@ -66,6 +68,14 @@ gboolean jsmn_is_json(const guint8* buf, const size_t len)
return ret;
}
+int wsjsmn_parse(const char *buf, jsmntok_t *tokens, unsigned int max_tokens)
+{
+ jsmn_parser p;
+
+ jsmn_init(&p);
+ return jsmn_parse(&p, buf, strlen(buf), tokens, max_tokens);
+}
+
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*