chars.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*====================================================================*
  2. *
  3. * chars.h - character selection and matcing macros;
  4. *
  5. * Motley Tools by Charles Maier;
  6. * Copyright 2001-2006 by Charles Maier Associates;
  7. * Licensed under the Internet Software Consortium License;
  8. *
  9. *--------------------------------------------------------------------*/
  10. #ifndef CHARS_HEADER
  11. #define CHARS_HEADER
  12. /*====================================================================*
  13. *
  14. *--------------------------------------------------------------------*/
  15. #ifndef nobreak
  16. #define nobreak(c) ((char)(c) != '\n') && ((int)(c) != EOF)
  17. #endif
  18. #ifndef isquote
  19. #define isquote(c) ((char)(c) == '\'') || ((char)(c) == '\"')
  20. #endif
  21. #ifndef isslash
  22. #define isslash(c) ((char)(c) == '/') || ((char)(c) == '\\')
  23. #endif
  24. #ifndef isident
  25. #define isident(c) (isalnum (c) || (c == '_') || (c == '-') || (c == '.') || (c == ':'))
  26. #endif
  27. #ifndef isoctal
  28. #define isoctal(c) ((char)(c) >= '0') && ((char)(c) <= '7')
  29. #endif
  30. #ifndef nomatch
  31. #define nomatch(c,o) ((char)(c) != (char)(o)) && ((int)(c) != EOF)
  32. #endif
  33. #ifndef iskey
  34. #define iskey(c) ((int)(c) < 0x20) || ((int)(c) > 0x7E)
  35. #endif
  36. /*====================================================================*
  37. * end definitions;
  38. *--------------------------------------------------------------------*/
  39. #endif