Add tolower and toupper

This commit is contained in:
g1n 2021-12-29 21:48:33 +02:00
parent c2ba116026
commit 7697e5d947
Signed by: g1n
GPG Key ID: 8D352193D65D4E2C
3 changed files with 11 additions and 1 deletions

View File

@ -3,7 +3,7 @@ LIBLINUXHEADERS=
LIBLINUXDIR=
LIBLINUXFILE=liblinux.a
CFILES=stdio.c string.c
OBJFILES=../builds/olibc/stdio.o ../builds/olibc/stdlib.o ../builds/olibc/string.o
OBJFILES=../builds/olibc/stdio.o ../builds/olibc/stdlib.o ../builds/olibc/string.o ../builds/olibc/ctype.o
LIBFILE=../builds/olibc.a
OLIBCHEADERS=include/
OLIBCDIR=../builds

View File

@ -43,3 +43,11 @@ int isprint(int c) {
int isgraph(int c) {
return (unsigned)c-0x21 < 0x5e;
}
int tolower(int c) {
return isupper(c) ? (c | 32) : c;
}
int toupper(int c) {
return islower(c) ? c & 0x5f : c;
}

View File

@ -12,5 +12,7 @@ int isalnum(int c);
int iscntrl(int c);
int isprint(int c);
int isgraph(int c);
int tolower(int c);
int toupper(int c);
#endif