_info 1.0 KB

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