/* Definition eigener Makros */ /* Datei: typen3.c */ #include #include #include static char klein[] = "üöäßµ" ; static char gross[] = "ÖÜÄ" ; #undef isgraph #undef isprint #define GMASK (_IS_PUN | _IS_DIG | _IS_UPP | _IS_LOW) #define isgraph(c) (_ctype[(c)+1] & (GMASK)) #define isprint(c) ((_ctype[(c)+1]&(GMASK))||((c)==' ')) int main () { char *cp; int i; cp = klein; while (*cp != '\0') _ctype [(*cp)+1] = _IS_LOW, cp++; cp = gross; while (*cp != '\0') _ctype [(*cp)+1] = _IS_UPP, cp++; for (i = 0; i<= CHAR_MAX; i++) { printf ("%03d : %02x %c ",i,_ctype[i+1], isprint (i) ? i : '*'); if (_ctype[i+1] & _IS_UPP) printf ("UPR "); if (_ctype[i+1] & _IS_LOW) printf ("LOW "); putchar ('\n'); } if (isgraph('ü')) printf ("\n\'ü\' ist graphisches Zeichen.\n"); if (isprint('ü')) printf ("\n\'ü\' ist druckbares Zeichen.\n"); return 0; }