2 * Copyright 2003-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
31 _ISblank
= 0x0001, /* blank */
32 _IScntrl
= 0x0002, /* control */
33 _ISpunct
= 0x0004, /* punctuation */
34 _ISalnum
= 0x0008, /* alpha-numeric */
35 _ISupper
= 0x0100, /* uppercase */
36 _ISlower
= 0x0200, /* lowercase */
37 _ISalpha
= 0x0400, /* alphabetic */
38 _ISdigit
= 0x0800, /* digit */
39 _ISxdigit
= 0x1000, /* hexadecimal digit */
40 _ISspace
= 0x2000, /* white space */
41 _ISprint
= 0x4000, /* printing */
42 _ISgraph
= 0x8000 /* graphical */
46 extern const unsigned short int *__ctype_b
;
47 /* Case conversions */
48 extern const int *__ctype_tolower
;
49 extern const int *__ctype_toupper
;
51 #define __isctype(c, type) \
52 (__ctype_b[(int)(c)] & (unsigned short int)type)
54 #define isascii(c) (((c) & ~0x7f) == 0) /* ASCII characters have bit 8 cleared */
55 #define toascii(c) ((c) & 0x7f) /* Clear higher bits */
57 #define tolower(c) ((int)__ctype_tolower[(int)(c)])
58 #define toupper(c) ((int)__ctype_toupper[(int)(c)])
59 #define _tolower(c) tolower(c)
60 #define _toupper(c) toupper(c)
62 #define isalnum(c) __isctype((c), _ISalnum)
63 #define isalpha(c) __isctype((c), _ISalpha)
64 #define isblank(c) __isctype((c), _ISblank)
65 #define iscntrl(c) __isctype((c), _IScntrl)
66 #define isdigit(c) __isctype((c), _ISdigit)
67 #define islower(c) __isctype((c), _ISlower)
68 #define isgraph(c) __isctype((c), _ISgraph)
69 #define isprint(c) __isctype((c), _ISprint)
70 #define ispunct(c) __isctype((c), _ISpunct)
71 #define isspace(c) __isctype((c), _ISspace)
72 #define isupper(c) __isctype((c), _ISupper)
73 #define isxdigit(c) __isctype((c), _ISxdigit)
75 extern unsigned short int __ctype_mb_cur_max
;