summaryrefslogtreecommitdiff
path: root/lib/darray/_info
blob: b6d5e4bad1dbaa9d8b6f0ecfeea5400099dfe93c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "config.h"
#include <stdio.h>
#include <string.h>

#include "ccan/darray/darray.h"

/**
 * darray - Generic resizable arrays
 *
 * darray is a set of macros for managing dynamically-allocated arrays.
 * It removes the tedium of managing realloc'd arrays with pointer, size, and
 * allocated size.
 *
 * Example:
 * #include <ccan/darray/darray.h>
 * #include <stdio.h>
 * 
 * int main(void) {
 * 	darray(int) numbers = darray_new();
 * 	char buffer[32];
 * 	
 * 	for (;;) {
 * 		int *i;
 * 		darray_foreach(i, numbers)
 * 			printf("%d ", *i);
 * 		if (darray_size(numbers) > 0)
 * 			puts("");
 * 		
 * 		printf("darray> ");
 * 		fgets(buffer, sizeof(buffer), stdin);
 * 		if (*buffer == '\0' || *buffer == '\n')
 * 			break;
 * 		
 * 		darray_append(numbers, atoi(buffer));
 * 	}
 * 	
 * 	darray_free(numbers);
 * 	
 * 	return 0;
 * }
 *
 * Author: Joey Adams <joeyadams3.14159@gmail.com>
 * License: MIT
 * Version: 0.2
 */
int main(int argc, char *argv[])
{
	if (argc != 2)
		return 1;

	if (strcmp(argv[1], "depends") == 0) {
		/* Nothing. */
		return 0;
	}

	return 1;
}