home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fed0217s.zip / include / _ctype.h next >
C/C++ Source or Header  |  2000-12-13  |  2KB  |  51 lines

  1. /*
  2. ** Module   :_CTYPE.H
  3. ** Abstract :NLS support routines
  4. **
  5. ** Copyright (C) Sergey I. Yevtushenko
  6. **
  7. ** Log: Sun  04/05/1997       Updated
  8. */
  9.  
  10. #include <common.h>
  11.  
  12. #ifndef  __CTYPE_H
  13. #define  __CTYPE_H
  14.  
  15. #define IS_NO     0
  16. #define IS_PU     1
  17. #define IS_SP     2
  18. #define IS_AL     4 /* 'a'-'z', 'A'-'Z', 'á'-'∩', 'Ç'-'ƒ' */
  19. #define IS_DI     8 /* '0'-'9' */
  20. #define IS_XD    16 /* '0'-'9', 'a'-'f', 'A'-'F' */
  21. #define IS_HD    32 /* '0'-'9', 'a'-'f', 'A'-'F', 'x', 'X', 'u','U', 'l', 'L'*/
  22. #define IS_QU    64 /* '\'', '\"' */
  23. #define IS_SE   128 /* ';' */
  24. #define IS_IS   256 /* 'a'-'z', 'A'-'Z', 'á'-'∩', 'Ç'-'ƒ', '#', '_' */
  25. #define IS_IC  (IS_IS | IS_DI) /* 'a'-'z', 'A'-'Z', 'á'-'∩', 'Ç'-'ƒ', '0'-'9', '#', '_' */
  26. #define IS_OP  1024 /* '%', '&', '*', '+', ',', '-', '.', '<', '>', '?', '{', '|', '}', '~' */
  27.  
  28. #define __isis(c) (__r_ctype[(unsigned char)(c)] & IS_IS)
  29. #define __isic(c) (__r_ctype[(unsigned char)(c)] & IS_IC)
  30. #define __issp(c) (__r_ctype[(unsigned char)(c)] & IS_SP)
  31. #define __ishd(c) (__r_ctype[(unsigned char)(c)] & IS_HD)
  32. #define __isdd(c) (__r_ctype[(unsigned char)(c)] & IS_DI)
  33.  
  34. inline char __to_lower(char chr)
  35. {
  36.     return tolower_cvt_table[(chr)];
  37. }
  38.  
  39. inline char __to_upper(char chr)
  40. {
  41.     return toupper_cvt_table[(chr)];
  42. }
  43.  
  44. void __nls_init(void);
  45. int __cstrcmp(char *, char *);
  46. int __cnstrcmp(char *s0, char *s1, int n);
  47. int __nstrcmp(char *, char *, char *);  /* str1, str2, cvt_tbl */
  48. char* __cstrchr(char* s0, int chr);
  49.  
  50. #endif
  51.