_info 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. /**
  5. * err - err(), errx(), warn() and warnx(), as per BSD's err.h.
  6. *
  7. * A few platforms don't provide err.h; for those, this provides replacements.
  8. * For most, it simple includes the system err.h.
  9. *
  10. * Unfortunately, you have to call err_set_progname() to tell the replacements
  11. * your program name, otherwise it prints "unknown program".
  12. *
  13. * Example:
  14. * #include <ccan/err/err.h>
  15. *
  16. * int main(int argc, char *argv[])
  17. * {
  18. * err_set_progname(argv[0]);
  19. * if (argc != 1)
  20. * errx(1, "Expect no arguments");
  21. * exit(0);
  22. * }
  23. *
  24. * License: CC0 (Public domain)
  25. * Author: Rusty Russell <rusty@rustcorp.com.au>
  26. */
  27. int main(int argc, char *argv[])
  28. {
  29. if (argc != 2)
  30. return 1;
  31. if (strcmp(argv[1], "depends") == 0) {
  32. #if !HAVE_ERR_H
  33. printf("ccan/compiler\n");
  34. #endif
  35. return 0;
  36. }
  37. return 1;
  38. }