3 extern int __isctype (int __c
, int __mask
);
7 /* These accessors are used by the optimized macros to find the
8 thread-local cache of ctype information from the current thread's
9 locale. For inside libc, define them as inlines using the _NL_CURRENT
10 accessors. We don't use _NL_CURRENT_LOCALE->__ctype_b here because we
11 want to cause a link-time ref to _nl_current_LC_CTYPE under
12 NL_CURRENT_INDIRECT. */
14 # include "../locale/localeinfo.h"
15 # include <bits/libc-tsd.h>
17 # ifndef CTYPE_EXTERN_INLINE /* Used by ctype/ctype-info.c, which see. */
18 # define CTYPE_EXTERN_INLINE extern inline
21 __libc_tsd_define (extern, CTYPE_B
)
22 __libc_tsd_define (extern, CTYPE_TOUPPER
)
23 __libc_tsd_define (extern, CTYPE_TOLOWER
)
25 CTYPE_EXTERN_INLINE
const uint16_t ** __attribute__ ((const))
31 const uint16_t **tablep
;
33 u
.ptr
= __libc_tsd_address (CTYPE_B
);
34 if (__builtin_expect (*u
.tablep
== NULL
, 0))
35 *u
.tablep
= (const uint16_t *) _NL_CURRENT (LC_CTYPE
, _NL_CTYPE_CLASS
) + 128;
39 CTYPE_EXTERN_INLINE
const int32_t ** __attribute__ ((const))
40 __ctype_toupper_loc (void)
45 const int32_t **tablep
;
47 u
.ptr
= __libc_tsd_address (CTYPE_TOUPPER
);
48 if (__builtin_expect (*u
.tablep
== NULL
, 0))
49 *u
.tablep
= ((int32_t *) _NL_CURRENT (LC_CTYPE
, _NL_CTYPE_TOUPPER
) + 128);
53 CTYPE_EXTERN_INLINE
const int32_t ** __attribute__ ((const))
54 __ctype_tolower_loc (void)
59 const int32_t **tablep
;
61 u
.ptr
= __libc_tsd_address (CTYPE_TOLOWER
);
62 if (__builtin_expect (*u
.tablep
== NULL
, 0))
63 *u
.tablep
= ((int32_t *) _NL_CURRENT (LC_CTYPE
, _NL_CTYPE_TOLOWER
) + 128);
67 # endif /* Not NOT_IN_libc. */
69 # include <ctype/ctype.h>
71 # if !defined __NO_CTYPE && !defined NOT_IN_libc
72 /* The spec says that isdigit must only match the decimal digits. We
73 can check this without a memory access. */
75 # define isdigit(c) ({ int __c = (c); __c >= '0' && __c <= '9'; })
77 # define isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; })
79 # define __isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; })