home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
-
- twscanner.h -- allgemeine Definitionen für GoldEd-Scanner
-
- AUTOR(EN): Thies Wellpott
- ERSTELLUNG: 15.04.1998
- COPYRIGHT: (c) 1998 Thies Wellpott
- BETRIEBSSYSTEM: AmigaOS
- COMPILER: SAS/C 6.58
-
- BESCHREIBUNG (DIESER HEADERDATEI):
-
- Makros, die in allen Scanner benötigt werden, wie UPPER(), Stringvergleich,
- SKIPBLANKS(), o. ä.
-
-
- FEHLER/EINSCHRÄNKUNGEN:
-
- keine
-
- **************************************************************************/
-
-
-
-
- /************************* INCLUDES *************************/
-
-
- #include <exec/types.h>
-
-
-
- /************************* DEFINES *************************/
-
-
- // einfache zu-Großbuchstaben-Konvertierung (für Zeichen a-z und à-þ)
- #define UPPER(c) ((c) & ~ 32)
-
- // Zeichenkettenvergleich mit 2,3,4 Buchstaben MIT überspringen der geprüften Zeichen
- // STRing [case Insensitive] CoMPare
- #define STRCMP2(ptr, c1, c2) ( (*(ptr)++ == (c1)) && (*(ptr)++ == (c2)) )
- #define STRCMP3(ptr, c1, c2, c3) ( (*(ptr)++ == (c1)) && (*(ptr)++ == (c2)) && (*(ptr)++ == (c3)) )
- #define STRCMP4(ptr, c1, c2, c3, c4) ( (*(ptr)++ == (c1)) && (*(ptr)++ == (c2)) && (*(ptr)++ == (c3)) && (*(ptr)++ == (c4)) )
- #define STRICMP2(ptr, c1, c2) ( (UPPER(*(ptr)++) == (c1)) && (UPPER(*(ptr)++) == (c2)) )
- #define STRICMP3(ptr, c1, c2, c3) ( (UPPER(*(ptr)++) == (c1)) && (UPPER(*(ptr)++) == (c2)) && (UPPER(*(ptr)++) == (c3)) )
- #define STRICMP4(ptr, c1, c2, c3, c4) ( (UPPER(*(ptr)++) == (c1)) && (UPPER(*(ptr)++) == (c2)) && (UPPER(*(ptr)++) == (c3)) && (UPPER(*(ptr)++) == (c4)) )
-
- // Zeichenkettenvergleich mit 2,3,4 Buchstaben OHNE überspringen der geprüften Zeichen
- // In Place STRing [case Insensitive] CoMPare
- #define IPSTRCMP2(ptr, c1, c2) ( (*(ptr) == (c1)) && ((ptr)[1] == (c2)) )
- #define IPSTRCMP3(ptr, c1, c2, c3) ( (*(ptr) == (c1)) && ((ptr)[1] == (c2)) && ((ptr)[2] == (c3)) )
- #define IPSTRCMP4(ptr, c1, c2, c3, c4) ( (*(ptr) == (c1)) && ((ptr)[1] == (c2)) && ((ptr)[2] == (c3)) && ((ptr)[3] == (c4)) )
- #define IPSTRICMP2(ptr, c1, c2) ( (UPPER(*(ptr)) == (c1)) && (UPPER((ptr)[1]) == (c2)) )
- #define IPSTRICMP3(ptr, c1, c2, c3) ( (UPPER(*(ptr)) == (c1)) && (UPPER((ptr)[1]) == (c2)) && (UPPER((ptr)[2]) == (c3)) )
- #define IPSTRICMP4(ptr, c1, c2, c3, c4) ( (UPPER(*(ptr)) == (c1)) && (UPPER((ptr)[1]) == (c2)) && (UPPER((ptr)[2]) == (c3)) && (UPPER((ptr)[3]) == (c4)) )
-
- // Zeichentypabfragen
- #define ISBLANK(c) ( ((c) > '\0') && ((c) <= ' ') )
- #define ISDIGIT(c) ( ((c) >= '0') && ((c) <= '9') )
- #define ISALPHA(c) ( (((c) >= 'A') && ((c) <= 'Z')) || (((c) >= 'a') && ((c) <= 'z')) )
- #define ISALNUM(c) ( ISALPHA(c) || ISDIGIT(c) )
-
- #define ISCSYM(c) ( ISALPHA(c) || ISDIGIT(c) || ((c) == '_') )
- #define ISAREXXSYM(c) ( ISALPHA(c) || ISDIGIT(c) || ((c) == '_') || ((c) == '!') || \
- ((c) == '$') || ((c) == '@') || ((c) == '#') || ((c) == '.') )
- #define ISMODPASSYM(c) ( ISALPHA(c) || ISDIGIT(c) || ((c) == '_') )
- #define ISSQLSYM(c) ( ISALPHA(c) || ISDIGIT(c) || ((c) == '_') || ((c) == '$') || \
- ((c) == '#') || ((c) == '.') ) // "." für "schema.objekt"
-
- // Leerzeichen überspringen; mit Kontrolle und Anpassung der Textlänge
- #define SKIPBLANKS(ptr, len) while ( (len) && ISBLANK(*(ptr)) ) { (ptr)++; (len)--; }
-
-
-
- /************************* STRUCTS *************************/
-
-