-
Notifications
You must be signed in to change notification settings - Fork 191
Document and improve abstract reader/writer interface #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sjlongland
wants to merge
26
commits into
intel:dev
Choose a base branch
from
widesky:feature/WSHUB-455-chunked-codec
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,857
−88
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0ff814d
CI: add dependabot configuration
pjonsson 2265e82
CI: add Github CI
pjonsson ad60cea
follow-up commit to 75eaa19
lightyear15 8907f20
Tests: disable the C90 test
thiagomacieira 89723e2
CI: Get Homebrew to use a bottle (precompiled) Qt
thiagomacieira f9fd089
CI: remove Valgrind on macOS: it doesn't work
thiagomacieira e9963de
CI/Makefile: do allow Qt 6
thiagomacieira 6550f66
CI: unbreak macOS: need to have CXX set
thiagomacieira a38a520
CI: Run the configure step in verbose mode and print the config output
thiagomacieira 5d167a0
Makefile: disable cJSON support when building without math support
thiagomacieira 722318d
add required SECURITY.md file for OSSF Scorecard compliance
rdower b4e1cc7
CI: add 'permissions' token to the GitHub actions file
thiagomacieira f994144
cborparser: Move parser initialisation to common routine.
sjlongland 167eef6
cborparser: Document `cbor_parser_init_reader`.
sjlongland 286d132
cbor: Document the reader interface.
sjlongland 3394f51
cborparser: Pass CborValue to operation routines.
sjlongland b7287ff
cborparser: Move `ops` outside of `union`
sjlongland da482b2
cborparser: Move the reader context to CborParser.
sjlongland 72d59f1
cborparser: Update documentation
sjlongland 1ef9a05
reader unit tests: Simplify the example reader
sjlongland b4b41d3
cborencoder: Document the write callback function.
sjlongland 914bee9
examples: Add buffered writer example.
sjlongland 34e931e
examples: Add buffered reader example
sjlongland 0c17e0f
cbor.h, cborencoder.c: Migrate documentation for encoder functions
sjlongland a4a6364
cbor.h, cborparser.c: Migrate parser documentation.
sjlongland 427e009
parser unit tests: Do not use `auto`, use reinterpret_cast
sjlongland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
target-branch: "main" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: CI | ||
permissions: read-all | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
# When a PR is updated, cancel the jobs from the previous version. Merges | ||
# do not define head_ref, so use run_id to never cancel those jobs. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
TinyCBOR: | ||
timeout-minutes: 45 | ||
# Common environment variables | ||
env: | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
HOMEBREW_NO_ANALYTICS: 1 | ||
|
||
strategy: | ||
# Always run all jobs in the matrix, even if one fails. | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
build_cfg: [ | ||
{ "name": "gcc-no-math", | ||
"flags": | ||
'{ "QMAKESPEC": "linux-gcc-no-math", | ||
"EVAL": "export CXX=false && touch math.h float.h", | ||
"CFLAGS": "-ffreestanding -DCBOR_NO_FLOATING_POINT -Os", | ||
"LDFLAGS": "-Wl,--no-undefined", | ||
"LDLIBS": "" | ||
}', | ||
}, | ||
{ "name": "gcc-freestanding", | ||
"flags": | ||
'{ "QMAKESPEC": "linux-gcc-freestanding", | ||
"EVAL": "export CXX=false", | ||
"CFLAGS": "-ffreestanding -Os", | ||
"LDFLAGS": "-Wl,--no-undefined -lm" | ||
}', | ||
}, | ||
{ "name": "clang", | ||
"flags": | ||
'{ "QMAKESPEC": "linux-clang", | ||
"EVAL": "export CC=clang && export CXX=clang++", | ||
"CFLAGS": "-Oz", | ||
"LDFLAGS": "-Wl,--no-undefined -lm", | ||
"QMAKEFLAGS": "-config release", | ||
"MAKEFLAGS": "-s", | ||
"TESTARGS": "-silent" | ||
}', | ||
}, | ||
{ "name": "linux-g++", | ||
"flags": | ||
'{ "QMAKESPEC": "linux-g++", | ||
"EVAL": "export CC=gcc && export CXX=g++", | ||
"CFLAGS": "-Os", | ||
"LDFLAGS": "-Wl,--no-undefined -lm", | ||
"QMAKEFLAGS": "-config release", | ||
"QT_NO_CPU_FEATURE": "rdrnd" | ||
}' | ||
} | ||
] | ||
include: | ||
- os: macos-13 | ||
build_cfg: { "name": "clang", | ||
"flags": | ||
'{ "QMAKESPEC": "macx-clang", | ||
"EVAL": "export CC=clang && export CXX=clang++", | ||
"CFLAGS": "-Oz", | ||
"QMAKEFLAGS": "-config debug", | ||
"MAKEFLAGS": "-s", | ||
"TESTARGS": "-silent", | ||
"PATH": "/usr/local/opt/qt/bin:$PATH" | ||
}' | ||
} | ||
|
||
# Default job name is too long to be visible in the "Checks" tab. | ||
name: ${{ matrix.os }}/${{ matrix.build_cfg.name }} | ||
# The type of runner that the job will run on | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Clone tinycbor | ||
uses: actions/checkout@v4 | ||
|
||
- name: install Linux software | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
# Need a recent Valgrind, otherwise debug info cannot be read. | ||
sudo snap install valgrind --classic | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends \ | ||
doxygen \ | ||
jq \ | ||
libc6-dbg \ | ||
libcjson-dev \ | ||
libfuntools-dev \ | ||
qtbase5-dev | ||
- name: install macOS software | ||
if: runner.os == 'macOS' | ||
run: | | ||
# Doxygen 1.9.7 is broken with ifdefs again, install 1.9.4 which works. | ||
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/41828ee36b96e35b63b2a4c8cfc2df2c3728944a/Formula/doxygen.rb | ||
brew install doxygen.rb | ||
rm doxygen.rb | ||
brew install qt cjson | ||
- name: Execute tests | ||
run: | | ||
set -x | ||
PATH=`echo /opt/qt*/bin`:$PATH | ||
eval $(echo '${{ matrix.build_cfg.flags }}' | jq -r 'to_entries[] | "\(.key)=\"\(.value)\""') | ||
eval "$EVAL" | ||
# FIXME: remove -Wno-error-line below. | ||
export CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration" | ||
make OUT=.config V=1 -s -f Makefile.configure configure && cat .config | ||
make -k \ | ||
CFLAGS="$CFLAGS -march=native -g1 -Wall -Wextra -Werror" \ | ||
CPPFLAGS="-DNDEBUG -DCBOR_ENCODER_WRITER_CONTROL=-1 -DCBOR_PARSER_READER_CONTROL=-1" \ | ||
lib/libtinycbor.a | ||
size lib/libtinycbor.a | tee sizes | ||
make -s clean | ||
make -k \ | ||
CFLAGS="$CFLAGS -O0 -g" \ | ||
LDFLAGS="$LDFLAGS" ${LDLIBS+LDLIBS="$LDLIBS"} | ||
grep -q freestanding-pass .config || make \ | ||
QMAKEFLAGS="$QMAKEFLAGS QMAKE_CXX=$CXX" \ | ||
tests/Makefile | ||
grep -q freestanding-pass .config || \ | ||
(cd tests && make TESTARGS=-silent check -k \ | ||
TESTRUNNER=`which valgrind 2>/dev/null`) | ||
make -s clean | ||
! [ $BUILD_DOCS ] || ./scripts/update-docs.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Security Policy | ||
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. | ||
|
||
## Reporting a Vulnerability | ||
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2016 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. | ||
** | ||
****************************************************************************/ | ||
|
||
#if defined(CBOR_CUSTOM_ALLOC_INCLUDE) | ||
# include CBOR_CUSTOM_ALLOC_INCLUDE | ||
#else | ||
# include <stdlib.h> | ||
# define cbor_malloc malloc | ||
# define cbor_free free | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TEMPLATE = subdirs | ||
SUBDIRS = parser encoder c90 cpp tojson | ||
SUBDIRS = parser encoder cpp tojson | ||
msvc: SUBDIRS -= tojson |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.