From: eck Date: Thu, 23 Nov 1989 10:43:15 +0000 (+0000) Subject: removed ctype.c, the library functions are generated X-Git-Tag: release-5-5~2045 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=47341506147f4fa81b81f0b69892677c6aecd1cf;p=ack.git removed ctype.c, the library functions are generated --- diff --git a/lang/cem/libcc.ansi/ctype/LIST b/lang/cem/libcc.ansi/ctype/LIST new file mode 100644 index 000000000..a8f581760 --- /dev/null +++ b/lang/cem/libcc.ansi/ctype/LIST @@ -0,0 +1,15 @@ +isalnum.c +isalpha.c +iscntrl.c +isdigit.c +isgraph.c +islower.c +isprint.c +ispunct.c +isspace.c +isupper.c +isxdigit.c +isascii.c +toupper.c +tolower.c +chartab.c diff --git a/lang/cem/libcc.ansi/ctype/Makefile b/lang/cem/libcc.ansi/ctype/Makefile new file mode 100644 index 000000000..c4aeb170e --- /dev/null +++ b/lang/cem/libcc.ansi/ctype/Makefile @@ -0,0 +1,33 @@ +CFLAGS=-L -LIB + +.SUFFIXES: .o .e .c + +.e.o: + $(CC) $(CFLAGS) -c -o $@ $*.e + + +genfiles: genfiles.c + $(CC) genfiles.c -o genfiles + +chartab.c: char.tab + tabgen -fchar.tab > chartab.c + +isalnum.c isalpha.c iscntrl.c isdigit.c isgraph.c islower.c isprint.c \ +ispunct.c isspace.c isupper.c isxdigit.c isascii.c tolower.c toupper.c: genfiles + genfiles + +isalnum.o: +isalpha.o: +iscntrl.o: +isdigit.o: +isgraph.o: +islower.o: +isprint.o: +ispunct.o: +isspace.o: +isupper.o: +isxdigit.o: +isascii.o: +tolower.o: +toupper.o: +chartab.o: diff --git a/lang/cem/libcc.ansi/ctype/char.tab b/lang/cem/libcc.ansi/ctype/char.tab new file mode 100644 index 000000000..eafe7d486 --- /dev/null +++ b/lang/cem/libcc.ansi/ctype/char.tab @@ -0,0 +1,28 @@ +% +% CHARACTER CLASSES +% +% the actual size is all unsigned chars + EOF == 257 characters +% , but we store the first element explicitely +% +% The _P contains ",-.", which means from "," to ".". These are the +% three characters ",-." +% +%S256 +%C +_C:\000-\037\177 +_C|_S:\f\n\r\t\v +_S:\040 +_P:!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ +_N:0-9 +_U|_X:A-F +_L|_X:a-f +_U:G-Z +_L:g-z +%T#include +%T +%Tint __x; +%T +%Tchar __ctype[] = { +%T0, +%p +%T}; diff --git a/lang/cem/libcc.ansi/ctype/genfiles.c b/lang/cem/libcc.ansi/ctype/genfiles.c new file mode 100644 index 000000000..e151ba5be --- /dev/null +++ b/lang/cem/libcc.ansi/ctype/genfiles.c @@ -0,0 +1,51 @@ +#include +#if __STDC__ == 1 +#include +#include +#else +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 +#endif + +#define UCHAR_MAX 256 + +char *functab[] = { + "isalnum", + "isalpha", + "iscntrl", + "isdigit", + "isgraph", + "islower", + "isprint", + "ispunct", + "isspace", + "isupper", + "isxdigit", + "isascii", + "toupper", + "tolower", + NULL, +}; + +char buf[100]; + +int +main() +{ + register char **name; + register int i; + FILE *file; + + name = functab; + while (*name) { + strcpy(buf, *name); + strcat(buf, ".c"); + if (!(file = fopen(buf,"w"))) exit(EXIT_FAILURE); + fprintf(file,"int (%s)(int c) {\n", *name); + fprintf(file,"\treturn %s(c);\n", *name); + fprintf(file,"}\n"); + fclose(file); + name++; + } + exit(EXIT_SUCCESS); +}