LibC: add toupper, tolower in ctype.h
This commit is contained in:
parent
01fa521a03
commit
926aa238ab
|
@ -64,3 +64,17 @@ int isxdigit(int c)
|
|||
{
|
||||
return isdigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F');
|
||||
}
|
||||
|
||||
int toupper(int c)
|
||||
{
|
||||
if (!islower(c))
|
||||
return c;
|
||||
return 'A' + (c - 'a');
|
||||
}
|
||||
|
||||
int tolower(int c)
|
||||
{
|
||||
if (!isupper(c))
|
||||
return c;
|
||||
return 'a' + (c - 'A');
|
||||
}
|
||||
|
|
|
@ -18,4 +18,7 @@ int isspace(int);
|
|||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
|
||||
int toupper(int);
|
||||
int tolower(int);
|
||||
|
||||
__END_DECLS
|
Loading…
Reference in New Issue