Skip to content

Commit f386de6

Browse files
committed
Merge pull request #1659 from Kijewski/ubjson
sys: add Universal Binary JSON module (UBJSON)
2 parents 4cf0fd6 + 6b559fa commit f386de6

File tree

11 files changed

+1654
-0
lines changed

11 files changed

+1654
-0
lines changed

sys/include/ubjson.h

Lines changed: 585 additions & 0 deletions
Large diffs are not rendered by default.

sys/ubjson/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(RIOTBASE)/Makefile.base

sys/ubjson/ubjson-internal.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright (C) 2014 René Kijewski <[email protected]>
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef UBJSON__INTERNAL_H__
20+
#define UBJSON__INTERNAL_H__
21+
22+
/* compare http://ubjson.org/type-reference/ */
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
typedef enum {
29+
UBJSON_MARKER_NULL = 'Z',
30+
UBJSON_MARKER_NOOP = 'N',
31+
32+
UBJSON_MARKER_TRUE = 'T',
33+
UBJSON_MARKER_FALSE = 'F',
34+
35+
UBJSON_MARKER_INT8 = 'i',
36+
UBJSON_MARKER_UINT8 = 'U',
37+
UBJSON_MARKER_INT16 = 'I',
38+
UBJSON_MARKER_INT32 = 'l',
39+
UBJSON_MARKER_INT64 = 'L',
40+
41+
UBJSON_MARKER_FLOAT32 = 'd',
42+
UBJSON_MARKER_FLOAT64 = 'D',
43+
UBJSON_MARKER_HP_NUMBER = 'H',
44+
45+
UBJSON_MARKER_CHAR = 'C',
46+
UBJSON_MARKER_STRING = 'S',
47+
48+
UBJSON_MARKER_ARRAY_START = '[',
49+
UBJSON_MARKER_ARRAY_END = ']',
50+
51+
UBJSON_MARKER_OBJECT_START = '{',
52+
UBJSON_MARKER_OBJECT_END = '}',
53+
54+
UBJSON_MARKER_COUNT = '#',
55+
UBJSON_MARKER_TYPE = '$',
56+
} ubjson_marker_t;
57+
58+
#ifdef __cplusplus
59+
}
60+
#endif
61+
62+
#endif /* ifndef UBJSON__INTERNAL_H__ */

0 commit comments

Comments
 (0)