4 #include "ccan/array/array.h"
7 * array - A collection of macros for generic dynamic array management.
9 * The array module provides generic dynamic array functions via macros. It
10 * removes the tedium of managing realloc'd arrays with pointer, size, and
11 * allocated size. It also fits into structures quite well. It uses the
12 * talloc library to allocate the memory.
14 * NOTE: The API should be fairly stable now, but do expect small changes
18 * #include <ccan/array/array.h>
22 * array(int) numbers = array_new(NULL);
27 * array_for(i, numbers, printf("%d ", *i));
28 * if (numbers.size) puts("");
31 * fgets(buffer, sizeof(buffer), stdin);
32 * if (*buffer==0 || *buffer=='\n')
36 * array_append(numbers, add);
39 * array_free(numbers);
48 int main(int argc, char *argv[])
53 if (strcmp(argv[1], "depends") == 0)
54 #ifndef ARRAY_USE_TALLOC
57 printf("ccan/talloc\n");