Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4509c99
Update version number for TinyCBOR 0.6
thiagomacieira Dec 24, 2017
3c4c103
One more place to update the version number in
thiagomacieira Feb 1, 2018
edd2b9e
Revert "Parser: remove the cbor_value_get_xxxx_string_chunk() API"
thiagomacieira Jan 27, 2018
c3c0f7e
Merge branch 'master' into dev
thiagomacieira Feb 6, 2018
d87c786
Validator: simplify (and correct) the map sorting verification
thiagomacieira Dec 18, 2017
573e5a4
Merge branch 'master' into dev
thiagomacieira Mar 31, 2018
666beac
Merge remote-tracking branch 'origin/master' into dev
thiagomacieira May 9, 2018
4e50bef
Merge branch 'master' into dev
thiagomacieira Jul 8, 2018
aa37315
Add a way to disable the declaration of some API
thiagomacieira Jul 1, 2018
dd2fa30
Merge branch 'master' into dev
thiagomacieira Aug 14, 2018
b0840db
Merge branch 'master' into 'dev'
thiagomacieira Sep 9, 2018
f1db0ab
enhancement #149 implemented: access half-precision floating point da…
phirsov Jan 21, 2019
6643c17
Merge branch 'master' into dev
thiagomacieira Mar 15, 2019
e52b1d5
Tests: Catch an earlier QCOMPARE failure in compare()
thiagomacieira Apr 4, 2019
9a13e92
Merge remote-tracking branch 'origin/master' into dev
thiagomacieira Apr 4, 2019
7dce551
Merge branch 'master' into dev
thiagomacieira Jan 13, 2021
dbf8f13
Update references of 'master' to 'main'
thiagomacieira Sep 3, 2021
cb37252
Update version number for TinyCBOR 0.6
thiagomacieira Dec 24, 2017
814ec02
enhancement #149 implemented: access half-precision floating point da…
phirsov Jan 21, 2019
9ed9d03
Update the qmake buildsystem source files
thiagomacieira Sep 3, 2021
5910b7d
Merge remote-tracking branch 'origin/main' into HEAD
thiagomacieira Sep 3, 2021
e2a4ed1
Build system: Add a few -Werror for sane C development
thiagomacieira Sep 3, 2021
bf919a2
AppVeyor: update to use more recent Qt and MSVC
thiagomacieira Sep 3, 2021
f798bc0
Validator: simplify (and correct) the map sorting verification
thiagomacieira Dec 18, 2017
6f001e6
Add a way to disable the declaration of some API
thiagomacieira Jul 1, 2018
2d8e73b
Tests: Catch an earlier QCOMPARE failure in compare()
thiagomacieira Apr 4, 2019
5521ccf
Parser: centralize checking of the available buffer size
thiagomacieira Dec 18, 2017
b8ea2eb
Parser: create a function that centralizes reading from the buffer
thiagomacieira Dec 18, 2017
14299a2
Parser: Save the fact that we found a 64-bit number
thiagomacieira Dec 20, 2017
0b4f7f6
Parser: inline the cbor_value_get_half_float() function
thiagomacieira Dec 22, 2017
a8515c4
Parser: use read_bytes() in the extract_number function
thiagomacieira Dec 18, 2017
eddbf5b
Parser: rework the two extract_{number,length} internal functions
thiagomacieira Dec 18, 2017
5d871b2
Validator & Pretty: Remove the last uses of _cbor_value_extract_number
thiagomacieira Dec 18, 2017
d503c11
Pretty & Validation: remove the last direct accesses to CborValue::ptr
thiagomacieira Dec 18, 2017
95129b8
Parser: let cbor_value_leave_container() consume the Break
thiagomacieira Jan 24, 2018
34c8452
WIP Initial API for delegated streaming in
thiagomacieira Dec 18, 2017
e26ff9a
WIP Initial API for delegated streaming out
thiagomacieira Dec 17, 2017
87a7a93
Move the testdata out to a separate .cpp so they can be reused
thiagomacieira Dec 17, 2017
5159ec3
Parser: add a way to parse the current element again
thiagomacieira Dec 22, 2017
8adc3cf
Parser: modify the zero-copy string API
thiagomacieira Feb 6, 2018
d393c16
Parser: fix reading it->extra on big endian when bytesNeeded == 1
mitya57 Apr 11, 2019
10f7399
.gitignore: ignore the c90 test too
thiagomacieira Sep 3, 2021
c223ee6
add CMake support
danewalton-msft Feb 9, 2021
b422a41
update to evaluate lib finding at compile time
danewalton-msft Feb 10, 2021
9ded7dc
remove test cbor
danewalton-msft Sep 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
version: 0.5.4-build-{build}
version: 0.6-build-{build}
pull_requests:
do_not_increment_build_number: true
image:
- Visual Studio 2015
- Visual Studio 2017
- Visual Studio 2019
install:
- cmd: >-
set tests=1
if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86) & (set QTDIR=C:\Qt\5.13\msvc2017)

