mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 0/4] lib: add jsmn JSON parser
Date: Tue, 10 Jan 2023 09:49:26 +0100	[thread overview]
Message-ID: <20230110084930.3439001-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2023-01-10  8:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10  8:49 Ahmad Fatoum [this message]
2023-01-10  8:49 ` [PATCH 1/4] lib: add jsmn JSON parser support Ahmad Fatoum
2023-01-10  8:49 ` [PATCH 2/4] lib: extend jsmn with simple JSONPath lookup helpers Ahmad Fatoum
2023-01-10  8:49 ` [PATCH 3/4] vsprintf: implement %pJP for printing JSONPaths Ahmad Fatoum
2023-01-10  8:49 ` [PATCH 4/4] test: self: add json parser test Ahmad Fatoum
2023-01-10 15:10 ` [PATCH 0/4] lib: add jsmn JSON parser Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230110084930.3439001-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox