summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-30 19:29:15 +0200
committerTyge Løvset <[email protected]>2021-10-30 19:29:15 +0200
commit89ee23a74687311c5234f832d782b5ad56e2de7f (patch)
treed10ad622bd29041c2ca05e24107a9136a21ab06f /examples
parent0a290000211562ffc5b39a7842a7f7fedb48baea (diff)
downloadSTC-modified-89ee23a74687311c5234f832d782b5ad56e2de7f.tar.gz
STC-modified-89ee23a74687311c5234f832d782b5ad56e2de7f.zip
Fixed docs alignments.
Diffstat (limited to 'examples')
-rw-r--r--examples/list_erase.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/list_erase.c b/examples/list_erase.c
index e2db62d5..c567f043 100644
--- a/examples/list_erase.c
+++ b/examples/list_erase.c
@@ -2,25 +2,26 @@
#include <stdio.h>
#define i_val int
-#define i_tag i
#include <stc/clist.h>
int main ()
{
- c_autovar (clist_i L = clist_i_init(), clist_i_del(&L))
+ c_auto (clist_int, L)
{
- c_apply(clist_i, push_back, &L, {10, 20, 30, 40, 50});
+ c_apply(clist_int, push_back, &L, {10, 20, 30, 40, 50});
+ c_foreach (x, clist_int, L) printf("%d ", *x.ref);
+ puts("");
// 10 20 30 40 50
- clist_i_iter it = clist_i_begin(&L); // ^
- clist_i_next(&it);
- it = clist_i_erase_at(&L, it); // 10 30 40 50
+ clist_int_iter it = clist_int_begin(&L); // ^
+ clist_int_next(&it);
+ it = clist_int_erase_at(&L, it); // 10 30 40 50
// ^
- clist_i_iter end = clist_i_end(&L); //
- clist_i_next(&it);
- it = clist_i_erase_range(&L, it, end); // 10 30
+ clist_int_iter end = clist_int_end(&L); //
+ clist_int_next(&it);
+ it = clist_int_erase_range(&L, it, end); // 10 30
// ^
- printf("mylist contains:");
- c_foreach (x, clist_i, L) printf(" %d", *x.ref);
+ printf("list contains:");
+ c_foreach (x, clist_int, L) printf(" %d", *x.ref);
puts("");
}
}