summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-02-20 16:57:09 +0100
committerTyge Løvset <[email protected]>2021-02-20 16:57:09 +0100
commit4d9378ef420b4787208a742057a60dcf408ef741 (patch)
treebb6b2a425308c5f1ae8bcb330c9e77114c555480 /docs
parentb24dd76490733666f7f7b3147c5c64a75c973ac6 (diff)
downloadSTC-modified-4d9378ef420b4787208a742057a60dcf408ef741.tar.gz
STC-modified-4d9378ef420b4787208a742057a60dcf408ef741.zip
Internal renaming improvements.
Diffstat (limited to 'docs')
-rw-r--r--docs/cdeq_api.md2
-rw-r--r--docs/clist_api.md2
-rw-r--r--docs/cmap_api.md25
-rw-r--r--docs/cptr_api.md6
-rw-r--r--docs/csmap_api.md16
-rw-r--r--docs/cstr_api.md2
-rw-r--r--docs/cvec_api.md2
7 files changed, 27 insertions, 28 deletions
diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md
index 8061cbdd..ed4730c6 100644
--- a/docs/cdeq_api.md
+++ b/docs/cdeq_api.md
@@ -22,7 +22,7 @@ be replaced by `my` in all of the following documentation.
`using_cdeq_str()` is a shorthand for:
```
-using_cdeq(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*)
+using_cdeq(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*)
```
## Header file
diff --git a/docs/clist_api.md b/docs/clist_api.md
index c69d61d3..3482cede 100644
--- a/docs/clist_api.md
+++ b/docs/clist_api.md
@@ -29,7 +29,7 @@ Default values are given above for args not specified. `X` is a type tag name an
will affect the names of all clist types and methods. E.g. declaring `using_clist(my, int);`, `X` should
be replaced by `my` in all of the following documentation. `using_clist_str()` is a shorthand for
```c
-using_clist(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*)
+using_clist(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*)
```
## Header file
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 1b953f1d..ccd4532f 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -197,17 +197,17 @@ Demonstrate cmap with plain-old-data key type Vec3i and int as mapped type: cmap
typedef struct { int x, y, z; } Vec3i;
-using_cmap(v3, Vec3i, int, c_mem_equals, // compare Vec3i bitwise
+using_cmap(v3, Vec3i, int, c_memcmp_equals, // compare Vec3i bitwise
c_default_hash); // hash Vec3i bitwise.
int main()
{
cmap_v3 vecs = cmap_v3_init();
- cmap_v3_emplace_put(&vecs, (Vec3i){100, 0, 0}, 1);
- cmap_v3_emplace_put(&vecs, (Vec3i){ 0, 100, 0}, 2);
- cmap_v3_emplace_put(&vecs, (Vec3i){ 0, 0, 100}, 3);
- cmap_v3_emplace_put(&vecs, (Vec3i){100, 100, 100}, 4);
+ cmap_v3_emplace(&vecs, (Vec3i){100, 0, 0}, 1);
+ cmap_v3_emplace(&vecs, (Vec3i){ 0, 100, 0}, 2);
+ cmap_v3_emplace(&vecs, (Vec3i){ 0, 0, 100}, 3);
+ cmap_v3_emplace(&vecs, (Vec3i){100, 100, 100}, 4);
c_foreach (i, cmap_v3, vecs)
printf("{ %3d, %3d, %3d }: %d\n", i.ref->first.x, i.ref->first.y, i.ref->first.z, i.ref->second);
@@ -235,10 +235,10 @@ using_cmap(iv, int, Vec3i);
int main()
{
cmap_iv vecs = cmap_iv_init();
- cmap_iv_emplace_put(&vecs, 1, (Vec3i){100, 0, 0});
- cmap_iv_emplace_put(&vecs, 2, (Vec3i){ 0, 100, 0});
- cmap_iv_emplace_put(&vecs, 3, (Vec3i){ 0, 0, 100});
- cmap_iv_emplace_put(&vecs, 4, (Vec3i){100, 100, 100});
+ cmap_iv_emplace(&vecs, 1, (Vec3i){100, 0, 0});
+ cmap_iv_emplace(&vecs, 2, (Vec3i){ 0, 100, 0});
+ cmap_iv_emplace(&vecs, 3, (Vec3i){ 0, 0, 100});
+ cmap_iv_emplace(&vecs, 4, (Vec3i){100, 100, 100});
c_foreach (i, cmap_iv, vecs)
printf("%d: { %3d, %3d, %3d }\n", i.ref->first, i.ref->second.x, i.ref->second.y, i.ref->second.z);
@@ -294,11 +294,10 @@ static inline VikingRaw viking_toRaw(Viking* vk) {
VikingRaw raw = {vk->name.str, vk->country.str}; return raw;
}
-// With this in place, we use the full using_cmap() macro to define {Viking -> int} hash map type:
+// With this in place, we use the using_cmap_keyarg() macro to define {Viking -> int} hash map type:
-using_cmap(vk, Viking, int, vikingraw_equals, vikingraw_hash,
- c_default_del, c_default_clone, // mapped: int => use default.
- viking_del, viking_fromRaw, viking_toRaw, VikingRaw);
+using_cmap_keyarg(vk, Viking, int, vikingraw_equals, vikingraw_hash,
+ viking_del, viking_fromRaw, viking_toRaw, VikingRaw);
int main()
{
diff --git a/docs/cptr_api.md b/docs/cptr_api.md
index 747f463c..baf31177 100644
--- a/docs/cptr_api.md
+++ b/docs/cptr_api.md
@@ -11,7 +11,7 @@ The pointed-to elements are automatically destructed and deleted when the contai
```c
using_cptr(X, Value, valueCompare=c_default_compare,
valueDestroy=c_default_del,
- valueClone=c_default_clone)
+ valueClone=c_default_fromraw)
using_csptr(X, Value, valueCompare=c_default_compare,
valueDestroy=c_default_del,
@@ -86,8 +86,8 @@ void Person_del(Person* p) {
c_del(cstr, &p->name, &p->last);
}
// declare managed pointer and cvec with pointers
-using_cptr(pe, Person, c_no_compare, Person_del, c_no_clone);
-using_cvec(pe, Person*, c_no_compare, cptr_pe_del, c_no_clone);
+using_cptr(pe, Person, c_no_compare, Person_del, c_no_fromraw);
+using_cvec(pe, Person*, c_no_compare, cptr_pe_del, c_no_fromraw);
int main() {
cvec_pe vec = cvec_pe_init();
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index ffbf7db4..7bc52406 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -189,10 +189,10 @@ int main()
{
csmap_vi vecs = csmap_vi_init();
- csmap_vi_emplace_put(&vecs, (Vec3i){100, 0, 0}, 1);
- csmap_vi_emplace_put(&vecs, (Vec3i){ 0, 100, 0}, 2);
- csmap_vi_emplace_put(&vecs, (Vec3i){ 0, 0, 100}, 3);
- csmap_vi_emplace_put(&vecs, (Vec3i){100, 100, 100}, 4);
+ csmap_vi_emplace(&vecs, (Vec3i){100, 0, 0}, 1);
+ csmap_vi_emplace(&vecs, (Vec3i){ 0, 100, 0}, 2);
+ csmap_vi_emplace(&vecs, (Vec3i){ 0, 0, 100}, 3);
+ csmap_vi_emplace(&vecs, (Vec3i){100, 100, 100}, 4);
c_foreach (i, csmap_vi, vecs)
printf("{ %3d, %3d, %3d }: %d\n", i.ref->first.x, i.ref->first.y, i.ref->first.z, i.ref->second);
@@ -220,10 +220,10 @@ using_csmap(iv, int, Vec3i);
int main()
{
csmap_iv vecs = csmap_iv_init();
- csmap_iv_emplace_put(&vecs, 1, (Vec3i){100, 0, 0});
- csmap_iv_emplace_put(&vecs, 2, (Vec3i){ 0, 100, 0});
- csmap_iv_emplace_put(&vecs, 3, (Vec3i){ 0, 0, 100});
- csmap_iv_emplace_put(&vecs, 4, (Vec3i){100, 100, 100});
+ csmap_iv_emplace(&vecs, 1, (Vec3i){100, 0, 0});
+ csmap_iv_emplace(&vecs, 2, (Vec3i){ 0, 100, 0});
+ csmap_iv_emplace(&vecs, 3, (Vec3i){ 0, 0, 100});
+ csmap_iv_emplace(&vecs, 4, (Vec3i){100, 100, 100});
c_foreach (i, csmap_iv, vecs)
printf("%d: { %3d, %3d, %3d }\n", i.ref->first, i.ref->second.x, i.ref->second.y, i.ref->second.z);
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 9703e4ff..773ef3cc 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -93,7 +93,7 @@ Iterator methods, typically used via the general *c_foreach* macro.
```
`1-2)` Read a line of text from *stream* and store it in string. Line is separated by *delim*, which is *'\n'* in `1)`.
```c
- const char* cstr_to_raw(const cstr* x);
+ const char* cstr_c_str(const cstr* x);
int cstr_compare_raw(const char** x, const char** y);
bool cstr_equals_raw(const char** x, const char** y);
uint32_t cstr_hash_raw(const char* const* x, size_t ignored);
diff --git a/docs/cvec_api.md b/docs/cvec_api.md
index ef5c9f99..fdbd879f 100644
--- a/docs/cvec_api.md
+++ b/docs/cvec_api.md
@@ -26,7 +26,7 @@ be replaced by `my` in all of the following documentation.
`using_cvec_str()` is a shorthand for:
```
-using_cvec(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*)
+using_cvec(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*)
```
## Header file