A simple helper C header-only library that implements lists, vectors, pairs, maps and some utility functions.
- C 98.8%
- Makefile 1.2%
| .gitignore | first old code commit | |
| COPYING | added license | |
| cutils.h | changed author email | |
| ex.c | changed author email | |
| Makefile | changed author email | |
| README | typo | |
cutils - a little header only helper C library =========== Description =========== cutils is a simple helper C library that I wrote some time ago, which implements lists, vectors, pairs, maps and some utility functions (not optimized). ===== Usage ===== Simply copy and include it in your source: #include "cutils.h" To declare your type, just use one of dectype directives: - dectype_vector - dectype_list - dectype_pair - dectype_map And after that, in your '.c' files do - define_vector - define_list - define_pair - define_map For example, to declare a vector of strings, do (ex. in header): > dectype_vector(char*, myvec_t) From now on, you can define objects of myvec_t type, and use them: > define_vector(char*, myvec_t) // preferably after includes (not in funcs!) > myvec_t* t = alloc(myvec_t); ------------------------- Other utilities functions ------------------------- To use utility functions do: > declare_utils() // perhaps in your headers > define_utils() // in your '.c' files To know additional details, please see the included example ex.c. License: GPL3