mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-21 22:23:05 +00:00
string.h: Add toupper()/tolower()
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
ef83f62d0e
commit
e763faa3c1
1 changed files with 16 additions and 0 deletions
|
@ -19,4 +19,20 @@ size_t strnlen(const char *s, size_t n);
|
|||
char *strchr(const char *s, int c);
|
||||
char *strrchr(const char *s, int c);
|
||||
|
||||
static inline int tolower(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c - 'A' + 'a';
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline int toupper(int c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
return c - 'a' + 'A';
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue