Skip to content

Commit 04f142c

Browse files
lpereiraAnas Nashif
authored andcommitted
lib: Add minimal JSON library
This is a minimal JSON parser (and string encoder helper). This has been originally written for the NATS client sample project, but since it's a generic bit of code, it's also being provided as a library outside the NATS application source. It's limited (no support for arrays, nested objects, only integer numbers, etc), but it is sufficient for the NATS protocol to work. Jira: ZEP-1012 Change-Id: Ibfe64aa1884e8763576ec5862f77e81b4fd54b69 Signed-off-by: Leandro Pereira <[email protected]>
1 parent 6352fc9 commit 04f142c

File tree

6 files changed

+698
-0
lines changed

6 files changed

+698
-0
lines changed

lib/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
obj-y += libc/
2+
3+
obj-$(CONFIG_JSON_LIBRARY) += json/

lib/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ source "lib/crypto/tinycrypt/Kconfig"
1010
endmenu
1111

1212
source "lib/libc/Kconfig"
13+
14+
source "lib/json/Kconfig"

lib/json/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Kconfig - JSON library
2+
3+
#
4+
# Copyright (c) 2016 Intel Corporation
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
menu "Additional libraries"
10+
11+
config JSON_LIBRARY
12+
bool
13+
default N
14+
prompt "Build JSON library"
15+
help
16+
Build a minimal JSON parsing/encoding library. Used by sample
17+
applications such as the NATS client.
18+
19+
endmenu

lib/json/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_JSON_LIBRARY) = json.o

0 commit comments

Comments
 (0)