From f48a0f6f17548ce66d9d919b8a3f4ff0e70042da Mon Sep 17 00:00:00 2001 From: DTB Date: Sat, 23 Dec 2023 08:51:22 -0700 Subject: [PATCH] builds, too --- lowercase/Makefile | 10 +++++----- lowercase/case-ascii.h | 3 ++- lowercase/case-unicode.h | 3 ++- lowercase/{lowercase.c => case.c} | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename lowercase/{lowercase.c => case.c} (100%) diff --git a/lowercase/Makefile b/lowercase/Makefile index e6d8d06..505e6ad 100644 --- a/lowercase/Makefile +++ b/lowercase/Makefile @@ -1,7 +1,7 @@ -all: lowercase uppercase +all: lowercase-ascii uppercase-ascii -lowercase: lowercase.c - $(CC) -DLOWERCASE -o lowercase lowercase.c +lowercase-ascii: case.c case-ascii.h + $(CC) -DCONV=TOLOWER -include case-ascii.h -o lowercase-ascii case.c -uppercase: lowercase.c - $(CC) -DUPPERCASE -o uppercase lowercase.c +uppercase-ascii: case.c case-ascii.h + $(CC) -DCONV=TOUPPER -include case-ascii.h -o uppercase-ascii case.c diff --git a/lowercase/case-ascii.h b/lowercase/case-ascii.h index aa115e1..3fb42df 100644 --- a/lowercase/case-ascii.h +++ b/lowercase/case-ascii.h @@ -1,6 +1,7 @@ #define CHARACTER int #define ISVALID(c) ((c) <= 0x127 /* ASCII DEL; 0b 0111 111 */ && (c) >= 0) -#include /* getc(3), putc(3) */ +#include /* getc(3), putc(3), EOF */ +#define ENDOFFILE EOF #define GETC getc #define PUTC putc #include /* tolower(3), toupper(3) */ diff --git a/lowercase/case-unicode.h b/lowercase/case-unicode.h index 13a6738..82e0394 100644 --- a/lowercase/case-unicode.h +++ b/lowercase/case-unicode.h @@ -4,6 +4,7 @@ #define ISVALID(c) ((c) <= UCHAR_MAX_VALUE && (c) >= 0) #define TOLOWER u_tolower #define TOUPPER u_toupper -#include /* u_fgetc(3), u_fputc(3) */ +#include /* u_fgetc(3), u_fputc(3), U_EOF */ +#define ENDOFFILE U_EOF #define GETC u_fgetc #define PUTC u_fputc diff --git a/lowercase/lowercase.c b/lowercase/case.c similarity index 100% rename from lowercase/lowercase.c rename to lowercase/case.c