_info 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "config.h"
  4. /**
  5. * str - string helper routines
  6. *
  7. * This is a grab bag of functions for string operations, designed to enhance
  8. * the standard string.h.
  9. *
  10. * Note that if you define CCAN_STR_DEBUG, you will get extra compile
  11. * checks on common misuses of the following functions (they will now
  12. * be out-of-line, so there is a runtime penalty!).
  13. *
  14. * strstr, strchr, strrchr:
  15. * Return const char * if first argument is const (gcc only).
  16. *
  17. * isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph,
  18. * islower, isprint, ispunct, isspace, isupper, isxdigit:
  19. * Static and runtime check that input is EOF or an *unsigned*
  20. * char, as per C standard (really!).
  21. *
  22. * Example:
  23. * #include <stdio.h>
  24. * #include <ccan/str/str.h>
  25. *
  26. * int main(int argc, char *argv[])
  27. * {
  28. * if (argv[1] && streq(argv[1], "--verbose"))
  29. * printf("verbose set\n");
  30. * if (argv[1] && strstarts(argv[1], "--"))
  31. * printf("Some option set\n");
  32. * if (argv[1] && strends(argv[1], "cow-powers"))
  33. * printf("Magic option set\n");
  34. * return 0;
  35. * }
  36. *
  37. * License: LGPL (v2.1 or any later version)
  38. * Author: Rusty Russell <rusty@rustcorp.com.au>
  39. */
  40. int main(int argc, char *argv[])
  41. {
  42. if (argc != 2)
  43. return 1;
  44. if (strcmp(argv[1], "depends") == 0) {
  45. printf("ccan/build_assert\n");
  46. return 0;
  47. }
  48. return 1;
  49. }