/tinycbor-2.7.6/tools/json2cbor/ |
D | json2cbor.c | 66 if (reverse_alphabet[in[0]] < 0 || reverse_alphabet[in[1]] < 0) { in decode_base64_generic() 73 val |= reverse_alphabet[in[1]] << 12; in decode_base64_generic() 107 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, in decode_base64() 108 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, in decode_base64() 109 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, in decode_base64() 110 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, in decode_base64() 111 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, in decode_base64() 112 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, in decode_base64() 113 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, in decode_base64() 114 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, in decode_base64() [all …]
|
/tinycbor-2.7.6/tests/encoder/ |
D | tst_encoder.cpp | 129 return QByteArray::fromRawData(data, N - 1); in raw() 284 QCOMPARE(encoder.remaining, size_t(1)); in compare() 301 QTest::newRow("1U") << raw("\x01") << QVariant(1U); in addFixedData() 308 QTest::newRow("65536U") << raw("\x1a\0\1\x00\x00") << QVariant(65536U); in addFixedData() 310 QTest::newRow("4294967296U") << raw("\x1b\0\0\0\1\0\0\0\0") << QVariant(Q_UINT64_C(4294967296)); in addFixedData() 316 QTest::newRow("1") << raw("\x01") << QVariant(1); in addFixedData() 323 QTest::newRow("65536") << raw("\x1a\0\1\x00\x00") << QVariant(65536); in addFixedData() 325 QTest::newRow("4294967296") << raw("\x1b\0\0\0\1\0\0\0\0") << QVariant(Q_INT64_C(4294967296)); in addFixedData() 328 QTest::newRow("-1") << raw("\x20") << QVariant(-1); in addFixedData() 333 QTest::newRow("-UINT8_MAX-1") << raw("\x39\x01\x00") << QVariant(-257); in addFixedData() [all …]
|
/tinycbor-2.7.6/tests/parser/ |
D | tst_parser.cpp | 156 return QByteArray::fromRawData(data, N - 1); in raw() 175 void compareOne_real(const QByteArray &data, const QString &expected, int line, int n = -1) in compareOne_real() 238 QTest::newRow("1") << raw("\x01") << "1"; in addFixedData() 243 QTest::newRow("UINT8_MAX+1") << raw("\x19\x01\x00") << "256"; in addFixedData() 245 QTest::newRow("UINT16_MAX+1") << raw("\x1a\0\1\x00\x00") << "65536"; in addFixedData() 247 QTest::newRow("UINT32_MAX+1") << raw("\x1b\0\0\0\1\0\0\0\0") << "4294967296"; in addFixedData() 252 QTest::newRow("-1") << raw("\x20") << "-1"; in addFixedData() 257 QTest::newRow("-UINT8_MAX-1") << raw("\x39\x01\x00") << "-257"; in addFixedData() 259 QTest::newRow("-UINT16_MAX-1") << raw("\x3a\0\1\x00\x00") << "-65537"; in addFixedData() 261 QTest::newRow("-UINT32_MAX-1") << raw("\x3b\0\0\0\1\0\0\0\0") << "-4294967297"; in addFixedData() [all …]
|
/tinycbor-2.7.6/tests/tojson/ |
D | tst_tojson.cpp | 81 return QByteArray::fromRawData(data, N - 1); in raw() 94 QTest::newRow("1") << raw("\x01") << "1"; in addFixedData() 95 QTest::newRow("2^53-1") << raw("\x1b\0\x1f\xff\xff""\xff\xff\xff\xff") << "9007199254740991"; in addFixedData() 99 QTest::newRow("-1") << raw("\x20") << "-1"; in addFixedData() 101 QTest::newRow("-2^53+1") << raw("\x3b\0\x1f\xff\xff""\xff\xff\xff\xfe") << "-9007199254740991"; in addFixedData() 111 QTest::newRow("-1.f16") << raw("\xf9\xbc\x00") << "-1"; in addFixedData() 112 QTest::newRow("-1.f") << raw("\xfa\xbf\x80\0\0") << "-1"; in addFixedData() 113 QTest::newRow("-1.") << raw("\xfb\xbf\xf0\0\0\0\0\0\0") << "-1"; in addFixedData() 122 QTest::newRow("2.f^24-1") << raw("\xfa\x4b\x7f\xff\xff") << "16777215"; in addFixedData() 123 QTest::newRow("2.^53-1") << raw("\xfb\x43\x3f\xff\xff""\xff\xff\xff\xff") << "9007199254740991"; in addFixedData() [all …]
|
/tinycbor-2.7.6/examples/ |
D | simplereader.c | 15 if (fstat(fileno(f), &st) == -1) in readfile() 18 *size = fread(buf, st.st_size, 1, f); in readfile() 52 err = dumprecursive(&recursed, nestingLevel + 1); in dumprecursive() 156 if (argc == 1) { in main() 162 uint8_t *buf = readfile(argv[1], &length); in main() 165 return 1; in main() 178 return 1; in main()
|
/tinycbor-2.7.6/ |
D | .appveyor.yml | 10 set tests=1 25 if /i "%tests%"=="1" qmake CONFIG-=release CONFIG+=debug 27 if /i "%tests%"=="1" nmake -nologo -s 30 if /i "%tests%"=="1" nmake -s -nologo check
|
D | maketag.pl | 63 push @v, '1'; 65 ++$v[-1]; 74 print VERSION "#define TINYCBOR_VERSION_MINOR ", $v[1], "\n"; 80 s/^version:.*/version: $v[0].$v[1].$v[2]-build-{build}/; 91 print "Don't forget to create the docs.\n" if $v[2] == 1;
|
D | Makefile.configure | 25 @echo $(subst check-,,$@)-tested := 1 $(OUT) 27 $(CC) -xc $($(subst check-,CCFLAGS-,$@)) -o /dev/null - $(if $(V),,>/dev/null 2>&1); \ 29 echo $(subst check-,,$@)-pass := 1 $(OUT); \
|
D | Makefile | 43 BUILD_SHARED = $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) 44 BUILD_STATIC = 1 46 ifneq ($(BUILD_STATIC),1) 47 ifneq ($(BUILD_SHARED),1) 53 ifeq ($(BUILD_SHARED),1) 59 ifeq ($(BUILD_STATIC),1) 86 check_qmake = $(strip $(shell $(1) -query QT_VERSION 2>/dev/null | cut -b1)) 115 ifeq ($(system-cjson-pass),1)
|
/tinycbor-2.7.6/src/ |
D | open_memstream.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 27 #define _GNU_SOURCE 1 67 return -1; in write_to_buffer() 71 size_t newalloc = newsize + newsize / 2 + 1; // give 50% more room in write_to_buffer() 74 return -1; in write_to_buffer()
|
D | cborvalidation.c | 26 #define _BSD_SOURCE 1 29 #define _DEFAULT_SOURCE 1 32 # define __STDC_LIMIT_MACROS 1 136 <td>1</td> 246 { 1, (uint8_t)(CborIntegerType+1) }, 310 size_t bytesUsed = (size_t)(offset - it->offset - 1); in validate_number() 363 type = (CborType)(type + 1); in validate_tag() 443 int previous = -1; in validate_container() 444 int previous_end = -1; in validate_container() 476 if (previous != -1) { in validate_container() [all …]
|
D | cbortojson.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 27 #define _GNU_SOURCE 1 30 # define __STDC_LIMIT_MACROS 1 100 * representing integers numbers outside the range [-(2<sup>53</sup>)+1, 101 * 2<sup>53</sup>-1] and is not capable of representing NaN or infinite. If the 186 buffer = (uint8_t *)malloc(n * 2 + 1); in dump_bytestring_base16() 191 err = cbor_value_copy_byte_string(it, buffer + n - 1, &n, it); in dump_bytestring_base16() 197 buffer[2*i + 1] = characters[byte & 0xf]; in dump_bytestring_base16() 212 out = buffer = (uint8_t *)malloc(len + 1); in generic_dump_base64() [all …]
|
D | cborparser_dup_string.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 28 # define __STDC_LIMIT_MACROS 1 56 * number of chunks). It requires constant memory (O(1)) in addition to the 87 * number of chunks). It requires constant memory (O(1)) in addition to the
|
D | cborparser.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 28 # define __STDC_LIMIT_MACROS 1 108 * time (O(1)), do not recurse and never allocate memory (thus, stack usage is 109 * bounded and is O(1)). 144 * \li extra: partially decoded integer value (0, 1 or 2 bytes) 199 size_t bytesNeeded = descriptor < Value8Bit ? 0 : (1 << (descriptor - Value8Bit)); in preparse_value() 200 if (bytesNeeded + 1 > (size_t)(parser->end - it->offset)) in preparse_value() 226 it->extra = parser->d->get8(parser->d, it->offset + 1); in preparse_value() 250 it->extra = parser->d->get8(parser->d, it->offset + 1); in preparse_value() [all …]
|
D | cborencoder.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 28 # define __STDC_LIMIT_MACROS 1 80 * cbor_encoder_create_map(&encoder, &mapEncoder, 1); 119 * err = cbor_encoder_create_map(&encoder, &mapEncoder, 1); 150 * while (1) { 250 return append_to_buffer(encoder, &byte, 1); in append_byte_to_buffer() 262 uint8_t *bufstart = bufend - 1; in encode_number_no_update() 263 put64(buf + 1, ui); /* we probably have a bunch of zeros in the beginning */ in encode_number_no_update() 275 bufstart -= (size_t)1 << more; in encode_number_no_update() [all …]
|
D | cborencoder_close_container_checked.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 28 # define __STDC_LIMIT_MACROS 1
|
D | parsetags.pl | 52 $tags{$1}{id} = $2; 53 $tags{$1}{semantic} = $4; 55 $tags{$1}{types} = \@types; 105 $actualtype = "($actualtype+1)" if $type eq "Integer";
|
D | cborpretty.c | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 28 # define __STDC_LIMIT_MACROS 1 194 if (n < charsNeeded - 1) in utf8EscapedDump() 313 /* CBOR stores the negative number X as -1 - X in value_to_pretty() 314 * (that is, -1 is stored as 0, -2 as 1 and so forth) */ in value_to_pretty() 320 * 0xffff`ffff`ffff`ffff + 1 = in value_to_pretty()
|
D | tags.txt | 3 1;UnixTime_t;Integer;Epoch-based date/time
|
/tinycbor-2.7.6/include/tinycbor/ |
D | extract_number_p.h | 25 #define _BSD_SOURCE 1 26 #define _DEFAULT_SOURCE 1 57 *len = 1; in extract_number() 65 size_t bytesNeeded = (size_t)(1 << (additional_information - Value8Bit)); in extract_number() 68 } else if (bytesNeeded == 1) { in extract_number()
|
D | cborconstants_p.h | 34 NegativeIntegerType = 1U, 62 SmallValueMask = (1U << SmallValueBitLength) - 1, /* 31 */
|
D | cborinternal_p.h | 45 NegativeIntegerType = 1U, 73 SmallValueMask = (1U << SmallValueBitLength) - 1, /* 31 */
|
D | config.h | 39 #define CBOR_NO_FLOATING_POINT 1 44 #define CBOR_NO_HALF_FLOAT_TYPE 1
|
D | cbor.h | 49 * So -1 gets converted to size_t by adding SIZE_MAX + 1, which results in SIZE_MAX. 51 # define SIZE_MAX ((size_t)-1) 99 CborUnixTime_tTag = 1, 156 CborErrorOutOfMemory = ~0U / 2 + 1, 205 { return cbor_encode_simple_value(encoder, (int)value - 1 + (CborBooleanType & 0x1f)); } in cbor_encode_boolean() 349 *result = -*result - 1; in cbor_value_get_int64() 358 *result = -*result - 1; in cbor_value_get_int()
|
D | compilersupport_p.h | 64 # define cbor_static_assert(x) ((void)sizeof(char[2*!!(x) - 1])) 166 # define likely(x) __builtin_expect(!!(x), 1) 208 mant >>= 1; in encode_half()
|