if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86) & (set QTDIR=C:\Qt\5.9\msvc2015)

if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\5.12\msvc2017_64)

if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\5.15\msvc2019_64) & set CFLAGS=/arch:AVX2
if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" (call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\6.1\msvc2019_64)

set path=%PATH%;%QTDIR%\bin
build_script:
- cmd: >-
nmake -f Makefile.nmake -nologo CFLAGS="%CFLAGS% -W3 -Os -MDd"
nmake -f Makefile.nmake -nologo CFLAGS="-W3 -Os -MDd"

cd tests

if /i "%tests%"=="1" qmake CONFIG-=release CONFIG+=debug
qmake CONFIG-=release CONFIG+=debug

if /i "%tests%"=="1" nmake -nologo -s
nmake -nologo -s
test_script:
- cmd: >-
if /i "%tests%"=="1" nmake -s -nologo TESTARGS=-silent check

if /i "%tests%"=="0" echo Tests skipped.
nmake -s -nologo TESTARGS=-silent check
artifacts:
- path: lib\tinycbor.lib
deploy: off
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ src/cjson
src/doxygen.log
!/Makefile
.config
build/
.vscode/
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ env:
- BUILD_DOCS=false
jobs:
include:
- # only build docs on master
if: branch = master
- # only build docs on main
if: branch = main
env: BUILD_DOCS=true

language: cpp
Expand Down Expand Up @@ -75,7 +75,7 @@ script:
- make -s -f Makefile.configure configure | tee .config
- make -k
CFLAGS="$CFLAGS -march=native -g1 -Wall -Wextra -Werror"
CPPFLAGS="-DNDEBUG"
CPPFLAGS="-DNDEBUG -DCBOR_ENCODER_WRITER_CONTROL=-1 -DCBOR_PARSER_READER_CONTROL=-1"
lib/libtinycbor.a
- size lib/libtinycbor.a | tee sizes
- make -s clean
Expand Down
55 changes: 55 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# /****************************************************************************
# **
# ** Copyright (C) 2015 Intel Corporation
# **
# ** Permission is hereby granted, free of charge, to any person obtaining a copy
# ** of this software and associated documentation files (the "Software"), to deal
# ** in the Software without restriction, including without limitation the rights
# ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# ** copies of the Software, and to permit persons to whom the Software is
# ** furnished to do so, subject to the following conditions:
# **
# ** The above copyright notice and this permission notice shall be included in
# ** all copies or substantial portions of the Software.
# **
# ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# ** THE SOFTWARE.
# **
# ****************************************************************************/

project(intel_tinycbor LANGUAGES C)

cmake_minimum_required(VERSION 3.10)

option(build_tools "Build the cbor tools. Note: This will install the cjson library as a dependency" OFF)

add_library(tinycbor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File listing has changed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the .c files should be there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are new files in the 0.6 release. That's what needs updating here.

${CMAKE_CURRENT_LIST_DIR}/src/cborencoder.c
${CMAKE_CURRENT_LIST_DIR}/src/cborencoder_close_container_checked.c
${CMAKE_CURRENT_LIST_DIR}/src/cborerrorstrings.c
${CMAKE_CURRENT_LIST_DIR}/src/cborparser.c
${CMAKE_CURRENT_LIST_DIR}/src/cborparser_dup_string.c
${CMAKE_CURRENT_LIST_DIR}/src/cborpretty.c
${CMAKE_CURRENT_LIST_DIR}/src/cborpretty_stdio.c
${CMAKE_CURRENT_LIST_DIR}/src/cbortojson.c
${CMAKE_CURRENT_LIST_DIR}/src/cborvalidation.c
${CMAKE_CURRENT_LIST_DIR}/src/open_memstream.c
)

