connglli / tlfc

tiny lib for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tlfc - tiny library for c

This is a tiny lib for c, implemented easily, which you can care nothing about type casting.

content

This lib includes some data structures as well as some easy but often used functions.

api intro

The api of tlfc is all the same among these data structures:

  • make_xxx: create/alloc and then initialize a data structure, e.g. make_array, usually used as array_int_t a = make_array(), but some may not have make method, e.g. pool_t
  • xxx_init: initialize a data structure, e.g. list_init, usually used as array_int_t a; array_init(&a)
  • xxx_get: get data/nodes of a data structure, e.g. array_get
  • xxx_set: set data/nodes of a data structure, e.g. array_set
  • xxx_insert: insert data/nodes of a data structure, e.g. list_insert
  • xxx_remove: remove data/nodes of a data structure, e.g. list_remove
  • xxx_deinit: destroy a data structure, e.g. list_deinit

In almost all api, if your access is invalid, the program will crash.

examples

You can check source code of coro, it uses pool and list.

thanks

About

tiny lib for C


Languages

Language:C 96.6%Language:Assembly 2.5%Language:C++ 0.5%Language:Makefile 0.4%