{"id":13466360,"url":"https://github.com/tboox/tbox","last_synced_at":"2025-05-13T17:12:26.929Z","repository":{"id":37850935,"uuid":"1595099","full_name":"tboox/tbox","owner":"tboox","description":"🎁 A glib-like multi-platform c library","archived":false,"fork":false,"pushed_at":"2025-04-24T02:37:26.000Z","size":32393,"stargazers_count":4995,"open_issues_count":37,"forks_count":743,"subscribers_count":209,"default_branch":"master","last_synced_at":"2025-05-10T15:02:42.294Z","etag":null,"topics":["algorithm","container","coroutines","cross-platform","iterator","json","network","plist","stream","tbox","xmake","xml"],"latest_commit_sha":null,"homepage":"https://docs.tboox.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tboox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":"waruqi","open_collective":"tbox","custom":"https://docs.tboox.org/#/about/sponsor"}},"created_at":"2011-04-10T15:01:20.000Z","updated_at":"2025-05-09T04:45:55.000Z","dependencies_parsed_at":"2023-02-18T16:32:16.013Z","dependency_job_id":"afa4cc13-64f8-40f1-bbc0-7d210a5c70e2","html_url":"https://github.com/tboox/tbox","commit_stats":{"total_commits":3315,"total_committers":35,"mean_commits":94.71428571428571,"dds":"0.028355957767722484","last_synced_commit":"1c3c01b1757febc4ade5ae16ce6a90c624b07d3c"},"previous_names":["waruqi/tbox"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tboox","download_url":"https://codeload.github.com/tboox/tbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253483870,"owners_count":21915730,"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":["algorithm","container","coroutines","cross-platform","iterator","json","network","plist","stream","tbox","xmake","xml"],"created_at":"2024-07-31T15:00:42.900Z","updated_at":"2025-05-13T17:12:21.898Z","avatar_url":"https://github.com/tboox.png","language":"C","readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ca href=\"https://docs.tboox.org\"\u003e\n    \u003cimg width=\"160\" heigth=\"160\" src=\"https://docs.tboox.org/assets/img/logo_text.png\"\u003e\n  \u003c/a\u003e\n\n  \u003cdiv\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/actions?query=workflow%3AWindows\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tboox/tbox/windows.yml?branch=dev\u0026style=flat-square\u0026logo=windows\" alt=\"github-ci\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/actions?query=workflow%3ALinux\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tboox/tbox/linux.yml?branch=dev\u0026style=flat-square\u0026logo=linux\" alt=\"github-ci\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/actions?query=workflow%3AmacOS\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tboox/tbox/macos.yml?branch=dev\u0026style=flat-square\u0026logo=apple\" alt=\"github-ci\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/actions?query=workflow%3AAndroid\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tboox/tbox/android.yml?branch=dev\u0026style=flat-square\u0026logo=android\" alt=\"github-ci\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/releases\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/release/tboox/tbox.svg?style=flat-square\" alt=\"Github All Releases\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n    \u003ca href=\"https://github.com/tboox/tbox/blob/master/LICENSE.md\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/tboox/tbox.svg?colorB=f48041\u0026style=flat-square\" alt=\"license\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.reddit.com/r/tboox/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square\" alt=\"Reddit\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://gitter.im/tboox/tboox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\n      \u003cimg src=\"https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square\u0026colorB=96c312\" alt=\"Gitter\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://t.me/tbooxorg\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square\" alt=\"Telegram\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jq.qq.com/?_wv=1027\u0026k=5hpwWFv\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square\" alt=\"QQ\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://tboox.org/donation/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/donate-us-orange.svg?style=flat-square\" alt=\"Donate\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\n  \u003cp\u003eA glib-like cross-platform C library\u003c/p\u003e\n\u003c/div\u003e\n\n## Supporting the project\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. 🙏 [[Become a sponsor](https://docs.tboox.org/#/about/sponsor)]\n\n\u003ca href=\"https://opencollective.com/tbox#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/tbox/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n## Introduction ([中文](/README_zh.md))\n\nTBOX is a glib-like cross-platform C library that is simple to use yet powerful in nature.\n\nThe project focuses on making C development easier and provides many modules (.e.g stream, coroutine, regex, container, algorithm ...),\nso that any developer can quickly pick it up and enjoy the productivity boost when developing in C language.\n\nIt supports the following platforms: Windows, Macosx, Linux, Android, iOS, *BSD and etc.\n\nAnd it provides many compiling options using [xmake](https://github.com/xmake-io/xmake):\n\n* Release: Disable debug information, assertion, memory checking and enable optimization.\n* Debug: Enable debug information, assertion, memory checking and disable optimization.\n* Small: Disable all extensional modules and enable space optimization.\n* Micro: compiling micro library (~64K) for the embed system.\n\nIf you want to know more, please refer to: [Documents](https://docs.tboox.org/#/getting_started), [Github](https://github.com/tboox/tbox) and [Gitee](https://gitee.com/tboox/tbox)\n\n## Features\n\n#### The stream library\n\n- Supports file, data, http and socket source\n- Supports the stream filter for gzip, charset and...\n- Implements stream transfer\n- Implements the static buffer stream for parsing data\n- Supports coroutine and implements asynchronous operation\n\n#### The coroutine library\n\n- Provides high-performance coroutine switch\n- Supports arm, arm64, x86, x86_64 ..\n- Provides channel interfaces\n- Provides semaphore and lock interfaces\n- Supports io socket and stream operation in coroutine\n- Provides some io servers (http ..) using coroutine\n- Provides stackfull and stackless coroutines\n- Support epoll, kqueue, poll, select and IOCP\n- Support to wait pipe, socket and process in coroutine and poller at same time\n\n#### The database library\n\n- Supports mysql and sqlite3 database and enumerates data using the iterator mode\n\n#### The xml parser library\n\n- Supports DOM and SAX mode and Supports xpath\n\n#### The serialization and deserialization library\n\n- Supports xml, json, bplist, xplist, binary formats\n\n#### The memory library\n\n- Implements some memory pools for optimizing memory\n- Supports fast memory error detecting. it can detect the following types of bugs for the debug mode:\n  - out-of-bounds accesses to heap and globals\n  - use-after-free\n  - double-free, invalid free\n  - memory leaks\n\n#### The container library\n\n- Implements hash table, single list, double list, vector, stack, queue\n  and min/max heap. Supports iterator mode for algorithm\n\n#### The algorithm library\n\n- Uses the iterator mode\n- Implements find, binary find and reverse find algorithm\n- Implements sort, bubble sort, quick sort, heap sort and insert sort algorithm\n- Implements count, walk items, reverse walk items, for_all and rfor_all\n\n#### The network library\n\n- Implements dns(cached)\n- Implements ssl(openssl, polarssl, mbedtls)\n- Implements http\n- Implements cookies\n- Supports ipv4, ipv6\n- Supports coroutine\n\n#### The platform library\n\n- Implements timer, fast and low precision timer\n- Implements atomic and atomic64 operation\n- Implements spinlock, mutex, event, semaphore, thread and thread pool\n- Implements file, socket operation\n- Implements poller using epoll, poll, select, kqueue ...\n- Implements switch context interfaces for coroutine\n\n#### The charset library\n\n- Supports utf8, utf16, gbk, gb2312, uc2 and uc4\n- Supports big endian and little endian mode\n\n#### The zip library\n\n- Supports gzip, zlibraw, zlib formats using the zlib library if exists\n- Implements lzsw, lz77 and rlc algorithm\n\n#### The utils library\n\n- Implements base32, base64 encoder and decoder\n- Implements assert and trace output for the debug mode\n- Implements bits operation for parsing u8, u16, u32, u64 data\n\n#### The math library\n\n- Implements random generator\n- Implements fast fixed-point calculation, Supports 6-bits, 16-bits, 30-bits fixed-point number\n\n#### The libc library\n\n- Implements lightweight libc library interfaces, the interface name contains `tb_xxx` prefix for avoiding conflict\n- Implements strixxx strrxxx wcsixxx wcsrxxx interface extension\n- Optimizes some frequently-used interface, .e.g. memset, memcpy, strcpy ...\n- Implements `memset_u16`, `memset_u32`, `memset_u64` extension interfaces\n\n#### The libm library\n\n- Implements lightweight libm library interfaces, the interface name contains `tb_xxx` prefix for avoiding conflict\n- Supports float and double type\n\n#### The regex library\n\n- Supports match and replace\n- Supports global/multiline/caseless mode\n- Uses pcre, pcre2 and posix regex modules\n\n#### The hash library\n\n- Implements crc32, adler32, md5 and sha1 hash algorithm\n- Implements some string hash algorithms (.e.g bkdr, fnv32, fnv64, sdbm, djb2, rshash, aphash ...)\n- Implements uuid generator\n\n## Projects\n\nSome projects using tbox:\n\n* [gbox](https://github.com/tboox/gbox)\n* [vm86](https://github.com/tboox/vm86)\n* [xmake](http://www.xmake.io)\n* [itrace](https://github.com/tboox/itrace)\n* [more](https://github.com/tboox/tbox/wiki/tbox-projects)\n\n## Build (xmake)\n\nPlease install xmake first: [xmake](https://github.com/xmake-io/xmake)\n\n```console\n# build for the host platform\n$ cd ./tbox\n$ xmake\n\n# build for the mingw platform\n$ cd ./tbox\n$ xmake f -p mingw --sdk=/home/mingwsdk\n$ xmake\n\n# build for the iphoneos platform\n$ cd ./tbox\n$ xmake f -p iphoneos\n$ xmake\n\n# build for the android platform\n$ cd ./tbox\n$ xmake f -p android --ndk=xxxxx\n$ xmake\n\n# build for the linux cross-platform\n$ cd ./tbox\n$ xmake f -p linux --sdk=/home/sdk # --bin=/home/sdk/bin\n$ xmake\n```\n\n## Build (xmake.sh)\n\n```console\n$ ./configure\n$ make\n```\n\n## Example\n\n```c\n#include \"tbox/tbox.h\"\n\nint main(int argc, char** argv) {\n    if (!tb_init(tb_null, tb_null)) return 0;\n\n    tb_vector_ref_t vector = tb_vector_init(0, tb_element_str(tb_true));\n    if (vector) {\n        tb_vector_insert_tail(vector, \"hello\");\n        tb_vector_insert_tail(vector, \"tbox\");\n\n        tb_for_all (tb_char_t const*, cstr, vector) {\n            tb_trace_i(\"%s\", cstr);\n        }\n        tb_vector_exit(vector);\n    }\n    tb_exit();\n    return 0;\n}\n```\n\n## Technical Support\n\nYou can also consider sponsoring us to get technical support services, [[Become a sponsor](https://docs.tboox.org/#/about/sponsor)]\n\n## Contacts\n\n* Email：[waruqi@gmail.com](mailto:waruqi@gmail.com)\n* Homepage：[tboox.org](https://tboox.org)\n* Community：[/r/tboox on reddit](https://www.reddit.com/r/tboox/)\n* ChatRoom：[Chat on telegram](https://t.me/tbooxorg), [Chat on gitter](https://gitter.im/tboox/tboox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n* QQ Group: 343118190(full), 662147501\n* Wechat Public: tboox-os\n\n","funding_links":["https://github.com/sponsors/waruqi","https://opencollective.com/tbox","https://docs.tboox.org/#/about/sponsor"],"categories":["Frameworks","C","Projects","C/C++程序设计"],"sub_categories":["资源传输下载"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Ftbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftboox%2Ftbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Ftbox/lists"}