]> git.ozlabs.org Git - ccan/blob - ccan/array/_info.c
crcsync change: better detection of final block.
[ccan] / ccan / array / _info.c
1 #include <string.h>
2 #include "config.h"
3
4 /**
5  * array - A collection of macros for generic dynamic array management.
6  *
7  * The array module provides generic dynamic array functions via macros.  It
8  * removes the tedium of managing realloc'd arrays with pointer, size, and
9  * allocated size.  It also fits into structures quite well.
10  * 
11  * NOTE:  The API is currently unstable.  It will likely change in the near future.
12  * 
13  * Example:
14  * #include <ccan/array/array.h>
15  * #include <stdio.h>
16  * 
17  * int main(void) {
18  *      Array(int) numbers = NewArray();
19  *      char buffer[32];
20  *      int add;
21  *      
22  *      for (;;) {
23  *              AFor(i, numbers, printf("%d ", *i))
24  *              if (numbers.size) puts("");
25  *              
26  *              printf("array> ");
27  *              fgets(buffer, sizeof(buffer), stdin);
28  *              if (*buffer==0 || *buffer=='\n')
29  *                      break;
30  *              add = atoi(buffer);
31  *              
32  *              AAppend(numbers, add);
33  *      }
34  *      
35  *      AFree(numbers);
36  *      
37  *      return 0;
38  * }
39  *
40  * Licence: BSD
41  */
42 int main(int argc, char *argv[])
43 {
44         if (argc != 2)
45                 return 1;
46
47         if (strcmp(argv[1], "depends") == 0)
48                 /* Nothing. */
49                 return 0;
50
51         return 1;
52 }