diff options
| author | Tyge Løvset <[email protected]> | 2021-12-22 09:07:40 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-22 09:07:40 +0100 |
| commit | f69f26927edb7e2850a5a235ed5117f278f437a1 (patch) | |
| tree | 7ed42e8654c81f3c3a49298b53530c1f9d5400ac | |
| parent | 6e65e30c6e3c2bc271d3885e749ceb0289bbd9cf (diff) | |
| download | STC-modified-f69f26927edb7e2850a5a235ed5117f278f437a1.tar.gz STC-modified-f69f26927edb7e2850a5a235ed5117f278f437a1.zip | |
Renamed '_rawvalue\b' to '_raw'
35 files changed, 75 insertions, 75 deletions
@@ -37,10 +37,10 @@ Replace (whole word + match case): - Added [**cbox**](docs/cbox_api.md) type: container of one element, similar to [std::unique_ptr](https://en.cppreference.com/w/cpp/memory/unique_ptr) - Added [example for **csptr**](examples/sptr_to_maps.c). - Added [**c_forpair**](docs/ccommon_api.md) macro: for-loop with "structured binding". -- Deprecated *csptr_X_make()*. Renamed to *csptr_X_new()*. Corresponding **cbox** method is *cbox_X_new()*. -- Deprecated *c_default_fromraw(raw)*. Renamed to *c_default_clone(raw)*. -- Deprecated `i_key_csptr` / `i_val_csptr`. Use `i_key_bind` / `i_val_bind` for types that has required functions defined. -- Deprecated `i_cnt`. Use `i_type` instead to define the complete container type name. +- Renamed: *csptr_X_make()* to *csptr_X_new()*. Corresponding **cbox** method is *cbox_X_new()*. +- Renamed: *c_default_fromraw(raw)* to *c_default_clone(raw)*. +- Renamed: `i_key_csptr` / `i_val_csptr`. Use `i_key_sptr` / `i_val_sptr` for **csptr** and **cbox**. +- Renamed: `i_cnt` to `i_type` for defining the complete container type name. - Added `i_opt` template parameter: compile-time options: `c_no_cmp`, `c_no_clone`, `c_no_atomic`, `c_is_fwd`; may be combined with `|` ### Version 2.0. Two main breaking changes from V1.X. @@ -200,7 +200,7 @@ int main(void) { c_apply(v, clist_int_push_back(&lst, v), int, {10, 20, 30}); c_apply(v, cstack_int_push(&stk, v), int, {10, 20, 30}); c_apply(v, csmap_int_insert(&map, c_pair(v)), - csmap_int_rawvalue, { {20, 2}, {10, 1}, {30, 3} }); + csmap_int_raw, { {20, 2}, {10, 1}, {30, 3} }); // add one more element to each container cset_int_insert(&set, 40); diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index eec56490..9c872519 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -137,7 +137,7 @@ c_forrange (i, int, 30, 0, -5) printf(" %d", i); // apply multiple push_backs c_apply(v, cvec_i_push_back(&vec, v), int, {1, 2, 3}); // inserts to existing map -c_apply(v, cmap_i_insert(&map, c_pair(v)), cmap_i_rawvalue, { {4, 5}, {6, 7} }); +c_apply(v, cmap_i_insert(&map, c_pair(v)), cmap_i_raw, { {4, 5}, {6, 7} }); int arr[] = {1, 2, 3}; c_apply_arr(v, cvec_i_push_back(&vec, v), int, arr, c_arraylen(arr)); diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md index ce14184f..b884c62d 100644 --- a/docs/cdeq_api.md +++ b/docs/cdeq_api.md @@ -78,7 +78,7 @@ cdeq_X_iter cdeq_X_begin(const cdeq_X* self); cdeq_X_iter cdeq_X_end(const cdeq_X* self); void cdeq_X_next(cdeq_X_iter* it); -cdeq_X_rawvalue cdeq_X_value_toraw(cdeq_X_value* pval); +cdeq_X_raw cdeq_X_value_toraw(cdeq_X_value* pval); cdeq_X_value cdeq_X_value_clone(cdeq_X_value val); ``` @@ -88,7 +88,7 @@ cdeq_X_value cdeq_X_value_clone(cdeq_X_value val); |:-------------------|:------------------------------------|:-----------------------| | `cdeq_X` | `struct { cdeq_X_value* data; }` | The cdeq type | | `cdeq_X_value` | `i_val` | The cdeq value type | -| `cdeq_X_rawvalue` | `i_valraw` | The raw value type | +| `cdeq_X_raw` | `i_valraw` | The raw value type | | `cdeq_X_iter` | `struct { cdeq_X_value* ref; }` | The iterator type | ## Examples diff --git a/docs/clist_api.md b/docs/clist_api.md index 41fbd274..fc54f40e 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -81,7 +81,7 @@ clist_X_iter clist_X_end(const clist_X* self); void clist_X_next(clist_X_iter* it); clist_X_iter clist_X_advance(clist_X_iter it, size_t n); // return n elements ahead. -clist_X_rawvalue clist_X_value_toraw(clist_X_value* pval); +clist_X_raw clist_X_value_toraw(clist_X_value* pval); clist_X_value clist_X_value_clone(clist_X_value val); ``` @@ -91,7 +91,7 @@ clist_X_value clist_X_value_clone(clist_X_value val); |:--------------------|:------------------------------------|:--------------------------| | `clist_X` | `struct { clist_X_node* last; }` | The clist type | | `clist_X_value` | `i_val` | The clist element type | -| `clist_X_rawvalue` | `i_valraw` | clist raw value type | +| `clist_X_raw` | `i_valraw` | clist raw value type | | `clist_X_iter` | `struct { clist_value *ref; ... }` | clist iterator | ## Example diff --git a/docs/cmap_api.md b/docs/cmap_api.md index b7a08e3e..38346e53 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -76,7 +76,7 @@ cmap_X_iter cmap_X_end(const cmap_X* self); void cmap_X_next(cmap_X_iter* it); cmap_X_value cmap_X_value_clone(cmap_X_value val); -cmap_X_rawvalue cmap_X_value_toraw(cmap_X_value* pval); +cmap_X_raw cmap_X_value_toraw(cmap_X_value* pval); ``` Helpers: ```c @@ -101,7 +101,7 @@ bool c_rawstr_eq(const char* const* a, const char* const* b); // | `cmap_X` | `struct { ... }` | The cmap type | | `cmap_X_rawkey` | `i_keyraw` | The raw key type | | `cmap_X_rawmapped` | `i_valraw` | The raw mapped type | -| `cmap_X_rawvalue` | `struct { i_keyraw first; i_valraw second; }` | i_keyraw + i_valraw type | +| `cmap_X_raw` | `struct { i_keyraw first; i_valraw second; }` | i_keyraw + i_valraw type | | `cmap_X_key` | `i_key` | The key type | | `cmap_X_mapped` | `i_val` | The mapped type | | `cmap_X_value` | `struct { const i_key first; i_val second; }` | The value: key is immutable | @@ -122,7 +122,7 @@ int main() // Create an unordered_map of three strings (that map to strings) c_auto (cmap_str, u) { - c_apply(v, cmap_str_emplace(&u, c_pair(v)), cmap_str_rawvalue, { + c_apply(v, cmap_str_emplace(&u, c_pair(v)), cmap_str_raw, { {"RED", "#FF0000"}, {"GREEN", "#00FF00"}, {"BLUE", "#0000FF"} @@ -168,7 +168,7 @@ int main() c_auto (cmap_id, idnames) { - c_apply(v, cmap_id_emplace(&idnames, c_pair(v)), cmap_id_rawvalue, { + c_apply(v, cmap_id_emplace(&idnames, c_pair(v)), cmap_id_raw, { {100, "Red"}, {110, "Blue"} }); // replace existing mapped value: @@ -384,7 +384,7 @@ static inline RViking Viking_toraw(const Viking* vk) { int main() { c_auto (Vikings, vikings) { - c_apply(v, Vikings_emplace(&vikings, v), c_pair(v), Vikings_rawvalue, { + c_apply(v, Vikings_emplace(&vikings, v), c_pair(v), Vikings_raw, { {{"Einar", "Norway"}, 20}, {{"Olaf", "Denmark"}, 24}, {{"Harald", "Iceland"}, 12}, diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md index 9fd2c4e0..0ecae014 100644 --- a/docs/cqueue_api.md +++ b/docs/cqueue_api.md @@ -52,7 +52,7 @@ i_val cqueue_X_value_clone(i_val value); |:--------------------|:---------------------|:-------------------------| | `cqueue_X` | `cdeq_X` | The cqueue type | | `cqueue_X_value` | `i_val` | The cqueue element type | -| `cqueue_X_rawvalue` | `i_valraw` | cqueue raw value type | +| `cqueue_X_raw` | `i_valraw` | cqueue raw value type | | `cqueue_X_iter` | `cdeq_X_iter` | cqueue iterator | ## Examples diff --git a/docs/cset_api.md b/docs/cset_api.md index 479cf3f3..18454dcf 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -65,7 +65,7 @@ cset_X_value cset_X_value_clone(cset_X_value val); |:-------------------|:-------------------------------------------------|:----------------------------|
| `cset_X` | `struct { ... }` | The cset type |
| `cset_X_rawkey` | `i_keyraw` | The raw key type |
-| `cset_X_rawvalue` | `i_keyraw` | The raw value type |
+| `cset_X_raw` | `i_keyraw` | The raw value type |
| `cset_X_key` | `i_key` | The key type |
| `cset_X_value` | `i_key` | The value |
| `cset_X_result` | `struct { cset_X_value* ref; bool inserted; }` | Result of insert/emplace |
diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 3791347b..c3f71a7c 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -73,7 +73,7 @@ void csmap_X_next(csmap_X_iter* iter); csmap_X_iter csmap_X_advance(csmap_X_iter it, size_t n); csmap_X_value csmap_X_value_clone(csmap_X_value val); -csmap_X_rawvalue csmap_X_value_toraw(csmap_X_value* pval); +csmap_X_raw csmap_X_value_toraw(csmap_X_value* pval); ``` ## Types @@ -82,7 +82,7 @@ csmap_X_rawvalue csmap_X_value_toraw(csmap_X_value* pval); | `csmap_X` | `struct { ... }` | The csmap type | | `csmap_X_rawkey` | `i_keyraw` | The raw key type | | `csmap_X_rawmapped` | `i_valraw` | The raw mapped type | -| `csmap_X_rawvalue` | `struct { i_keyraw first; i_valraw second; }` | i_keyraw+i_valraw type | +| `csmap_X_raw` | `struct { i_keyraw first; i_valraw second; }` | i_keyraw+i_valraw type | | `csmap_X_key` | `i_key` | The key type | | `csmap_X_mapped` | `i_val` | The mapped type | | `csmap_X_value` | `struct { const i_key first; i_val second; }` | The value: key is immutable | @@ -100,7 +100,7 @@ int main() // Create a sorted map of three strings (maps to string) c_auto (csmap_str, colors) // RAII { - c_apply(v, csmap_str_emplace(&colors, c_pair(v)), csmap_str_rawvalue, { + c_apply(v, csmap_str_emplace(&colors, c_pair(v)), csmap_str_raw, { {"RED", "#FF0000"}, {"GREEN", "#00FF00"}, {"BLUE", "#0000FF"} @@ -146,7 +146,7 @@ int main() csmap_id idnames = csmap_id_init(); c_autodefer (csmap_id_drop(&idnames)) { - c_apply(v, csmap_id_emplace(&idnames, c_pair(v)), csmap_id_rawvalue, { + c_apply(v, csmap_id_emplace(&idnames, c_pair(v)), csmap_id_raw, { {100, "Red"}, {110, "Blue"}, }); diff --git a/docs/csptr_api.md b/docs/csptr_api.md index 6a48f91a..95575417 100644 --- a/docs/csptr_api.md +++ b/docs/csptr_api.md @@ -101,17 +101,17 @@ int main() // POPULATE the stack with shared pointers to Map: Map *map; map = Stack_push(&stack, Arc_new(Map_init()))->get; - c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, { + c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, { {"Joey", 1990}, {"Mary", 1995}, {"Joanna", 1992} }); map = Stack_push(&stack, Arc_new(Map_init()))->get; - c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, { + c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, { {"Rosanna", 2001}, {"Brad", 1999}, {"Jack", 1980} }); // POPULATE the list: map = List_push_back(&list, Arc_new(Map_init()))->get; - c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, { + c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, { {"Steve", 1979}, {"Rick", 1974}, {"Tracy", 2003} }); diff --git a/docs/csset_api.md b/docs/csset_api.md index 62ccb638..01926453 100644 --- a/docs/csset_api.md +++ b/docs/csset_api.md @@ -60,7 +60,7 @@ csset_X_value csset_X_value_clone(csset_X_value val); |:-------------------|:--------------------------------------------------|:----------------------------|
| `csset_X` | `struct { ... }` | The csset type |
| `csset_X_rawkey` | `i_keyraw` | The raw key type |
-| `csset_X_rawvalue` | `i_keyraw` | The raw key type |
+| `csset_X_raw` | `i_keyraw` | The raw key type |
| `csset_X_key` | `i_key` | The key type |
| `csset_X_value` | `i_key ` | The value: key is immutable |
| `csset_X_result` | `struct { csset_X_value* ref; bool inserted; }` | Result of insert/emplace |
diff --git a/docs/cstack_api.md b/docs/cstack_api.md index b6992dc0..672b3168 100644 --- a/docs/cstack_api.md +++ b/docs/cstack_api.md @@ -55,11 +55,11 @@ i_val cstack_X_value_clone(i_val value); ## Types -| Type name | Type definition | Used to represent... | -|:--------------------|:---------------------------------------|:----------------------------| +| Type name | Type definition | Used to represent... | +|:--------------------|:-------------------------------------|:----------------------------| | `cstack_X` | `struct { cstack_value *data; ... }` | The cstack type | -| `cstack_X_value` | `i_val` | The cstack element type | -| `cstack_X_rawvalue` | `i_valraw` | cstack raw value type | +| `cstack_X_value` | `i_val` | The cstack element type | +| `cstack_X_raw` | `i_valraw` | cstack raw value type | | `cstack_X_iter` | `struct { cstack_value *ref; }` | cstack iterator | ## Example diff --git a/docs/cvec_api.md b/docs/cvec_api.md index 2a4ceaf6..ef145b94 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -86,7 +86,7 @@ cvec_X_iter cvec_X_begin(const cvec_X* self); cvec_X_iter cvec_X_end(const cvec_X* self); void cvec_X_next(cvec_X_iter* iter); -cvec_X_rawvalue cvec_X_value_toraw(cvec_X_value* pval); +cvec_X_raw cvec_X_value_toraw(cvec_X_value* pval); cvec_X_value cvec_X_value_clone(cvec_X_value val); ``` @@ -96,7 +96,7 @@ cvec_X_value cvec_X_value_clone(cvec_X_value val); |:-------------------|:----------------------------------|:-----------------------| | `cvec_X` | `struct { cvec_X_value* data; }` | The cvec type | | `cvec_X_value` | `i_val` | The cvec value type | -| `cvec_X_rawvalue` | `i_valraw` | The raw value type | +| `cvec_X_raw` | `i_valraw` | The raw value type | | `cvec_X_iter` | `struct { cvec_X_value* ref; }` | The iterator type | ## Examples diff --git a/examples/convert.c b/examples/convert.c index 034657db..8258e1b6 100644 --- a/examples/convert.c +++ b/examples/convert.c @@ -16,7 +16,7 @@ int main() c_auto (cvec_str, keys, values) c_auto (clist_str, list) { - c_apply(v, cmap_str_emplace(&map, c_pair(v)), cmap_str_rawvalue, { + c_apply(v, cmap_str_emplace(&map, c_pair(v)), cmap_str_raw, { {"green", "#00ff00"}, {"blue", "#0000ff"}, {"yellow", "#ffff00"}, diff --git a/examples/csmap_erase.c b/examples/csmap_erase.c index 7b179bef..68a0378b 100644 --- a/examples/csmap_erase.c +++ b/examples/csmap_erase.c @@ -37,7 +37,7 @@ int main() c_auto (mymap, m2) { // Fill in some data to test with, one at a time, using c_apply() - c_apply(v, mymap_emplace(&m2, c_pair(v)), mymap_rawvalue, { + c_apply(v, mymap_emplace(&m2, c_pair(v)), mymap_raw, { {10, "Bob"}, {11, "Rob"}, {12, "Robert"}, diff --git a/examples/csmap_find.c b/examples/csmap_find.c index c70e0523..078c7a11 100644 --- a/examples/csmap_find.c +++ b/examples/csmap_find.c @@ -7,12 +7,12 @@ #define i_tag istr #include <stc/csmap.h> -#define i_val csmap_istr_rawvalue +#define i_val csmap_istr_raw #define i_opt c_no_cmp #define i_tag istr #include <stc/cvec.h> -void print_elem(csmap_istr_rawvalue p) { +void print_elem(csmap_istr_raw p) { printf("(%d, %s) ", p.first, p.second); } @@ -45,7 +45,7 @@ int main() c_auto (csmap_istr, m1) c_auto (cvec_istr, v) { - c_apply(v, csmap_istr_emplace(&m1, c_pair(v)), csmap_istr_rawvalue, + c_apply(v, csmap_istr_emplace(&m1, c_pair(v)), csmap_istr_raw, {{40, "Zr"}, {45, "Rh"}}); puts("The starting map m1 is (key, value):"); print_collection_csmap_istr(m1); diff --git a/examples/csmap_insert.c b/examples/csmap_insert.c index 1b89915e..5f5813a8 100644 --- a/examples/csmap_insert.c +++ b/examples/csmap_insert.c @@ -14,7 +14,7 @@ #define i_tag istr // Map of int => cstr
#include <stc/csmap.h>
-#define i_val csmap_ii_rawvalue
+#define i_val csmap_ii_raw
#define i_opt c_no_cmp
#define i_tag ii
#include <stc/cvec.h>
@@ -99,7 +99,7 @@ int main() c_auto (csmap_ii, m4) {
// Insert the elements from an initializer_list
- c_apply(v, csmap_ii_insert(&m4, c_pair(v)), csmap_ii_rawvalue,
+ c_apply(v, csmap_ii_insert(&m4, c_pair(v)), csmap_ii_raw,
{ { 4, 44 }, { 2, 22 }, { 3, 33 }, { 1, 11 }, { 5, 55 } });
puts("After initializer_list insertion, m4 contains:");
print_ii(m4);
diff --git a/examples/inits.c b/examples/inits.c index 3f62b9fc..4fdc17d5 100644 --- a/examples/inits.c +++ b/examples/inits.c @@ -67,7 +67,7 @@ int main(void) // CMAP CNT
c_auto (cmap_cnt, countries) {
- c_apply(v, cmap_cnt_emplace(&countries, c_pair(v)), cmap_cnt_rawvalue, {
+ c_apply(v, cmap_cnt_emplace(&countries, c_pair(v)), cmap_cnt_raw, {
{"Norway", 100},
{"Denmark", 50},
{"Iceland", 10},
diff --git a/examples/new_map.c b/examples/new_map.c index 1c27d5bf..f641a0eb 100644 --- a/examples/new_map.c +++ b/examples/new_map.c @@ -48,14 +48,14 @@ int main() {
cmap_int_insert(&map, 123, 321);
- c_apply(v, cmap_pnt_insert(&pmap, c_pair(v)), cmap_pnt_rawvalue, {
+ c_apply(v, cmap_pnt_insert(&pmap, c_pair(v)), cmap_pnt_raw, {
{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}
});
c_foreach (i, cmap_pnt, pmap)
printf(" (%d, %d: %d)", i.ref->first.x, i.ref->first.y, i.ref->second);
puts("");
- c_apply(v, cmap_str_emplace(&smap, c_pair(v)), cmap_str_rawvalue, {
+ c_apply(v, cmap_str_emplace(&smap, c_pair(v)), cmap_str_raw, {
{"Hello, friend", "long time no see"},
{"So long, friend", "see you around"},
});
diff --git a/examples/phonebook.c b/examples/phonebook.c index 064de93f..ccc10eaf 100644 --- a/examples/phonebook.c +++ b/examples/phonebook.c @@ -50,7 +50,7 @@ int main(int argc, char **argv) bool erased;
c_auto (cmap_str, phone_book) {
- c_apply(v, cmap_str_emplace(&phone_book, c_pair(v)), cmap_str_rawvalue, {
+ c_apply(v, cmap_str_emplace(&phone_book, c_pair(v)), cmap_str_raw, {
{"Lilia Friedman", "(892) 670-4739"},
{"Tariq Beltran", "(489) 600-7575"},
{"Laiba Juarez", "(303) 885-5692"},
diff --git a/examples/sidebyside.cpp b/examples/sidebyside.cpp index cf4b2f70..85fea774 100644 --- a/examples/sidebyside.cpp +++ b/examples/sidebyside.cpp @@ -19,7 +19,7 @@ int main() { }
c_auto (cmap_str, food)
{
- c_apply(v, cmap_str_emplace(&food, c_pair(v)), cmap_str_rawvalue,
+ c_apply(v, cmap_str_emplace(&food, c_pair(v)), cmap_str_raw,
{{"burger", 5}, {"pizza", 12}, {"steak", 15}});
c_foreach (i, cmap_str, food)
printf("%s, %d\n", i.ref->first.str, i.ref->second);
diff --git a/examples/sptr_to_maps.c b/examples/sptr_to_maps.c index 6b4dd359..64866ba3 100644 --- a/examples/sptr_to_maps.c +++ b/examples/sptr_to_maps.c @@ -30,17 +30,17 @@ int main() // POPULATE stack with shared pointers to Maps:
Map *map;
map = Stack_push(&stack, Arc_from(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, {
+ c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
{"Joey", 1990}, {"Mary", 1995}, {"Joanna", 1992}
});
map = Stack_push(&stack, Arc_from(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, {
+ c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
{"Rosanna", 2001}, {"Brad", 1999}, {"Jack", 1980}
});
// POPULATE list:
map = List_push_back(&list, Arc_from(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_rawvalue, {
+ c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
{"Steve", 1979}, {"Rick", 1974}, {"Tracy", 2003}
});
diff --git a/examples/vikings.c b/examples/vikings.c index 9900e9b6..5acafb3f 100644 --- a/examples/vikings.c +++ b/examples/vikings.c @@ -49,7 +49,7 @@ static inline RViking Viking_toraw(const Viking* vk) { int main() { c_auto (Vikings, vikings) { - c_apply(v, Vikings_emplace(&vikings, c_pair(v)), Vikings_rawvalue, { + c_apply(v, Vikings_emplace(&vikings, c_pair(v)), Vikings_raw, { {{"Einar", "Norway"}, 20}, {{"Olaf", "Denmark"}, 24}, {{"Harald", "Iceland"}, 12}, diff --git a/include/stc/alt/clist.h b/include/stc/alt/clist.h index 14abc7e4..38b722a4 100644 --- a/include/stc/alt/clist.h +++ b/include/stc/alt/clist.h @@ -64,13 +64,13 @@ STC_API size_t _clist_count(const clist_VOID* self); #define _c_using_clist(_cx_self, i_val, i_cmp, i_valdrop, i_valfrom, i_valto, i_valraw, defTypes) \
\
defTypes( _c_clist_types(_cx_self, i_val); ) \
- typedef i_valraw _cx_rawvalue; \
+ typedef i_valraw _cx_raw; \
\
STC_API _cx_self _cx_memb(_clone)(_cx_self lst); \
STC_API void _cx_memb(_drop)(_cx_self* self); \
STC_API void _cx_memb(_push_back)(_cx_self* self, i_val value); \
STC_API void _cx_memb(_push_front)(_cx_self* self, i_val value); \
- STC_API void _cx_memb(_emplace_items)(_cx_self *self, const _cx_rawvalue arr[], size_t n); \
+ STC_API void _cx_memb(_emplace_items)(_cx_self *self, const _cx_raw arr[], size_t n); \
STC_API _cx_self _cx_memb(_split_after)(_cx_self* self, _cx_iter pos1, _cx_iter pos2); \
STC_API void _cx_memb(_splice_after)(_cx_self* self, _cx_iter pos, _cx_self* other); \
STC_DEF void _cx_memb(_splice_after_range)(_cx_self* self, _cx_iter pos, _cx_self* other, _cx_iter i1, _cx_iter i2); \
@@ -176,7 +176,7 @@ STC_API size_t _clist_count(const clist_VOID* self); } \
\
STC_DEF void \
- _cx_memb(_emplace_items)(_cx_self *self, const _cx_rawvalue arr[], size_t n) { \
+ _cx_memb(_emplace_items)(_cx_self *self, const _cx_raw arr[], size_t n) { \
for (size_t i=0; i<n; ++i) _cx_memb(_push_back)(self, i_valfrom(arr[i])); \
} \
\
diff --git a/include/stc/alt/csmap.h b/include/stc/alt/csmap.h index beccf559..9be41054 100644 --- a/include/stc/alt/csmap.h +++ b/include/stc/alt/csmap.h @@ -74,7 +74,7 @@ int main(void) { typedef _i_SET_ONLY( _cx_rawkey ) \
_i_MAP_ONLY( struct { _cx_rawkey first; \
_cx_memb(_rawmapped) second; } ) \
- _cx_rawvalue; \
+ _cx_raw; \
\
STC_API _cx_self _cx_memb(_init)(void); \
STC_API _cx_value* _cx_memb(_find_it)(const _cx_self* self, i_keyraw rkey, _cx_iter* out); \
@@ -125,7 +125,7 @@ int main(void) { } \
\
STC_INLINE void \
- _cx_memb(_emplace_items)(_cx_self* self, const _cx_rawvalue arr[], size_t n) { \
+ _cx_memb(_emplace_items)(_cx_self* self, const _cx_raw arr[], size_t n) { \
for (size_t i=0; i<n; ++i) _i_SET_ONLY( _cx_memb(_emplace)(self, arr[i]); ) \
_i_MAP_ONLY( _cx_memb(_emplace)(self, arr[i].first, arr[i].second); ) \
} \
diff --git a/include/stc/cbox.h b/include/stc/cbox.h index 37687134..fdde5e8c 100644 --- a/include/stc/cbox.h +++ b/include/stc/cbox.h @@ -72,7 +72,7 @@ int main() { #define _i_prefix cbox_
#endif
#include "template.h"
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
#if !c_option(c_is_fwd)
_cx_deftypes(_c_cbox_types, _cx_self, i_val);
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index e11fa3be..ac6e9d31 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -208,14 +208,14 @@ STC_INLINE uint64_t c_default_hash(const void* key, size_t len) { // [deprecated]
#define c_apply_OLD(C, method, cx, ...) do { \
- const C##_rawvalue _c_arr[] = __VA_ARGS__; \
+ const C##_raw _c_arr[] = __VA_ARGS__; \
C* _c_cx = cx; \
for (size_t _c_i = 0; _c_i < c_arraylen(_c_arr); ++_c_i) \
C##_##method(_c_cx, _c_arr[_c_i]); \
} while (0)
// [deprecated]
#define c_apply_pair_OLD(C, method, cx, ...) do { \
- const C##_rawvalue _c_arr[] = __VA_ARGS__; \
+ const C##_raw _c_arr[] = __VA_ARGS__; \
C* _c_cx = cx; \
for (size_t _c_i = 0; _c_i < c_arraylen(_c_arr); ++_c_i) \
C##_##method(_c_cx, _c_arr[_c_i].first, _c_arr[_c_i].second); \
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index 050f9e67..f0866dad 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -38,7 +38,7 @@ struct cdeq_rep { size_t size, cap; void* base[]; }; #if !c_option(c_is_fwd)
_cx_deftypes(_c_cdeq_types, _cx_self, i_val);
#endif
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
STC_API _cx_self _cx_memb(_init)(void);
STC_API void _cx_memb(_clear)(_cx_self* self);
@@ -51,7 +51,7 @@ STC_API void _cx_memb(_shrink_to_fit)(_cx_self *self); STC_API _cx_iter _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos,
const _cx_value* p1, const _cx_value* p2);
STC_API _cx_iter _cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos,
- const _cx_rawvalue* p1, const _cx_rawvalue* p2);
+ const _cx_raw* p1, const _cx_raw* p2);
#endif // !c_no_clone
#if !c_option(c_no_cmp)
@@ -166,7 +166,7 @@ _cx_memb(_emplace)(_cx_self* self, const size_t idx, i_valraw raw) { return _cx_memb(_emplace_range_p)(self, self->data + idx, &raw, &raw + 1);
}
STC_INLINE _cx_iter
-_cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_rawvalue arr[], const size_t n) {
+_cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_raw arr[], const size_t n) {
return _cx_memb(_emplace_range_p)(self, self->data + idx, arr, arr + n);
}
STC_INLINE _cx_iter
@@ -369,7 +369,7 @@ _cx_memb(_erase_range_p)(_cx_self* self, _cx_value* p1, _cx_value* p2) { #if !c_option(c_no_clone)
STC_DEF _cx_iter
-_cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos, const _cx_rawvalue* p1, const _cx_rawvalue* p2) {
+_cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos, const _cx_raw* p1, const _cx_raw* p2) {
pos = _cx_memb(_insert_space_)(self, pos, p2 - p1);
_cx_iter it = {pos};
for (; p1 != p2; ++p1) *pos++ = i_valfrom(*p1);
diff --git a/include/stc/clist.h b/include/stc/clist.h index c239fdd9..2194067c 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -87,7 +87,7 @@ _c_clist_complete_types(clist_VOID, dummy); _cx_deftypes(_c_clist_types, _cx_self, i_val);
#endif
_cx_deftypes(_c_clist_complete_types, _cx_self, dummy);
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
STC_API size_t _clist_count(const clist_VOID* self);
diff --git a/include/stc/cmap.h b/include/stc/cmap.h index b7529871..87ed7c6c 100644 --- a/include/stc/cmap.h +++ b/include/stc/cmap.h @@ -85,7 +85,7 @@ typedef i_valraw _cx_memb(_rawmapped); typedef _i_SET_ONLY( i_keyraw )
_i_MAP_ONLY( struct { i_keyraw first;
i_valraw second; } )
-_cx_rawvalue;
+_cx_raw;
STC_API _cx_self _cx_memb(_with_capacity)(size_t cap);
#if !c_option(c_no_clone)
@@ -153,10 +153,10 @@ _cx_memb(_emplace)(_cx_self* self, i_keyraw rkey _i_MAP_ONLY(, i_valraw rmapped) }
#endif // !c_no_clone
-STC_INLINE _cx_rawvalue
+STC_INLINE _cx_raw
_cx_memb(_value_toraw)(_cx_value* val) {
return _i_SET_ONLY( i_keyto(val) )
- _i_MAP_ONLY( c_make(_cx_rawvalue){i_keyto(&val->first), i_valto(&val->second)} );
+ _i_MAP_ONLY( c_make(_cx_raw){i_keyto(&val->first), i_valto(&val->second)} );
}
STC_INLINE void
diff --git a/include/stc/cpque.h b/include/stc/cpque.h index 87be1e73..caea1549 100644 --- a/include/stc/cpque.h +++ b/include/stc/cpque.h @@ -36,7 +36,7 @@ #if !c_option(c_is_fwd)
_cx_deftypes(_c_cpque_types, _cx_self, i_val);
#endif
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
STC_API void _cx_memb(_make_heap)(_cx_self* self);
STC_API void _cx_memb(_erase_at)(_cx_self* self, size_t idx);
diff --git a/include/stc/csmap.h b/include/stc/csmap.h index 04dc895d..8115cf46 100644 --- a/include/stc/csmap.h +++ b/include/stc/csmap.h @@ -91,7 +91,7 @@ typedef i_keyraw _cx_rawkey; typedef i_valraw _cx_memb(_rawmapped);
typedef _i_SET_ONLY( i_keyraw )
_i_MAP_ONLY( struct { i_keyraw first; i_valraw second; } )
- _cx_rawvalue;
+ _cx_raw;
STC_API _cx_self _cx_memb(_init)(void);
#if !c_option(c_no_clone)
@@ -128,10 +128,10 @@ _cx_memb(_with_capacity)(const size_t cap) { return tree;
}
-STC_INLINE _cx_rawvalue
+STC_INLINE _cx_raw
_cx_memb(_value_toraw)(_cx_value* val) {
return _i_SET_ONLY( i_keyto(val) )
- _i_MAP_ONLY( c_make(_cx_rawvalue){i_keyto(&val->first), i_valto(&val->second)} );
+ _i_MAP_ONLY( c_make(_cx_raw){i_keyto(&val->first), i_valto(&val->second)} );
}
STC_INLINE int
diff --git a/include/stc/csptr.h b/include/stc/csptr.h index 4e9b4687..0718a4cc 100644 --- a/include/stc/csptr.h +++ b/include/stc/csptr.h @@ -76,7 +76,7 @@ int main() { #endif
#define _i_has_internal_clone
#include "template.h"
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
#if !c_option(c_no_atomic)
#define _i_atomic_inc(v) c_atomic_inc(v)
diff --git a/include/stc/cstack.h b/include/stc/cstack.h index fa74494d..387c0126 100644 --- a/include/stc/cstack.h +++ b/include/stc/cstack.h @@ -36,7 +36,7 @@ #if !c_option(c_is_fwd)
_cx_deftypes(_c_cstack_types, _cx_self, i_val);
#endif
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
STC_INLINE _cx_self _cx_memb(_init)(void)
{ return c_make(_cx_self){0, 0, 0}; }
@@ -96,7 +96,7 @@ STC_INLINE const _cx_value* _cx_memb(_at)(const _cx_self* self, size_t idx) #if !c_option(c_no_clone)
-STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, _cx_rawvalue raw)
+STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, _cx_raw raw)
{ return _cx_memb(_push)(self, i_valfrom(raw)); }
STC_INLINE _cx_self _cx_memb(_clone)(_cx_self v) {
diff --git a/include/stc/cvec.h b/include/stc/cvec.h index 92f6afd6..3486cc37 100644 --- a/include/stc/cvec.h +++ b/include/stc/cvec.h @@ -76,7 +76,7 @@ struct cvec_rep { size_t size, cap; void* data[]; }; #if !c_option(c_is_fwd)
_cx_deftypes(_c_cvec_types, _cx_self, i_val);
#endif
-typedef i_valraw _cx_rawvalue;
+typedef i_valraw _cx_raw;
STC_API _cx_self _cx_memb(_init)(void);
STC_API void _cx_memb(_drop)(_cx_self* self);
@@ -98,7 +98,7 @@ STC_API _cx_self _cx_memb(_clone)(_cx_self cx); STC_API _cx_iter _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos,
const _cx_value* p1, const _cx_value* p2);
STC_API _cx_iter _cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos,
- const _cx_rawvalue* p1, const _cx_rawvalue* p2);
+ const _cx_raw* p1, const _cx_raw* p2);
STC_INLINE i_val _cx_memb(_value_clone)(_cx_value val)
{ return i_valfrom(i_valto(&val)); }
STC_INLINE i_val _cx_memb(_value_fromraw)(i_valraw raw) { return i_valfrom(raw); }
@@ -112,7 +112,7 @@ _cx_memb(_copy)(_cx_self *self, _cx_self other) { _cx_memb(_drop)(self); *self = _cx_memb(_clone)(other);
}
STC_INLINE _cx_iter
-_cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_rawvalue arr[], const size_t n) {
+_cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_raw arr[], const size_t n) {
return _cx_memb(_emplace_range_p)(self, self->data + idx, arr, arr + n);
}
STC_INLINE _cx_iter
@@ -350,7 +350,7 @@ _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos, STC_DEF _cx_iter
_cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos,
- const _cx_rawvalue* p1, const _cx_rawvalue* p2) {
+ const _cx_raw* p1, const _cx_raw* p2) {
pos = _cx_memb(_insert_space_)(self, pos, p2 - p1);
_cx_iter it = {pos};
for (; p1 != p2; ++p1) *pos++ = i_valfrom(*p1);
diff --git a/include/stc/template.h b/include/stc/template.h index 675baa47..1d1551fa 100644 --- a/include/stc/template.h +++ b/include/stc/template.h @@ -31,7 +31,7 @@ #define _cx_value _cx_memb(_value)
#define _cx_key _cx_memb(_key)
#define _cx_mapped _cx_memb(_mapped)
- #define _cx_rawvalue _cx_memb(_rawvalue)
+ #define _cx_raw _cx_memb(_raw)
#define _cx_rawkey _cx_memb(_rawkey)
#define _cx_rawmapped _cx_memb(_rawmapped)
#define _cx_iter _cx_memb(_iter)
|
