1999-01-12 04:13:43 +08:00
|
|
|
#ifndef _WCTYPE_H
|
Remove __need macros from stdio.h and wchar.h.
wint_t is a little finicky because it might be defined by stddef.h, which
belongs to the compiler.
In addition to the _types_, a bunch of other declarations shared between
wctype.h and wchar.h are factored out to their own header.
* libio/bits/types/FILE.h, libio/bits/types/__FILE.h
* wcsmbs/bits/types/mbstate_t.h, wcsmbs/bits/types/__mbstate_t.h
* wcsmbs/bits/types/wint_t.h: New single-type definition files.
* wctype/bits/wctype-wchar.h: New file holding declarations shared
between wctype.h and wchar.h.
* libio/Makefile, wcsmbs/Makefile, wctype/Makefile:
Install them.
* include/bits/types/FILE.h, include/bits/types/__FILE.h
* include/bits/types/mbstate_t.h, include/bits/types/__mbstate_t.h
* include/bits/types/wint_t.h, include/bits/wcsmbs-wchar.h:
New wrappers.
* include/stdio.h, include/wchar.h, include/wctype.h:
No need to handle __need macros.
* grp/grp.h, gshadow/gshadow.h, hurd/hurd.h, iconv/gconv.h
* libio/stdio.h, mach/mach.h, misc/mntent.h, pwd/pwd.h
* shadow/shadow.h, stdio-common/printf.h, wcsmbs/uchar.h
* wcsmbs/wchar.h, wctype/wctype.h
* sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h
Use the new files instead of __need macros.
2016-11-21 12:00:02 +08:00
|
|
|
#include <wctype/wctype.h>
|
1999-01-12 04:13:43 +08:00
|
|
|
|
2012-02-26 12:18:39 +08:00
|
|
|
#ifndef _ISOMAC
|
* include/bits/dlfcn.h: New file.
* elf/dl-profstub.c (_dl_mcount_wrapper_check): Add libc_hidden_def.
* include/grp.h (_nss_files_parse_grent): Add libc_hidden_proto.
* include/netinet/ether.h (_nss_files_parse_etherent): Likewise.
* include/rpc/netdb.h (_nss_files_parse_rpcent): Likewise.
* include/pwd.h (_nss_files_parse_pwent): Likewise.
* include/shadow.h (_nss_files_parse_spent): Likewise.
* include/netdb.h (_nss_files_parse_protoent,
_nss_files_parse_servent, _nss_files_parse_netent): Likewise.
* nss/nss_files/files-parse.c (nss_files_parse_hidden_def): Define.
(LINE_PARSER): Use it.
* nss/nsswitch.h (__nss_hostname_digits_dots): Add libc_hidden_proto.
* nss/digits_dots.c (__nss_hostname_digits_dots): Add libc_hidden_def.
* include/wctype.h (iswalpha, iswdigit, iswlower, iswspace, iswxdigit,
towlower, towupper): Add prototypes here too. Add libc_hidden_proto.
* wctype/wcfuncs ((iswalpha, iswdigit, iswlower, iswspace, iswxdigit,
towlower, towupper): Add libc_hidden_weak.
* libio/oldiopopen.c: Move #if SHLIB_COMPAT after _IO_HAVE_SYS_WAIT
#endif.
* manual/debug.texi (%MENU%): Remove trailing dot.
Reported by <hayastan132@hotmail.com>.
2002-08-10 15:54:55 +08:00
|
|
|
|
|
|
|
libc_hidden_proto (iswalpha)
|
2002-12-07 07:38:01 +08:00
|
|
|
libc_hidden_proto (iswalnum)
|
* include/bits/dlfcn.h: New file.
* elf/dl-profstub.c (_dl_mcount_wrapper_check): Add libc_hidden_def.
* include/grp.h (_nss_files_parse_grent): Add libc_hidden_proto.
* include/netinet/ether.h (_nss_files_parse_etherent): Likewise.
* include/rpc/netdb.h (_nss_files_parse_rpcent): Likewise.
* include/pwd.h (_nss_files_parse_pwent): Likewise.
* include/shadow.h (_nss_files_parse_spent): Likewise.
* include/netdb.h (_nss_files_parse_protoent,
_nss_files_parse_servent, _nss_files_parse_netent): Likewise.
* nss/nss_files/files-parse.c (nss_files_parse_hidden_def): Define.
(LINE_PARSER): Use it.
* nss/nsswitch.h (__nss_hostname_digits_dots): Add libc_hidden_proto.
* nss/digits_dots.c (__nss_hostname_digits_dots): Add libc_hidden_def.
* include/wctype.h (iswalpha, iswdigit, iswlower, iswspace, iswxdigit,
towlower, towupper): Add prototypes here too. Add libc_hidden_proto.
* wctype/wcfuncs ((iswalpha, iswdigit, iswlower, iswspace, iswxdigit,
towlower, towupper): Add libc_hidden_weak.
* libio/oldiopopen.c: Move #if SHLIB_COMPAT after _IO_HAVE_SYS_WAIT
#endif.
* manual/debug.texi (%MENU%): Remove trailing dot.
Reported by <hayastan132@hotmail.com>.
2002-08-10 15:54:55 +08:00
|
|
|
libc_hidden_proto (iswdigit)
|
|
|
|
libc_hidden_proto (iswlower)
|
|
|
|
libc_hidden_proto (iswspace)
|
|
|
|
libc_hidden_proto (iswxdigit)
|
|
|
|
libc_hidden_proto (towlower)
|
|
|
|
libc_hidden_proto (towupper)
|
|
|
|
|
2001-02-07 02:27:57 +08:00
|
|
|
/* Internal interfaces. */
|
1999-10-19 21:53:34 +08:00
|
|
|
extern int __iswspace (wint_t __wc);
|
2001-02-07 02:27:57 +08:00
|
|
|
extern int __iswctype (wint_t __wc, wctype_t __desc);
|
2012-01-08 12:57:22 +08:00
|
|
|
extern wctype_t __wctype (const char *__property);
|
2004-02-09 18:05:22 +08:00
|
|
|
extern wctrans_t __wctrans (const char *__property);
|
2001-02-07 02:27:57 +08:00
|
|
|
extern wint_t __towctrans (wint_t __wc, wctrans_t __desc);
|
|
|
|
|
2015-06-06 04:04:47 +08:00
|
|
|
extern __typeof (iswalnum) __iswalnum __THROW __attribute_pure__;
|
2002-08-28 07:36:31 +08:00
|
|
|
extern __typeof (iswalnum_l) __iswalnum_l;
|
|
|
|
extern __typeof (iswalpha_l) __iswalpha_l;
|
|
|
|
extern __typeof (iswblank_l) __iswblank_l;
|
|
|
|
extern __typeof (iswcntrl_l) __iswcntrl_l;
|
|
|
|
extern __typeof (iswdigit_l) __iswdigit_l;
|
2015-06-06 04:04:47 +08:00
|
|
|
extern __typeof (iswlower) __iswlower __THROW __attribute_pure__;
|
2002-08-28 07:36:31 +08:00
|
|
|
extern __typeof (iswlower_l) __iswlower_l;
|
|
|
|
extern __typeof (iswgraph_l) __iswgraph_l;
|
|
|
|
extern __typeof (iswprint_l) __iswprint_l;
|
|
|
|
extern __typeof (iswpunct_l) __iswpunct_l;
|
|
|
|
extern __typeof (iswspace_l) __iswspace_l;
|
|
|
|
extern __typeof (iswupper_l) __iswupper_l;
|
|
|
|
extern __typeof (iswxdigit_l) __iswxdigit_l;
|
|
|
|
extern __typeof (towlower_l) __towlower_l;
|
|
|
|
extern __typeof (towupper_l) __towupper_l;
|
Fix fnmatch towlower namespace (bug 18469).
fnmatch brings in references to towlower (and thereby towupper), which
isn't in all the standards that contain fnmatch, resulting in
linknamespace test failures. (This is contrary to glibc conventions,
rather than a standards conformance issue, because of the to*
reservation.) This patch fixes this in the usual way, making those
functions into weak aliases.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch). This is on top
of <https://sourceware.org/ml/libc-alpha/2015-06/msg00019.html>, but
the two patches should be independent.
(The __attribute_pure__ on the declarations in include/wctype.h comes
from GCC's built-in attributes for towlower and towupper, and is
needed to get the same code generation for fnmatch before and after
the patch. It seems likely there are cases where the declaration of
__foo in the internal headers is missing attributes from foo in the
public headers, built-in to GCC or both, but I don't know a good way
to detect such missing attributes.)
[BZ #18469]
* wctype/wcfuncs.c (towlower): Rename to __towlower and define as
weak alias of __towlower. Use libc_hidden_weak.
(towupper): Rename to __towupper and define as weak alias of
__towupper. Use libc_hidden_weak.
* include/wctype.h (__towlower): Declare. Use libc_hidden_proto.
(__towupper): Likewise.
* posix/fnmatch.c [HANDLE_MULTIBYTE && _LIBC] (FOLD): Use
__towlower instead of towlower.
2015-06-03 04:23:09 +08:00
|
|
|
extern __typeof (towlower) __towlower __THROW __attribute_pure__;
|
|
|
|
extern __typeof (towupper) __towupper __THROW __attribute_pure__;
|
2002-08-28 07:36:31 +08:00
|
|
|
|
2004-03-05 18:54:16 +08:00
|
|
|
libc_hidden_proto (__towctrans)
|
Update.
2002-08-04 Ulrich Drepper <drepper@redhat.com>
* elf/dl-addr.c (_dl_addr): Add libc_hidden_def.
* elf/dl-close.c (_dl_close): Add libc_hidden_def.
* elf/dl-open.c (_dl_open): Add libc_hidden_def.
* include/dlfcn.h: Add libc_hidden_proto for _dl_addr, _dl_open,
_dl_close.
* include/libio.h: Add libc_hidden_proto for __underflow, __wuflow,
__wunderflow.
* libio/genops.c (__underflow): Add libc_hidden_def.
* libio/wgenops.c (__wuflow): Likewise.
(__wunderflow): Likewise.
* include/obstack.h: Add libc_hidden_proto for _obstack_newchunk.
* malloc/obstack.c (_obstack_newchunk): Add libc_hidden_def.
* include/stdio.h: Add libc_hidden_proto for __vfscanf.
* stdio-common/vfscanf.c (__vfscanf): Add libc_hidden_def.
* include/string.h: Add libc_hidden_proto for __strverscmp.
* string/strverscmp.c (__strverscmp): Add libc_hidden_def.
* include/unistd.h: Add libc_hidden_proto for __sysconf.
* sysdeps/generic/sysconf.c (__sysconf): Add libc_hidden_def.
* sysdeps/posix/sysconf.c: Likewise.
* sysdeps/unix/sysv/irix4/sysconf.c: Likewise.
* sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
* include/wctype.h: Use libc_hidden_proto for __iswctype, __iswalnum_l,
__iswalpha_l, __iswblank_l, __iswcntrl_l, __iswdigit_l, __iswlower_l,
__iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l,
__iswxdigit_l, __towlower_l, __towupper_l.
* wcsmbs/wcstype.c (__iswctype): Use libc_hidden_def.
* wcsmbs/wcfuncs_l.c: Use libc_hidden_def for all functions.
* include/sys/wait.h: Add libc_hidden_proto for __xmknod.
* sysdeps/generic/xmknod.c (__xmknod): Add libc_hidden_def.
* sysdeps/mach/hurd/xmknod.c: Likewise.
* sysdeps/unix/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise.
* sunrpc/svc.c: Add missing INTUSE for _authenticate.
2002-08-04 17:27:27 +08:00
|
|
|
libc_hidden_proto (__iswctype)
|
2015-06-06 04:04:47 +08:00
|
|
|
libc_hidden_proto (__iswalnum)
|
Update.
2002-08-04 Ulrich Drepper <drepper@redhat.com>
* elf/dl-addr.c (_dl_addr): Add libc_hidden_def.
* elf/dl-close.c (_dl_close): Add libc_hidden_def.
* elf/dl-open.c (_dl_open): Add libc_hidden_def.
* include/dlfcn.h: Add libc_hidden_proto for _dl_addr, _dl_open,
_dl_close.
* include/libio.h: Add libc_hidden_proto for __underflow, __wuflow,
__wunderflow.
* libio/genops.c (__underflow): Add libc_hidden_def.
* libio/wgenops.c (__wuflow): Likewise.
(__wunderflow): Likewise.
* include/obstack.h: Add libc_hidden_proto for _obstack_newchunk.
* malloc/obstack.c (_obstack_newchunk): Add libc_hidden_def.
* include/stdio.h: Add libc_hidden_proto for __vfscanf.
* stdio-common/vfscanf.c (__vfscanf): Add libc_hidden_def.
* include/string.h: Add libc_hidden_proto for __strverscmp.
* string/strverscmp.c (__strverscmp): Add libc_hidden_def.
* include/unistd.h: Add libc_hidden_proto for __sysconf.
* sysdeps/generic/sysconf.c (__sysconf): Add libc_hidden_def.
* sysdeps/posix/sysconf.c: Likewise.
* sysdeps/unix/sysv/irix4/sysconf.c: Likewise.
* sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
* include/wctype.h: Use libc_hidden_proto for __iswctype, __iswalnum_l,
__iswalpha_l, __iswblank_l, __iswcntrl_l, __iswdigit_l, __iswlower_l,
__iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l,
__iswxdigit_l, __towlower_l, __towupper_l.
* wcsmbs/wcstype.c (__iswctype): Use libc_hidden_def.
* wcsmbs/wcfuncs_l.c: Use libc_hidden_def for all functions.
* include/sys/wait.h: Add libc_hidden_proto for __xmknod.
* sysdeps/generic/xmknod.c (__xmknod): Add libc_hidden_def.
* sysdeps/mach/hurd/xmknod.c: Likewise.
* sysdeps/unix/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise.
* sunrpc/svc.c: Add missing INTUSE for _authenticate.
2002-08-04 17:27:27 +08:00
|
|
|
libc_hidden_proto (__iswalnum_l)
|
|
|
|
libc_hidden_proto (__iswalpha_l)
|
|
|
|
libc_hidden_proto (__iswblank_l)
|
|
|
|
libc_hidden_proto (__iswcntrl_l)
|
|
|
|
libc_hidden_proto (__iswdigit_l)
|
2015-06-06 04:04:47 +08:00
|
|
|
libc_hidden_proto (__iswlower)
|
Update.
2002-08-04 Ulrich Drepper <drepper@redhat.com>
* elf/dl-addr.c (_dl_addr): Add libc_hidden_def.
* elf/dl-close.c (_dl_close): Add libc_hidden_def.
* elf/dl-open.c (_dl_open): Add libc_hidden_def.
* include/dlfcn.h: Add libc_hidden_proto for _dl_addr, _dl_open,
_dl_close.
* include/libio.h: Add libc_hidden_proto for __underflow, __wuflow,
__wunderflow.
* libio/genops.c (__underflow): Add libc_hidden_def.
* libio/wgenops.c (__wuflow): Likewise.
(__wunderflow): Likewise.
* include/obstack.h: Add libc_hidden_proto for _obstack_newchunk.
* malloc/obstack.c (_obstack_newchunk): Add libc_hidden_def.
* include/stdio.h: Add libc_hidden_proto for __vfscanf.
* stdio-common/vfscanf.c (__vfscanf): Add libc_hidden_def.
* include/string.h: Add libc_hidden_proto for __strverscmp.
* string/strverscmp.c (__strverscmp): Add libc_hidden_def.
* include/unistd.h: Add libc_hidden_proto for __sysconf.
* sysdeps/generic/sysconf.c (__sysconf): Add libc_hidden_def.
* sysdeps/posix/sysconf.c: Likewise.
* sysdeps/unix/sysv/irix4/sysconf.c: Likewise.
* sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
* include/wctype.h: Use libc_hidden_proto for __iswctype, __iswalnum_l,
__iswalpha_l, __iswblank_l, __iswcntrl_l, __iswdigit_l, __iswlower_l,
__iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l,
__iswxdigit_l, __towlower_l, __towupper_l.
* wcsmbs/wcstype.c (__iswctype): Use libc_hidden_def.
* wcsmbs/wcfuncs_l.c: Use libc_hidden_def for all functions.
* include/sys/wait.h: Add libc_hidden_proto for __xmknod.
* sysdeps/generic/xmknod.c (__xmknod): Add libc_hidden_def.
* sysdeps/mach/hurd/xmknod.c: Likewise.
* sysdeps/unix/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/xmknod.c: Likewise.
* sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise.
* sunrpc/svc.c: Add missing INTUSE for _authenticate.
2002-08-04 17:27:27 +08:00
|
|
|
libc_hidden_proto (__iswlower_l)
|
|
|
|
libc_hidden_proto (__iswgraph_l)
|
|
|
|
libc_hidden_proto (__iswprint_l)
|
|
|
|
libc_hidden_proto (__iswpunct_l)
|
|
|
|
libc_hidden_proto (__iswspace_l)
|
|
|
|
libc_hidden_proto (__iswupper_l)
|
|
|
|
libc_hidden_proto (__iswxdigit_l)
|
|
|
|
libc_hidden_proto (__towlower_l)
|
|
|
|
libc_hidden_proto (__towupper_l)
|
Fix fnmatch towlower namespace (bug 18469).
fnmatch brings in references to towlower (and thereby towupper), which
isn't in all the standards that contain fnmatch, resulting in
linknamespace test failures. (This is contrary to glibc conventions,
rather than a standards conformance issue, because of the to*
reservation.) This patch fixes this in the usual way, making those
functions into weak aliases.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch). This is on top
of <https://sourceware.org/ml/libc-alpha/2015-06/msg00019.html>, but
the two patches should be independent.
(The __attribute_pure__ on the declarations in include/wctype.h comes
from GCC's built-in attributes for towlower and towupper, and is
needed to get the same code generation for fnmatch before and after
the patch. It seems likely there are cases where the declaration of
__foo in the internal headers is missing attributes from foo in the
public headers, built-in to GCC or both, but I don't know a good way
to detect such missing attributes.)
[BZ #18469]
* wctype/wcfuncs.c (towlower): Rename to __towlower and define as
weak alias of __towlower. Use libc_hidden_weak.
(towupper): Rename to __towupper and define as weak alias of
__towupper. Use libc_hidden_weak.
* include/wctype.h (__towlower): Declare. Use libc_hidden_proto.
(__towupper): Likewise.
* posix/fnmatch.c [HANDLE_MULTIBYTE && _LIBC] (FOLD): Use
__towlower instead of towlower.
2015-06-03 04:23:09 +08:00
|
|
|
libc_hidden_proto (__towlower)
|
|
|
|
libc_hidden_proto (__towupper)
|
1999-01-12 04:13:43 +08:00
|
|
|
|
2004-03-16 18:10:13 +08:00
|
|
|
/* The spec says that isdigit must only match the decimal digits. We
|
|
|
|
can check this without a memory access. */
|
2014-11-24 17:33:45 +08:00
|
|
|
# if IS_IN (libc)
|
2004-03-16 18:10:13 +08:00
|
|
|
# undef iswdigit
|
|
|
|
# define iswdigit(c) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
|
|
|
|
# undef iswdigit_l
|
|
|
|
# define iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
|
|
|
|
# undef __iswdigit_l
|
|
|
|
# define __iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
|
|
|
|
# endif
|
|
|
|
|
1999-01-12 04:13:43 +08:00
|
|
|
#endif
|
2012-02-26 12:18:39 +08:00
|
|
|
#endif
|