{"id":18250275,"url":"https://github.com/tboox/tbox-docs","last_synced_at":"2026-03-10T10:32:06.460Z","repository":{"id":83684309,"uuid":"101948784","full_name":"tboox/tbox-docs","owner":"tboox","description":"The tbox online documentation site","archived":false,"fork":false,"pushed_at":"2023-09-18T01:36:00.000Z","size":4050,"stargazers_count":10,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T20:32:46.439Z","etag":null,"topics":["documentation","docute","site","tbox","vuepress"],"latest_commit_sha":null,"homepage":"https://docs.tboox.org","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tboox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-08-31T02:12:15.000Z","updated_at":"2023-09-17T09:13:38.000Z","dependencies_parsed_at":"2024-11-05T09:45:04.944Z","dependency_job_id":"bf34798f-41cd-4ca6-99b4-073d45892717","html_url":"https://github.com/tboox/tbox-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tboox/tbox-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tboox","download_url":"https://codeload.github.com/tboox/tbox-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Ftbox-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30330574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["documentation","docute","site","tbox","vuepress"],"created_at":"2024-11-05T09:44:09.769Z","updated_at":"2026-03-10T10:32:06.419Z","avatar_url":"https://github.com/tboox.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction \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:\n\n- Windows\n- Macosx\n- Linux\n- Android\n- iOS\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:\n\n* [HomePage](https://tboox.org)\n* [Documents](https://tboox.io/#/getting_started)\n* [Github](https://github.com/tboox/tbox)\n* [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(refer to [reports](https://tboox.org/2016/10/28/benchbox-coroutine/))\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\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\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## Example\n\n```c\n#include \"tbox/tbox.h\"\n\nint main(int argc, char** argv)\n{\n    // init tbox\n    if (!tb_init(tb_null, tb_null)) return 0;\n\n    // trace\n    tb_trace_i(\"hello tbox\");\n\n    // init vector\n    tb_vector_ref_t vector = tb_vector_init(0, tb_element_cstr(tb_true));\n    if (vector)\n    {\n        // insert item\n        tb_vector_insert_tail(vector, \"hello\");\n        tb_vector_insert_tail(vector, \"tbox\");\n\n        // dump all items\n        tb_for_all (tb_char_t const*, cstr, vector)\n        {\n            // trace\n            tb_trace_i(\"%s\", cstr);\n        }\n\n        // exit vector\n        tb_vector_exit(vector);\n    }\n\n    // init stream\n    tb_stream_ref_t stream = tb_stream_init_from_url(\"http://www.xxx.com/file.txt\");\n    if (stream)\n    {\n        // open stream\n        if (tb_stream_open(stream))\n        {\n            // read line\n            tb_long_t size = 0;\n            tb_char_t line[TB_STREAM_BLOCK_MAXN];\n            while ((size = tb_stream_bread_line(stream, line, sizeof(line))) \u003e= 0)\n            {\n                // trace\n                tb_trace_i(\"line: %s\", line);\n            }\n        }\n\n        // exit stream\n        tb_stream_exit(stream);\n    }\n\n    // wait \n    tb_getchar();\n\n    // exit tbox\n    tb_exit();\n    return 0;\n}\n```\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* QQ Group: 343118190\n* Wechat Public: tboox-os\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Ftbox-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftboox%2Ftbox-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Ftbox-docs/lists"}