1CK_ARRAY_FOREACH(3) BSD Library Functions Manual CK_ARRAY_FOREACH(3)
2
4 CK_ARRAY_FOREACH — iterate through an array
5
7 Concurrency Kit (libck, -lck)
8
10 #include <ck_array.h>
11
12 bool
13 CK_ARRAY_FOREACH(ck_array_t *array, ck_array_iterator_t *iterator,
14 void **b);
15
17 The CK_ARRAY_FOREACH(3) macro iterates through the array pointed to by
18 array. A pointer to an iterator object must be specified by iterator and
19 b must point to a void pointer.
20
22 #include <ck_array.h>
23
24 /* Assume this was already previously initialized. */
25 ck_array_t array;
26
27 void
28 example(void)
29 {
30 ck_array_iterator_t iterator;
31 void *pointer;
32
33 CK_ARRAY_FOREACH(&array, &iterator, &pointer) {
34 do_something(pointer);
35 }
36 }
37
39 This macro has no return value.
40
42 ck_array_init(3), ck_array_commit(3), ck_array_put(3),
43 ck_array_put_unique(3), ck_array_remove(3), ck_array_deinit(3)
44 ck_array_length(3), ck_array_buffer(3), ck_array_initialized(3)
45
46 Additional information available at http://concurrencykit.org/
47
48 October 18, 2013