isdigit.c revision 6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648
2N/A/*
2N/A * This file and its contents are supplied under the terms of the
2N/A * Common Development and Distribution License ("CDDL"), version 1.0.
2N/A * You may only use this file in accordance with the terms version
2N/A * 1.0 of the CDDL.
2N/A *
2N/A * A full copy of the text of the CDDL should have accompanied this
2N/A * source. A copy is of the CDDL is also available via the Internet
2N/A * at http://www.illumos.org/license/CDDL.
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * This file contains the implementation of various functional forms
2N/A * of the ctype tests, specifically the required by ISO C. These are defined
2N/A * in the "C" (POSIX) locale.
2N/A */
2N/A
2N/A#include "lint.h"
2N/A#include <ctype.h>
2N/A
2N/A/*
2N/A * We are supplying functional forms, so make sure to suppress any macros
2N/A * we might have imported.
2N/A */
2N/A
#ifdef isblank
#undef isblank
#endif
int
isblank(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISBLANK));
}
#ifdef isupper
#undef isupper
#endif
int
isupper(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISUPPER));
}
#ifdef islower
#undef islower
#endif
int
islower(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISLOWER));
}
#ifdef isdigit
#undef isdigit
#endif
int
isdigit(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISDIGIT));
}
#ifdef isxdigit
#undef isxdigit
#endif
int
isxdigit(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISXDIGIT));
}
#ifdef isalpha
#undef isalpha
#endif
int
isalpha(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISALPHA));
}
#ifdef isalnum
#undef isalnum
#endif
int
isalnum(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISALNUM));
}
#ifdef isspace
#undef isspace
#endif
int
isspace(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISSPACE));
}
#ifdef iscntrl
#undef iscntrl
#endif
int
iscntrl(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISCNTRL));
}
#ifdef isgraph
#undef isgraph
#endif
int
isgraph(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISGRAPH));
}
#ifdef ispunct
#undef ispunct
#endif
int
ispunct(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISPUNCT));
}
#ifdef isprint
#undef isprint
#endif
int
isprint(int c)
{
return (((unsigned)c > 255) ? 0 : (__ctype_mask[c] & _ISPRINT));
}