1
0
Fork 0

remove str isvalue

This commit is contained in:
dtb 2023-12-22 20:59:08 -07:00
parent e3d27c7963
commit 8a7cf3cdd3
5 changed files with 16 additions and 16 deletions

View File

@ -1,2 +1 @@
str: str.c
$(CC) -include isvalue.c -o $@ $@.c

View File

@ -1,2 +0,0 @@
#define _isvalue_c
int isvalue(int c){ return 1; }

View File

@ -14,9 +14,9 @@
- `str.c`
- A single C file that builds to a single executable, which should be
named `simexec`.
named `str`.
- `simexec`
- `str`
- Program binary. Should be placed in a user-accessible binaries
directory.
@ -30,11 +30,11 @@
## Compilation
```
cc -include isvalue.c -o simexec simexec.c
cc -o str str.c
```
Or without `<sysexits.h>`:
```
cc -DEX_USAGE=1 -include isvalue.c -o simexec simexec.c
cc -DEX_USAGE=1 -o str str.c
```

View File

@ -12,23 +12,29 @@ str
.SH DESCRIPTION
Str tests each character in an arbitrary quantity of string arguments against the function of the same name within ctype(3).
Str tests each character in an arbitrary quantity of string arguments against
the function of the same name within ctype(3).
.SH DIAGNOSTICS
Str exits successfully if all tests pass and unsuccessfully if a test failed.
.PP
Str will exit unsuccessfully if a string is empty, as none of its contents passed the test.
Str will exit unsuccessfully if a string is empty, as none of its contents
passed the test.
.PP
Str will print a message to standard error and exit unsuccessfully if used improperly.
Str will print a message to standard error and exit unsuccessfully if used
improperly.
.SH EXTENSIONS FROM CTYPE
.SH ISVALUE
Using the ctype "isvalue", which does not exist within ctype(3), will make str exit successfully as long as the given string(s) have non-zero length.
Str used to have an "isvalue" type as an extension to ctype(3). This was
removed in favor of using strcmp(1) to compare strings against the empty string
('').
.SH BUGS
There's no way of knowing which argument failed the test without re-testing arguments individually.
There's no way of knowing which argument failed the test without re-testing
arguments individually.
.PP
If a character in a string isn't valid ASCII str will exit unsuccessfully.

View File

@ -24,9 +24,6 @@ static struct {
{ "ispunct", ispunct },
{ "isspace", isspace },
{ "isupper", isupper }
#if defined _isvalue_c
, { "isvalue", isvalue }
#endif
};
int main(int argc, char *argv[]){