Go to the source code of this file.
◆ INPLACE_CAPACITY
◆ MAX_CAPACITY
◆ SELF
#define SELF staticvec_chars |
◆ iter_example()
- Examples
- structures/staticvec.c.
Definition at line 40 of file staticvec.c.
40 {
41 staticvec_chars vec = staticvec_chars_new();
42
43
45 staticvec_chars_push(&vec, 'a' + i);
46 }
47
48
49 staticvec_chars_iter_const iter = staticvec_chars_get_iter_const(&vec);
50 unsigned char const* item = NULL;
51 while (item = staticvec_chars_iter_const_next(&iter), item != NULL) {
52 printf("%u ", *item);
53 }
54 printf("\n");
55
56 staticvec_chars_delete(&vec);
57}
◆ main()
◆ push_example()
- Examples
- structures/staticvec.c.
Definition at line 17 of file staticvec.c.
17 {
18 staticvec_chars vec = staticvec_chars_new();
19
20
22 staticvec_chars_push(&vec, i);
23 }
24
25
26 assert(!staticvec_chars_try_push(&vec, 8));
27
28
30 assert(*staticvec_chars_read(&vec, i) == i);
31 }
32
33
34 assert(staticvec_chars_try_read(&vec,
MAX_CAPACITY) == NULL);
35 assert(staticvec_chars_try_read(&vec,
MAX_CAPACITY + 1) == NULL);
36
37 staticvec_chars_delete(&vec);
38}