sys/sys/ctype_inline.h: merged

Change-Id: I0a04b7729b2226ce601cadceebfb6878302c64d1
This commit is contained in:
Lionel Sambuc 2013-12-02 15:31:33 +01:00
parent df23a7e418
commit d1ae7749c8

View file

@ -44,20 +44,20 @@
#include <sys/featuretest.h>
#include <sys/ctype_bits.h>
/* LSC: cast to unsigned char in order to prevent char as indice errors. */
#define isdigit(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_N))
#define islower(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_L))
#define isspace(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_S))
#define ispunct(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_P))
#define isupper(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_U))
#define isalpha(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_U|_CTYPE_L)))
#define isxdigit(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_N|_CTYPE_X)))
#define isalnum(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_U|_CTYPE_L|_CTYPE_N)))
#define isprint(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)))
#define isgraph(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)))
#define iscntrl(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_C))
#define tolower(c) ((int)((_tolower_tab_ + 1)[(unsigned char)(c)]))
#define toupper(c) ((int)((_toupper_tab_ + 1)[(unsigned char)(c)]))
#define isdigit(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_N))
#define islower(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_L))
#define isspace(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_S))
#define ispunct(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_P))
#define isupper(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_U))
#define isalpha(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_U|_CTYPE_L)))
#define isxdigit(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_N|_CTYPE_X)))
#define isalnum(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_U|_CTYPE_L|_CTYPE_N)))
#define isprint(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)))
#define isgraph(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)))
#define iscntrl(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_C))
#define tolower(c) ((int)((_tolower_tab_ + 1)[(c)]))
#define toupper(c) ((int)((_toupper_tab_ + 1)[(c)]))
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define isascii(c) ((unsigned)(c) <= 0177)