bcachefs-tools/ccan/darray/_info

58 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-03-12 09:18:42 +03:00
#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;
}