mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 17:17:45 +00:00
More LibC portability work while trying to get figlet building.
This commit is contained in:
parent
bb90c8ecab
commit
9160fd0d47
12 changed files with 128 additions and 2 deletions
33
LibC/ctype.h
33
LibC/ctype.h
|
@ -1,4 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#define isascii(c) (((c) & ~0x7f) == 0)
|
||||
inline int isascii(int ch)
|
||||
{
|
||||
return (ch & ~0x7f) == 0;
|
||||
}
|
||||
|
||||
inline int isspace(int ch)
|
||||
{
|
||||
return ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' == '\v';
|
||||
}
|
||||
|
||||
inline int islower(int c)
|
||||
{
|
||||
return c >= 'a' && c <= 'z';
|
||||
}
|
||||
|
||||
inline int isupper(int c)
|
||||
{
|
||||
return c >= 'A' && c <= 'Z';
|
||||
}
|
||||
|
||||
inline int tolower(int c)
|
||||
{
|
||||
if (isupper(c))
|
||||
return c | 0x20;
|
||||
return c;
|
||||
}
|
||||
|
||||
inline int toupper(int c)
|
||||
{
|
||||
if (islower(c))
|
||||
return c & ~0x20;
|
||||
return c;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue