diff options
| author | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
| commit | d623c6c85071b9af5d607bb5d9aceceaea05220a (patch) | |
| tree | f20fc3714f86e1553d1103bed6dc8efefcbd9d6b /misc/examples/new_map.c | |
| parent | 5f57d597cd27aef55adbcb3b452973b0c6e33667 (diff) | |
| download | STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.tar.gz STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.zip | |
Experimental uppercase macros.
Diffstat (limited to 'misc/examples/new_map.c')
| -rw-r--r-- | misc/examples/new_map.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/misc/examples/new_map.c b/misc/examples/new_map.c index f43d4217..72705eb2 100644 --- a/misc/examples/new_map.c +++ b/misc/examples/new_map.c @@ -42,32 +42,32 @@ int point_cmp(const Point* a, const Point* b) { int main() { - c_auto (cmap_int, map) - c_auto (cmap_pnt, pmap) - c_auto (cmap_str, smap) - c_auto (cset_str, sset) + c_AUTO (cmap_int, map) + c_AUTO (cmap_pnt, pmap) + c_AUTO (cmap_str, smap) + c_AUTO (cset_str, sset) { cmap_int_insert(&map, 123, 321); - c_forlist (i, cmap_pnt_raw, {{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}}) + c_FORLIST (i, cmap_pnt_raw, {{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}}) cmap_pnt_insert(&pmap, c_PAIR(i.ref)); - c_foreach (i, cmap_pnt, pmap) + c_FOREACH (i, cmap_pnt, pmap) printf(" (%d, %d: %d)", i.ref->first.x, i.ref->first.y, i.ref->second); puts(""); - c_forlist (i, cmap_str_raw, { + c_FORLIST (i, cmap_str_raw, { {"Hello, friend", "long time no see"}, {"So long, friend", "see you around"}, }) cmap_str_emplace(&smap, c_PAIR(i.ref)); - c_forlist (i, const char*, { + c_FORLIST (i, const char*, { "Hello, friend", "Nice to see you again", "So long, friend", }) cset_str_emplace(&sset, *i.ref); - c_foreach (i, cset_str, sset) + c_FOREACH (i, cset_str, sset) printf(" %s\n", cstr_str(i.ref)); } } |
