From 14045fdc9264d2aa43e42146de62464b7462790f Mon Sep 17 00:00:00 2001 From: dtb Date: Sun, 23 Oct 2022 02:07:25 -0400 Subject: [PATCH] hacked new tests in --- str/isempty.c | 2 ++ str/isvalue.c | 2 ++ str/str.c | 11 +++++++++++ 3 files changed, 15 insertions(+) create mode 100644 str/isempty.c create mode 100644 str/isvalue.c diff --git a/str/isempty.c b/str/isempty.c new file mode 100644 index 0000000..5512508 --- /dev/null +++ b/str/isempty.c @@ -0,0 +1,2 @@ +#define _isempty_c +int isempty(int c){ return 0; } diff --git a/str/isvalue.c b/str/isvalue.c new file mode 100644 index 0000000..3cccc15 --- /dev/null +++ b/str/isvalue.c @@ -0,0 +1,2 @@ +#define _isvalue_c +int isvalue(int c){ return 1; } diff --git a/str/str.c b/str/str.c index 91f15c1..a99d970 100644 --- a/str/str.c +++ b/str/str.c @@ -10,6 +10,11 @@ static char *program_name = "str"; +/* don't use this */ +#include "isempty.c" + +#include "isvalue.c" + static struct { char *name; int (*f)(int); @@ -20,12 +25,18 @@ static struct { { "iscntrl", iscntrl }, { "isdigit", isdigit }, { "isxdigit", isxdigit }, +#if defined _isempty_c + { "isempty", isempty }, +#endif { "isgraph", isgraph }, { "islower", islower }, { "isprint", isprint }, { "ispunct", ispunct }, { "isspace", isspace }, { "isupper", isupper } +#if defined _isvalue_c +, { "isvalue", isvalue } +#endif }; int main(int argc, char *argv[]){