git: abd872540f24 - main - libcbor: vendor update to 0.11.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 03 May 2024 23:34:28 UTC
The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abd872540f24cfc7dbd1ea29b6918c7082a22108 commit abd872540f24cfc7dbd1ea29b6918c7082a22108 Merge: b27eb9ce96b8 5f50d6b344f0 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-05-03 23:33:50 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-05-03 23:33:50 +0000 libcbor: vendor update to 0.11.0 Sponsored by: The FreeBSD Foundation contrib/libcbor/.circleci/config.yml | 30 ++-- contrib/libcbor/.cirrus.yml | 26 +++ contrib/libcbor/.readthedocs.yaml | 21 +++ contrib/libcbor/CHANGELOG.md | 15 +- contrib/libcbor/CMakeLists.txt | 18 +- contrib/libcbor/CONTRIBUTING.md | 2 +- contrib/libcbor/Doxyfile | 2 +- contrib/libcbor/README.md | 7 +- contrib/libcbor/appveyor.yml | 14 -- contrib/libcbor/doc/source/api/item_types.rst | 2 +- contrib/libcbor/doc/source/conf.py | 18 +- contrib/libcbor/doc/source/development.rst | 6 +- contrib/libcbor/doc/source/index.rst | 8 +- contrib/libcbor/doc/source/internal.rst | 4 +- contrib/libcbor/doc/source/requirements.txt | 52 +++--- ...fc_conformance.rst => standard_conformance.rst} | 6 +- contrib/libcbor/examples/CMakeLists.txt | 4 + .../bazel/third_party/libcbor/cbor/configuration.h | 4 +- contrib/libcbor/examples/cbor2cjson.c | 123 +++++++++++++ contrib/libcbor/examples/cjson2cbor.c | 4 +- contrib/libcbor/examples/data/all_types.cbor | Bin 0 -> 354 bytes contrib/libcbor/examples/readfile.c | 2 +- contrib/libcbor/oss-fuzz/build.sh | 2 +- contrib/libcbor/src/CMakeLists.txt | 21 ++- contrib/libcbor/src/cbor.c | 82 +++++---- contrib/libcbor/src/cbor/common.h | 2 +- .../libcbor/src/cbor/internal/builder_callbacks.c | 27 +-- contrib/libcbor/src/cbor/internal/loaders.c | 2 +- contrib/libcbor/src/cbor/internal/memory_utils.h | 2 +- contrib/libcbor/src/cbor/internal/unicode.c | 6 +- contrib/libcbor/src/cbor/internal/unicode.h | 6 +- contrib/libcbor/src/cbor/maps.c | 1 + contrib/libcbor/src/cbor/streaming.c | 43 ++--- contrib/libcbor/src/cbor/strings.c | 10 ++ contrib/libcbor/src/cbor/strings.h | 19 +- contrib/libcbor/src/libcborConfig.cmake.in | 8 + contrib/libcbor/test/callbacks_test.c | 25 +++ contrib/libcbor/test/cbor_serialize_test.c | 32 ++++ contrib/libcbor/test/cbor_stream_decode_test.c | 8 +- contrib/libcbor/test/float_ctrl_test.c | 6 +- contrib/libcbor/test/pretty_printer_test.c | 197 +++++++++++++++++++-- contrib/libcbor/test/string_test.c | 67 +++++++ contrib/libcbor/test/tag_test.c | 23 +++ contrib/libcbor/test/test_allocator.c | 2 +- 44 files changed, 746 insertions(+), 213 deletions(-) diff --cc contrib/libcbor/.cirrus.yml index 000000000000,000000000000..948ae23b4a98 new file mode 100644 --- /dev/null +++ b/contrib/libcbor/.cirrus.yml @@@ -1,0 -1,0 +1,26 @@@ ++freebsd_task: ++ install_script: ++ - ASSUME_ALWAYS_YES=yes pkg bootstrap -f && pkg install -y cmocka cmake ninja ++ build_script: ++ - mkdir build ++ - cd build ++ - cmake -GNinja -DWITH_TESTS=ON ++ -DCBOR_CUSTOM_ALLOC=ON ++ -DCMAKE_BUILD_TYPE=Debug ++ -DSANITIZE=OFF ++ .. ++ - ninja -j $(sysctl -n hw.ncpu) ++ test_script: ++ - cd build ++ - ctest -VV ++ matrix: ++ # From gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images ++ - name: freebsd-13-2 ++ freebsd_instance: ++ image_family: freebsd-13-2 ++ - name: freebsd-14-0 ++ freebsd_instance: ++ image_family: freebsd-14-0 ++ - name: freebsd-15-0-snap ++ freebsd_instance: ++ image_family: freebsd-15-0-snap diff --cc contrib/libcbor/.readthedocs.yaml index 000000000000,f2514ffae113..f2514ffae113 mode 000000,100644..100644 --- a/contrib/libcbor/.readthedocs.yaml +++ b/contrib/libcbor/.readthedocs.yaml diff --cc contrib/libcbor/CONTRIBUTING.md index cc834d21a46b,000000000000..9bd42a06b6dc mode 100644,000000..100644 --- a/contrib/libcbor/CONTRIBUTING.md +++ b/contrib/libcbor/CONTRIBUTING.md @@@ -1,35 -1,0 +1,35 @@@ +# Contributing to libcbor + +libcbor is maintained by [@PJK](https://github.com/PJK) in his spare time on a best-effort basis. + - Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described belows. ++Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described below. + +## Principles + +**Bug reports and questions:** Bug reports and specific technical questions are always welcome. Feel free to open an [issue](https://github.com/PJK/libcbor/issues). + +**Incremental improvements:** Bug fixes (including build scripts, examples, test, typos, CI/CD config, etc.) and documentation improvements (fixes of typos, inaccuracies, out of date content, etc.) are always welcome. Feel free to open a [PR](https://github.com/PJK/libcbor/pulls). + +**New features:** I am looking to keep the scope of libcbor small. If you would like to add a feature, please open an issue with your proposal (or reach out to me privately) to discuss if the feature fits into libcbor before opening a PR. + +**Major changes:** Please open an issue with your proposal (or reach out to me privately) to discuss if the improvement fits into cbor before opening a PR. + +## Pull Request Process + +1. Ensure that all CI checks pass +2. Check that the PR is complete and of good quality + - Include a descriptive summary of the change. If the PR addresses an open issue, please link it. + - Code changes: Add tests + - If necessary: Update documentation, including any links +3. Code changes: Update [the changelog](https://github.com/PJK/libcbor/blob/master/CHANGELOG.md). Do *not* change the version number. + +## Interactions + +I work on libcbor on a best effort basis. The typical response time is a few days. + +If you do not receive a response in a few weeks, feel free to ping the PR or issue. + +## Resources + +- [Development documentation](https://libcbor.readthedocs.io/en/latest/development.html) + diff --cc contrib/libcbor/README.md index 6d34ba9d4dcb,000000000000..ea54bed9437b mode 100644,000000..100644 --- a/contrib/libcbor/README.md +++ b/contrib/libcbor/README.md @@@ -1,122 -1,0 +1,121 @@@ +# [libcbor](https://github.com/PJK/libcbor) + +[![CircleCI](https://circleci.com/gh/PJK/libcbor/tree/master.svg?style=svg)](https://circleci.com/gh/PJK/libcbor/tree/master) - [![Build status](https://ci.appveyor.com/api/projects/status/8kkmvmefelsxp5u2?svg=true)](https://ci.appveyor.com/project/PJK/libcbor) +[![Documentation Status](https://readthedocs.org/projects/libcbor/badge/?version=latest)](https://readthedocs.org/projects/libcbor/?badge=latest) +[![latest packaged version(s)](https://repology.org/badge/latest-versions/libcbor.svg)](https://repology.org/project/libcbor/versions) +[![codecov](https://codecov.io/gh/PJK/libcbor/branch/master/graph/badge.svg)](https://codecov.io/gh/PJK/libcbor) + - **libcbor** is a C library for parsing and generating [CBOR](https://tools.ietf.org/html/rfc7049), the general-purpose schema-less binary data format. ++**libcbor** is a C library for parsing and generating [CBOR](https://cbor.io/), the general-purpose schema-less binary data format. + +## Main features - - Complete RFC conformance - - Robust C99 implementation ++ - Complete [IETF RFC 8949 (STD 94)](https://www.rfc-editor.org/info/std94) conformance ++ - Robust platform-independent C99 implementation + - Layered architecture offers both control and convenience + - Flexible memory management + - No shared global state - threading friendly + - Proper handling of UTF-8 + - Full support for streams & incremental processing + - Extensive documentation and test suite + - No runtime dependencies, small footprint + +## Getting started + +### Compile from source + +```bash +git clone https://github.com/PJK/libcbor +cmake -DCMAKE_BUILD_TYPE=Release libcbor +make +make install +``` + +### Homebrew + +```bash +brew install libcbor +``` + +### Ubuntu 18.04 and above + +```bash +sudo add-apt-repository universe +sudo apt-get install libcbor-dev +``` + +### Fedora & RPM friends + +```bash +yum install libcbor-devel +``` + +### Others + +<details> + <summary>Packaged libcbor is available from 15+ major repositories. Click here for more detail</summary> + + [![Packaging status](https://repology.org/badge/vertical-allrepos/libcbor.svg)](https://repology.org/project/libcbor/versions) +</details> + +## Usage example + +```c +#include <cbor.h> +#include <stdio.h> + +int main(void) { + /* Preallocate the map structure */ + cbor_item_t* root = cbor_new_definite_map(2); + /* Add the content */ + bool success = cbor_map_add( + root, (struct cbor_pair){ + .key = cbor_move(cbor_build_string("Is CBOR awesome?")), + .value = cbor_move(cbor_build_bool(true))}); + success &= cbor_map_add( + root, (struct cbor_pair){ + .key = cbor_move(cbor_build_uint8(42)), + .value = cbor_move(cbor_build_string("Is the answer"))}); + if (!success) return 1; + /* Output: `length` bytes of data in the `buffer` */ + unsigned char* buffer; + size_t buffer_size; + cbor_serialize_alloc(root, &buffer, &buffer_size); + + fwrite(buffer, 1, buffer_size, stdout); + free(buffer); + + fflush(stdout); + cbor_decref(&root); +} +``` + +## Documentation +Get the latest documentation at [libcbor.readthedocs.org](http://libcbor.readthedocs.org/) + +## Contributions + +Bug reports and contributions are welcome. Please see [CONTRIBUTING.md](https://github.com/PJK/libcbor/blob/master/CONTRIBUTING.md) for more info. + +Kudos to all the [contributors](https://github.com/PJK/libcbor/graphs/contributors)! + +## License +The MIT License (MIT) + +Copyright (c) Pavel Kalvoda, 2014-2020 + +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. diff --cc contrib/libcbor/examples/cbor2cjson.c index 000000000000,99ddc9ee09e1..99ddc9ee09e1 mode 000000,100644..100644 --- a/contrib/libcbor/examples/cbor2cjson.c +++ b/contrib/libcbor/examples/cbor2cjson.c diff --cc contrib/libcbor/examples/data/all_types.cbor index 000000000000,00d66a0e667e..00d66a0e667e mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/src/libcborConfig.cmake.in index 000000000000,565bed365e24..565bed365e24 mode 000000,100644..100644 --- a/contrib/libcbor/src/libcborConfig.cmake.in +++ b/contrib/libcbor/src/libcborConfig.cmake.in