target_include_directories(tinycbor
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src
)

add_library(intel::tinycbor ALIAS tinycbor)

add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/examples)

if(${build_tools})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tools)
endif()
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ TINYCBOR_FREESTANDING_SOURCES = \
src/cborerrorstrings.c \
src/cborencoder.c \
src/cborencoder_close_container_checked.c \
src/cborencoder_float.c \
src/cborparser.c \
src/cborparser_float.c \
src/cborpretty.c \
#
CBORDUMP_SOURCES = tools/cbordump/cbordump.c
Expand Down Expand Up @@ -234,7 +236,10 @@ tag: distcheck
.SECONDARY:

cflags := $(CPPFLAGS) -I$(SRCDIR)src
cflags += -std=gnu99 $(CFLAGS)
cflags += -std=gnu99 $(CFLAGS) \
-Werror=incompatible-pointer-types \
-Werror=implicit-function-declaration \
-Werror=int-conversion
%.o: %.c
@test -d $(@D) || $(MKDIR) $(@D)
$(CC) $(cflags) $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<
Expand Down
4 changes: 4 additions & 0 deletions Makefile.nmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ TINYCBOR_SOURCES = \
src\cborerrorstrings.c \
src\cborencoder.c \
src\cborencoder_close_container_checked.c \
src\cborencoder_float.c \
src\cborparser.c \
src\cborparser_dup_string.c \
src\cborparser_float.c \
src\cborpretty.c \
src\cborpretty_stdio.c \
src\cborvalidation.c
TINYCBOR_OBJS = \
src\cborerrorstrings.obj \
src\cborencoder.obj \
src\cborencoder_close_container_checked.obj \
src\cborencoder_float.obj \
src\cborparser.obj \
src\cborparser_dup_string.obj \
src\cborparser_float.obj \
src\cborpretty.obj \
src\cborpretty_stdio.obj \
src\cborvalidation.obj
Expand Down
18 changes: 15 additions & 3 deletions README → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ Concise Binary Object Representation (CBOR) Library

To build TinyCBOR:

make
```bash
make
```

If you want to change the compiler or pass extra compiler flags:

make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"
```bash
make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"
```

Documentation: https://intel.github.io/tinycbor/current/
You may also use CMake to build and integrate with your project:

```bash
mkdir build
cd build
cmake ..
cmake --build .
```

Documentation: https://intel.github.io/tinycbor/current/
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.4
0.6.0
34 changes: 34 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# /****************************************************************************
# **
# ** Copyright (C) 2015 Intel Corporation
# **
# ** Permission is hereby granted, free of charge, to any person obtaining a copy
# ** of this software and associated documentation files (the "Software"), to deal
# ** in the Software without restriction, including without limitation the rights
# ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# ** copies of the Software, and to permit persons to whom the Software is
# ** furnished to do so, subject to the following conditions:
# **
# ** The above copyright notice and this permission notice shall be included in
# ** all copies or substantial portions of the Software.
# **
# ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# ** THE SOFTWARE.
# **
# ****************************************************************************/

cmake_minimum_required(VERSION 3.10)

add_executable(simplereader
${CMAKE_CURRENT_LIST_DIR}/simplereader.c
)

target_link_libraries(simplereader
PRIVATE
intel::tinycbor
)
15 changes: 15 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# tinyCBOR Example

This directory has sample CBOR data (`testcbor`) that can be used with the example. The CBOR data resembles the following CBOR (based on [cbor.me diagnostic notation](http://cbor.me/)):

```
[ 1, [2, 3, 4]]
```

To run the example, be sure the test data is in the same directory as the example executable and add `testcbor` as an argument to the executable.

Example:

```bash
./examples/simplereader testcbor
```
2 changes: 1 addition & 1 deletion scripts/update-docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -ex
tuple="$TRAVIS_BRANCH${TRAVIS_TAG:+tag:$TRAVIS_TAG},$TRAVIS_PULL_REQUEST"
case "$tuple" in
dev,false|master,false|tag:*)
dev,false|main,false|tag:*)
;;
*)
exit 0
Expand Down
Loading