diff options
| author | tylo <[email protected]> | 2020-09-07 10:15:41 +0200 |
|---|---|---|
| committer | tylo <[email protected]> | 2020-09-07 10:17:15 +0200 |
| commit | 2dbbf289ae169bbe633632fa119557fab36fdbb4 (patch) | |
| tree | 90c0cbe1f989290f26f5671e34cb56ec6b93c951 /examples/mapmap.c | |
| parent | 5b78847871217562dcddbb0bd34076a892eb49e1 (diff) | |
| download | STC-modified-2dbbf289ae169bbe633632fa119557fab36fdbb4.tar.gz STC-modified-2dbbf289ae169bbe633632fa119557fab36fdbb4.zip | |
Added back cmap insert()
Diffstat (limited to 'examples/mapmap.c')
| -rw-r--r-- | examples/mapmap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/mapmap.c b/examples/mapmap.c index 6929dc69..e1e78bba 100644 --- a/examples/mapmap.c +++ b/examples/mapmap.c @@ -9,14 +9,14 @@ declare_cmap_strkey(cfg, cmap_str, cmap_str_destroy); int main(void) {
cmap_cfg config = cmap_ini;
cmap_str init = cmap_ini;
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "user", init).item->value, "name", "Joe");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "user", init).item->value, "groups", "proj1,proj3");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "group", init).item->value, "proj1", "Energy");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "group", init).item->value, "proj2", "Windy");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "group", init).item->value, "proj3", "Oil");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "admin", init).item->value, "employees", "2302");
+ cmap_str_put(&cmap_cfg_insert(&config, "user", init).item->value, "name", "Joe");
+ cmap_str_put(&cmap_cfg_insert(&config, "user", init).item->value, "groups", "proj1,proj3");
+ cmap_str_put(&cmap_cfg_insert(&config, "group", init).item->value, "proj1", "Energy");
+ cmap_str_put(&cmap_cfg_insert(&config, "group", init).item->value, "proj2", "Windy");
+ cmap_str_put(&cmap_cfg_insert(&config, "group", init).item->value, "proj3", "Oil");
+ cmap_str_put(&cmap_cfg_insert(&config, "admin", init).item->value, "employees", "2302");
- cmap_str_insert_or_assign(&cmap_cfg_emplace(&config, "group", init).item->value, "proj2", "Wind"); // Update
+ cmap_str_put(&cmap_cfg_insert(&config, "group", init).item->value, "proj2", "Wind"); // Update
c_foreach (i, cmap_cfg, config)
c_foreach (j, cmap_str, i.item->value)
|
