just some basic functions (and why not, some non basic)
Source

github repo
docs
docs headers
all func/macro
Example
- using list
./examples/readme.c
int main(int ac, const char *av[])
{
x_puts(
"Hewwo fwiends!!",
true);
for (int i = 0; i < ac; i++) {
}
}
return (0);
}
int list_find_ptrnode(list_t *list, node_t *node_ptr)
find node index that have node == node_ptr
list_t * list_create(void)
create an empty list
#define L_DATA(x)
return the data of the node
list_t * list_append(list_t *list, void *data, void(*destroy)(void *data), void *(*copy)(void *data))
append new data to list
#define L_EACH(x, list)
the for each that i like
int x_printf(const char *format,...)
put a formated string to stdout (nothing if format = 0)
int x_puts(const char *str, bool newline)
put str to stdout (nothing if str = 0)
char * x_strdup(const char *s)
duplicate a string
void free_ifnotnull(void *ptr)
free if ptr is not null
gcc examples/readme.c -Iincludes/ -L. -ltinylibc
./a.out
Install
git clone https://github.com/Saverio976/tinylibc.git
cd tinylibc
Build
this will output the file libtinylibc.a
object are compiled to obj
folder (and makefile dont relink !!!) (i'm proud of that xD)
Use it
compile your c code (change value of CC to your c compiler and PATHTINYLIBC to the right value):
export CC=gcc
export PATHTINYLIBC=path/where/libtinylibc.a/is/
$CC -L $PATHTINYLIBC -ltinylibc -I $PATHTINYLIBC/includes
Utils
there is rule in the makefile that remove some files uneeded for use only: