removed ctype.c, the library functions are generated
authoreck <none@none>
Thu, 23 Nov 1989 10:43:15 +0000 (10:43 +0000)
committereck <none@none>
Thu, 23 Nov 1989 10:43:15 +0000 (10:43 +0000)
lang/cem/libcc.ansi/ctype/LIST [new file with mode: 0644]
lang/cem/libcc.ansi/ctype/Makefile [new file with mode: 0644]
lang/cem/libcc.ansi/ctype/char.tab [new file with mode: 0644]
lang/cem/libcc.ansi/ctype/genfiles.c [new file with mode: 0644]

diff --git a/lang/cem/libcc.ansi/ctype/LIST b/lang/cem/libcc.ansi/ctype/LIST
new file mode 100644 (file)
index 0000000..a8f5817
--- /dev/null
@@ -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 (file)
index 0000000..c4aeb17
--- /dev/null
@@ -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 (file)
index 0000000..eafe7d4
--- /dev/null
@@ -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     <ctype.h>
+%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 (file)
index 0000000..e151ba5
--- /dev/null
@@ -0,0 +1,51 @@
+#include       <stdio.h>
+#if __STDC__ == 1
+#include       <stdlib.h>
+#include       <string.h>
+#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);
+}