home *** CD-ROM | disk | FTP | other *** search
/ Dream 48 / Amiga_Dream_48.iso / Atari / c / cpp.zoo / src / ztype.c < prev    next >
C/C++ Source or Header  |  1993-06-03  |  671b  |  30 lines

  1.  
  2. #include <limits.h>
  3. #include <ctype.h>
  4. #include "global.h"
  5. #include "ztype.h"
  6.  
  7. unsigned char Z_type[UCHAR_MAX + 1];
  8.  
  9. /* Z_type_init() -- initialize lookup table for extended ctype macros */
  10. void Z_type_init()
  11. {
  12.   unsigned c;
  13.  
  14.   for (c = 0; c <= UCHAR_MAX; c++) {
  15.     Z_type[c] = '\0';
  16.     if (isalpha(c) || c == '_')
  17.       Z_type[c] |= Z_ct1;
  18.     if (isalnum(c) || c == '_')
  19.       Z_type[c] |= Z_ct2;
  20.     if (c == 'f' || c == 'F')
  21.       Z_type[c] |= Z_fsx;
  22.     if (c == 'U' || c == 'u')
  23.       Z_type[c] |= Z_isx;
  24.     if (c == 'L' || c == 'l')
  25.       Z_type[c] |= (Z_fsx | Z_isx);
  26.     if (c >= '0' && c <= '7')
  27.       Z_type[c] |= Z_oct;
  28.   }
  29. }
  30.