#include <ctype.h>
#undef isalnum
#undef isalpha
#undef isascii
#undef isblank
#undef iscntrl
#undef isdigit
#undef islower
#undef isgraph
#undef isprint
#undef ispunct
#undef isspace
#undef isupper
#undef isxdigit
#undef toascii
#undef tolower
#undef toupper
extern "C"
{
int
isalnum(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & (_ISupper | _ISlower | _ISdigit);
return 0;
}
int
isalpha(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & (_ISupper | _ISlower);
return 0;
}
int
isascii(int c)
{
return (c & ~0x7f) == 0;
}
int
isblank(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISblank;
return 0;
}
int
iscntrl(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _IScntrl;
return 0;
}
int
isdigit(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISdigit;
return 0;
}
int
isgraph(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISgraph;
return 0;
}
int
islower(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISlower;
return 0;
}
int
isprint(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISprint;
return 0;
}
int
ispunct(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISpunct;
return 0;
}
int
isspace(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISspace;
return 0;
}
int
isupper(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISupper;
return 0;
}
int
isxdigit(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_b_loc())[c] & _ISxdigit;
return 0;
}
int
toascii(int c)
{
return c & 0x7f;
}
int
tolower(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_tolower_loc())[c];
return c;
}
int
toupper(int c)
{
if (c >= -128 && c < 256)
return (*__ctype_toupper_loc())[c];
return c;
}
}