summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-12-17 07:55:59 +0100
committerTyge Løvset <[email protected]>2020-12-17 07:55:59 +0100
commitbc2981ee8fa3cba0be0d0efb1e2a2072c98ca5a0 (patch)
tree2e848e43a77cf4507645d7b89231c9a726b3ec05 /docs
parent214a2aa75d164d285661719131f54c71fa2f8e37 (diff)
downloadSTC-modified-bc2981ee8fa3cba0be0d0efb1e2a2072c98ca5a0.tar.gz
STC-modified-bc2981ee8fa3cba0be0d0efb1e2a2072c98ca5a0.zip
API change: Reverted back to original name used for .val in iterators to .ref
Diffstat (limited to 'docs')
-rw-r--r--docs/carray_api.md8
-rw-r--r--docs/clist_api.md22
-rw-r--r--docs/cmap_api.md10
-rw-r--r--docs/copt_api.md2
-rw-r--r--docs/cptr_api.md6
-rw-r--r--docs/cqueue_api.md2
-rw-r--r--docs/crand_api.md6
-rw-r--r--docs/cset_api.md12
-rw-r--r--docs/cstr_api.md2
-rw-r--r--docs/cvec_api.md20
10 files changed, 45 insertions, 45 deletions
diff --git a/docs/carray_api.md b/docs/carray_api.md
index 9d80ad13..24841448 100644
--- a/docs/carray_api.md
+++ b/docs/carray_api.md
@@ -19,7 +19,7 @@ be replaced by `my` in all of the following documentation. The `#` character sho
|:---------------------|:------------------------------|:--------------------------|
| `carray#X` | `struct { ... }` | The carray type |
| `carray#X_value_t` | `Value` | The value type |
-| `carray#X_iter_t` | `struct { Value *val; }` | Iterator type |
+| `carray#X_iter_t` | `struct { Value *ref; }` | Iterator type |
## Constants and macros
@@ -46,9 +46,9 @@ All cset definitions and prototypes may be included in your C source file by inc
### Constructors
```c
-carray1X carray1X_init(size_t xdim, Value val);
-carray2X carray2X_init(size_t ydim, size_t xdim, Value val);
-carray3X carray3X_init(size_t zdim, size_t ydim, size_t xdim, Value val);
+carray1X carray1X_init(size_t xdim, Value ref);
+carray2X carray2X_init(size_t ydim, size_t xdim, Value ref);
+carray3X carray3X_init(size_t zdim, size_t ydim, size_t xdim, Value ref);
carray1X carray1X_from(Value* array, size_t xdim);
carray2X carray2X_from(Value* array, size_t ydim, size_t xdim);
carray3X carray3X_from(Value* array, size_t zdim, size_t ydim, size_t xdim);
diff --git a/docs/clist_api.md b/docs/clist_api.md
index 8bb48b37..f3f17270 100644
--- a/docs/clist_api.md
+++ b/docs/clist_api.md
@@ -29,7 +29,7 @@ using_clist(str, cstr_t, cstr_del, cstr_compare_raw, const char*, cstr_to_raw, c
| `clist_X_value_t` | `Value` | The clist element type |
| `clist_X_input_t` | `clist_X_value_t` | clist input type |
| `clist_X_rawvalue_t` | `RawValue` | clist raw value type |
-| `clist_X_iter_t` | `struct { clist_value_t *val; ... }`| clist iterator |
+| `clist_X_iter_t` | `struct { clist_value_t *ref; ... }`| clist iterator |
## Constants and macros
@@ -61,15 +61,15 @@ clist_X_value_t* clist_X_front(clist_X* self);
clist_X_value_t* clist_X_back(clist_X* self);
void clist_X_push_n(clist_X *self, const clist_X_input_t in[], size_t size);
-void clist_X_emplace_back(clist_X* self, RawValue val);
+void clist_X_emplace_back(clist_X* self, RawValue ref);
void clist_X_push_back(clist_X* self, Value value);
-void clist_X_emplace_front(clist_X* self, RawValue val);
+void clist_X_emplace_front(clist_X* self, RawValue ref);
void clist_X_push_front(clist_X* self, Value value);
void clist_X_pop_front(clist_X* self);
-clist_X_iter_t clist_X_emplace_after(clist_X* self, clist_X_iter_t pos, RawValue val);
-clist_X_iter_t clist_X_insert_after(clist_X* self, clist_X_iter_t pos, Value val);
+clist_X_iter_t clist_X_emplace_after(clist_X* self, clist_X_iter_t pos, RawValue ref);
+clist_X_iter_t clist_X_insert_after(clist_X* self, clist_X_iter_t pos, Value ref);
clist_X_iter_t clist_X_erase_after(clist_X* self, clist_X_iter_t pos);
clist_X_iter_t clist_X_erase_range_after(clist_X* self, clist_X_iter_t pos, clist_X_iter_t finish);
@@ -78,11 +78,11 @@ void clist_X_splice_front(clist_X* self, clist_X* other);
void clist_X_splice_back(clist_X* self, clist_X* other);
void clist_X_splice_after(clist_X* self, clist_X_iter_t pos, clist_X* other);
-clist_X_iter_t clist_X_find(const clist_X* self, RawValue val);
+clist_X_iter_t clist_X_find(const clist_X* self, RawValue ref);
clist_X_iter_t clist_X_find_before(const clist_X* self,
- clist_X_iter_t first, clist_X_iter_t finish, RawValue val);
+ clist_X_iter_t first, clist_X_iter_t finish, RawValue ref);
-size_t clist_X_remove(clist_X* self, RawValue val);
+size_t clist_X_remove(clist_X* self, RawValue ref);
void clist_X_sort(clist_X* self);
@@ -93,7 +93,7 @@ clist_X_iter_t clist_X_end(const clist_X* self);
void clist_X_next(clist_X_iter_t* it);
clist_X_value_t* clist_X_itval(clist_X_iter_t it);
-Value clist_X_value_from_raw(RawValue val);
+Value clist_X_value_from_raw(RawValue ref);
```
## Example
@@ -116,13 +116,13 @@ int main() {
printf("initial: ");
c_foreach (i, clist_d, list)
- printf(" %g", *i.val);
+ printf(" %g", *i.ref);
clist_d_sort(&list); // mergesort O(n*log n)
printf("\nsorted: ");
c_foreach (i, clist_d, list)
- printf(" %g", *i.val);
+ printf(" %g", *i.ref);
clist_d_del(&list);
}
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 197d4b92..b1fd7a3a 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -51,7 +51,7 @@ using_cmap(str, cstr_t, cstr_t, cstr_del, cstr_equals_raw, cstr_hash_raw,
| `cmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type |
| `cmap_X_input_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawVal type |
| `cmap_X_result_t` | `struct { cmap_X_value_t first; bool second; }` | Result of insert/put/emplace |
-| `cmap_X_iter_t` | `struct { cmap_X_value_t *val; ... }` | Iterator type |
+| `cmap_X_iter_t` | `struct { cmap_X_value_t *ref; ... }` | Iterator type |
## Constants and macros
@@ -61,7 +61,7 @@ using_cmap(str, cstr_t, cstr_t, cstr_del, cstr_equals_raw, cstr_hash_raw,
| `cmap_empty(map)` | Test for empty map |
| `cmap_size(map)` | Get map size |
| `cmap_capacity(map)` | Get map capacity |
-| `c_try_emplace(self, ctype, key, val)` | Emplace if key exist |
+| `c_try_emplace(self, ctype, key, ref)` | Emplace if key exist |
## Header file
@@ -98,7 +98,7 @@ cmap_X_result_t cmap_X_put_mapped(cmap_X* self, RawKey rkey, Mapped mapped);
cmap_X_mapped_t* cmap_X_at(const cmap_X* self, RawKey rkey);
size_t cmap_X_erase(cmap_X* self, RawKey rkey);
-void cmap_X_erase_entry(cmap_X* self, cmap_X_value_t* val);
+void cmap_X_erase_entry(cmap_X* self, cmap_X_value_t* ref);
cmap_X_iter_t cmap_X_erase_at(cmap_X* self, cmap_X_iter_t pos);
cmap_X_value_t* cmap_X_find(const cmap_X* self, RawKey rkey);
@@ -134,7 +134,7 @@ int main()
// Iterate and print keys and values of unordered map
c_foreach (n, cmap_str, u) {
- printf("Key:[%s] Value:[%s]\n", n.val->first.str, n.val->second.str);
+ printf("Key:[%s] Value:[%s]\n", n.ref->first.str, n.ref->second.str);
}
// Add two new entries to the unordered map
@@ -179,7 +179,7 @@ int main()
cmap_id_put(&idnames, 80, cstr_from("White"));
c_foreach (i, cmap_id, idnames)
- printf("%d: %s\n", i.val->first, i.val->second.str);
+ printf("%d: %s\n", i.ref->first, i.ref->second.str);
puts("");
cmap_id_del(&idnames);
diff --git a/docs/copt_api.md b/docs/copt_api.md
index 819ac7b3..3c0d1719 100644
--- a/docs/copt_api.md
+++ b/docs/copt_api.md
@@ -22,7 +22,7 @@ typedef struct {
typedef struct {
const char *name;
int has_arg;
- int val;
+ int ref;
} copt_long_t;
```
diff --git a/docs/cptr_api.md b/docs/cptr_api.md
index 6273833e..560db243 100644
--- a/docs/cptr_api.md
+++ b/docs/cptr_api.md
@@ -51,7 +51,7 @@ int cptr_X_compare(cptr_X* x, cptr_X* y);
```
```c
csptr_X csptr_X_from(csptr_X_value_t* ptr);
-csptr_X csptr_X_make(csptr_X_value_t val);
+csptr_X csptr_X_make(csptr_X_value_t ref);
csptr_X csptr_X_share(csptr_X ptr);
void csptr_X_reset(csptr_X* self, csptr_X_value_t* p);
void csptr_X_del(csptr_X* self);
@@ -101,14 +101,14 @@ int main() {
puts("cvec of cptr<Person>:");
cvec_pp_sort(&pvec);
c_foreach (i, cvec_pp, pvec)
- printf(" %s %s\n", (*i.val)->name.str, (*i.val)->last.str);
+ printf(" %s %s\n", (*i.ref)->name.str, (*i.ref)->last.str);
cvec_ps svec = cvec_inits;
for (int i=0;i<6; i+=2) cvec_ps_push_back(&svec, csptr_ps_from(Person_make(c_new(Person), names[i], names[i+1])));
puts("cvec of csptr<Person>:");
cvec_ps_sort(&svec);
c_foreach (i, cvec_ps, svec)
- printf(" %s %s\n", i.val->get->name.str, i.val->get->last.str);
+ printf(" %s %s\n", i.ref->get->name.str, i.ref->get->last.str);
csptr_ps x = csptr_ps_share(svec.data[1]);
diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md
index b5cbfe29..4645cbeb 100644
--- a/docs/cqueue_api.md
+++ b/docs/cqueue_api.md
@@ -72,7 +72,7 @@ int main() {
cqueue_i_pop(&queue);
c_foreach (i, cqueue_i, queue)
- printf(" %d", *i.val);
+ printf(" %d", *i.ref);
cqueue_i_del(&queue);
}
diff --git a/docs/crand_api.md b/docs/crand_api.md
index df452a49..3eb0bf43 100644
--- a/docs/crand_api.md
+++ b/docs/crand_api.md
@@ -95,16 +95,16 @@ int main()
// Transfer map to vec and sort it by map entry keys.
cvec_e vhist = cvec_e_init();
c_foreach (i, cmap_i, mhist)
- cvec_e_push_back(&vhist, *i.val);
+ cvec_e_push_back(&vhist, *i.ref);
cvec_e_sort(&vhist);
// Print the gaussian bar chart
cstr_t bar = cstr_init();
c_foreach (i, cvec_e, vhist) {
- size_t n = (size_t) (i.val->second * StdDev * Scale * 2.5 / N);
+ size_t n = (size_t) (i.ref->second * StdDev * Scale * 2.5 / N);
if (n > 0) {
cstr_resize(&bar, n, '*');
- printf("%4d %s\n", i.val->first, bar.str);
+ printf("%4d %s\n", i.ref->first, bar.str);
}
}
diff --git a/docs/cset_api.md b/docs/cset_api.md
index 3e63f383..223dd1cf 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -32,7 +32,7 @@ be replaced by `my` in all of the following documentation.
| `cset_X_value_t` | `Key` | The value type |
| `cset_X_result_t` | `struct { Key first; bool second; }` | Result of insert/emplace |
| `cset_X_input_t` | `cset_X_rawkey_t` | The input type (rawkey) |
-| `cset_X_iter_t` | `struct { cset_X_value_t *val; ... }` | Iterator type |
+| `cset_X_iter_t` | `struct { cset_X_value_t *ref; ... }` | Iterator type |
## Constants and macros
@@ -42,7 +42,7 @@ be replaced by `my` in all of the following documentation.
| `cset_empty(set)` | Test for empty set |
| `cset_size(set)` | Get set size |
| `cset_capacity(set)` | Get set capacity |
-| `c_try_emplace(self, ctype, key, val)` | Emplace if key exist |
+| `c_try_emplace(self, ctype, key, ref)` | Emplace if key exist |
## Header file
@@ -110,13 +110,13 @@ int main ()
cset_str_emplace(&fourth, "flour");
cset_str fifth = cset_inits;
- c_foreach (x, cset_str, second) cset_str_emplace(&fifth, x.val->str);
- c_foreach (x, cset_str, third) cset_str_emplace(&fifth, x.val->str);
- c_foreach (x, cset_str, fourth) cset_str_emplace(&fifth, x.val->str);
+ c_foreach (x, cset_str, second) cset_str_emplace(&fifth, x.ref->str);
+ c_foreach (x, cset_str, third) cset_str_emplace(&fifth, x.ref->str);
+ c_foreach (x, cset_str, fourth) cset_str_emplace(&fifth, x.ref->str);
c_del(cset_str, &first, &second, &third, &fourth);
printf("fifth contains:\n\n");
- c_foreach (x, cset_str, fifth) printf("%s\n", x.val->str);
+ c_foreach (x, cset_str, fifth) printf("%s\n", x.ref->str);
cset_str_del(&fifth);
return 0;
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 97fc4032..7a86ecc8 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -8,7 +8,7 @@ This describes the API of string type **cstr_t**.
|:------------------|:---------------------------------|:---------------------------|
| `cstr_t` | `struct { const char *str; }` | The string type |
| `cstr_value_t` | `char` | The string element type |
-| `cstr_iter_t` | `struct { cstr_value_t *val; }` | cstr_t iterator |
+| `cstr_iter_t` | `struct { cstr_value_t *ref; }` | cstr_t iterator |
## Constants and macros
diff --git a/docs/cvec_api.md b/docs/cvec_api.md
index d33a4d42..628d5acd 100644
--- a/docs/cvec_api.md
+++ b/docs/cvec_api.md
@@ -30,7 +30,7 @@ using_cvec(str, cstr_t, cstr_del, cstr_compare_raw, const char*, cstr_to_raw, cs
| `cvec_X_value_t` | `Value` | The cvec value type |
| `cvec_X_input_t` | `cvec_X_value_t` | The input type |
| `cvec_X_rawvalue_t` | `RawValue` | The raw value type |
-| `cvec_X_iter_t` | `struct { cvec_X_value_t* val; }` | The iterator type |
+| `cvec_X_iter_t` | `struct { cvec_X_value_t* ref; }` | The iterator type |
## Constants and macros
@@ -73,12 +73,12 @@ cvec_X_value_t* cvec_X_front(cvec_X* self);
cvec_X_value_t* cvec_X_back(cvec_X* self);
void cvec_X_push_n(cvec_X *self, const cvec_X_input_t arr[], size_t size);
-void cvec_X_emplace_back(cvec_X* self, RawValue val);
+void cvec_X_emplace_back(cvec_X* self, RawValue ref);
void cvec_X_push_back(cvec_X* self, Value value);
void cvec_X_pop_back(cvec_X* self);
-cvec_X_iter_t cvec_X_emplace(cvec_X* self, cvec_X_iter_t pos, RawValue val);
-cvec_X_iter_t cvec_X_emplace_at(cvec_X* self, size_t idx, RawValue val);
+cvec_X_iter_t cvec_X_emplace(cvec_X* self, cvec_X_iter_t pos, RawValue ref);
+cvec_X_iter_t cvec_X_emplace_at(cvec_X* self, size_t idx, RawValue ref);
cvec_X_iter_t cvec_X_insert(cvec_X* self, cvec_X_iter_t pos, Value value);
cvec_X_iter_t cvec_X_insert_at(cvec_X* self, size_t idx, Value value);
cvec_X_iter_t cvec_X_insert_range(cvec_X* self, cvec_X_iter_t pos,
@@ -91,9 +91,9 @@ cvec_X_iter_t cvec_X_erase_n(cvec_X* self, size_t idx, size_t n);
cvec_X_iter_t cvec_X_erase_range(cvec_X* self, cvec_X_iter_t first, cvec_X_iter_t finish);
cvec_X_iter_t cvec_X_erase_range_p(cvec_X* self, cvec_X_value_t* pfirst, cvec_X_value_t* pfinish);
-cvec_X_iter_t cvec_X_find(const cvec_X* self, RawValue val);
+cvec_X_iter_t cvec_X_find(const cvec_X* self, RawValue ref);
cvec_X_iter_t cvec_X_find_in_range(const cvec_X* self,
- cvec_X_iter_t first, cvec_X_iter_t finish, RawValue val);
+ cvec_X_iter_t first, cvec_X_iter_t finish, RawValue ref);
void cvec_X_sort(cvec_X* self);
void cvec_X_sort_with(cvec_X* self, size_t ifirst, size_t ifinish,
@@ -105,7 +105,7 @@ void cvec_X_next(cvec_X_iter_t* it);
cvec_X_value_t* cvec_X_itval(cvec_X_iter_t it);
size_t cvec_X_index(const cvec_X vec, cvec_X_iter_t it);
-Value cvec_X_value_from_raw(RawValue val);
+Value cvec_X_value_from_raw(RawValue ref);
```
## Examples
@@ -126,7 +126,7 @@ int main()
printf("initial: ");
c_foreach (n, cvec_i, vec) {
- printf(" %d", *n.val);
+ printf(" %d", *n.ref);
}
// Sort the vector
@@ -134,7 +134,7 @@ int main()
printf("\nsorted: ");
c_foreach (n, cvec_i, vec) {
- printf(" %d", *n.val);
+ printf(" %d", *n.ref);
}
cvec_i_del(&vec);
@@ -166,7 +166,7 @@ int main() {
printf("%s\n", names.data[1].str); // Access the second element
c_foreach (i, cvec_str, names)
- printf("item: %s\n", i.val->str);
+ printf("item: %s\n", i.ref->str);
cvec_str_del(&names);
}
```