home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / entrand.zip / ent / iso8859.h < prev    next >
C/C++ Source or Header  |  1998-10-19  |  1KB  |  18 lines

  1.  
  2. /* ISO 8859/1 Latin-1 "ctype" macro replacements. */
  3.  
  4. extern unsigned char isoalpha[32], isoupper[32], isolower[32];
  5.  
  6. #define isISOspace(x)    ((isascii(((unsigned char) (x))) && isspace(((unsigned char) (x)))) || ((x) == 0xA0))
  7. #define isISOalpha(x)    ((isoalpha[(((unsigned char) (x))) / 8] & (0x80 >> ((((unsigned char) (x))) % 8))) != 0)
  8. #define isISOupper(x)    ((isoupper[(((unsigned char) (x))) / 8] & (0x80 >> ((((unsigned char) (x))) % 8))) != 0)
  9. #define isISOlower(x)    ((isolower[(((unsigned char) (x))) / 8] & (0x80 >> ((((unsigned char) (x))) % 8))) != 0)
  10. #define isISOprint(x)   ((((x) >= ' ') && ((x) <= '~')) || ((x) >= 0xA0))
  11. #define toISOupper(x)   (isISOlower(x) ? (isascii(((unsigned char) (x))) ?  \
  12.                             toupper(x) : (((((unsigned char) (x)) != 0xDF) && \
  13.                             (((unsigned char) (x)) != 0xFF)) ? \
  14.                 (((unsigned char) (x)) - 0x20) : (x))) : (x))
  15. #define toISOlower(x)   (isISOupper(x) ? (isascii(((unsigned char) (x))) ?  \
  16.                             tolower(x) : (((unsigned char) (x)) + 0x20)) \
  17.                 : (x))
  18.