Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

  1. /*****************************************************************************
  2. *
  3. * ctype.h
  4. *
  5. * Character type classification.
  6. *
  7. *****************************************************************************/
  8. extern BYTE rgbIdent[];
  9. #define tchLquo '`'
  10. #define tchRquo '\''
  11. #define tchLpar '('
  12. #define tchRpar ')'
  13. #define tchComma ','
  14. #define fLquoTch(tch) ((tch) == tchLquo)
  15. #define fRquoTch(tch) ((tch) == tchRquo)
  16. #define fLcomTch(tch) ((tch) == '#')
  17. #define fRcomTch(tch) ((tch) == '\n')
  18. #define fMagicTch(tch) ((tch) == tchMagic)
  19. #define tchMaxMagic 30 /* Must be co-ordinated with predef.c */
  20. #define fValidMagicTch(tch) ((TBYTE)(tch) < tchMaxMagic)
  21. INLINE F
  22. fIdentTch(TCH tch)
  23. {
  24. return ((TBYTE)tch < 128 && rgbIdent[tch]);
  25. }
  26. INLINE F
  27. fInitialIdentTch(TCH tch)
  28. {
  29. return ((TBYTE)tch < 128 && (rgbIdent[tch] & 2));
  30. }
  31. INLINE F
  32. fWhiteTch(TCH tch)
  33. {
  34. return tch == ' ' || tch == '\r' || tch == '\n' || tch == '\t';
  35. }