1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-22 01:31:33 +00:00
C02/test/ctypetst.c02
2022-07-09 18:25:34 -04:00

61 lines
1.4 KiB
Plaintext

/*************************************
* CTYPETST - Test Library ctype.h02 *
*************************************/
//Specify System Header using -H option
#include <ctype.h02>
char c, i;
main:
i = 0;
head:
putstr(" ");
putchr('C'); //Control
putchr('S'); //White Space
putchr('P'); //Punctuation
putchr('D'); //Digit
putchr('H'); //Hex Digit
putchr('U'); //Upper Case
putchr('L'); //Lower Case
putchr('A'); //Alphabetic
putchr('N'); //Alphanumeric
putchr('M'); //Alphanumunder
putchr('T'); //Alphanumundots
putchr('G'); //Graphic
putchr('R'); //Printable
putchr('B'); //Binary
newlin();
loop:
prbyte(i);
putchr(' ');
c = i;
if (c < $20) c = $20;
if (c >= $7F) c = $20;
putchr(c);
putchr(' ');
c = isctrl(i) & $0A | $20; putchr(c);
c = isspce(i) & $0A | $20; putchr(c);
c = ispnct(i) & $0A | $20; putchr(c);
c = isdigt(i) & $0A | $20; putchr(c);
c = ishdgt(i) & $0A | $20; putchr(c);
c = isuppr(i) & $0A | $20; putchr(c);
c = islowr(i) & $0A | $20; putchr(c);
c = isalph(i) & $0A | $20; putchr(c);
c = isalnm(i) & $0A | $20; putchr(c);
c = isalnu(i) & $0A | $20; putchr(c);
c = isalud(i) & $0A | $20; putchr(c);
c = isgrph(i) & $0A | $20; putchr(c);
c = isprnt(i) & $0A | $20; putchr(c);
c = isbdgt(i) & $0A | $20; putchr(c);
newlin();
i++;
if (i == 0) goto exit;
if (i & $0F <> 0) goto loop;
newlin();
c = getchr();
if (c == $1B) goto exit;
goto head;