From: Ben Pfaff Date: Tue, 7 Sep 2004 23:47:31 +0000 (+0000) Subject: Add tolower(), toupper(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=commitdiff_plain;h=b30b093dee7671ccb8c30218d78449c542a6bfec Add tolower(), toupper(). --- diff --git a/src/lib/ctype.h b/src/lib/ctype.h index 71b432c..adc96be 100644 --- a/src/lib/ctype.h +++ b/src/lib/ctype.h @@ -22,4 +22,7 @@ static inline int ispunct (int c) { return isprint (c) && !isalnum (c) && !isspace (c); } +static inline int tolower (int c) { return isupper (c) ? c - 'A' + 'a' : c; } +static inline int toupper (int c) { return islower (c) ? c - 'a' + 'A' : c; } + #endif /* lib/ctype.h */