{"id":13420494,"url":"https://github.com/PJK/libcbor","last_synced_at":"2025-03-15T06:33:16.640Z","repository":{"id":25437852,"uuid":"28867623","full_name":"PJK/libcbor","owner":"PJK","description":"CBOR protocol implementation for C","archived":false,"fork":false,"pushed_at":"2025-03-06T05:09:48.000Z","size":2146,"stargazers_count":355,"open_issues_count":27,"forks_count":98,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-10T05:37:56.112Z","etag":null,"topics":["c","c-plus-plus","c99","cbor","serialization"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PJK.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-06T14:45:32.000Z","updated_at":"2025-03-04T23:42:03.000Z","dependencies_parsed_at":"2023-11-25T01:24:25.988Z","dependency_job_id":"8370a39a-c7bc-499d-9b1a-a7ade874c22a","html_url":"https://github.com/PJK/libcbor","commit_stats":{"total_commits":1132,"total_committers":41,"mean_commits":"27.609756097560975","dds":0.07862190812720848,"last_synced_commit":"34cf74b90d1151e8eb873c6804a774379ecd71d4"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJK%2Flibcbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJK%2Flibcbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJK%2Flibcbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJK%2Flibcbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PJK","download_url":"https://codeload.github.com/PJK/libcbor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695465,"owners_count":20332622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c-plus-plus","c99","cbor","serialization"],"created_at":"2024-07-30T22:01:34.816Z","updated_at":"2025-03-15T06:33:16.247Z","avatar_url":"https://github.com/PJK.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings","Structured File Processing","结构化文件处理"],"sub_categories":["Others","其他"],"readme":"# [libcbor](https://github.com/PJK/libcbor)\n\n[![CircleCI](https://circleci.com/gh/PJK/libcbor/tree/master.svg?style=svg)](https://circleci.com/gh/PJK/libcbor/tree/master)\n[![Documentation Status](https://readthedocs.org/projects/libcbor/badge/?version=latest)](https://readthedocs.org/projects/libcbor/?badge=latest)\n[![latest packaged version(s)](https://repology.org/badge/latest-versions/libcbor.svg)](https://repology.org/project/libcbor/versions)\n[![codecov](https://codecov.io/gh/PJK/libcbor/branch/master/graph/badge.svg)](https://codecov.io/gh/PJK/libcbor)\n\n**libcbor** is a C library for parsing and generating [CBOR](https://cbor.io/), the general-purpose schema-less binary data format.\n\n## Main features\n - Complete [IETF RFC 8949 (STD 94)](https://www.rfc-editor.org/info/std94) conformance\n - Robust platform-independent C99 implementation\n - Layered architecture offers both control and convenience\n - Flexible memory management\n - No shared global state - threading friendly\n - Proper handling of UTF-8\n - Full support for streams \u0026 incremental processing\n - Extensive documentation and test suite\n - No runtime dependencies, small footprint\n \n## Getting started\n\n### Compile from source\n\n```bash\ngit clone https://github.com/PJK/libcbor\ncmake -DCMAKE_BUILD_TYPE=Release libcbor\nmake\nmake install\n```\n\n### Homebrew\n\n```bash\nbrew install libcbor\n```\n\n### Ubuntu 18.04 and above\n\n```bash\nsudo add-apt-repository universe\nsudo apt-get install libcbor-dev\n```\n\n### Fedora \u0026 RPM friends\n\n```bash\nyum install libcbor-devel\n```\n\n### Others \n\n\u003cdetails\u003e\n  \u003csummary\u003ePackaged libcbor is available from 15+ major repositories. Click here for more detail\u003c/summary\u003e\n  \n  [![Packaging status](https://repology.org/badge/vertical-allrepos/libcbor.svg)](https://repology.org/project/libcbor/versions)\n\u003c/details\u003e\n\n## Usage example\n\n```c\n#include \u003ccbor.h\u003e\n#include \u003cstdio.h\u003e\n\nint main(void) {\n  /* Preallocate the map structure */\n  cbor_item_t* root = cbor_new_definite_map(2);\n  /* Add the content */\n  bool success = cbor_map_add(\n      root, (struct cbor_pair){\n                .key = cbor_move(cbor_build_string(\"Is CBOR awesome?\")),\n                .value = cbor_move(cbor_build_bool(true))});\n  success \u0026= cbor_map_add(\n      root, (struct cbor_pair){\n                .key = cbor_move(cbor_build_uint8(42)),\n                .value = cbor_move(cbor_build_string(\"Is the answer\"))});\n  if (!success) return 1;\n  /* Output: `length` bytes of data in the `buffer` */\n  unsigned char* buffer;\n  size_t buffer_size;\n  cbor_serialize_alloc(root, \u0026buffer, \u0026buffer_size);\n\n  fwrite(buffer, 1, buffer_size, stdout);\n  free(buffer);\n\n  fflush(stdout);\n  cbor_decref(\u0026root);\n}\n```\n\n## Documentation\nGet the latest documentation at [libcbor.readthedocs.org](http://libcbor.readthedocs.org/)\n\n## Contributions\n\nBug reports and contributions are welcome. Please see [CONTRIBUTING.md](https://github.com/PJK/libcbor/blob/master/CONTRIBUTING.md) for more info.\n\nKudos to all the [contributors](https://github.com/PJK/libcbor/graphs/contributors)!\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) Pavel Kalvoda, 2014-2020\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPJK%2Flibcbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPJK%2Flibcbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPJK%2Flibcbor/lists"}