1.4 KiB
1.4 KiB
tlibtoml
A fork of libtoml rewritten to use tlibc instead of its own (worse) implementation of collections and strings. For example, Table from libtoml is just an array of key-value pairs, where search happens by calling strcmp() on each element. Such inefficient code hurts my mind, so i have no other choise than to rewrite this library.
Build
-
Clone this repository.
git clone https://timerix.ddns.net/git/Timerix/tlibtoml.git -
Install cbuild version specified in
project.config. -
Clone tlibc. By default
dependencies/tlibc.configexpects thattlibc/is present in the same directory astlibtoml/. If you cloned it to another directory, changeDEPENDENCIES_DIRintlibtoml/project.user.config.git clone https://timerix.ddns.net/git/Timerix/tlibc.git -
Build and run tests
cd tlibtoml cbuild build_exec exec -
To build library use tasks
build_static_lib[_dbg]orbuild_shared_lib[_dbg]
Usage
#include "tlibtoml.h"
int main(){
Deferral(32); // reserve memory for 32 defers
try_fatal_void(tlibc_init());
try_fatal_void(tlibtoml_init());
Defer(tlibc_deinit());
Defer(tlibtoml_deinit());
Return 0; // call defers
}