Skip to content

Commit b4c2d93

Browse files
vrahanecarlescufi
authored andcommitted
ext: lib: tinycbor: Add tinyCBOR as an ext lib
The TinyCBOR library is a small Concise Binary Object Representation (CBOR) encoder and decoder library, optimized for very fast operation with very small footprint. Origin: TinyCBOR License: MIT URL: https://github.com/intel/tinycbor Version: 0.5.0-beta1 commit: 497066ee87dd54341adaa1195bf15ad11ee33b20 Purpose: Introduction of TinyCBOR Maintained-by: External Signed-off-by: Vipul Rahane <[email protected]>
1 parent 41db766 commit b4c2d93

24 files changed

+6024
-0
lines changed

ext/lib/encoding/tinycbor/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Intel Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

ext/lib/encoding/tinycbor/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Concise Binary Object Representation (CBOR) Library
2+
---------------------------------------------------
3+
4+
To build TinyCBOR:
5+
6+
make
7+
8+
If you want to change the compiler or pass extra compiler flags:
9+
10+
make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"
11+
12+
Documentation: https://intel.github.io/tinycbor/current/
13+

ext/lib/encoding/tinycbor/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.5
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/****************************************************************************
2+
**
3+
** Copyright (C) 2016 Intel Corporation
4+
**
5+
** Permission is hereby granted, free of charge, to any person obtaining a copy
6+
** of this software and associated documentation files (the "Software"), to deal
7+
** in the Software without restriction, including without limitation the rights
8+
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
** copies of the Software, and to permit persons to whom the Software is
10+
** furnished to do so, subject to the following conditions:
11+
**
12+
** The above copyright notice and this permission notice shall be included in
13+
** all copies or substantial portions of the Software.
14+
**
15+
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
** THE SOFTWARE.
22+
**
23+
****************************************************************************/
24+
25+
/**
26+
* \mainpage
27+
* The TinyCBOR $(VERSION) library is a small CBOR encoder and decoder library,
28+
* optimized for very fast operation with very small footprint. The main encoder
29+
* and decoder functions do not allocate memory.
30+
*
31+
* TinyCBOR is divided into the following groups of functions and structures:
32+
* - \ref CborGlobals
33+
* - \ref CborEncoding
34+
* - \ref CborParsing
35+
* - \ref CborPretty
36+
* - \ref CborToJson
37+
*/
38+
39+
/**
40+
* \file <cbor.h>
41+
* The <cbor.h> is the main header in TinyCBOR and defines the constants used by most functions
42+
* as well as the structures for encoding (CborEncoder) and decoding (CborValue).
43+
*
44+
* \sa <cborjson.h>
45+
*/
46+
47+
/**
48+
* \file <cborjson.h>
49+
* The <cborjson.h> file contains the routines that are used to convert a CBOR
50+
* data stream into JSON.
51+
*
52+
* \sa <cbor.h>
53+
*/
54+
55+
/**
56+
* \defgroup CborGlobals Global constants
57+
* \brief Constants used by all TinyCBOR function groups.
58+
*/
59+
60+
/**
61+
* \addtogroup CborGlobals
62+
* @{
63+
*/
64+
65+
/**
66+
* \var size_t CborIndefiniteLength
67+
*
68+
* This variable is a constant used to indicate that the length of the map or
69+
* array is not yet determined. It is used in functions
70+
* cbor_encoder_create_map() and cbor_encoder_create_array()
71+
*/
72+
73+
/**
74+
* \enum CborType
75+
* The CborType enum contains the types known to TinyCBOR.
76+
*
77+
* \value CborIntegerType Type is an integer value, positive, negative or zero
78+
* \value CborByteStringType Type is a string of arbitrary raw bytes
79+
* \value CborTextStringType Type is a text string encoded in UTF-8
80+
* \value CborArrayType Type is a CBOR array
81+
* \value CborMapType Type is a CBOR map (an associative container with key and value pairs)
82+
* \value CborTagType Type is a CBOR tag (a 64-bit integer describing the item that follows, see CborKnownTags)
83+
* \value CborSimpleType Type is one of CBOR Simple Types
84+
* \value CborBooleanType Type is a boolean (true or false)
85+
* \value CborNullType Type encodes a null
86+
* \value CborUndefinedType Type encodes an undefined value
87+
* \value CborHalfFloatType Type is an IEEE 754 half precision (16-bit) floating point type
88+
* \value CborFloatType Type is an IEEE 754 single precision (32-bit) floating point type
89+
* \value CborDoubleType Type is an IEEE 754 double precision (64-bit) floating point type
90+
* \value CborInvalidType Type is not valid (this value is used to indicate error conditions)
91+
*/
92+
93+
/**
94+
* \enum CborKnownTags
95+
* The CborKnownTags enum contains known tags specified in RFC 7049, for use by the application.
96+
* TinyCBOR does not usually interpret the meaning of these tags and does not add them to the
97+
* output stream, unless specifically instructed to do so in functions for that effect.
98+
*
99+
* \value CborDateTimeStringTag Text string contains a date-time encoded in RFC 3339 format, "YYYY-MM-DD hh:mm:ss+zzzz"
100+
* \value CborUnixTime_tTag Number is a Unix time_t quantity, the number of seconds since 1970-01-01 midnight UTC
101+
* \value CborPositiveBignumTag Item is a CBOR byte string encoding a positive integer of arbitrary precision
102+
* \value CborNegativeBignumTag Item is a CBOR byte string encoding a negative integer of arbitrary precision
103+
* \value CborDecimalTag Item is a CBOR array of two integers encoding a fixed-point decimal
104+
* \value CborBigfloatTag Item is a bigfloat
105+
* \value CborExpectedBase64urlTag Item is a CBOR byte string that is expected to be encoded as Base64Url
106+
* \value CborExpectedBase64Tag Item is a CBOR byte string that is expected to be encoded as Base64
107+
* \value CborExpectedBase16Tag Item is a CBOR byte string that is expected to be encoded as Base16 (also known as "hexdump")
108+
* \value CborUriTag Item is a CBOR text string containing an URI (RFC 3986) or IRI (RFC 3987)
109+
* \value CborBase64urlTag Item is a CBOR text string that was encoded as Base64Url
110+
* \value CborBase64Tag Item is a CBOR text string that was encoded as Base64
111+
* \value CborRegularExpressionTag Item is a CBOR text string containing a regular expression
112+
* \value CborMimeMessageTag Item is a CBOR text string containing a MIME message (RFC 2045, 2046, 2047, 2822)
113+
* \value CborSignatureTag Item contains CBOR-encoded data.
114+
* This tag is also used as "file magic," marking a file as containing CBOR
115+
*/
116+
117+
/**
118+
* \typedef CborTag
119+
* This typedef is an unsigned 64-bit integer. Known CBOR tags can be used from the CborKnownTags enum
120+
* but the user application may use other tag values than the ones specified in RFC 7049.
121+
*/
122+
123+
/** @} */

0 commit comments

Comments
 (0)