diff options
author | ache <ache@FreeBSD.org> | 2000-11-30 21:05:33 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-11-30 21:05:33 +0000 |
commit | 5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068 (patch) | |
tree | a212ee10b5214f5c4302ff44d44c2542d83cf7b6 /contrib/tcsh/sh.char.h | |
parent | d7d472004aa5fe13bc67f9aa639952d978d342e9 (diff) | |
download | FreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.zip FreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.tar.gz |
Initial import of slightly trimmed tcsh 6.10
Diffstat (limited to 'contrib/tcsh/sh.char.h')
-rw-r--r-- | contrib/tcsh/sh.char.h | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/contrib/tcsh/sh.char.h b/contrib/tcsh/sh.char.h index 63c127c..d5286d4 100644 --- a/contrib/tcsh/sh.char.h +++ b/contrib/tcsh/sh.char.h @@ -1,4 +1,4 @@ -/* $Header: /src/pub/tcsh/sh.char.h,v 3.15 1998/09/18 16:09:07 christos Exp $ */ +/* $Header: /src/pub/tcsh/sh.char.h,v 3.17 2000/11/11 23:03:35 christos Exp $ */ /* * sh.char.h: Table for spotting special characters quickly * Makes for very obscure but efficient coding. @@ -86,34 +86,35 @@ extern tcshuc _cmap_lower[], _cmap_upper[]; #define _PUN 0x8000 /* punctuation */ #if defined(SHORT_STRINGS) && defined(KANJI) -#define ASC(ch) ch -#define CTL_ESC(ch) ch -#define cmap(c, bits) \ +# define ASC(ch) ch +# define CTL_ESC(ch) ch +# define cmap(c, bits) \ ((((c) & QUOTE) || ((c & 0x80) && adrof(STRnokanji))) ? \ 0 : (_cmap[(tcshuc)(c)] & (bits))) -#else -#ifndef _OSD_POSIX -#define ASC(ch) ch -#define CTL_ESC(ch) ch -#define cmap(c, bits) \ +#else /* SHORT_STRINGS && KANJI */ +# ifdef IS_ASCII +# define ASC(ch) ch +# define CTL_ESC(ch) ch +# define cmap(c, bits) \ (((c) & QUOTE) ? 0 : (_cmap[(tcshuc)(c)] & (bits))) -#else /*_OSD_POSIX*/ +# else /* IS_ASCII */ /* "BS2000 OSD" is a POSIX on a main frame using a EBCDIC char set */ +/* "OS/390 USS" is a POSIX on a main frame using an IBM1047 char set */ extern unsigned short _toascii[256]; extern unsigned short _toebcdic[256]; /* mainly for comparisons if (ASC(ch)=='\177')... */ -#define ASC(ch) _toascii[(tcshuc)ch] +# define ASC(ch) _toascii[(tcshuc)ch] /* Literal escapes ('\010') must be mapped to EBCDIC, * for C-Escapes ('\b'), the compiler already does it. */ -#define CTL_ESC(ch) _toebcdic[(tcshuc)ch] +# define CTL_ESC(ch) _toebcdic[(tcshuc)ch] -#define cmap(c, bits) \ +# define cmap(c, bits) \ (((c) & QUOTE) ? 0 : (_cmap[_toascii[(tcshuc)(c)]] & (bits))) -#endif /*_OSD_POSIX*/ -#endif +# endif /* IS_ASCII */ +#endif /* SHORT_STRINGS && KANJI */ #define isglob(c) cmap(c, _GLOB) #define isspc(c) cmap(c, _SP) @@ -150,7 +151,7 @@ extern unsigned short _toebcdic[256]; #endif /* !defined(DSPMBYTE) */ # define Ispunct(c) (((Char)(c) & QUOTE) ? 0 : NXIsPunct((unsigned) (c))) # else /* !NeXT */ -# ifndef WINNT +# ifndef WINNT_NATIVE # define Isspace(c) (((Char)(c) & QUOTE) ? 0 : isspace((tcshuc) (c))) # define Isdigit(c) (((Char)(c) & QUOTE) ? 0 : isdigit((tcshuc) (c))) # define Isalpha(c) (((Char)(c) & QUOTE) ? 0 : isalpha((tcshuc) (c))) @@ -191,7 +192,7 @@ extern unsigned short _toebcdic[256]; # define Isprint(c) ( (IsprintM(c)) || (_enable_mbdisp&&(IsmbyteU((c)))) ) #endif /* !defined(DSPMBYTE) */ # define Ispunct(c) (((Char)(c) & QUOTE) ? 0 : ispunct((tcshuc) (c))) -# else /* WINNT */ +# else /* WINNT_NATIVE */ # define Isspace(c) (((Char)(c) & QUOTE) ? 0 : isspace( oem_it((tcshuc)(c)))) # define Isdigit(c) (((Char)(c) & QUOTE) ? 0 : isdigit( oem_it((tcshuc)(c)))) # define Isalpha(c) (((Char)(c) & QUOTE) ? 0 : isalpha( oem_it((tcshuc)(c)))) @@ -211,7 +212,7 @@ extern unsigned short _toebcdic[256]; # define Iscntrl(c) (((Char)(c) & QUOTE) ? 0 : iscntrl( oem_it((tcshuc)(c)))) # define Isprint(c) (((Char)(c) & QUOTE) ? 0 : isprint( oem_it((tcshuc)(c)))) #endif /* !defined(DSPMBYTE) */ -# endif /* WINNT */ +# endif /* WINNT_NATIVE */ # endif /* !NeXT */ #else /* !NLS */ # define Isspace(c) cmap(c, _SP|_NL) @@ -219,14 +220,14 @@ extern unsigned short _toebcdic[256]; # define Isalpha(c) (cmap(c,_LET) && !(((c) & META) && AsciiOnly)) # define Islower(c) (cmap(c,_DOW) && !(((c) & META) && AsciiOnly)) # define Isupper(c) (cmap(c, _UP) && !(((c) & META) && AsciiOnly)) -#ifndef _OSD_POSIX -# define Tolower(c) (_cmap_lower[(tcshuc)(c)]) -# define Toupper(c) (_cmap_upper[(tcshuc)(c)]) -#else /*_OSD_POSIX*/ +# ifdef IS_ASCII +# define Tolower(c) (_cmap_lower[(tcshuc)(c)]) +# define Toupper(c) (_cmap_upper[(tcshuc)(c)]) +# else /* "BS2000 OSD" is a POSIX on a main frame using a EBCDIC char set */ -# define Tolower(c) (_cmap_lower[_toascii[(tcshuc)(c)]]) -# define Toupper(c) (_cmap_upper[_toascii[(tcshuc)(c)]]) -#endif /*_OSD_POSIX*/ +# define Tolower(c) (_cmap_lower[_toascii[(tcshuc)(c)]]) +# define Toupper(c) (_cmap_upper[_toascii[(tcshuc)(c)]]) +# endif # define Isxdigit(c) cmap(c, _XD) # define Isalnum(c) (cmap(c, _DIG|_LET) && !(((Char)(c) & META) && AsciiOnly)) #if defined(DSPMBYTE) |