Home

Awesome

<div align="center"> <a href="https://docs.tboox.org"> <img width="160" heigth="160" src="https://docs.tboox.org/assets/img/logo_text.png"> </a> <div> <a href="https://github.com/tboox/tbox/actions?query=workflow%3AWindows"> <img src="https://img.shields.io/github/actions/workflow/status/tboox/tbox/windows.yml?branch=dev&style=flat-square&logo=windows" alt="github-ci" /> </a> <a href="https://github.com/tboox/tbox/actions?query=workflow%3ALinux"> <img src="https://img.shields.io/github/actions/workflow/status/tboox/tbox/linux.yml?branch=dev&style=flat-square&logo=linux" alt="github-ci" /> </a> <a href="https://github.com/tboox/tbox/actions?query=workflow%3AmacOS"> <img src="https://img.shields.io/github/actions/workflow/status/tboox/tbox/macos.yml?branch=dev&style=flat-square&logo=apple" alt="github-ci" /> </a> <a href="https://github.com/tboox/tbox/actions?query=workflow%3AAndroid"> <img src="https://img.shields.io/github/actions/workflow/status/tboox/tbox/android.yml?branch=dev&style=flat-square&logo=android" alt="github-ci" /> </a> <a href="https://github.com/tboox/tbox/releases"> <img src="https://img.shields.io/github/release/tboox/tbox.svg?style=flat-square" alt="Github All Releases" /> </a> </div> <div> <a href="https://github.com/tboox/tbox/blob/master/LICENSE.md"> <img src="https://img.shields.io/github/license/tboox/tbox.svg?colorB=f48041&style=flat-square" alt="license" /> </a> <a href="https://www.reddit.com/r/tboox/"> <img src="https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square" alt="Reddit" /> </a> <a href="https://gitter.im/tboox/tboox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"> <img src="https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square&colorB=96c312" alt="Gitter" /> </a> <a href="https://t.me/tbooxorg"> <img src="https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square" alt="Telegram" /> </a> <a href="https://jq.qq.com/?_wv=1027&k=5hpwWFv"> <img src="https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square" alt="QQ" /> </a> <a href="https://tboox.org/donation/"> <img src="https://img.shields.io/badge/donate-us-orange.svg?style=flat-square" alt="Donate" /> </a> </div> <p>A glib-like cross-platform C library</p> </div>

Supporting the project

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. 🙏 [Become a sponsor]

<a href="https://opencollective.com/tbox#backers" target="_blank"><img src="https://opencollective.com/tbox/backers.svg?width=890"></a>

Introduction (中文)

TBOX is a glib-like cross-platform C library that is simple to use yet powerful in nature.

The project focuses on making C development easier and provides many modules (.e.g stream, coroutine, regex, container, algorithm ...), so that any developer can quickly pick it up and enjoy the productivity boost when developing in C language.

It supports the following platforms: Windows, Macosx, Linux, Android, iOS, *BSD and etc.

And it provides many compiling options using xmake:

If you want to know more, please refer to: Documents, Github and Gitee

Features

The stream library

The coroutine library

The database library

The xml parser library

The serialization and deserialization library

The memory library

The container library

The algorithm library

The network library

The platform library

The charset library

The zip library

The utils library

The math library

The libc library

The libm library

The regex library

The hash library

Projects

Some projects using tbox:

Build (xmake)

Please install xmake first: xmake

# build for the host platform
$ cd ./tbox
$ xmake

# build for the mingw platform
$ cd ./tbox
$ xmake f -p mingw --sdk=/home/mingwsdk
$ xmake

# build for the iphoneos platform
$ cd ./tbox
$ xmake f -p iphoneos
$ xmake

# build for the android platform
$ cd ./tbox
$ xmake f -p android --ndk=xxxxx
$ xmake

# build for the linux cross-platform
$ cd ./tbox
$ xmake f -p linux --sdk=/home/sdk # --bin=/home/sdk/bin
$ xmake

Build (xmake.sh)

$ ./configure
$ make

Example

#include "tbox/tbox.h"

int main(int argc, char** argv) {
    if (!tb_init(tb_null, tb_null)) return 0;

    tb_vector_ref_t vector = tb_vector_init(0, tb_element_str(tb_true));
    if (vector) {
        tb_vector_insert_tail(vector, "hello");
        tb_vector_insert_tail(vector, "tbox");

        tb_for_all (tb_char_t const*, cstr, vector) {
            tb_trace_i("%s", cstr);
        }
        tb_vector_exit(vector);
    }
    tb_exit();
    return 0;
}

Technical Support

You can also consider sponsoring us to get technical support services, [Become a sponsor]

Contacts