diff options
author | Robert de Bath <rdebath@poboxes.com> | 1996-03-24 17:45:55 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:29:43 +0200 |
commit | fe22c37817ce338fbbc90b239320248c270957fa (patch) | |
tree | d9550410c4a20bdd382fcc58d2d3d7c5e04e5245 /bcc/misc/test/ctype.t | |
parent | a7aba15e8efffb1c5d3097656f1a93955a64f01f (diff) | |
parent | 42192453ea219b80d0bf9f41e51e36d3d4d0740b (diff) | |
download | dev86-fe22c37817ce338fbbc90b239320248c270957fa.tar.gz |
Import Dev86-0.0.4.tar.gzv0.0.4
Diffstat (limited to 'bcc/misc/test/ctype.t')
-rw-r--r-- | bcc/misc/test/ctype.t | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/bcc/misc/test/ctype.t b/bcc/misc/test/ctype.t new file mode 100644 index 0000000..93b3e4f --- /dev/null +++ b/bcc/misc/test/ctype.t @@ -0,0 +1,38 @@ +/* ctype.h */ + +#define _C 1 /* control */ +#define _D 2 /* digit */ +#define _L 4 /* lower */ +#define _P 8 /* punctuation */ +#define _S 16 /* space */ +#define _U 32 /* upper */ +#define _UN 64 /* underline */ +#define _X '\200' /* hex digit, not digit */ + +extern char _ctype_[]; + +#define _ct1_ (_ctype_+1) + +#define isalnum(c) (_ct1_[c]&(_U|_L|_D)) +#define isalpha(c) (_ct1_[c]&(_U|_L)) +#define isascii(i) ((unsigned)(i)<=0x7f) +#define isalpha(c) (_ct1_[c]&(_U|_L)) +#define iscntrl(c) (_ct1_[c]&_C) +#define iscsym(c) (_ct1_[c]&(_U|_L|_D|_UN)) +#define iscsymf(c) (_ct1_[c]&(_U|_L|_UN)) +#define isdigit(c) (_ct1_[c]&_D) +#define isgraph(c) (_ct1_[c]&(_U|_L|_D|_P)) +#define islower(c) (_ct1_[c]&_L) +/* isodigit(i) is a function */ +/* isprint(i) is a function */ +#define ispunct(c) (_ct1_[c]&_P) +#define isspace(c) (_ct1_[c]&_S) +#define isupper(c) (_ct1_[c]&_U) +#define isxdigit(c) (_ct1_[c]&(_D|_X)) + +#define toascii(i) ((i)&0x7f) +/* toint(i) is a function */ +/* tolower(i) is a function */ +#define _tolower(c) ((c)+('a'-'A')) +/* toupper(i) is a function */ +#define _toupper(c) ((c)+('A'-'a')) |