1
0
Fork
You've already forked cutils
0
A simple helper C header-only library that implements lists, vectors, pairs, maps and some utility functions.
  • C 98.8%
  • Makefile 1.2%
Find a file
2024年12月21日 23:40:12 +01:00
.gitignore first old code commit 2022年06月02日 19:00:24 +02:00
COPYING added license 2022年06月02日 19:05:29 +02:00
cutils.h changed author email 2024年12月21日 23:40:12 +01:00
ex.c changed author email 2024年12月21日 23:40:12 +01:00
Makefile changed author email 2024年12月21日 23:40:12 +01:00
README typo 2022年09月10日 18:08:43 +02:00

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