TBOX is participating 2021 OSC China Open Source Project Selection , please vote for it!
TBOX in 2021 OSC China Open Source Project Selection {{projectVoteCount} has been obtained in, please vote for it!
2021 OSC China Open Source Project Selection It is in hot progress. Come and vote for your favorite open source project!
2021 OSC China Open Source Project Selection>>> Midfield Review
TBOX won the 2021 OSC China Open Source Project Selection "The Best Popularity Project" !
Authorization Agreement Apache-2.0
development language C/C++ assembly
operating system Cross platform
Software type Open source software
Open source organizations nothing
region domestic
deliverer ruki
intended for unknown
Recording time 2014-08-15

Software Introduction

TBOX is a cross platform development library implemented in C language.

For each platform, it encapsulates a unified interface, simplifying common operations in various development processes, making you pay more attention to the development of practical applications in the development process, rather than waste time on trivial interface compatibility, and make full use of some unique features of each platform for optimization.

The purpose of this project is to make C development more simple and efficient.

It also provides a microkernel compilation mode, which is optimized for the embedded platform and only generates a 64K thin library.

Currently supported platforms include:

  • Windows

  • Macosx

  • Linux

  • Android

  • iOS

If you want to know more, please refer to:

characteristic

Stream library

For http, file, socket, data and other stream data, a unified interface is implemented for reading and writing, and three reading and writing modes are supported: blocking, non blocking, and asynchronous. It supports adding multi-layer filter streams in the middle for stream filtering, realizing read while decompression, coding conversion, encryption and other operations inside, greatly reducing memory usage.

The following modules are mainly provided:

  • Stream: general non blocking stream, which is used for general independent io processing, and also supports coroutine for asynchronous transmission.

  • Transfer: the transmission device, which maintains the transmission of two streams.

  • Static_stream: static stream optimized for static data buffer, used for lightweight and fast data parsing.

Coroutine library

  • Fast and efficient co schedule switching support (refer to: Benchmark test report

  • Cross platform support is provided. The core switching algorithm refers to boost, and it is rewritten and optimized. The current support architecture: x86, x86_64, arm, arm64

  • Provide data communication support between channel processes based on production and consumer models

  • Provide semaphore and coroutine lock support

  • Socket and stream modules natively support coroutines, and can be switched seamlessly between threads and coroutines

  • It provides simple server instances based on coroutine such as http and file. It takes only a few hundred lines of code to write a high-performance io server from the socket. The code logic is clearer than the asynchronous callback mode

  • It provides support for stackfull and stackless. The interface is similar. stackfull is more flexible and easy to use, and stackless is lighter and more efficient

data base

  • Unify and simplify the database operation interface, adapt to various data sources, automatically connect and open the supported database through a unified url, and use the iterator model for data enumeration.

  • Currently, sqlite3 and mysql relational databases are supported, and other relational databases can also be customized and extended.

Xml library

  • DOM and SAX parsing modes are provided for xml. SAX mode adopts external iteration mode, which has higher flexibility and performance, and can select specified path for parsing.

  • The parsing process is completely based on stream, so it is highly streaming. It can realize the one-stop service of downloading, decompressing, transcoding, and parsing at the same time. It can also parse large-scale data with low memory.

  • Provide an xml writer to support the generation of xml

Memory Library

  • Refer to the implementation of the memory management mechanism of the Linux kernel, and carry out various transformations and optimizations on it. The realized TBOX has a complete set of unique memory pool management architecture.

  • In debug mode, you can easily detect and locate common memory problems such as memory leaks, memory overruns, memory overlap and coverage, and make statistics and brief analysis of the overall memory usage.

  • It makes full use of large data, small data and string data to avoid a large number of external and internal fragments. The allocation operation has been optimized. In 96% cases, the efficiency is O (1).

Container Library

  • Common containers such as hash, linked list, array, queue, stack, minimum and maximum heap are provided.

  • Various common member types are supported. In the original container opening, the member types can also be fully customized and extended.

  • All containers support iterator operations.

  • Most containers can support stream based serialization and deserialization operations.

Algorithm library

  • Various sorting algorithms are provided: bubble sorting, heap sorting, quick sorting and insert sorting.

  • Provide various search algorithms: linear traversal, dichotomy search.

  • Various traversal, deletion and statistics algorithms are provided.

  • It uses iterator as the interface to realize the separation of algorithm and container. It is similar to stl, but the c implementation is lighter.

Network library

  • Implement http client module

  • Implement cookies

  • Implement dns parsing and caching

  • Implement ssl (support openssl, polarssl, mbedtls)

  • Support ipv4 and ipv6

  • Support asynchronous mode through coroutine

Math operation library

  • Provide fixed-point operation support with various precision

  • Provide random number generator

Libc library

  • A lightweight implementation of libc, completely cross platform, and optimized for different architectures.

  • Support most string and wide string operations.

  • Various case insensitive operation interfaces for extended strings and wide strings

  • Expand and highly optimize memset_u16, memset_u32 and other interfaces, especially suitable for graphic rendering programs

Libm library

  • A lightweight implementation of some interfaces of libm, and the encapsulation of common system interfaces. (Currently, only part of it has been implemented, and it will be completely implemented when time comes)

  • The common interface of the extension part adds the integer version calculation of common functions such as sqrt and log2, which is highly optimized and does not involve floating-point operations, and is suitable for embedded environments.

Object library

  • The lightweight Apple class CoreFoundation library supports common objects such as object, dictionary, array, string, number, date, and data, and can easily extend the serialization of custom objects.

  • It supports the serialization and deserialization of xml, json, binary, and apple plist (xplist/bplist) formats. It also implements its own binary serialization format, and implements simple encryption for plaintext. Without affecting performance, the serialized size is 30% less than that of bplist.

Platform Library

  • Provide common system interfaces such as file, directory, socket, thread, time, etc

  • Provide atomic and atomic64 interfaces

  • Provide high-precision and high-precision timers

  • Provides high-performance thread pool operations

  • Provide event, mutex, semaphore, spin lock and other events, mutex, semaphore, spin lock operations

  • Provides an interface for obtaining function stack information, facilitating debugging and error location

  • Provide cross platform dynamic library loading interface (if supported by the system)

  • Provides io pollers, which are packaged across platforms for epoll, poll, select, and kqueue

  • It provides a cross platform context switching interface, which is mainly used for coroutine implementation. The switching efficiency is very high

Compression Library

  • Support the compression and decompression of zlib/zlibraw/gzip (the third-party zlib library support is required).

Character encoding library

  • It supports transcoding among utf8, utf16, gbk, gb2312, uc2, and uc4, and supports both the big and small end formats.

Utility Library

  • Implement base64/32 codec

  • Implement common hash algorithms such as crc32, adler32, md5, sha1, etc

  • Implement auxiliary debugging tools such as log output and assertion

  • Implement url encoding and decoding

  • It implements bit operation related interfaces, supports parsing of various data formats, and can parse fields of 8bits, 16bits, 32bits, 64bits, float, double, and any bits. It also supports big end, small end, and local end modes, and optimizes some operations, such as static_stream All streams have related interfaces to encapsulate them, which is convenient for fast data parsing on the stream.

  • Realize swap16, swap32, swap64 and other bit exchange operations, and optimize them for each platform.

  • Implement some advanced bit processing interfaces, such as: fast statistics of bit 0, fast bit count of leading 0 and leading 1, fast bit count of leading 01

  • Implement the singleton module, which can quickly encapsulate static objects and instance objects, and achieve global thread safety

  • Implement the option module, parse command line parameters, and provide fast and convenient command line option creation and parsing operations, which is very helpful for writing terminal programs

Regular expression library

  • Support matching and replacement operations

  • Support global, multi line, case insensitive and other modes

  • Using the pcre, pcre2, and posix regular libraries

Asio library (obsolete)

  • Please use the coroutine for asynchronous io programming

Expand to read the full text

code

Gitee index of is
exceed Items for

BOM

Device model Device manufacturer More information
{{o.mpn}} {{o.mfr}} see

comment

Click to join the discussion 🔥 (12) Post and join the discussion 🔥
Published information
2020/03/01 10:18

Tbox v1.6.5 was released to improve coordination scheduling support

There are not many changes in the functions and features of this version. The main reason is that the scheduling module of the lower subprocess has been improved to achieve unified scheduling support among the three objects: process, socket, and pipe. We can simultaneously operate processes, sockets, and pipes in the subprocess. This depends on the poller module provided by tbox, which uniformly encapsulates the epoll/kqueue/select/poll/iocp and other interfaces, enabling cross platform waiting for socket/pipe object events. The poller interface related to the official project source code document mainly includes the following four interfaces, in which the object can be a process/pipe/socket object, and then set the upper alignment

seven
eight
Published information
2019/10/12 07:32

Updated tbox v1.6.4, adding c11 style atomic operations

This version mainly improves stream/stdio read/write, character set encoding conversion and other operations, reconstructs the entire atomic operation implementation, and adds c11 style atomic api for more granular control. New Features of the Official Project Source Code Document # 70: Add the tb_stream_init_from_sock_ref() interface to directly open a socket as a stream to read data. Add the stdfile interface to read/write stdin, stdout and stderr# 81: Add CPU affinity settings and acquisition for processes and threads Add filelock File lock Cross platform api interface Add anonymous pipes, named pipes support improved optimization queue_buffe

three
three
Published information
2018/08/01 09:45

TBOX v1.6.3 was updated and IOCP based coordination support was added

TBOX is a cross platform development library implemented in c language. For each platform, it encapsulates a unified interface, simplifying common operations in various development processes, making you pay more attention to the development of practical applications in the development process, rather than waste time on trivial interface compatibility, and make full use of some unique features of each platform for optimization. The purpose of this project is to make C development more simple and efficient. Currently supported platforms are: Windows Macosx Linux Android iOS This version mainly improves the support of coroutine under Windows, fixes many stability problems, and implements

eight
six
Published information
2017/08/30 09:41

Updated tbox v1.6.2 to fix some stability problems

This version mainly fixes some stability problems and improves dependency package construction through xmake. Improve and modify the license, use the more relaxed Apache License 2.0 to rename -- smallest=y | n option to -- small=y | n use stat64 to support large file information to obtain improved tb_file_copy, faster file copying, and repair the problem of file permission loss after copying. Improve the path operation under the posix platform, improve the socket initialization interface, and support the icmp protocol to improve xmake.lua, Remove the built-in binary dependency package file Bugs Repair Repair Create a file with incorrect permissions Repair file and directory paths

four
three
Published information
2016/12/07 10:46

Tbox v1.6.1 was released, and stackless coroutine library was added

Tbox v1.6.1 was released. TBOX is a cross platform development library implemented in c language. For each platform, it encapsulates a unified interface, simplifying common operations in various development processes, making you pay more attention to the development of practical applications in the development process, rather than waste time on trivial interface compatibility, and make full use of some unique features of each platform for optimization. The purpose of this project is to make C development more simple and efficient. This version mainly adds stackless co scheduling module and micro micro module compilation (~64K) for embedded platform. This stackless scheduling module is more than

five
twenty-six
Published information
2016/10/31 00:00

Cross platform c development library tbox v1.6.0, supporting cross platform collaboration

New features support make for direct compilation (it will automatically download xmake for construction). In the platform library, add a context switching interface (refer to the implementation principle of boost.context for rewriting, and optimize some architectures). Add a cross platform collaboration module (support i386, x86_64, arm, arm64), Provide more easy-to-use high-performance concurrent programming mode, add various server development instances based on coroutine (including simple and lightweight http servers, crawlers...), add poller poller interfaces, implement encapsulation of epoll, poll, queue, select, and gradually replace the old aiop interfaces

six
forty-four
Published information
2016/08/30 00:00

Tbox v1.5.3 release, cross platform c development library

Tbox v1.5.3 release, The update is as follows: new features are added, while waiting for multiple process interfaces to be added, uuid generator is added, hash library module is added, __tb_depreciated__ keyword is added, and configuration options are improved. The mobile part utils interface is modified to hash module. Random generator Bugs is rewritten, and stdout is repaired. Compatibility problems in versions above vs2015 are repaired. Introduction to process parameter length limits. TBOX is a c language implementation The current cross platform development library. For each platform, it encapsulates a unified interface, simplifies common operations in various development processes, and makes you pay more attention to the development of practical applications in the development process

ten
thirty-nine
Published information
2016/06/27 00:00

Tbox v1.5.2 release, lightweight cross platform C development library

Tbox v1.5.2 was released. New features add smallest parameter configuration option, realize one click configuration, minimize compilation, disable all extension modules and dependent libraries, add process creation and control interface, improve and enhance environment variable setting interface, modify xmake.lua, support the latest version of xmake v2. x, Simplify compilation configuration Bugs repair repair ltimer timer inaccuracy repair asio part of memory leak problem repair asio/httpd under linux keepalive mode, slow response problem repair some bugs in path processing under windows Introduction TBOX is a multi platform development library implemented in c language, supporting windows, l

nineteen
eighty-one
Published information
2016/01/27 00:00

TBOX v1.5.1 release, lightweight cross platform C development library

TBOX v1.5.1 was released. The updated information is as follows: v1.5.1 updates and optimizes stream, supports automatic detection of all system libc interfaces for reading and writing character device files, gives priority to using the system version to fix some bugs under Android, modifies tb_init interface, adds allocator custom memory allocator parameters, and implements user's intrusive memory management and reconfiguration of memory management, Allocator mode is fully adopted, which can flexibly switch memory management. It supports various allocation methods such as native system memory, static buffer memory, memory pool, etc. It supports custom memory allocators, and can be used in debug

thirteen
eighty-six
Published information
2015/10/22 00:00

TBOX v1.5.0 release, lightweight cross platform development library

TBOX v1.5.0 was released. The updated content of this version is as follows: Update: rebuild the entire compilation architecture, and use xmake cross platform automatic build tool to build.. Optimize the. pkg dependency package mechanism, support the automatic detection of dependency libraries and interfaces, and give priority to the automatically detected system library interfaces for libc and libm. If the current platform is not implemented, use the self implemented version of tbox to maximize performance and cross platform performance.. Fixed the implementation bug of some libc interfaces such as strlcpy, added the cross platform environment variable operation interface, improved and optimized path operations, and added the introduction of mutual conversion between relative paths and absolute paths

two
fifty-nine
Published information
2014/08/15 00:00

Multi platform development library: tbox_v1.4.7_rc1 released!

TBOX is a multi platform development library implemented in c language, which supports windows, linux, mac, ios, android and other embedded systems. For each platform, it encapsulates a unified interface, simplifying common operations in various development processes, making you pay more attention to the development of practical applications in the development process, rather than waste time on trivial interface compatibility, and make full use of some unique features of each platform for optimization. Online documents: https://github.com/waruqi/tbox/wiki/%E7%9B%AE%E5%BD%95 Online manual: http://tboox.github.io/doc/tbox/h...

twenty-three
one hundred and one
No more
Loading failed, please refresh the page
Click to load more
Loading
next page
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
No more
No content temporarily
Issued a question and answer
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
No more
No content temporarily
No content temporarily
twelve comment
three hundred and fifty-eight Collection
 OSCHINA
Log in to view more high-quality content
 Back to top
Top