summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-03-11 15:01:56 +0100
committerGitHub <[email protected]>2020-03-11 15:01:56 +0100
commitcb376ebcbe9f2c1c280a13d7a528926e2b2e4f24 (patch)
tree235e17817e97e7343fb48e99d4f627b9bbb1dfa9
parent5cb3bdd51bd20b7d73914bdd363927b9210baaa7 (diff)
downloadSTC-modified-cb376ebcbe9f2c1c280a13d7a528926e2b2e4f24.tar.gz
STC-modified-cb376ebcbe9f2c1c280a13d7a528926e2b2e4f24.zip
Update
-rw-r--r--README.md30
1 files changed, 23 insertions, 7 deletions
diff --git a/README.md b/README.md
index 86bbae5b..ea935a3d 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,33 @@
-# C99Containers
+# c_Lib
Introduction
------------
-Typesafe, efficient, generic C99 containers: c_String, c_Vector and c_Hashmap
+A modern, typesafe, very efficient, generic C99 container library: String, Vector and Hashmap
-Headers only library with the most useful data structures: string, dynamic vector/stack, and map/assosiative array.
-
-The map is using open hashing with a novel probing strategy (fibonacci sequence), which is as efficient as quadratic probing, but has none of its limitations (max half full table, and prime number table length only requirements).
-
-The library has an intuitive and straight forward API, and is fully type safe. It uses "overloadable macros", to simplify usage.
+Headers only library with the most used data structures: string, dynamic vector/stack, and map/assosiative array. The library has an intuitive and API, somewhat im. It uses overloadable macros to simplify usage.
Usage
-----
+c_String demo:
+```
+#include "c_string.h"
+
+int main() {
+ c_String cs = c_string_make("one-nine-three-seven-five");
+ printf("%s.\n", cs.str);
+ c_string_insert(&cs, 3, "-two");
+ printf("%s.\n", cs.str);
+ c_string_erase(&cs, 7, 5); // -nine
+ printf("%s.\n", cs.str);
+ c_string_replace(&cs, 0, "seven", "four");
+ printf("%s.\n", cs.str);
+ printf("find: %s\n", cs.str + c_string_find(cs, 0, "four"));
+ // reassign:
+ c_string_assign(&cs, "one two three four five six seven");
+ c_string_append(&cs, " eight");
+ printf("append: %s\n", cs.str);
+}
+```
Simple c_Vector of 64bit ints:
```
#include "c_vector.h"