_info 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "ccan/darray/darray.h"
  5. /**
  6. * darray - Generic resizable arrays
  7. *
  8. * darray is a set of macros for managing dynamically-allocated arrays.
  9. * It removes the tedium of managing realloc'd arrays with pointer, size, and
  10. * allocated size.
  11. *
  12. * Example:
  13. * #include <ccan/darray/darray.h>
  14. * #include <stdio.h>
  15. *
  16. * int main(void) {
  17. * darray(int) numbers = darray_new();
  18. * char buffer[32];
  19. *
  20. * for (;;) {
  21. * int *i;
  22. * darray_foreach(i, numbers)
  23. * printf("%d ", *i);
  24. * if (darray_size(numbers) > 0)
  25. * puts("");
  26. *
  27. * printf("darray> ");
  28. * fgets(buffer, sizeof(buffer), stdin);
  29. * if (*buffer == '\0' || *buffer == '\n')
  30. * break;
  31. *
  32. * darray_append(numbers, atoi(buffer));
  33. * }
  34. *
  35. * darray_free(numbers);
  36. *
  37. * return 0;
  38. * }
  39. *
  40. * Author: Joey Adams <joeyadams3.14159@gmail.com>
  41. * License: MIT
  42. * Version: 0.2
  43. */
  44. int main(int argc, char *argv[])
  45. {
  46. if (argc != 2)
  47. return 1;
  48. if (strcmp(argv[1], "depends") == 0) {
  49. /* Nothing. */
  50. return 0;
  51. }
  52. return 1;
  53. }