[PATCH 0/4] lib: add jsmn JSON parser

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jan 10 00:49:26 PST 2023


Board code I have needs to read out factory data encoded into JSON blob
on EEPROM. Import JSMN, a minimal JSON parser written in C.

I don't know if the board code will be upstreamed in future, but for
now, add a selftest that exercises the API. As JSON could be useful
elsewhere as well, I think it's good to have it in-tree.

Ahmad Fatoum (4):
  lib: add jsmn JSON parser support
  lib: extend jsmn with simple JSONPath lookup helpers
  vsprintf: implement %pJP for printing JSONPaths
  test: self: add json parser test

 include/bselftest.h |   3 +-
 include/jsmn.h      | 148 ++++++++++++++
 lib/Kconfig         |   5 +
 lib/Makefile        |   1 +
 lib/jsmn.c          | 457 ++++++++++++++++++++++++++++++++++++++++++++
 lib/vsprintf.c      |  44 +++++
 test/self/Kconfig   |   5 +
 test/self/Makefile  |   1 +
 test/self/json.c    | 146 ++++++++++++++
 test/self/printf.c  |  17 ++
 10 files changed, 826 insertions(+), 1 deletion(-)
 create mode 100644 include/jsmn.h
 create mode 100644 lib/jsmn.c
 create mode 100644 test/self/json.c

-- 
2.30.2




More information about the barebox mailing list