summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-06-20 20:54:59 +0200
committerGitHub <[email protected]>2020-06-20 20:54:59 +0200
commit630cd3059f43e88af1592827675d667250428c04 (patch)
treec2473973d16a912ac5b44336ff23ecd0a3cc895f
parent173d32f0eb194b30b40fb5eb6e708bc3c4f8f421 (diff)
downloadSTC-modified-630cd3059f43e88af1592827675d667250428c04.tar.gz
STC-modified-630cd3059f43e88af1592827675d667250428c04.zip
Update README.md
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index 689a62bd..26fbaeac 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,29 @@ An elegant, modern, generic, typesafe, and very efficient standard container lib
This is a small headers only library with the most used container components: **cstring**, **cvector**, **carray**, **clist** and **chash**.
+All containers, except CString is generic (similar to templates in C++). Typical usage is:
+```
+#include <stc/vector.h>
+declare_CVector(my, int);
+int main(void) {
+ CVector_my vec = cvector_init;
+ cvector_pushBack(&vec, 123);
+ cvector_destroy(&vec);
+}
+```
+Installation
+------------
+
+This is a header only library, so files can simply be included in your program. The functions will be inlined by default. If the library is extensively used accross many files with same instantiated type, it can alternatively be compiled as a library in order to minimize executable size. In that case, specify -DSTC_HEADER on the compiler line, and create one file that contains all implementations of containers, e.g.
+```
+#define STC_IMPLEMENT
+#include <stc/vector.h>
+#include <stc/map.h>
+declare_CVector(my, int);
+declare_CMap(my, int, int);
+...
+```
+
Usage by examples
-----------------