+2011-02-09 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool: Make copyright notice adjustment more robust.
+ * gnulib-tool (func_import): In sed_transform_main_lib_file,
+ sed_transform_build_aux_file, sed_transform_testsrelated_lib_file,
+ allow a line break to occur after "GNU" in "GNU [Lesser] General Public
+ License".
+ Reported by Glenn Morris <rgm@gnu.org> via Paul Eggert.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'towctrans'.
+ * modules/towctrans: New file.
+ * lib/wctype.in.h (towctrans): New declaration.
+ * lib/towctrans.c: New file.
+ * lib/towctrans-impl.h: New file.
+ * m4/towctrans.m4: New file.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether towctrans is declared.
+ (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_TOWCTRANS.
+ * modules/wctype-h (Makefile.am): Substitute GNULIB_TOWCTRANS.
+ * tests/test-wctype-h-c++.cc: Test the declaration of towctrans.
+ * doc/posix-functions/towctrans.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wctrans'.
+ * modules/wctrans: New file.
+ * lib/wctype.in.h (wctrans): New declaration.
+ * lib/wctrans.c: New file.
+ * lib/wctrans-impl.h: New file.
+ * m4/wctrans.m4: New file.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether wctrans is declared.
+ (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_WCTRANS.
+ * modules/wctype-h (Makefile.am): Substitute GNULIB_WCTRANS.
+ * tests/test-wctype-h-c++.cc: Test the declaration of wctrans.
+ * doc/posix-functions/wctrans.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'iswctype'.
+ * modules/iswctype: New file.
+ * lib/wctype.in.h (iswctype): New declaration.
+ * lib/iswctype.c: New file.
+ * lib/iswctype-impl.h: New file.
+ * m4/iswctype.m4: New file.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether iswctype is declared.
+ (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWCTYPE.
+ * modules/wctype-h (Makefile.am): Substitute GNULIB_ISWCTYPE.
+ * tests/test-wctype-h-c++.cc: Test the declaration of iswctype.
+ * doc/posix-functions/iswctype.texi: Mention the new module and the
+ HP-UX 11.00 problem.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wctype'.
+ * modules/wctype: Change to represent the wctype() substitute.
+ * lib/wctype.in.h (wctype): New declaration.
+ * lib/wctype.c: New file.
+ * lib/wctype-impl.h: New file.
+ * m4/wctype.m4: New file.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether wctype is declared.
+ (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_WCTYPE.
+ * modules/wctype-h (Makefile.am): Substitute GNULIB_WCTYPE.
+ * tests/test-wctype-h-c++.cc: Test the declaration of wctype.
+ * doc/posix-functions/wctype.texi: Mention the new module and the
+ HP-UX 11.00 problem.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ wctype-h: Ensure wctype_t and wctrans_t are defined.
+ * lib/wctype.in.h (wctype_t, wctrans_t): New type declarations.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Determine HAVE_WCTYPE_T, HAVE_WCTRANS_T.
+ (gl_WCTYPE_H_DEFAULTS): Initialize HAVE_WCTYPE_T, HAVE_WCTRANS_T.
+ * modules/wctype-h (Makefile.am): Substitute HAVE_WCTYPE_T,
+ HAVE_WCTRANS_T.
+ * tests/test-wctype-h.c: Check that wctype_t and wctrans_t are defined.
+
+2011-02-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ flock: fix license typo
+
+ * lib/flock.c: Fix typo in license. One of the "Lesser"s was
+ omitted.
+
+2011-02-08 Bruno Haible <bruno@clisp.org>
+
+ Split large sed scripts, for HP-UX sed.
+ * modules/math (Makefile.am): Split sed scripts around 50 sed commands,
+ to avoid HP-UX limit of 99 commands, in the near future.
+ * modules/stdlib (Makefile.am): Likewise.
+ * modules/unistd (Makefile.am): Likewise.
+ * modules/wchar (Makefile.am): Likewise.
+ Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>.
+ Suggestion by Ralf Wildenhues <Ralf.Wildenhues@gmx.de> in
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-01/msg00216.html>.
+
+2011-02-08 Paul Eggert <eggert@cs.ucla.edu>
+ Bruno Haible <bruno@clisp.org>
+
+ stdlib: improve random_r modularization
+ * lib/stdlib.in.h: Encapsulate all the stuff having to do with
+ random_r inside "#if @GNULIB_RANDOM_R@", so that it's clearer that
+ you also need the random_r module to get this material right.
+ * m4/random_r.m4 (gl_FUNC_RANDOM_R): Move check for random.h here ...
+ * m4/stdlib_h.m4 (gl_STDLIB_H): ... from here.
+ (gl_STDLIB_H_DEFAULTS): Default HAVE_RANDOM_H to 1, and AC_SUBST it.
+
+2011-02-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdlib: don't depend on stdint
+ * lib/stdlib.in.h: Don't include <stdint.h> merely because
+ GNULIB_POSIXCHECK is defined. GNULIB_POSIXCHECK seems to
+ be independent of whether stdint.h is needed.
+ * m4/random_r.m4 (gl_FUNC_RANDOM_R): Check for struct random_data
+ here, instead of ...
+ * m4/stdlib_h.m4 (gl_STDLIB_H): ... here. Applications that need
+ struct random_data should be using the random_r module, not just
+ the stdlib module (which wouldn't make sense: what package needs
+ just struct random_data without also needing random_r?).
+ * modules/stdlib (Depends-on): Remove stdint.
+
+ getloadavg: don't depend on c-strtod, cloexec, fcntl-safer
+ See the thread rooted at
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-02/msg00090.html>.
+ * lib/getloadavg.c: Do not include c-strtod.h, cloexec.h, or fcntl--.h.
+ Include <fcntl.h> only if (defined __linux__ || defined __CYGWIN__
+ || defined SUNOS_5 || (defined LOAD_AVE_TYPE && ! defined
+ __VMS)); previously it was always included (via fcntl--.h).
+ (getloadavg): Do not use c_strtod. Instead, approximate it by
+ hand; this is good enough for load averages. Also, do not use
+ set_cloexec_flag; instead, use the O_CLOEXEC and F_DUPFD_CLOEXEC
+ flags directly if available and don't bother otherwise. (Packages
+ that need the extra reliability should use the modules that define
+ these flags on older platforms that lack them.)
+ * modules/getloadavg (Depends-on): Remove c-strtod, cloexec,
+ fcntl-safer.
+
+2011-02-08 Jim Meyering <meyering@redhat.com>
+
+ di-set.h, ino-map.h: add multiple-inclusion guard
+ Technically, the guard is required only for ino-map.h, due to its
+ INO_MAP_INSERT_FAILURE definition, but do both for consistency.
+ * lib/di-set.h: Add file-spanning #ifndef _GL_DI_SET_H.
+ * lib/ino-map.h: Likewise.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ iswblank: Ensure declaration on glibc systems.
+ * m4/iswblank.m4 (gl_FUNC_ISWBLANK): Require gl_USE_SYSTEM_EXTENSIONS.
+ * modules/iswblank (Dependencies): Add 'extensions'.
+ * doc/posix-functions/iswblank.texi: Document the glibc problem.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'iswblank'.
+ * lib/wctype.in.h (iswblank): Don't declare if GNULIB_ISWBLANK is 0.
+ * modules/iswblank: New file.
+ * modules/wctype-h (Files): Remove lib/iswblank.c.
+ (Makefile.am): Substitute GNULIB_ISWBLANK.
+ * m4/iswblank.m4: New file, partially extracted from m4/wctype_h.m4.
+ * m4/wctype_h.m4 (gl_WCTYPE_MODULE_INDICATOR): New macro.
+ (gl_WCTYPE_H_DEFAULTS): New macro.
+ (gl_WCTYPE_H): Require it. Remove iswblank related code.
+ * modules/iswblank-tests: New file.
+ * tests/test-iswblank.c: New file, extraced from tests/test-wctype-h.c.
+ * tests/test-wctype-h.c (main): Remove iswblank tests.
+ * tests/test-wctype-h-c++.cc: Guard the signature test of iswblank.
+ * doc/posix-functions/iswblank.texi: Mention module 'iswblank' instead
+ of 'wctype-h'.
+ * NEWS: Mention the change.
+ * modules/mbchar (Depends-on): Add iswblank.
+
+2011-02-08 Bruno Haible <bruno@clisp.org>
+
+ di-set tests: Refactor.
+ * tests/test-di-set.c: Include di-set.h early. Include macros.h. Drop
+ unnecessary includes.
+ (ASSERT): Remove macro.
+ (main): Make C90 compliant by avoiding variable declaration after
+ statement.
+ * modules/di-set-tests (Files): Add tests/macros.h.
+
+2011-02-08 Bruno Haible <bruno@clisp.org>
+
+ ino-map tests: Refactor.
+ * tests/test-ino-map.c: Include ino-map.h early. Include macros.h. Drop
+ unnecessary includes.
+ (ASSERT): Remove macro.
+ (main): Make C90 compliant by avoiding variable declaration after
+ statement.
+ * modules/ino-map-tests (Files): Add tests/macros.h.
+
+2011-02-08 Jim Meyering <meyering@redhat.com>
+
+ di-set: add "const" to a cast
+ * lib/di-set.c (di_set_insert): Cast hash_insert0 argument to
+ "(void const *)", not "(void *)". Spotted by Bruno Haible.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ Rename module 'wctype' to 'wctype-h'.
+ * modules/wctype-h: Renamed from modules/wctype.
+ * modules/wctype: Simplyfy to a redirection to 'wctype-h'.
+ * modules/wctype-h-tests: Renamed from modules/wctype-tests.
+ (Files, Depends-on, Makefile.am): Update.
+ * modules/wctype-h-c++-tests: Renamed from modules/wctype-c++-tests.
+ (Files, Makefile.am): Update.
+ * tests/test-wctype-h.c: Renamed from tests/test-wctype.c.
+ * tests/test-wctype-h-c++.cc: Renamed from tests/test-wctype-c++.cc.
+ * doc/posix-headers/wctype.texi: Update.
+ * doc/posix-functions/iswalnum.texi: Update.
+ * doc/posix-functions/iswalpha.texi: Update.
+ * doc/posix-functions/iswblank.texi: Update.
+ * doc/posix-functions/iswcntrl.texi: Update.
+ * doc/posix-functions/iswdigit.texi: Update.
+ * doc/posix-functions/iswgraph.texi: Update.
+ * doc/posix-functions/iswlower.texi: Update.
+ * doc/posix-functions/iswprint.texi: Update.
+ * doc/posix-functions/iswpunct.texi: Update.
+ * doc/posix-functions/iswspace.texi: Update.
+ * doc/posix-functions/iswupper.texi: Update.
+ * doc/posix-functions/iswxdigit.texi: Update.
+ * doc/posix-functions/towlower.texi: Update.
+ * doc/posix-functions/towupper.texi: Update.
+ * NEWS: Mention the change.
+ * modules/fnmatch (Dependencies): Add wctype-h, remove wctype.
+ * modules/mbchar (Dependencies): Likewise.
+ * modules/mbswidth (Dependencies): Likewise.
+ * modules/quotearg (Dependencies): Likewise.
+ * modules/regex (Dependencies): Likewise.
+ * modules/wcscasecmp (Dependencies): Likewise.
+ * modules/wcsncasecmp (Dependencies): Likewise.
+ * modules/wcwidth (Dependencies): Likewise.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcswidth'.
+ * modules/wcswidth: New file.
+ * lib/wchar.in.h (wcswidth): New declaration.
+ * lib/wcswidth.c: New file.
+ * lib/wcswidth-impl.h: New file, from libutf8 with modifications.
+ * m4/wcswidth.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcswidth is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSWIDTH, HAVE_WCSWIDTH,
+ REPLACE_WCSWIDTH.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSWIDTH,
+ HAVE_WCSWIDTH, REPLACE_WCSWIDTH.
+ * tests/test-wchar-c++.cc: Test the declaration of wcswidth.
+ * doc/posix-functions/wcswidth.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcstok'.
+ * modules/wcstok: New file.
+ * lib/wchar.in.h (wcstok): New declaration.
+ * lib/wcstok.c: New file.
+ * lib/wcstok-impl.h: New file, from libutf8 with modifications.
+ * m4/wcstok.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcstok is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSTOK, HAVE_WCSTOK.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSTOK, HAVE_WCSTOK.
+ * tests/test-wchar-c++.cc: Test the declaration of wcstok.
+ * doc/posix-functions/wcstok.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsstr'.
+ * modules/wcsstr: New file.
+ * lib/wchar.in.h (wcsstr): New declaration.
+ * lib/wcsstr.c: New file.
+ * lib/wcsstr-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsstr.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsstr is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSSTR, HAVE_WCSSTR.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSSTR, HAVE_WCSSTR.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsstr.
+ * doc/posix-functions/wcsstr.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcspbrk'.
+ * modules/wcspbrk: New file.
+ * lib/wchar.in.h (wcspbrk): New declaration.
+ * lib/wcspbrk.c: New file.
+ * lib/wcspbrk-impl.h: New file, from libutf8 with modifications.
+ * m4/wcspbrk.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcspbrk is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSPBRK, HAVE_WCSPBRK.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSPBRK, HAVE_WCSPBRK.
+ * tests/test-wchar-c++.cc: Test the declaration of wcspbrk.
+ * doc/posix-functions/wcspbrk.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsspn'.
+ * modules/wcsspn: New file.
+ * lib/wchar.in.h (wcsspn): New declaration.
+ * lib/wcsspn.c: New file.
+ * lib/wcsspn-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsspn.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsspn is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSSPN, HAVE_WCSSPN.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSSPN, HAVE_WCSSPN.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsspn.
+ * doc/posix-functions/wcsspn.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscspn'.
+ * modules/wcscspn: New file.
+ * lib/wchar.in.h (wcscspn): New declaration.
+ * lib/wcscspn.c: New file.
+ * lib/wcscspn-impl.h: New file, from libutf8 with modifications.
+ * m4/wcscspn.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscspn is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCSPN, HAVE_WCSCSPN.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCSPN, HAVE_WCSCSPN.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscspn.
+ * doc/posix-functions/wcscspn.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsrchr'.
+ * modules/wcsrchr: New file.
+ * lib/wchar.in.h (wcsrchr): New declaration.
+ * lib/wcsrchr.c: New file.
+ * lib/wcsrchr-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsrchr.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsrchr is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSRCHR, HAVE_WCSRCHR.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSRCHR, HAVE_WCSRCHR.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsrchr.
+ * doc/posix-functions/wcsrchr.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcschr'.
+ * modules/wcschr: New file.
+ * lib/wchar.in.h (wcschr): New declaration.
+ * lib/wcschr.c: New file.
+ * lib/wcschr-impl.h: New file, from libutf8 with modifications.
+ * m4/wcschr.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcschr is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCHR, HAVE_WCSCHR.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCHR, HAVE_WCSCHR.
+ * tests/test-wchar-c++.cc: Test the declaration of wcschr.
+ * doc/posix-functions/wcschr.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsdup'.
+ * modules/wcsdup: New file.
+ * lib/wchar.in.h (wcsdup): New declaration.
+ * lib/wcsdup.c: New file.
+ * lib/wcsdup-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsdup.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsdup is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSDUP, HAVE_WCSDUP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSDUP, HAVE_WCSDUP.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsdup.
+ * doc/posix-functions/wcsdup.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsxfrm'.
+ * modules/wcsxfrm: New file.
+ * lib/wchar.in.h (wcsxfrm): New declaration.
+ * lib/wcsxfrm.c: New file.
+ * lib/wcsxfrm-impl.h: New file.
+ * m4/wcsxfrm.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsxfrm is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSXFRM, HAVE_WCSXFRM.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSXFRM, HAVE_WCSXFRM.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsxfrm.
+ * doc/posix-functions/wcsxfrm.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscoll'.
+ * modules/wcscoll: New file.
+ * lib/wchar.in.h (wcscoll): New declaration.
+ * lib/wcscoll.c: New file.
+ * lib/wcscoll-impl.h: New file.
+ * m4/wcscoll.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscoll is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCOLL, HAVE_WCSCOLL.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCOLL, HAVE_WCSCOLL.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscoll.
+ * doc/posix-functions/wcscoll.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsncasecmp'.
+ * modules/wcsncasecmp: New file.
+ * lib/wchar.in.h (wcsncasecmp): New declaration.
+ * lib/wcsncasecmp.c: New file.
+ * lib/wcsncasecmp-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsncasecmp.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsncasecmp is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSNCASECMP, HAVE_WCSNCASECMP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSNCASECMP,
+ HAVE_WCSNCASECMP.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsncasecmp.
+ * doc/posix-functions/wcsncasecmp.texi: Mention the new module.
+
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscasecmp'.
+ * modules/wcscasecmp: New file.
+ * lib/wchar.in.h (wcscasecmp): New declaration.
+ * lib/wcscasecmp.c: New file.
+ * lib/wcscasecmp-impl.h: New file, from libutf8 with modifications.
+ * m4/wcscasecmp.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscasecmp is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCASECMP, HAVE_WCSCASECMP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCASECMP,
+ HAVE_WCSCASECMP.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscasecmp.
+ * doc/posix-functions/wcscasecmp.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsncmp'.
+ * modules/wcsncmp: New file.
+ * lib/wchar.in.h (wcsncmp): New declaration.
+ * lib/wcsncmp.c: New file.
+ * lib/wcsncmp-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsncmp.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsncmp is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSNCMP, HAVE_WCSNCMP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSNCMP, HAVE_WCSNCMP.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsncmp.
+ * doc/posix-functions/wcsncmp.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscmp'.
+ * modules/wcscmp: New file.
+ * lib/wchar.in.h (wcscmp): New declaration.
+ * lib/wcscmp.c: New file.
+ * lib/wcscmp-impl.h: New file, from libutf8 with modifications.
+ * m4/wcscmp.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscmp is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCMP, HAVE_WCSCMP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCMP, HAVE_WCSCMP.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscmp.
+ * doc/posix-functions/wcscmp.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsncat'.
+ * modules/wcsncat: New file.
+ * lib/wchar.in.h (wcsncat): New declaration.
+ * lib/wcsncat.c: New file.
+ * lib/wcsncat-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsncat.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsncat is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSNCAT, HAVE_WCSNCAT.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSNCAT, HAVE_WCSNCAT.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsncat.
+ * doc/posix-functions/wcsncat.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscat'.
+ * modules/wcscat: New file.
+ * lib/wchar.in.h (wcscat): New declaration.
+ * lib/wcscat.c: New file.
+ * lib/wcscat-impl.h: New file, from libutf8 with modifications.
+ * m4/wcscat.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscat is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCAT, HAVE_WCSCAT.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCAT, HAVE_WCSCAT.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscat.
+ * doc/posix-functions/wcscat.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcpncpy'.
+ * modules/wcpncpy: New file.
+ * lib/wchar.in.h (wcpncpy): New declaration.
+ * lib/wcpncpy.c: New file.
+ * lib/wcpncpy-impl.h: New file, from libutf8 with modifications.
+ * m4/wcpncpy.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcpncpy is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCPNCPY, HAVE_WCPNCPY.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCPNCPY, HAVE_WCPNCPY.
+ * tests/test-wchar-c++.cc: Test the declaration of wcpncpy.
+ * doc/posix-functions/wcpncpy.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsncpy'.
+ * modules/wcsncpy: New file.
+ * lib/wchar.in.h (wcsncpy): New declaration.
+ * lib/wcsncpy.c: New file.
+ * lib/wcsncpy-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsncpy.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsncpy is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSNCPY, HAVE_WCSNCPY.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSNCPY, HAVE_WCSNCPY.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsncpy.
+ * doc/posix-functions/wcsncpy.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcpcpy'.
+ * modules/wcpcpy: New file.
+ * lib/wchar.in.h (wcpcpy): New declaration.
+ * lib/wcpcpy.c: New file.
+ * lib/wcpcpy-impl.h: New file, from libutf8 with modifications.
+ * m4/wcpcpy.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcpcpy is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCPCPY, HAVE_WCPCPY.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCPCPY, HAVE_WCPCPY.
+ * tests/test-wchar-c++.cc: Test the declaration of wcpcpy.
+ * doc/posix-functions/wcpcpy.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcscpy'.
+ * modules/wcscpy: New file.
+ * lib/wchar.in.h (wcscpy): New declaration.
+ * lib/wcscpy.c: New file.
+ * lib/wcscpy-impl.h: New file, from libutf8 with modifications.
+ * m4/wcscpy.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscpy is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCPY, HAVE_WCSCPY.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSCPY, HAVE_WCSCPY.
+ * tests/test-wchar-c++.cc: Test the declaration of wcscpy.
+ * doc/posix-functions/wcscpy.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcsnlen'.
+ * modules/wcsnlen: New file.
+ * lib/wchar.in.h (wcsnlen): New declaration.
+ * lib/wcsnlen.c: New file.
+ * lib/wcsnlen-impl.h: New file, from libutf8 with modifications.
+ * m4/wcsnlen.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsnlen is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSNLEN, HAVE_WCSNLEN.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSNLEN, HAVE_WCSNLEN.
+ * tests/test-wchar-c++.cc: Test the declaration of wcsnlen.
+ * doc/posix-functions/wcsnlen.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wcslen'.
+ * modules/wcslen: New file.
+ * lib/wchar.in.h (wcslen): New declaration.
+ * lib/wcslen.c: New file.
+ * lib/wcslen-impl.h: New file, from libutf8 with modifications.
+ * m4/wcslen.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcslen is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSLEN, HAVE_WCSLEN.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WCSLEN, HAVE_WCSLEN.
+ * tests/test-wchar-c++.cc: Test the declaration of wcslen.
+ * doc/posix-functions/wcslen.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wmemset'.
+ * modules/wmemset: New file.
+ * lib/wchar.in.h (wmemset): New declaration.
+ * lib/wmemset.c: New file.
+ * lib/wmemset-impl.h: New file, from libutf8 with modifications.
+ * m4/wmemset.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemset is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMSET, HAVE_WMEMSET.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WMEMSET, HAVE_WMEMSET.
+ * tests/test-wchar-c++.cc: Test the declaration of wmemset.
+ * doc/posix-functions/wmemset.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wmemmove'.
+ * modules/wmemmove: New file.
+ * lib/wchar.in.h (wmemmove): New declaration.
+ * lib/wmemmove.c: New file.
+ * lib/wmemmove-impl.h: New file, from libutf8 with modifications.
+ * m4/wmemmove.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemmove is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMMOVE, HAVE_WMEMMOVE.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WMEMMOVE,
+ HAVE_WMEMMOVE.
+ * tests/test-wchar-c++.cc: Test the declaration of wmemmove.
+ * doc/posix-functions/wmemmove.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wmemcpy'.
+ * modules/wmemcpy: New file.
+ * lib/wchar.in.h (wmemcpy): New declaration.
+ * lib/wmemcpy.c: New file.
+ * lib/wmemcpy-impl.h: New file, from libutf8 with modifications.
+ * m4/wmemcpy.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemcpy is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCPY, HAVE_WMEMCPY.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WMEMCPY, HAVE_WMEMCPY.
+ * tests/test-wchar-c++.cc: Test the declaration of wmemcpy.
+ * doc/posix-functions/wmemcpy.texi: Mention the new module.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wmemcmp'.
+ * modules/wmemcmp: New file.
+ * lib/wchar.in.h (wmemcmp): New declaration.
+ * lib/wmemcmp.c: New file.
+ * lib/wmemcmp-impl.h: New file, from libutf8 with modifications.
+ * m4/wmemcmp.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemcmp is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCMP, HAVE_WMEMCMP.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WMEMCMP, HAVE_WMEMCMP.
+ * tests/test-wchar-c++.cc: Test the declaration of wmemcmp.
+ * doc/posix-functions/wmemcmp.texi: Mention the new module.
+
+2011-02-07 Jim Meyering <meyering@redhat.com>
+
+ di-set, ino-map: new modules, from coreutils
+ * lib/di-set.c: New file.
+ * lib/di-set.h: Likewise.
+ * lib/ino-map.c: Likewise.
+ * lib/ino-map.h: Likewise.
+ * modules/di-set: Likewise.
+ * modules/di-set-tests: Likewise.
+ * modules/ino-map: Likewise.
+ * modules/ino-map-tests: Likewise.
+ * tests/test-di-set.c: Likewise.
+ * tests/test-ino-map.c: Likewise.
+
+2011-02-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ getloadavg: merge minor changes from Emacs
+
+ * lib/getloadavg.c (getloadavg_initialized): More-accurate comment.
+ (getloadavg): Use memset, not bzero.
+
+ 2008-07-25 Chong Yidong <cyd@stupidchicken.com>
+ * lib/getloadavg.c (nl): Rename to name_list to avoid ncurses.h
+ clash (bug#86).
+
+2010-11-14 Bruno Haible <bruno@clisp.org>
+
+ Allow multiple gnulib generated replacements to coexist.
+ * lib/getopt.in.h (struct option): Avoid identical redefinition.
+ * lib/inttypes.in.h (imaxdiv_t): Likewise.
+ * lib/langinfo.in.h (nl_item): Likewise.
+ * lib/math.in.h (_NaN, NAN): Likewise.
+ * lib/netdb.in.h (struct addrinfo): Likewise.
+ * lib/poll.in.h (struct pollfd, nfds_t): Likewise.
+ * lib/pthread.in.h (pthread_t, pthread_attr_t, pthread_barrier_t,
+ pthread_barrierattr_t, pthread_cond_t, pthread_condattr_t,
+ pthread_key_t, pthread_mutex_t, pthread_mutexattr_t, pthread_once_t,
+ pthread_rwlock_t, pthread_rwlockattr_t, pthread_cond_destroy,
+ pthread_cond_init, pthread_cond_signal, pthread_cond_wait,
+ pthread_create, pthread_exit, pthread_join, pthread_mutexattr_destroy,
+ pthread_mutexattr_init, pthread_mutexattr_settype,
+ pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
+ pthread_mutex_trylock, pthread_mutex_unlock, pthread_spinlock_t,
+ pthread_spin_init, pthread_spin_destroy, pthread_spin_lock,
+ pthread_spin_trylock, pthread_spin_unlock): Likewise.
+ * lib/sched.in.h (struct sched_param): Likewise.
+ * lib/se-selinux.in.h (security_class_t, security_context_t,
+ is_selinux_enabled, getcon, freecon, getfscreatecon, setfscreatecon,
+ matchpathcon, getfilecon, lgetfilecon, fgetfilecon, setfilecon,
+ lsetfilecon, fsetfilecon, security_check_context,
+ security_check_context_raw, setexeccon, matchpathcon_init_prefix):
+ Likewise.
+ * lib/search.in.h (VISIT, _gl_search_compar_fn, _gl_search_action_fn):
+ Likewise.
+ * lib/signal.in.h (sig_atomic_t, sigset_t, verify_NSIG_constraint,
+ _gl_function_taking_int_returning_void_t, union sigval,
+ struct siginfo_t, siginfo_t, struct sigaction): Likewise.
+ * lib/spawn.in.h (posix_spawnattr_t, posix_spawn_file_actions_t,
+ verify_POSIX_SPAWN_USEVFORK_no_overlap): Likewise.
+ * lib/stdint.in.h (gl_int8_t, gl_uint8_t, gl_int16_t, gl_uint16_t,
+ gl_int32_t, gl_uint32_t, gl_int64_t, gl_uint64_t, int_least8_t,
+ uint_least8_t, int_least16_t, uint_least16_t, int_least32_t,
+ uint_least32_t, int_least64_t, uint_least64_t, gl_int_fast8_t,
+ gl_uint_fast8_t, gl_int_fast16_t, gl_uint_fast16_t, gl_int_fast32_t,
+ gl_uint_fast32_t, int_fast64_t, uint_fast64_t, gl_intptr_t,
+ gl_uintptr_t, intmax_t, uintmax_t, _verify_intmax_size): Likewise.
+ * lib/stdio.in.h (rpl_fseek, rpl_ftell): Likewise.
+ * lib/sys_socket.in.h (sa_family_t, struct sockaddr_storage,
+ socklen_t, rpl_fd_isset): Likewise.
+ * lib/sys_stat.in.h (rpl_mkdir): Likewise.
+ * lib/sys_time.in.h (struct timeval): Likewise.
+ * lib/sys_times.in.h (struct tms): Likewise.
+ * lib/sys_utsname.in.h (struct utsname):
+ * lib/time.in.h (struct timespec, __time_t_must_be_integral): Likewise.
+ * lib/unistd.in.h (getpagesize): Likewise.
+ * lib/wchar.in.h (mbstate_t): Likewise.
+ * lib/wctype.in.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit,
+ iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit,
+ towlower, towupper): Likewise.
+ Reported by Sam Steingold <sds@gnu.org>.
+
+2011-02-05 Eric Blake <eblake@redhat.com>
+
+ unsetenv: work around Haiku issues
+ * m4/setenv.m4 (gl_FUNC_UNSETENV): Also detect Haiku issue.
+ * doc/posix-functions/unsetenv.texi (unsetenv): Document it.
+
+2010-12-30 Bruce Korb <bkorb@gnu.org>
+
+ libposix: avoid calling error() within libposix
+ * lib/openat-die.c: remove error module stuff when GNULIB_LIBPOSIX
+ is defined.
+
+2011-02-05 Eric Blake <eblake@redhat.com>
+
+ strerror_r-posix: port to cygwin
+ * lib/strerror_r.c (strerror_r) [__CYGWIN__]: Add cygwin
+ implementation.
+ * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Adjust comment.
+ * tests/test-strerror_r.c (main): Fix test.
+ * doc/posix-functions/strerror_r.texi (strerror_r): Document the
+ issue.
+
+2011-02-05 Bruno Haible <bruno@clisp.org>
+
+ New module 'wmemchr'.
+ * modules/wmemchr: New file.
+ * lib/wchar.in.h (wmemchr): New declaration.
+ * lib/wmemchr.c: New file.
+ * lib/wmemchr-impl.h: New file, from libutf8 with modifications.
+ * m4/wmemchr.m4: New file.
+ * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemchr is declared.
+ (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCHR, HAVE_WMEMCHR.
+ * modules/wchar (Makefile.am): Substitute GNULIB_WMEMCHR, HAVE_WMEMCHR.
+ * tests/test-wchar-c++.cc: Test the declaration of wmemchr.
+ * doc/posix-functions/wmemchr.texi: Mention the new module.
+
+2011-02-04 Eric Blake <eblake@redhat.com>
+
+ fdopendir: detect FreeBSD bug
+ * m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Detect bug.
+ * doc/posix-functions/fdopendir.texi (fdopendir): Document it.
+
+2011-02-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdbool: do not define HAVE_STDBOOL_H
+ * m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Renamed from
+ AC_HEADER_STDBOOL. All uses changed. Do not define
+ HAVE_STDBOOL_H, as gnulib does not need this. This change is
+ imported from the latest Autoconf git. It was motivated by Emacs,
+ which uses gnulib but does not need HAVE_STDBOOL_H.
+
+2011-02-04 Bruno Haible <bruno@clisp.org>
+
+ wcsnrtombs: Prepare for new module wwcsnrtombs.
+ * lib/wcsnrtombs-impl.h: New file, extracted from lib/wcsnrtombs.c.
+ * lib/wcsnrtombs.c: Include it.
+ * modules/wcsnrtombs (Files): Add lib/wcsnrtombs-impl.h.
+
+ wcsrtombs: Prepare for new module wwcsrtombs.
+ * lib/wcsrtombs-impl.h: New file, extracted from lib/wcsrtombs.c.
+ * lib/wcsrtombs.c: Include it.
+ * modules/wcsrtombs (Files): Add lib/wcsrtombs-impl.h.
+
+ mbsnrtowcs: Prepare for new module mbsnrtowwcs.
+ * lib/mbsnrtowcs-impl.h: New file, extracted from lib/mbsnrtowcs.c.
+ * lib/mbsnrtowcs.c: Include it.
+ * modules/mbsnrtowcs (Files): Add lib/mbsnrtowcs-impl.h.
+
+ mbsrtowcs: Prepare for new module mbsrtowwcs.
+ * lib/mbsrtowcs-impl.h: New file, extracted from lib/mbsrtowcs.c.
+ * lib/mbsrtowcs.c: Include it.
+ * modules/mbsrtowcs (Files): Add lib/mbsrtowcs-impl.h.
+
+2011-02-04 Bruno Haible <bruno@clisp.org>
+
+ vasnprintf: Reduce use of malloc for small format strings.
+ * lib/printf-args.h (N_DIRECT_ALLOC_ARGUMENTS): New macro.
+ (arguments): Add room for the first 7 arguments.
+ * lib/printf-parse.h (N_DIRECT_ALLOC_DIRECTIVES): New macro.
+ (char_directives, u8_directives, u16_directives, u32_directives): Add
+ room for the first 7 directives.
+ * lib/printf-parse.c: Include <string.h>.
+ (PRINTF_PARSE): Change memory handling code so that it uses the first
+ 7 preallocated elements in an 'arguments' or 'DIRECTIVES' struct.
+ * lib/vasnprintf.c (VASNPRINTF): Update memory handling code.
+ Reported by Pádraig Brady <P@draigbrady.com>.
+
2011-01-31 Eric Blake <eblake@redhat.com>
dup2: work around Haiku bug
indirectly on xalloc. This change causes the openat substitute
to fall back on save_cwd when memory is tight, and for save_cwd to
fail instead of dying when memory is tight, but that's good enough.
+ Problem and initial idea for fix reported by Bastien Roucaries in
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00170.html>.
* lib/openat-proc.c: Include stdlib.h (for malloc), not
xalloc.h (for xmalloc).
Date Modules Changes
+2011-02-08 wctype-h This module no longer provides the iswblank()
+ function. If you need this function, you now need
+ to request the 'iswblank' module.
+
+2011-02-07 wctype This module is renamed to wctype-h.
+
2011-01-18 multiarch This no longer #defines AA_APPLE_UNIVERSAL_BUILD;
instead, use the shell var APPLE_UNIVERSAL_BUILD.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011 Free Software Foundation, Inc.
-timestamp='2011-01-23'
+timestamp='2011-02-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
+ esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo frv-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
- exit ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011 Free Software Foundation, Inc.
-timestamp='2011-01-01'
+timestamp='2011-02-02'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
+ -bluegene*)
+ os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
+ cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze)
basic_machine=microblaze-xilinx
;;
mingw32)
np1)
basic_machine=np1-gould
;;
- neo-tandem)
+ neo-tandem)
basic_machine=neo-tandem
;;
- nse-tandem)
+ nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=t90-cray
os=-unicos
;;
- # This must be matched before tile*.
- tilegx*)
+ # This must be matched before tile*.
+ tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ -auroraux)
+ os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
-dicos*)
os=-dicos
;;
- -nacl*)
- ;;
+ -nacl*)
+ ;;
-none)
;;
*)
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
;;
tic54x-*)
os=-coff
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2011-02-01.10}
+\def\texinfoversion{2011-02-07.16}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
\gdef^^b9{$^1$}
\gdef^^ba{\ordm}
%
- \gdef^^bb{\guilletright}
+ \gdef^^bb{\guillemetright}
\gdef^^bc{$1\over4$}
\gdef^^bd{$1\over2$}
\gdef^^be{$3\over4$}
This function does not reject non-directory file descriptors on some
platforms:
GNU/Hurd.
+@item
+This function mistakenly closes non-directory file descriptors on some
+platforms:
+FreeBSD 8.1.
@end itemize
Portability problems not fixed by Gnulib:
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswalnum.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswalpha.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswblank.html}
-Gnulib module: wctype
+Gnulib module: iswblank
Portability problems fixed by Gnulib:
@itemize
This function is declared but not defined on some platforms:
IRIX 6.5.30.
@item
+This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms:
+glibc 2.8.
+@item
This function returns 0 for all possible arguments on some platforms:
Linux libc5.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswctype.html}
-Gnulib module: ---
+Gnulib module: iswctype
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
+@item
+This function is declared in @code{<wchar.h>}, not in @code{<wctype.h>}, on
+some platforms:
+HP-UX 11.00.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswdigit.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswgraph.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswlower.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswprint.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswpunct.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswspace.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswupper.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswxdigit.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
This function is missing on some platforms:
NetBSD 3.0, HP-UX 11.23, IRIX 6.5, Solaris 9, mingw.
@item
-glibc has an incompatible version of this function. The POSIX compliant code
+glibc and Cygwin have an incompatible version of this function. The
+POSIX compliant code
@smallexample
char *s = (strerror_r (err, buf, buflen) == 0 ? buf : NULL);
@end smallexample
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/towctrans.html}
-Gnulib module: ---
+Gnulib module: towctrans
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.5.1, mingw, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.5.1, mingw, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/towlower.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/towupper.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
@item
This function removes only the first value association for the given
environment variable, not all of them, on some platforms:
-Solaris 11 2010-11.
+Solaris 11 2010-11, Haiku.
@end itemize
Portability problems not fixed by Gnulib:
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcpcpy.html}
-Gnulib module: ---
+Gnulib module: wcpcpy
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcpncpy.html}
-Gnulib module: ---
+Gnulib module: wcpncpy
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscasecmp.html}
-Gnulib module: ---
+Gnulib module: wcscasecmp
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscat.html}
-Gnulib module: ---
+Gnulib module: wcscat
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcschr.html}
-Gnulib module: ---
+Gnulib module: wcschr
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscmp.html}
-Gnulib module: ---
+Gnulib module: wcscmp
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscoll.html}
-Gnulib module: ---
+Gnulib module: wcscoll
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscpy.html}
-Gnulib module: ---
+Gnulib module: wcscpy
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcscspn.html}
-Gnulib module: ---
+Gnulib module: wcscspn
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsdup.html}
-Gnulib module: ---
+Gnulib module: wcsdup
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcslen.html}
-Gnulib module: ---
+Gnulib module: wcslen
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsncasecmp.html}
-Gnulib module: ---
+Gnulib module: wcsncasecmp
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsncat.html}
-Gnulib module: ---
+Gnulib module: wcsncat
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsncmp.html}
-Gnulib module: ---
+Gnulib module: wcsncmp
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsncpy.html}
-Gnulib module: ---
+Gnulib module: wcsncpy
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsnlen.html}
-Gnulib module: ---
+Gnulib module: wcsnlen
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11,
+IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX
-11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcspbrk.html}
-Gnulib module: ---
+Gnulib module: wcspbrk
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsrchr.html}
-Gnulib module: ---
+Gnulib module: wcsrchr
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsspn.html}
-Gnulib module: ---
+Gnulib module: wcsspn
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsstr.html}
-Gnulib module: ---
+Gnulib module: wcsstr
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 5.3, Solaris 2.6.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 5.3, Solaris 2.6.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcstok.html}
-Gnulib module: ---
+Gnulib module: wcstok
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcswidth.html}
-Gnulib module: ---
+Gnulib module: wcswidth
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+OpenBSD 3.8, IRIX 5.3, Solaris 2.5.1, mingw, BeOS.
+@item
+This function handles combining characters in UTF-8 locales incorrectly on some
+platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-OpenBSD 3.8, IRIX 5.3, Solaris 2.5.1, mingw, BeOS.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsxfrm.html}
-Gnulib module: ---
+Gnulib module: wcsxfrm
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wctrans.html}
-Gnulib module: ---
+Gnulib module: wctrans
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.5.1, mingw, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.5.1, mingw, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wctype.html}
-Gnulib module: ---
+Gnulib module: wctype
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
+@item
+This function is declared in @code{<wchar.h>}, not in @code{<wctype.h>}, on
+some platforms:
+HP-UX 11.00.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1, mingw.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wmemchr.html}
-Gnulib module: ---
+Gnulib module: wmemchr
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wmemcmp.html}
-Gnulib module: ---
+Gnulib module: wmemcmp
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wmemcpy.html}
-Gnulib module: ---
+Gnulib module: wmemcpy
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wmemmove.html}
-Gnulib module: ---
+Gnulib module: wmemmove
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wmemset.html}
-Gnulib module: ---
+Gnulib module: wmemset
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-HP-UX 11.00, IRIX 6.5, Solaris 2.6, Interix 3.5.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html}
-Gnulib module: wctype
+Gnulib module: wctype-h
Portability problems fixed by Gnulib:
@itemize
yes | 3)
sed_transform_main_lib_file=$sed_transform_main_lib_file'
s/GNU General/GNU Lesser General/g
+ s/General Public License/Lesser General Public License/g
+ s/Lesser Lesser General Public License/Lesser General Public License/g
'
;;
2)
sed_transform_main_lib_file=$sed_transform_main_lib_file'
s/GNU General/GNU Lesser General/g
+ s/General Public License/Lesser General Public License/g
+ s/Lesser Lesser General Public License/Lesser General Public License/g
+
s/version [23]\([ ,]\)/version 2.1\1/g
'
;;
# Update license.
sed_transform_main_lib_file=$sed_transform_main_lib_file'
s/GNU Lesser General/GNU General/g
+ s/Lesser General Public License/General Public License/g
+
s/GNU Library General/GNU General/g
+ s/Library General Public License/General Public License/g
+
s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
'
fi
# Update license.
sed_transform_build_aux_file=$sed_transform_build_aux_file'
s/GNU Lesser General/GNU General/g
+ s/Lesser General Public License/General Public License/g
+
s/GNU Library General/GNU General/g
+ s/Library General Public License/General Public License/g
+
s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
'
fi
# Update license.
sed_transform_testsrelated_lib_file=$sed_transform_testsrelated_lib_file'
s/GNU Lesser General/GNU General/g
+ s/Lesser General Public License/General Public License/g
+
s/GNU Library General/GNU General/g
+ s/Library General Public License/General Public License/g
+
s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
'
fi
--- /dev/null
+/* Set operations for device-inode pairs stored in a space-efficient manner.
+
+ Copyright 2009-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert and Jim Meyering */
+
+#include <config.h>
+#include "di-set.h"
+
+#include "hash.h"
+#include "ino-map.h"
+
+#include <limits.h>
+#include <stdlib.h>
+
+/* The hash package hashes "void *", but this package wants to hash
+ integers. Use integers that are as large as possible, but no
+ larger than void *, so that they can be cast to void * and back
+ without losing information. */
+typedef size_t hashint;
+#define HASHINT_MAX ((hashint) -1)
+
+/* Integers represent inode numbers. Integers in the range
+ 1..(LARGE_INO_MIN-1) represent inode numbers directly. (The hash
+ package does not work with null pointers, so inode 0 cannot be used
+ as a key.) To find the representations of other inode numbers, map
+ them through INO_MAP. */
+#define LARGE_INO_MIN (HASHINT_MAX / 2)
+
+/* Set operations for device-inode pairs stored in a space-efficient
+ manner. Use a two-level hash table. The top level hashes by
+ device number, as there are typically a small number of devices.
+ The lower level hashes by mapped inode numbers. In the typical
+ case where the inode number is positive and small, the inode number
+ maps to itself, masquerading as a void * value; otherwise, its
+ value is the result of hashing the inode value through INO_MAP. */
+
+/* A pair that maps a device number to a set of inode numbers. */
+struct di_ent
+{
+ dev_t dev;
+ struct hash_table *ino_set;
+};
+
+/* A two-level hash table that manages and indexes these pairs. */
+struct di_set
+{
+ /* Map device numbers to sets of inode number representatives. */
+ struct hash_table *dev_map;
+
+ /* If nonnull, map large inode numbers to their small
+ representatives. If null, there are no large inode numbers in
+ this set. */
+ struct ino_map *ino_map;
+
+ /* Cache of the most recently allocated and otherwise-unused storage
+ for probing this table. */
+ struct di_ent *probe;
+};
+
+/* Hash a device-inode-set entry. */
+static size_t
+di_ent_hash (void const *x, size_t table_size)
+{
+ struct di_ent const *p = x;
+ dev_t dev = p->dev;
+
+ /* When DEV is wider than size_t, exclusive-OR the words of DEV into H.
+ This avoids loss of info, without applying % to the wider type,
+ which could be quite slow on some systems. */
+ size_t h = dev;
+ unsigned int i;
+ unsigned int n_words = sizeof dev / sizeof h + (sizeof dev % sizeof h != 0);
+ for (i = 1; i < n_words; i++)
+ h ^= dev >> CHAR_BIT * sizeof h * i;
+
+ return h % table_size;
+}
+
+/* Return true if two device-inode-set entries are the same. */
+static bool
+di_ent_compare (void const *x, void const *y)
+{
+ struct di_ent const *a = x;
+ struct di_ent const *b = y;
+ return a->dev == b->dev;
+}
+
+/* Free a device-inode-set entry. */
+static void
+di_ent_free (void *v)
+{
+ struct di_ent *a = v;
+ hash_free (a->ino_set);
+ free (a);
+}
+
+/* Create a set of device-inode pairs. Return NULL on allocation failure. */
+struct di_set *
+di_set_alloc (void)
+{
+ struct di_set *dis = malloc (sizeof *dis);
+ if (dis)
+ {
+ enum { INITIAL_DEV_MAP_SIZE = 11 };
+ dis->dev_map = hash_initialize (INITIAL_DEV_MAP_SIZE, NULL,
+ di_ent_hash, di_ent_compare,
+ di_ent_free);
+ if (! dis->dev_map)
+ {
+ free (dis);
+ return NULL;
+ }
+ dis->ino_map = NULL;
+ dis->probe = NULL;
+ }
+
+ return dis;
+}
+
+/* Free a set of device-inode pairs. */
+void
+di_set_free (struct di_set *dis)
+{
+ hash_free (dis->dev_map);
+ free (dis->ino_map);
+ free (dis->probe);
+ free (dis);
+}
+
+/* Hash an encoded inode number I. */
+static size_t
+di_ino_hash (void const *i, size_t table_size)
+{
+ return (hashint) i % table_size;
+}
+
+/* Using the DIS table, map a device to a hash table that represents
+ a set of inode numbers. Return NULL on error. */
+static struct hash_table *
+map_device (struct di_set *dis, dev_t dev)
+{
+ /* Find space for the probe, reusing the cache if available. */
+ struct di_ent *ent;
+ struct di_ent *probe = dis->probe;
+ if (probe)
+ {
+ /* If repeating a recent query, return the cached result. */
+ if (probe->dev == dev)
+ return probe->ino_set;
+ }
+ else
+ {
+ dis->probe = probe = malloc (sizeof *probe);
+ if (! probe)
+ return NULL;
+ }
+
+ /* Probe for the device. */
+ probe->dev = dev;
+ ent = hash_insert (dis->dev_map, probe);
+ if (! ent)
+ return NULL;
+
+ if (ent != probe)
+ {
+ /* Use the existing entry. */
+ probe->ino_set = ent->ino_set;
+ }
+ else
+ {
+ enum { INITIAL_INO_SET_SIZE = 1021 };
+
+ /* Prepare to allocate a new probe next time; this one is in use. */
+ dis->probe = NULL;
+
+ /* DEV is new; allocate an inode set for it. */
+ probe->ino_set = hash_initialize (INITIAL_INO_SET_SIZE, NULL,
+ di_ino_hash, NULL, NULL);
+ }
+
+ return probe->ino_set;
+}
+
+/* Using the DIS table, map an inode number to a mapped value.
+ Return INO_MAP_INSERT_FAILURE on error. */
+static hashint
+map_inode_number (struct di_set *dis, ino_t ino)
+{
+ if (0 < ino && ino < LARGE_INO_MIN)
+ return ino;
+
+ if (! dis->ino_map)
+ {
+ dis->ino_map = ino_map_alloc (LARGE_INO_MIN);
+ if (! dis->ino_map)
+ return INO_MAP_INSERT_FAILURE;
+ }
+
+ return ino_map_insert (dis->ino_map, ino);
+}
+
+/* Attempt to insert the DEV,INO pair into the set DIS.
+ If it matches a pair already in DIS, keep that pair and return 0.
+ Otherwise, if insertion is successful, return 1.
+ Upon any failure return -1. */
+int
+di_set_insert (struct di_set *dis, dev_t dev, ino_t ino)
+{
+ hashint i;
+
+ /* Map the device number to a set of inodes. */
+ struct hash_table *ino_set = map_device (dis, dev);
+ if (! ino_set)
+ return -1;
+
+ /* Map the inode number to a small representative I. */
+ i = map_inode_number (dis, ino);
+ if (i == INO_MAP_INSERT_FAILURE)
+ return -1;
+
+ /* Put I into the inode set. */
+ return hash_insert0 (ino_set, (void const *) i, NULL);
+}
+
+/* Look up the DEV,INO pair in the set DIS.
+ If found, return 1; if not found, return 0.
+ Upon any failure return -1. */
+int
+di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
+{
+ hashint i;
+
+ /* Map the device number to a set of inodes. */
+ struct hash_table *ino_set = map_device (dis, dev);
+ if (! ino_set)
+ return -1;
+
+ /* Map the inode number to a small representative I. */
+ i = map_inode_number (dis, ino);
+ if (i == INO_MAP_INSERT_FAILURE)
+ return -1;
+
+ /* Perform the look-up. */
+ return !!hash_lookup (ino_set, (void const *) i);
+}
--- /dev/null
+#ifndef _GL_DI_SET_H
+# define _GL_DI_SET_H
+
+# include <sys/types.h>
+
+# undef _ATTRIBUTE_NONNULL_
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
+# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
+# else
+# define _ATTRIBUTE_NONNULL_(m)
+# endif
+
+struct di_set *di_set_alloc (void);
+int di_set_insert (struct di_set *, dev_t, ino_t) _ATTRIBUTE_NONNULL_ (1);
+void di_set_free (struct di_set *) _ATTRIBUTE_NONNULL_ (1);
+int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
+ _ATTRIBUTE_NONNULL_ (1);
+
+#endif
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
# include <sys/param.h>
# endif
-# include "c-strtod.h"
-# include "cloexec.h"
# include "intprops.h"
/* The existing Emacs configuration files define a macro called
# endif /* NLIST_STRUCT */
# ifdef SUNOS_5
-# include <fcntl.h>
# include <kvm.h>
# include <kstat.h>
# endif
# include <sys/dg_sys_info.h>
# endif
-# include "fcntl--.h"
+# if (defined __linux__ || defined __CYGWIN__ || defined SUNOS_5 \
+ || (defined LOAD_AVE_TYPE && ! defined __VMS))
+# include <fcntl.h>
+# endif
\f
/* Avoid static vars inside a function since in HPUX they dump as pure. */
# if !defined (HAVE_LIBKSTAT) && defined (LOAD_AVE_TYPE)
/* File descriptor open to /dev/kmem or VMS load ave driver. */
static int channel;
-/* True iff channel is valid. */
+/* True if channel is valid. */
static bool getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */
static long offset;
# if ! defined __VMS && ! defined sgi && ! defined __linux__
-static struct nlist nl[2];
+static struct nlist name_list[2];
# endif
# ifdef SUNOS_5
for (elem = 0; elem < nelem; elem++)
{
- char *endptr;
- double d;
+ double numerator = 0;
+ double denominator = 1;
+ bool have_digit = false;
+
+ while (*ptr == ' ')
+ ptr++;
- errno = 0;
- d = c_strtod (ptr, &endptr);
- if (ptr == endptr || (d == 0 && errno != 0))
+ /* Finish if this number is missing, and report an error if all
+ were missing. */
+ if (! ('0' <= *ptr && *ptr <= '9'))
{
if (elem == 0)
return -1;
break;
}
- loadavg[elem] = d;
- ptr = endptr;
+
+ while ('0' <= *ptr && *ptr <= '9')
+ numerator = 10 * numerator + (*ptr++ - '0');
+
+ if (*ptr == '.')
+ for (ptr++; '0' <= *ptr && *ptr <= '9'; ptr++)
+ numerator = 10 * numerator + (*ptr - '0'), denominator *= 10;
+
+ loadavg[elem++] = numerator / denominator;
}
return elem;
for (i = 0; i < conf.config_maxclass; ++i)
{
struct class_stats stats;
- bzero ((char *) &stats, sizeof stats);
+ memset (&stats, 0, sizeof stats);
desc.sd_type = CPUTYPE_CLASS;
desc.sd_objid = i;
{
# ifndef sgi
# if ! defined NLIST_STRUCT || ! defined N_NAME_POINTER
- strcpy (nl[0].n_name, LDAV_SYMBOL);
- strcpy (nl[1].n_name, "");
+ strcpy (name_list[0].n_name, LDAV_SYMBOL);
+ strcpy (name_list[1].n_name, "");
# else /* NLIST_STRUCT */
# ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
- nl[0].n_un.n_name = LDAV_SYMBOL;
- nl[1].n_un.n_name = 0;
+ name_list[0].n_un.n_name = LDAV_SYMBOL;
+ name_list[1].n_un.n_name = 0;
# else /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
- nl[0].n_name = LDAV_SYMBOL;
- nl[1].n_name = 0;
+ name_list[0].n_name = LDAV_SYMBOL;
+ name_list[1].n_name = 0;
# endif /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
# endif /* NLIST_STRUCT */
# ifndef SUNOS_5
if (
# if !(defined (_AIX) && !defined (ps2))
- nlist (KERNEL_FILE, nl)
+ nlist (KERNEL_FILE, name_list)
# else /* _AIX */
- knlist (nl, 1, sizeof (nl[0]))
+ knlist (name_list, 1, sizeof (name_list[0]))
# endif
>= 0)
- /* Omit "&& nl[0].n_type != 0 " -- it breaks on Sun386i. */
+ /* Omit "&& name_list[0].n_type != 0 " -- it breaks on Sun386i. */
{
# ifdef FIXUP_KERNEL_SYMBOL_ADDR
- FIXUP_KERNEL_SYMBOL_ADDR (nl);
+ FIXUP_KERNEL_SYMBOL_ADDR (name_list);
# endif
- offset = nl[0].n_value;
+ offset = name_list[0].n_value;
}
# endif /* !SUNOS_5 */
# else /* sgi */
if (!getloadavg_initialized)
{
# ifndef SUNOS_5
- channel = open ("/dev/kmem", O_RDONLY);
- if (channel >= 0)
+ /* Set the channel to close on exec, so it does not
+ litter any child's descriptor table. */
+# ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+# endif
+ int fd = open ("/dev/kmem", O_RDONLY | O_CLOEXEC);
+ if (0 <= fd)
{
- /* Set the channel to close on exec, so it does not
- litter any child's descriptor table. */
- set_cloexec_flag (channel, true);
- getloadavg_initialized = true;
+# if F_DUPFD_CLOEXEC
+ if (fd <= STDERR_FILENO)
+ {
+ int fd1 = fcntl (fd, F_DUPFD_CLOEXEC, STDERR_FILENO + 1);
+ close (fd);
+ fd = fd1;
+ }
+# endif
+ if (0 <= fd)
+ {
+ channel = fd;
+ getloadavg_initialized = true;
+ }
}
# else /* SUNOS_5 */
/* We pass 0 for the kernel, corefile, and swapfile names
if (kd != 0)
{
/* nlist the currently running kernel. */
- kvm_nlist (kd, nl);
- offset = nl[0].n_value;
+ kvm_nlist (kd, name_list);
+ offset = name_list[0].n_value;
getloadavg_initialized = true;
}
# endif /* SUNOS_5 */
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
+# if !GNULIB_defined_struct_option
struct option
{
const char *name;
int *flag;
int val;
};
+# define GNULIB_defined_struct_option 1
+# endif
/* Names for the values of the `has_arg' field of `struct option'. */
--- /dev/null
+/* Map an ino_t inode number to a small integer.
+
+ Copyright 2009-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert and Jim Meyering */
+
+#include <config.h>
+#include "ino-map.h"
+
+#include "hash.h"
+#include "verify.h"
+
+#include <limits.h>
+#include <stdlib.h>
+
+/* A pair that maps an inode number to a mapped inode number; the
+ latter is a small unique ID for the former. */
+struct ino_map_ent
+{
+ ino_t ino;
+ size_t mapped_ino;
+};
+
+/* A table that manages and indexes these pairs. */
+struct ino_map
+{
+ /* A table of KEY,VAL pairs, where KEY is the raw ino_t value and
+ VAL is the small number that it maps to. */
+ struct hash_table *map;
+
+ /* The next mapped inode number to hand out. */
+ size_t next_mapped_ino;
+
+ /* Cache of the most recently allocated and otherwise-unused storage
+ for probing the table. */
+ struct ino_map_ent *probe;
+};
+
+/* Hash an inode map entry. */
+static size_t
+ino_hash (void const *x, size_t table_size)
+{
+ struct ino_map_ent const *p = x;
+ ino_t ino = p->ino;
+
+ /* When INO is wider than size_t, exclusive-OR the words of INO into H.
+ This avoids loss of info, without applying % to the wider type,
+ which could be quite slow on some systems. */
+ size_t h = ino;
+ unsigned int i;
+ unsigned int n_words = sizeof ino / sizeof h + (sizeof ino % sizeof h != 0);
+ for (i = 1; i < n_words; i++)
+ h ^= ino >> CHAR_BIT * sizeof h * i;
+
+ return h % table_size;
+}
+
+/* Return true if two inode map entries are the same. */
+static bool
+ino_compare (void const *x, void const *y)
+{
+ struct ino_map_ent const *a = x;
+ struct ino_map_ent const *b = y;
+ return a->ino == b->ino;
+}
+
+/* Allocate an inode map that will hand out integers starting with
+ NEXT_MAPPED_INO. Return NULL if memory is exhausted. */
+struct ino_map *
+ino_map_alloc (size_t next_mapped_ino)
+{
+ struct ino_map *im = malloc (sizeof *im);
+
+ if (im)
+ {
+ enum { INITIAL_INO_MAP_TABLE_SIZE = 1021 };
+ im->map = hash_initialize (INITIAL_INO_MAP_TABLE_SIZE, NULL,
+ ino_hash, ino_compare, free);
+ if (! im->map)
+ {
+ free (im);
+ return NULL;
+ }
+ im->next_mapped_ino = next_mapped_ino;
+ im->probe = NULL;
+ }
+
+ return im;
+}
+
+/* Free an inode map. */
+void
+ino_map_free (struct ino_map *map)
+{
+ hash_free (map->map);
+ free (map->probe);
+ free (map);
+}
+
+
+/* Insert into MAP the inode number INO if it's not there already,
+ and return its nonnegative mapped inode number.
+ If INO is already in MAP, return the existing mapped inode number.
+ Return INO_MAP_INSERT_FAILURE on memory or counter exhaustion. */
+size_t
+ino_map_insert (struct ino_map *im, ino_t ino)
+{
+ struct ino_map_ent *ent;
+
+ /* Find space for the probe, reusing the cache if available. */
+ struct ino_map_ent *probe = im->probe;
+ if (probe)
+ {
+ /* If repeating a recent query, return the cached result. */
+ if (probe->ino == ino)
+ return probe->mapped_ino;
+ }
+ else
+ {
+ im->probe = probe = malloc (sizeof *probe);
+ if (! probe)
+ return INO_MAP_INSERT_FAILURE;
+ }
+
+ probe->ino = ino;
+ ent = hash_insert (im->map, probe);
+ if (! ent)
+ return INO_MAP_INSERT_FAILURE;
+
+ if (ent != probe)
+ {
+ /* Use the existing entry. */
+ probe->mapped_ino = ent->mapped_ino;
+ }
+ else
+ {
+ /* If adding 1 to map->next_mapped_ino would cause it to
+ overflow to zero, then it must equal INO_MAP_INSERT_FAILURE,
+ which is the value that should be returned in that case.
+ Verify that this works. */
+ verify (INO_MAP_INSERT_FAILURE + 1 == 0);
+
+ /* Prepare to allocate a new probe next time; this one is in use. */
+ im->probe = NULL;
+
+ /* INO is new; allocate a mapped inode number for it. */
+ probe->mapped_ino = im->next_mapped_ino++;
+ }
+
+ return probe->mapped_ino;
+}
--- /dev/null
+#ifndef _GL_INO_MAP_H
+# define _GL_INO_MAP_H
+
+# include <sys/types.h>
+
+# undef _ATTRIBUTE_NONNULL_
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
+# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
+# else
+# define _ATTRIBUTE_NONNULL_(m)
+# endif
+
+# define INO_MAP_INSERT_FAILURE ((size_t) -1)
+
+struct ino_map *ino_map_alloc (size_t);
+void ino_map_free (struct ino_map *) _ATTRIBUTE_NONNULL_ (1);
+size_t ino_map_insert (struct ino_map *, ino_t) _ATTRIBUTE_NONNULL_ (1);
+
+#endif
#if @GNULIB_IMAXDIV@
# if !@HAVE_DECL_IMAXDIV@
+# if !GNULIB_defined_imaxdiv_t
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+# define GNULIB_defined_imaxdiv_t 1
+# endif
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
--- /dev/null
+/* Test whether a wide character has a given property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+iswctype (wint_t wc, wctype_t desc)
+{
+ return ((int (*) (wint_t)) desc) (wc);
+}
--- /dev/null
+/* Test whether a wide character has a given property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+#include "iswctype-impl.h"
/* A platform that lacks <langinfo.h>. */
/* Assume that it also lacks <nl_types.h> and the nl_item type. */
+# if !GNULIB_defined_nl_item
typedef int nl_item;
+# define GNULIB_defined_nl_item 1
+# endif
/* nl_langinfo items of the LC_CTYPE category */
# define CODESET 10000
it on platforms like Solaris 10, where NAN is present but defined
as a function pointer rather than a floating point constant. */
#if !defined NAN || @REPLACE_NAN@
-# undef NAN
+# if !GNULIB_defined_NAN
+# undef NAN
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
-# ifdef __DECC
+# ifdef __DECC
static float
_NaN ()
{
static float zero = 0.0f;
return zero / zero;
}
-# define NAN (_NaN())
-# else
-# define NAN (0.0f / 0.0f)
+# define NAN (_NaN())
+# else
+# define NAN (0.0f / 0.0f)
+# endif
+# define GNULIB_defined_NAN 1
# endif
#endif
--- /dev/null
+/* Convert string to wide string.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &_gl_mbsrtowcs_state;
+ {
+ const char *src = *srcp;
+
+ if (dest != NULL)
+ {
+ wchar_t *destptr = dest;
+
+ for (; srclen > 0 && len > 0; destptr++, len--)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MIN (srclen, MB_LEN_MAX)); */
+ if (srclen == 1 || src[0] == '\0')
+ src_avail = 1;
+ else if (srclen == 2 || src[1] == '\0')
+ src_avail = 2;
+ else if (srclen == 3 || src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || srclen == 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MIN (srclen, MB_LEN_MAX) - 4);
+
+ /* Parse the next multibyte character. */
+ ret = mbrtowc (destptr, src, src_avail, ps);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input;
+ if (ret == 0)
+ {
+ src = NULL;
+ /* Here mbsinit (ps). */
+ break;
+ }
+ src += ret;
+ srclen -= ret;
+ }
+
+ *srcp = src;
+ return destptr - dest;
+ }
+ else
+ {
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (; srclen > 0; totalcount++)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MIN (srclen, MB_LEN_MAX)); */
+ if (srclen == 1 || src[0] == '\0')
+ src_avail = 1;
+ else if (srclen == 2 || src[1] == '\0')
+ src_avail = 2;
+ else if (srclen == 3 || src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || srclen == 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MIN (srclen, MB_LEN_MAX) - 4);
+
+ /* Parse the next multibyte character. */
+ ret = mbrtowc (NULL, src, src_avail, &state);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (ret == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ src += ret;
+ srclen -= ret;
+ }
+
+ return totalcount;
+ }
+
+ bad_input:
+ *srcp = src;
+ bad_input2:
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+}
extern mbstate_t _gl_mbsrtowcs_state;
-size_t
-mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps)
-{
- if (ps == NULL)
- ps = &_gl_mbsrtowcs_state;
- {
- const char *src = *srcp;
-
- if (dest != NULL)
- {
- wchar_t *destptr = dest;
-
- for (; srclen > 0 && len > 0; destptr++, len--)
- {
- size_t src_avail;
- size_t ret;
-
- /* An optimized variant of
- src_avail = strnlen1 (src, MIN (srclen, MB_LEN_MAX)); */
- if (srclen == 1 || src[0] == '\0')
- src_avail = 1;
- else if (srclen == 2 || src[1] == '\0')
- src_avail = 2;
- else if (srclen == 3 || src[2] == '\0')
- src_avail = 3;
- else if (MB_LEN_MAX <= 4 || srclen == 4 || src[3] == '\0')
- src_avail = 4;
- else
- src_avail = 4 + strnlen1 (src + 4, MIN (srclen, MB_LEN_MAX) - 4);
-
- /* Parse the next multibyte character. */
- ret = mbrtowc (destptr, src, src_avail, ps);
-
- if (ret == (size_t)(-2))
- /* Encountered a multibyte character that extends past a '\0' byte
- or that is longer than MB_LEN_MAX bytes. Cannot happen. */
- abort ();
-
- if (ret == (size_t)(-1))
- goto bad_input;
- if (ret == 0)
- {
- src = NULL;
- /* Here mbsinit (ps). */
- break;
- }
- src += ret;
- srclen -= ret;
- }
-
- *srcp = src;
- return destptr - dest;
- }
- else
- {
- /* Ignore dest and len, don't store *srcp at the end, and
- don't clobber *ps. */
- mbstate_t state = *ps;
- size_t totalcount = 0;
-
- for (; srclen > 0; totalcount++)
- {
- size_t src_avail;
- size_t ret;
-
- /* An optimized variant of
- src_avail = strnlen1 (src, MIN (srclen, MB_LEN_MAX)); */
- if (srclen == 1 || src[0] == '\0')
- src_avail = 1;
- else if (srclen == 2 || src[1] == '\0')
- src_avail = 2;
- else if (srclen == 3 || src[2] == '\0')
- src_avail = 3;
- else if (MB_LEN_MAX <= 4 || srclen == 4 || src[3] == '\0')
- src_avail = 4;
- else
- src_avail = 4 + strnlen1 (src + 4, MIN (srclen, MB_LEN_MAX) - 4);
-
- /* Parse the next multibyte character. */
- ret = mbrtowc (NULL, src, src_avail, &state);
-
- if (ret == (size_t)(-2))
- /* Encountered a multibyte character that extends past a '\0' byte
- or that is longer than MB_LEN_MAX bytes. Cannot happen. */
- abort ();
-
- if (ret == (size_t)(-1))
- goto bad_input2;
- if (ret == 0)
- {
- /* Here mbsinit (&state). */
- break;
- }
- src += ret;
- srclen -= ret;
- }
-
- return totalcount;
- }
-
- bad_input:
- *srcp = src;
- bad_input2:
- errno = EILSEQ;
- return (size_t)(-1);
- }
-}
+#include "mbsnrtowcs-impl.h"
--- /dev/null
+/* Convert string to wide string.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &_gl_mbsrtowcs_state;
+ {
+ const char *src = *srcp;
+
+ if (dest != NULL)
+ {
+ wchar_t *destptr = dest;
+
+ for (; len > 0; destptr++, len--)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MB_LEN_MAX); */
+ if (src[0] == '\0')
+ src_avail = 1;
+ else if (src[1] == '\0')
+ src_avail = 2;
+ else if (src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
+
+ /* Parse the next multibyte character. */
+ ret = mbrtowc (destptr, src, src_avail, ps);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input;
+ if (ret == 0)
+ {
+ src = NULL;
+ /* Here mbsinit (ps). */
+ break;
+ }
+ src += ret;
+ }
+
+ *srcp = src;
+ return destptr - dest;
+ }
+ else
+ {
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (;; totalcount++)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MB_LEN_MAX); */
+ if (src[0] == '\0')
+ src_avail = 1;
+ else if (src[1] == '\0')
+ src_avail = 2;
+ else if (src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
+
+ /* Parse the next multibyte character. */
+ ret = mbrtowc (NULL, src, src_avail, &state);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (ret == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ src += ret;
+ }
+
+ return totalcount;
+ }
+
+ bad_input:
+ *srcp = src;
+ bad_input2:
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+}
extern mbstate_t _gl_mbsrtowcs_state;
-size_t
-mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
-{
- if (ps == NULL)
- ps = &_gl_mbsrtowcs_state;
- {
- const char *src = *srcp;
-
- if (dest != NULL)
- {
- wchar_t *destptr = dest;
-
- for (; len > 0; destptr++, len--)
- {
- size_t src_avail;
- size_t ret;
-
- /* An optimized variant of
- src_avail = strnlen1 (src, MB_LEN_MAX); */
- if (src[0] == '\0')
- src_avail = 1;
- else if (src[1] == '\0')
- src_avail = 2;
- else if (src[2] == '\0')
- src_avail = 3;
- else if (MB_LEN_MAX <= 4 || src[3] == '\0')
- src_avail = 4;
- else
- src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
-
- /* Parse the next multibyte character. */
- ret = mbrtowc (destptr, src, src_avail, ps);
-
- if (ret == (size_t)(-2))
- /* Encountered a multibyte character that extends past a '\0' byte
- or that is longer than MB_LEN_MAX bytes. Cannot happen. */
- abort ();
-
- if (ret == (size_t)(-1))
- goto bad_input;
- if (ret == 0)
- {
- src = NULL;
- /* Here mbsinit (ps). */
- break;
- }
- src += ret;
- }
-
- *srcp = src;
- return destptr - dest;
- }
- else
- {
- /* Ignore dest and len, don't store *srcp at the end, and
- don't clobber *ps. */
- mbstate_t state = *ps;
- size_t totalcount = 0;
-
- for (;; totalcount++)
- {
- size_t src_avail;
- size_t ret;
-
- /* An optimized variant of
- src_avail = strnlen1 (src, MB_LEN_MAX); */
- if (src[0] == '\0')
- src_avail = 1;
- else if (src[1] == '\0')
- src_avail = 2;
- else if (src[2] == '\0')
- src_avail = 3;
- else if (MB_LEN_MAX <= 4 || src[3] == '\0')
- src_avail = 4;
- else
- src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
-
- /* Parse the next multibyte character. */
- ret = mbrtowc (NULL, src, src_avail, &state);
-
- if (ret == (size_t)(-2))
- /* Encountered a multibyte character that extends past a '\0' byte
- or that is longer than MB_LEN_MAX bytes. Cannot happen. */
- abort ();
-
- if (ret == (size_t)(-1))
- goto bad_input2;
- if (ret == 0)
- {
- /* Here mbsinit (&state). */
- break;
- }
- src += ret;
- }
-
- return totalcount;
- }
-
- bad_input:
- *srcp = src;
- bad_input2:
- errno = EILSEQ;
- return (size_t)(-1);
- }
-}
+#include "mbsrtowcs-impl.h"
# if !@HAVE_STRUCT_ADDRINFO@
+# if !GNULIB_defined_struct_addrinfo
/* Structure to contain information about address of a service provider. */
struct addrinfo
{
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
+# define GNULIB_defined_struct_addrinfo 1
+# endif
# endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
#include <stdlib.h>
+#ifndef GNULIB_LIBPOSIX
#include "error.h"
+#endif
+
#include "exitfail.h"
#include "gettext.h"
void
openat_save_fail (int errnum)
{
+#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("unable to record current working directory"));
-
+#endif
/* The `noreturn' attribute cannot be applied to error, since it returns
when its first argument is 0. To help compilers understand that this
function does not return, call abort. Also, the abort is a
void
openat_restore_fail (int errnum)
{
+#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("failed to return to initial working directory"));
+#endif
/* As above. */
abort ();
# define POLLWRNORM 0x0100
# define POLLWRBAND 0x0200
+# if !GNULIB_defined_poll_types
+
struct pollfd
{
int fd; /* which file descriptor to poll */
typedef unsigned long nfds_t;
+# define GNULIB_defined_poll_types 1
+# endif
+
/* Define INFTIM only if doing so conforms to POSIX. */
# if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
# define INFTIM (-1)
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2011 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
}
argument;
+/* Number of directly allocated arguments (no malloc() needed). */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
typedef struct
{
size_t count;
argument *arg;
+ argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
}
arguments;
/* malloc(), realloc(), free(). */
#include <stdlib.h>
+/* memcpy(). */
+#include <string.h>
+
/* errno. */
#include <errno.h>
int
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
{
- const CHAR_T *cp = format; /* pointer into format */
+ const CHAR_T *cp = format; /* pointer into format */
size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
size_t max_width_length = 0;
size_t max_precision_length = 0;
d->count = 0;
- d_allocated = 1;
- d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
- if (d->dir == NULL)
- /* Out of memory. */
- goto out_of_memory_1;
+ d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+ d->dir = d->direct_alloc_dir;
a->count = 0;
- a_allocated = 0;
- a->arg = NULL;
+ a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+ a->arg = a->direct_alloc_arg;
#define REGISTER_ARG(_index_,_type_) \
{ \
if (size_overflow_p (memory_size)) \
/* Overflow, would lead to out of memory. */ \
goto out_of_memory; \
- memory = (argument *) (a->arg \
+ memory = (argument *) (a->arg != a->direct_alloc_arg \
? realloc (a->arg, memory_size) \
: malloc (memory_size)); \
if (memory == NULL) \
/* Out of memory. */ \
goto out_of_memory; \
+ if (a->arg == a->direct_alloc_arg) \
+ memcpy (memory, a->arg, a->count * sizeof (argument)); \
a->arg = memory; \
} \
while (a->count <= n) \
if (size_overflow_p (memory_size))
/* Overflow, would lead to out of memory. */
goto out_of_memory;
- memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+ memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
if (memory == NULL)
/* Out of memory. */
goto out_of_memory;
+ if (d->dir == d->direct_alloc_dir)
+ memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
d->dir = memory;
}
}
return 0;
error:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
errno = EINVAL;
return -1;
out_of_memory:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
-out_of_memory_1:
errno = ENOMEM;
return -1;
}
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2011 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
/* xxx_directive: A parsed directive.
xxx_directives: A parsed format string. */
+/* Number of directly allocated directives (no malloc() needed). */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
/* A parsed directive. */
typedef struct
{
char_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
char_directives;
u8_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u8_directives;
u16_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u16_directives;
u32_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u32_directives;
#include <time.h>
#if ! @HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_types
typedef int pthread_t;
typedef int pthread_attr_t;
typedef int pthread_barrier_t;
typedef int pthread_once_t;
typedef int pthread_rwlock_t;
typedef int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_types 1
+# endif
#endif
#ifndef PTHREAD_COND_INITIALIZER
#if ! @HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_functions
+
/* Provide substitutes for the thread functions that should work
adequately on a single-threaded implementation, where
pthread_create always fails. The goal is to let programs compile
return 0;
}
+# define GNULIB_defined_pthread_functions 1
+# endif
+
#endif
#if ! @HAVE_PTHREAD_SPINLOCK_T@
+# if !GNULIB_defined_pthread_spinlock_t
+
/* Approximate spinlocks with mutexes. */
typedef pthread_mutex_t pthread_spinlock_t;
{
return pthread_mutex_unlock (lock);
}
+
+# define GNULIB_defined_pthread_spinlock_t 1
+# endif
+
#endif
#endif /* _GL_PTHREAD_H_ */
#if !@HAVE_STRUCT_SCHED_PARAM@
+# if !GNULIB_defined_struct_sched_param
struct sched_param
{
int sched_priority;
};
+# define GNULIB_defined_struct_sched_param 1
+# endif
#endif
/* The definition of _GL_UNUSED_PARAMETER is copied here. */
+# if !GNULIB_defined_security_types
+
typedef unsigned short security_class_t;
-# define security_context_t char*
-# define is_selinux_enabled() 0
+# define security_context_t char*
+# define is_selinux_enabled() 0
static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
char const *prefix _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
+# define GNULIB_defined_security_types 1
+# endif
+
# endif
#endif /* _GL_SELINUX_SELINUX_H */
for details. */
# if !@HAVE_TSEARCH@
+# if !GNULIB_defined_search_types
typedef enum
{
preorder,
leaf
}
VISIT;
+# define GNULIB_defined_search_types 1
+# endif
# endif
# ifdef __cplusplus
extern "C" {
# endif
+# if !GNULIB_defined_search_fn_types
typedef int (*_gl_search_compar_fn) (const void *, const void *);
typedef void (*_gl_search_action_fn) (const void *, VISIT, int);
+# define GNULIB_defined_search_fn_types 1
+# endif
# ifdef __cplusplus
}
# endif
'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
Hence, redefine this to a non-volatile type as needed. */
#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+# if !GNULIB_defined_sig_atomic_t
typedef int rpl_sig_atomic_t;
-# undef sig_atomic_t
-# define sig_atomic_t rpl_sig_atomic_t
+# undef sig_atomic_t
+# define sig_atomic_t rpl_sig_atomic_t
+# define GNULIB_defined_sig_atomic_t 1
+# endif
#endif
/* A set or mask of signals. */
#if !@HAVE_SIGSET_T@
+# if !GNULIB_defined_sigset_t
typedef unsigned int sigset_t;
+# define GNULIB_defined_sigset_t 1
+# endif
#endif
# endif
/* This code supports only 32 signals. */
+# if !GNULIB_defined_verify_NSIG_constraint
typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
+# define GNULIB_defined_verify_NSIG_constraint 1
+# endif
# endif
# ifdef __cplusplus
extern "C" {
# endif
+# if !GNULIB_defined_function_taking_int_returning_void_t
typedef void (*_gl_function_taking_int_returning_void_t) (int);
+# define GNULIB_defined_function_taking_int_returning_void_t 1
+# endif
# ifdef __cplusplus
}
# endif
# if !@HAVE_SIGACTION@
# if !@HAVE_SIGINFO_T@
+
+# if !GNULIB_defined_siginfo_types
+
/* Present to allow compilation, but unsupported by gnulib. */
union sigval
{
union sigval si_value;
};
typedef struct siginfo_t siginfo_t;
+
+# define GNULIB_defined_siginfo_types 1
+# endif
+
# endif /* !@HAVE_SIGINFO_T@ */
/* We assume that platforms which lack the sigaction() function also lack
the 'struct sigaction' type, and vice versa. */
+# if !GNULIB_defined_struct_sigaction
+
struct sigaction
{
union
/* Not all POSIX flags are supported. */
int sa_flags;
};
-# define sa_handler _sa_func._sa_handler
-# define sa_sigaction _sa_func._sa_sigaction
+# define sa_handler _sa_func._sa_handler
+# define sa_sigaction _sa_func._sa_sigaction
/* Unsupported flags are not present. */
-# define SA_RESETHAND 1
-# define SA_NODEFER 2
-# define SA_RESTART 4
+# define SA_RESETHAND 1
+# define SA_NODEFER 2
+# define SA_RESTART 4
+
+# define GNULIB_defined_struct_sigaction 1
+# endif
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
struct sigaction *restrict));
# define posix_spawnattr_t rpl_posix_spawnattr_t
#endif
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
+# if !GNULIB_defined_posix_spawnattr_t
typedef struct
{
short int _flags;
int _policy;
int __pad[16];
} posix_spawnattr_t;
+# define GNULIB_defined_posix_spawnattr_t 1
+# endif
#endif
# define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
#endif
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
+# if !GNULIB_defined_posix_spawn_file_actions_t
typedef struct
{
int _allocated;
struct __spawn_action *_actions;
int __pad[16];
} posix_spawn_file_actions_t;
+# define GNULIB_defined_posix_spawn_file_actions_t 1
+# endif
#endif
| POSIX_SPAWN_SETSCHEDULER \
| (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
+ 1)
+#if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
[(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
| POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
& POSIX_SPAWN_USEVFORK)
== 0)
? 1 : -1];
+# define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
+#endif
#if @GNULIB_POSIX_SPAWN@
warnings in the signed case. */ \
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+#if !GNULIB_defined_stdint_types
+
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
+
/* 7.18.2. Limits of specified-width integer types */
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
/* Provide an fseek function that is consistent with fseeko. */
/* In order to avoid that fseek gets defined as a macro here, the
developer can request the 'fseek' module. */
-# undef fseek
-# define fseek rpl_fseek
+# if !GNULIB_defined_fseek_function
+# undef fseek
+# define fseek rpl_fseek
static inline int _GL_ARG_NONNULL ((1))
rpl_fseek (FILE *fp, long offset, int whence)
{
-# if @REPLACE_FSEEKO@
+# if @REPLACE_FSEEKO@
return rpl_fseeko (fp, offset, whence);
-# else
+# else
return fseeko (fp, offset, whence);
-# endif
+# endif
}
+# define GNULIB_defined_fseek_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FSEEK_WARN /* Category 1, above. */
/* Provide an ftell function that is consistent with ftello. */
/* In order to avoid that ftell gets defined as a macro here, the
developer can request the 'ftell' module. */
-# undef ftell
-# define ftell rpl_ftell
+# if !GNULIB_defined_ftell_function
+# undef ftell
+# define ftell rpl_ftell
static inline long _GL_ARG_NONNULL ((1))
rpl_ftell (FILE *f)
{
-# if @REPLACE_FTELLO@
+# if @REPLACE_FTELLO@
return rpl_ftello (f);
-# else
+# else
return ftello (f);
-# endif
+# endif
}
+# define GNULIB_defined_ftell_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FTELL_WARN /* Category 1, above. */
# include <sys/loadavg.h>
#endif
+#if @GNULIB_RANDOM_R@
+
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
- from <stdlib.h> if _REENTRANT is defined. Include it always. */
-#if @HAVE_RANDOM_H@
-# include <random.h>
-#endif
+ from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
+ 'struct random_data'. */
+# if @HAVE_RANDOM_H@
+# include <random.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
- || defined GNULIB_POSIXCHECK
-# include <stdint.h>
-#endif
+# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
+# include <stdint.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@
+# if !@HAVE_STRUCT_RANDOM_DATA@
/* Define 'struct random_data'.
But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
-# if !GNULIB_defined_struct_random_data
+# if !GNULIB_defined_struct_random_data
struct random_data
{
int32_t *fptr; /* Front pointer. */
int rand_sep; /* Distance between front and rear. */
int32_t *end_ptr; /* Pointer behind state table. */
};
-# define GNULIB_defined_struct_random_data 1
+# define GNULIB_defined_struct_random_data 1
+# endif
# endif
#endif
#if HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__) && !EXTEND_STRERROR_R
/* The system's strerror_r function is OK, except that its third argument
- is 'int', not 'size_t'. */
+ is 'int', not 'size_t', or its return type is wrong. */
# include <limits.h>
else
ret = strerror_r (errnum, buf, buflen);
}
+# elif defined __CYGWIN__
+ /* Cygwin only provides the glibc interface, is thread-safe, and
+ always succeeds (although it may truncate). */
+ strerror_r (errnum, buf, buflen);
+ ret = 0;
# else
ret = strerror_r (errnum, buf, buflen);
# endif
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
typedef unsigned short sa_family_t;
+# define GNULIB_defined_sa_family_t 1
+# endif
#endif
#if @HAVE_STRUCT_SOCKADDR_STORAGE@
: alignof (__ss_aligntype)) \
+ sizeof (__ss_aligntype)))
+# if !GNULIB_defined_struct_sockaddr_storage
struct sockaddr_storage
{
sa_family_t ss_family; /* Address family, etc. */
__ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
#endif
#if @HAVE_SYS_SOCKET_H@
# include <sys/types.h>
# include <io.h>
+# if !GNULIB_defined_socklen_t
typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
# endif
#if @HAVE_WINSOCK2_H@
+# if !GNULIB_defined_rpl_fd_isset
+
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
return 0;
}
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
# undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
which are included above. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
static inline int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir
# endif
# if ! @HAVE_STRUCT_TIMEVAL@
+
+# if !GNULIB_defined_struct_timeval
struct timeval
{
time_t tv_sec;
long int tv_usec;
};
+# define GNULIB_defined_struct_timeval 1
+# endif
+
# endif
# ifdef __cplusplus
# endif
# if !@HAVE_STRUCT_TMS@
+# if !GNULIB_defined_struct_tms
/* Structure describing CPU time used by a process and its children. */
struct tms
{
clock_t tms_cutime; /* User CPU time of dead children. */
clock_t tms_cstime; /* System CPU time of dead children. */
};
+# define GNULIB_defined_struct_tms 1
+# endif
# endif
# if @GNULIB_TIMES@
# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
# endif
+# if !GNULIB_defined_struct_utsname
/* Structure describing the system and machine. */
struct utsname
{
/* Name of the hardware type the system is running on. */
char machine[_UTSNAME_MACHINE_LENGTH];
};
+# define GNULIB_defined_struct_utsname 1
+# endif
+
#endif /* !@HAVE_STRUCT_UTSNAME@ */
extern "C" {
# endif
-# undef timespec
-# define timespec rpl_timespec
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
+# define GNULIB_defined_struct_timespec 1
+# endif
# ifdef __cplusplus
}
# endif
# endif
+# if !GNULIB_defined_struct_time_t_must_be_integral
/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
time_t to be an integer type, even though C99 permits floating
point. We don't know of any implementation that uses floating
struct __time_t_must_be_integral {
unsigned int __floating_time_t_unsupported : (time_t) 1;
};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
--- /dev/null
+/* Convert a wide character using a case mapping.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wint_t
+towctrans (wint_t wc, wctrans_t desc)
+{
+ return ((wint_t (*) (wint_t)) desc) (wc);
+}
--- /dev/null
+/* Convert a wide character using a case mapping.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+#include "towctrans-impl.h"
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize() _gl_getpagesize ()
# else
+# if !GNULIB_defined_getpagesize_function
static inline int
getpagesize ()
{
return _gl_getpagesize ();
}
+# define GNULIB_defined_getpagesize_function 1
+# endif
# endif
# endif
# endif
return NULL;
#define CLEANUP() \
- free (d.dir); \
- if (a.arg) \
+ if (d.dir != d.direct_alloc_dir) \
+ free (d.dir); \
+ if (a.arg != a.direct_alloc_arg) \
free (a.arg);
if (PRINTF_FETCHARGS (args, &a) < 0)
On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
implementing mbrtowc for encodings like UTF-8. */
#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# define GNULIB_defined_mbstate_t 1
+# endif
#endif
#endif
+/* Search N wide characters of S for C. */
+#if @GNULIB_WMEMCHR@
+# if !@HAVE_WMEMCHR@
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN (wmemchr);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemchr
+# if HAVE_RAW_DECL_WMEMCHR
+_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
+ "use gnulib module wmemchr for portability");
+# endif
+#endif
+
+
+/* Compare N wide characters of S1 and S2. */
+#if @GNULIB_WMEMCMP@
+# if !@HAVE_WMEMCMP@
+_GL_FUNCDECL_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wmemcmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcmp
+# if HAVE_RAW_DECL_WMEMCMP
+_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
+ "use gnulib module wmemcmp for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST. */
+#if @GNULIB_WMEMCPY@
+# if !@HAVE_WMEMCPY@
+_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcpy
+# if HAVE_RAW_DECL_WMEMCPY
+_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
+ "use gnulib module wmemcpy for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
+ overlapping memory areas. */
+#if @GNULIB_WMEMMOVE@
+# if !@HAVE_WMEMMOVE@
+_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemmove);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemmove
+# if HAVE_RAW_DECL_WMEMMOVE
+_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
+ "use gnulib module wmemmove for portability");
+# endif
+#endif
+
+
+/* Set N wide characters of S to C. */
+#if @GNULIB_WMEMSET@
+# if !@HAVE_WMEMSET@
+_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN (wmemset);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemset
+# if HAVE_RAW_DECL_WMEMSET
+_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
+ "use gnulib module wmemset for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S. */
+#if @GNULIB_WCSLEN@
+# if !@HAVE_WCSLEN@
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+_GL_CXXALIASWARN (wcslen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcslen
+# if HAVE_RAW_DECL_WCSLEN
+_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
+ "use gnulib module wcslen for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S, but at most MAXLEN. */
+#if @GNULIB_WCSNLEN@
+# if !@HAVE_WCSNLEN@
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+# endif
+_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_CXXALIASWARN (wcsnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnlen
+# if HAVE_RAW_DECL_WCSNLEN
+_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
+ "use gnulib module wcsnlen for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST. */
+#if @GNULIB_WCSCPY@
+# if !@HAVE_WCSCPY@
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscpy
+# if HAVE_RAW_DECL_WCSCPY
+_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
+ "use gnulib module wcscpy for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
+#if @GNULIB_WCPCPY@
+# if !@HAVE_WCPCPY@
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpcpy
+# if HAVE_RAW_DECL_WCPCPY
+_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
+ "use gnulib module wcpcpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N wide characters of SRC to DEST. */
+#if @GNULIB_WCSNCPY@
+# if !@HAVE_WCSNCPY@
+_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncpy
+# if HAVE_RAW_DECL_WCSNCPY
+_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
+ "use gnulib module wcsncpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+#if @GNULIB_WCPNCPY@
+# if !@HAVE_WCPNCPY@
+_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpncpy
+# if HAVE_RAW_DECL_WCPNCPY
+_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
+ "use gnulib module wcpncpy for portability");
+# endif
+#endif
+
+
+/* Append SRC onto DEST. */
+#if @GNULIB_WCSCAT@
+# if !@HAVE_WCSCAT@
+_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscat
+# if HAVE_RAW_DECL_WCSCAT
+_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
+ "use gnulib module wcscat for portability");
+# endif
+#endif
+
+
+/* Append no more than N wide characters of SRC onto DEST. */
+#if @GNULIB_WCSNCAT@
+# if !@HAVE_WCSNCAT@
+_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncat
+# if HAVE_RAW_DECL_WCSNCAT
+_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
+ "use gnulib module wcsncat for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2. */
+#if @GNULIB_WCSCMP@
+# if !@HAVE_WCSCMP@
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscmp
+# if HAVE_RAW_DECL_WCSCMP
+_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
+ "use gnulib module wcscmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N wide characters of S1 and S2. */
+#if @GNULIB_WCSNCMP@
+# if !@HAVE_WCSNCMP@
+_GL_FUNCDECL_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncmp
+# if HAVE_RAW_DECL_WCSNCMP
+_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
+ "use gnulib module wcsncmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, ignoring case. */
+#if @GNULIB_WCSCASECMP@
+# if !@HAVE_WCSCASECMP@
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscasecmp
+# if HAVE_RAW_DECL_WCSCASECMP
+_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
+ "use gnulib module wcscasecmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+#if @GNULIB_WCSNCASECMP@
+# if !@HAVE_WCSNCASECMP@
+_GL_FUNCDECL_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncasecmp
+# if HAVE_RAW_DECL_WCSNCASECMP
+_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
+ "use gnulib module wcsncasecmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
+ category of the current locale. */
+#if @GNULIB_WCSCOLL@
+# if !@HAVE_WCSCOLL@
+_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscoll);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscoll
+# if HAVE_RAW_DECL_WCSCOLL
+_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
+ "use gnulib module wcscoll for portability");
+# endif
+#endif
+
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
+ to two transformed strings the result is the as applying 'wcscoll' to the
+ original strings. */
+#if @GNULIB_WCSXFRM@
+# if !@HAVE_WCSXFRM@
+_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsxfrm);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsxfrm
+# if HAVE_RAW_DECL_WCSXFRM
+_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
+ "use gnulib module wcsxfrm for portability");
+# endif
+#endif
+
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_WCSDUP@
+# if !@HAVE_WCSDUP@
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+_GL_CXXALIASWARN (wcsdup);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsdup
+# if HAVE_RAW_DECL_WCSDUP
+_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
+ "use gnulib module wcsdup for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of WC in WCS. */
+#if @GNULIB_WCSCHR@
+# if !@HAVE_WCSCHR@
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# endif
+_GL_CXXALIAS_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN (wcschr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcschr
+# if HAVE_RAW_DECL_WCSCHR
+_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
+ "use gnulib module wcschr for portability");
+# endif
+#endif
+
+
+/* Find the last occurrence of WC in WCS. */
+#if @GNULIB_WCSRCHR@
+# if !@HAVE_WCSRCHR@
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# endif
+_GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN (wcsrchr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrchr
+# if HAVE_RAW_DECL_WCSRCHR
+_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
+ "use gnulib module wcsrchr for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters not in REJECT. */
+#if @GNULIB_WCSCSPN@
+# if !@HAVE_WCSCSPN@
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+# endif
+_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+_GL_CXXALIASWARN (wcscspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscspn
+# if HAVE_RAW_DECL_WCSCSPN
+_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
+ "use gnulib module wcscspn for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters in ACCEPT. */
+#if @GNULIB_WCSSPN@
+# if !@HAVE_WCSSPN@
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+# endif
+_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN (wcsspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsspn
+# if HAVE_RAW_DECL_WCSSPN
+_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
+ "use gnulib module wcsspn for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence in WCS of any character in ACCEPT. */
+#if @GNULIB_WCSPBRK@
+# if !@HAVE_WCSPBRK@
+_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept));
+# endif
+_GL_CXXALIAS_SYS (wcspbrk, wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN (wcspbrk);
+#elif defined GNULIB_POSIXCHECK
+# undef wcspbrk
+# if HAVE_RAW_DECL_WCSPBRK
+_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
+ "use gnulib module wcspbrk for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_WCSSTR@
+# if !@HAVE_WCSSTR@
+_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
+ (const wchar_t *haystack, const wchar_t *needle));
+# endif
+_GL_CXXALIAS_SYS (wcsstr, wchar_t *,
+ (const wchar_t *haystack, const wchar_t *needle));
+_GL_CXXALIASWARN (wcsstr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsstr
+# if HAVE_RAW_DECL_WCSSTR
+_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
+ "use gnulib module wcsstr for portability");
+# endif
+#endif
+
+
+/* Divide WCS into tokens separated by characters in DELIM. */
+#if @GNULIB_WCSTOK@
+# if !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+ (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+ (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+_GL_CXXALIASWARN (wcstok);
+#elif defined GNULIB_POSIXCHECK
+# undef wcstok
+# if HAVE_RAW_DECL_WCSTOK
+_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
+ "use gnulib module wcstok for portability");
+# endif
+#endif
+
+
+/* Determine number of column positions required for first N wide
+ characters (or fewer if S ends before this) in S. */
+#if @GNULIB_WCSWIDTH@
+# if @REPLACE_WCSWIDTH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcswidth
+# define wcswidth rpl_wcswidth
+# endif
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+# else
+# if !@HAVE_WCSWIDTH@
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+_GL_CXXALIASWARN (wcswidth);
+#elif defined GNULIB_POSIXCHECK
+# undef wcswidth
+# if HAVE_RAW_DECL_WCSWIDTH
+_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
+ "use gnulib module wcswidth for portability");
+# endif
+#endif
+
+
#endif /* _GL_WCHAR_H */
#endif /* _GL_WCHAR_H */
#endif
--- /dev/null
+/* Copy a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcpcpy (wchar_t *dest, const wchar_t *src)
+{
+ for (; (*dest = *src) != (wchar_t)'\0'; src++, dest++)
+ ;
+ return dest;
+}
--- /dev/null
+/* Copy a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcpcpy-impl.h"
--- /dev/null
+/* Copy a size-bounded wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcpncpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ for (; n > 0 && (*dest = *src) != (wchar_t)'\0'; src++, dest++, n--)
+ ;
+
+ /* This behavior is rarely useful, but it is here for consistency with
+ wcsncpy. */
+ for (; n > 0; n--)
+ *dest++ = (wchar_t)'\0';
+
+ return dest-1;
+}
--- /dev/null
+/* Copy a size-bounded wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcpncpy-impl.h"
--- /dev/null
+/* Compare two wide strings ignoring case.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcscasecmp (const wchar_t *s1, const wchar_t *s2)
+{
+ for (;;)
+ {
+ wchar_t wc1 = towlower (*s1++);
+ wchar_t wc2 = towlower (*s2++);
+ if (wc1 != (wchar_t)'\0' && wc1 == wc2)
+ continue;
+ /* Note that wc1 and wc2 each have at most 31 bits. */
+ return (int)wc1 - (int)wc2;
+ /* > 0 if wc1 > wc2, < 0 if wc1 < wc2,
+ = 0 if wc1 and wc2 are both '\0'. */
+ }
+}
--- /dev/null
+/* Compare two wide strings ignoring case.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <wctype.h>
+
+#include "wcscasecmp-impl.h"
--- /dev/null
+/* Concatenate two wide strings.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcscat (wchar_t *dest, const wchar_t *src)
+{
+ wchar_t *destptr = dest + wcslen (dest);
+
+ for (; (*destptr = *src) != (wchar_t)'\0'; src++, destptr++)
+ ;
+ return dest;
+}
--- /dev/null
+/* Concatenate two wide strings.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcscat-impl.h"
--- /dev/null
+/* Search wide string for a wide character.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcschr (const wchar_t *wcs, wchar_t wc)
+{
+ for (;; wcs++)
+ {
+ if (*wcs == wc)
+ break;
+ if (*wcs == (wchar_t)'\0')
+ goto notfound;
+ }
+ return (wchar_t *) wcs;
+
+ notfound:
+ return NULL;
+}
--- /dev/null
+/* Search wide string for a wide character.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcschr-impl.h"
--- /dev/null
+/* Compare two wide strings.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcscmp (const wchar_t *s1, const wchar_t *s2)
+{
+ for (;;)
+ {
+ wchar_t wc1 = *s1++;
+ wchar_t wc2 = *s2++;
+ if (wc1 != (wchar_t)'\0' && wc1 == wc2)
+ continue;
+ /* Note that wc1 and wc2 each have at most 31 bits. */
+ return (int)wc1 - (int)wc2;
+ /* > 0 if wc1 > wc2, < 0 if wc1 < wc2,
+ = 0 if wc1 and wc2 are both '\0'. */
+ }
+}
--- /dev/null
+/* Compare two wide strings.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcscmp-impl.h"
--- /dev/null
+/* Compare two wide strings using the current locale.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcscoll (const wchar_t *s1, const wchar_t *s2)
+{
+ char mbbuf1[1024];
+ char mbbuf2[1024];
+ char *mbs1;
+ char *mbs2;
+
+ {
+ int saved_errno = errno;
+
+ /* Convert s1 to a multibyte string, trying to avoid malloc(). */
+ {
+ size_t ret;
+
+ ret = wcstombs (mbbuf1, s1, sizeof (mbbuf1));
+ if (ret == (size_t)-1)
+ goto failed1;
+ if (ret < sizeof (mbbuf1))
+ mbs1 = mbbuf1;
+ else
+ {
+ size_t need = wcstombs (NULL, s1, 0);
+ if (need == (size_t)-1)
+ goto failed1;
+ mbs1 = (char *) malloc (need + 1);
+ if (mbs1 == NULL)
+ goto out_of_memory1;
+ ret = wcstombs (mbs1, s1, need + 1);
+ if (ret != need)
+ abort ();
+ }
+ }
+
+ /* Convert s2 to a multibyte string, trying to avoid malloc(). */
+ {
+ size_t ret;
+
+ ret = wcstombs (mbbuf2, s2, sizeof (mbbuf2));
+ if (ret == (size_t)-1)
+ goto failed2;
+ if (ret < sizeof (mbbuf2))
+ mbs2 = mbbuf2;
+ else
+ {
+ size_t need = wcstombs (NULL, s2, 0);
+ if (need == (size_t)-1)
+ goto failed2;
+ mbs2 = (char *) malloc (need + 1);
+ if (mbs2 == NULL)
+ goto out_of_memory2;
+ ret = wcstombs (mbs2, s2, need + 1);
+ if (ret != need)
+ abort ();
+ }
+ }
+
+ /* No error so far. */
+ errno = saved_errno;
+ }
+
+ /* Compare the two multibyte strings. */
+ {
+ int result = strcoll (mbs1, mbs2);
+
+ if (mbs1 != mbbuf1)
+ {
+ int saved_errno = errno;
+ free (mbs1);
+ errno = saved_errno;
+ }
+ if (mbs2 != mbbuf2)
+ {
+ int saved_errno = errno;
+ free (mbs2);
+ errno = saved_errno;
+ }
+ return result;
+ }
+
+ out_of_memory2:
+ if (mbs1 != mbbuf1)
+ free (mbs1);
+ out_of_memory1:
+ errno = ENOMEM;
+ return 0;
+
+ failed2:
+ if (mbs1 != mbbuf1)
+ free (mbs1);
+ failed1:
+ errno = EILSEQ;
+ return 0;
+}
--- /dev/null
+/* Compare two wide strings using the current locale.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "wcscoll-impl.h"
--- /dev/null
+/* Copy a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcscpy (wchar_t *dest, const wchar_t *src)
+{
+ wchar_t *destptr = dest;
+
+ for (; (*destptr = *src) != (wchar_t)'\0'; src++, destptr++)
+ ;
+ return dest;
+}
--- /dev/null
+/* Copy a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcscpy-impl.h"
--- /dev/null
+/* Search a wide string for any of a set of wide characters.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcscspn (const wchar_t *wcs, const wchar_t *reject)
+{
+ /* Optimize two cases. */
+ if (reject[0] == (wchar_t)'\0')
+ return wcslen (wcs);
+
+ if (reject[1] == (wchar_t)'\0')
+ {
+ wchar_t wc = reject[0];
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (*ptr == wc)
+ break;
+ }
+ return ptr - wcs;
+ }
+
+ /* General case. */
+ {
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (wcschr (reject, *ptr))
+ break;
+ }
+ return ptr - wcs;
+ }
+}
--- /dev/null
+/* Search a wide string for any of a set of wide characters.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcscspn-impl.h"
--- /dev/null
+/* Duplicate a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcsdup (const wchar_t *s)
+{
+ size_t n = wcslen (s) + 1;
+ wchar_t *copy = (wchar_t *) malloc (n * sizeof (wchar_t));
+ if (copy != NULL)
+ return wmemcpy (copy, s, n);
+ else
+ /* The glibc documentation does not say that errno should be set to ENOMEM
+ here. */
+ return NULL;
+}
--- /dev/null
+/* Duplicate a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <stdlib.h>
+
+#include "wcsdup-impl.h"
--- /dev/null
+/* Determine the length of a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t)'\0'; ptr++)
+ ;
+ return ptr - s;
+}
--- /dev/null
+/* Determine the length of a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcslen-impl.h"
--- /dev/null
+/* Compare two wide strings ignoring case.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcsncasecmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ for (; n > 0;)
+ {
+ wchar_t wc1 = towlower (*s1++);
+ wchar_t wc2 = towlower (*s2++);
+ if (wc1 != (wchar_t)'\0' && wc1 == wc2)
+ {
+ n--;
+ continue;
+ }
+ /* Note that wc1 and wc2 each have at most 31 bits. */
+ return (int)wc1 - (int)wc2;
+ /* > 0 if wc1 > wc2, < 0 if wc1 < wc2,
+ = 0 if wc1 and wc2 are both '\0'. */
+ }
+ return 0;
+}
--- /dev/null
+/* Compare two wide strings ignoring case.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <wctype.h>
+
+#include "wcsncasecmp-impl.h"
--- /dev/null
+/* Append part of a wide string to a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcsncat (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ wchar_t *destptr = dest + wcslen (dest);
+
+ for (; n > 0 && (*destptr = *src) != (wchar_t)'\0'; src++, destptr++, n--)
+ ;
+ if (n == 0)
+ *destptr = (wchar_t)'\0';
+ return dest;
+}
--- /dev/null
+/* Append part of a wide string to a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsncat-impl.h"
--- /dev/null
+/* Compare two wide strings.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcsncmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ for (; n > 0;)
+ {
+ wchar_t wc1 = *s1++;
+ wchar_t wc2 = *s2++;
+ if (wc1 != (wchar_t)'\0' && wc1 == wc2)
+ {
+ n--;
+ continue;
+ }
+ /* Note that wc1 and wc2 each have at most 31 bits. */
+ return (int)wc1 - (int)wc2;
+ /* > 0 if wc1 > wc2, < 0 if wc1 < wc2,
+ = 0 if wc1 and wc2 are both '\0'. */
+ }
+ return 0;
+}
--- /dev/null
+/* Compare two wide strings.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsncmp-impl.h"
--- /dev/null
+/* Copy a size-bounded wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcsncpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ wchar_t *destptr = dest;
+
+ for (; n > 0 && (*destptr = *src) != (wchar_t)'\0'; src++, destptr++, n--)
+ ;
+
+ /* This behavior is rarely useful, but it is specified by the ISO C
+ standard. */
+ for (; n > 0; n--)
+ *destptr++ = (wchar_t)'\0';
+
+ return dest;
+}
--- /dev/null
+/* Copy a size-bounded wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsncpy-impl.h"
--- /dev/null
+/* Determine the length of a size-bounded wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcsnlen (const wchar_t *s, size_t maxlen)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; maxlen > 0 && *ptr != (wchar_t)'\0'; ptr++, maxlen--)
+ ;
+ return ptr - s;
+}
--- /dev/null
+/* Determine the length of a size-bounded wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsnlen-impl.h"
--- /dev/null
+/* Convert wide string to string.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &_gl_wcsrtombs_state;
+ {
+ const wchar_t *src = *srcp;
+ size_t cur_max = MB_CUR_MAX;
+ char buf[64];
+
+ if (!(cur_max <= sizeof (buf)))
+ abort ();
+
+ if (dest != NULL)
+ {
+ char *destptr = dest;
+
+ for (; srclen > 0 && len > 0; src++, srclen--)
+ {
+ wchar_t wc = *src;
+ size_t ret = wcrtomb (len >= cur_max ? destptr : buf, wc, ps);
+
+ if (ret == (size_t)(-1))
+ goto bad_input;
+ if (!(ret <= cur_max))
+ abort ();
+ if (len < ret)
+ break;
+ if (len < cur_max)
+ memcpy (destptr, buf, ret);
+ if (wc == 0)
+ {
+ src = NULL;
+ /* Here mbsinit (ps). */
+ break;
+ }
+ destptr += ret;
+ len -= ret;
+ }
+ *srcp = src;
+ return destptr - dest;
+ }
+ else
+ {
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (; srclen > 0; src++, srclen--)
+ {
+ wchar_t wc = *src;
+ size_t ret = wcrtomb (buf, wc, &state);
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (wc == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ totalcount += ret;
+ }
+ return totalcount;
+ }
+
+ bad_input:
+ *srcp = src;
+ bad_input2:
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+}
extern mbstate_t _gl_wcsrtombs_state;
-size_t
-wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps)
-{
- if (ps == NULL)
- ps = &_gl_wcsrtombs_state;
- {
- const wchar_t *src = *srcp;
- size_t cur_max = MB_CUR_MAX;
- char buf[64];
-
- if (!(cur_max <= sizeof (buf)))
- abort ();
-
- if (dest != NULL)
- {
- char *destptr = dest;
-
- for (; srclen > 0 && len > 0; src++, srclen--)
- {
- wchar_t wc = *src;
- size_t ret = wcrtomb (len >= cur_max ? destptr : buf, wc, ps);
-
- if (ret == (size_t)(-1))
- goto bad_input;
- if (!(ret <= cur_max))
- abort ();
- if (len < ret)
- break;
- if (len < cur_max)
- memcpy (destptr, buf, ret);
- if (wc == 0)
- {
- src = NULL;
- /* Here mbsinit (ps). */
- break;
- }
- destptr += ret;
- len -= ret;
- }
- *srcp = src;
- return destptr - dest;
- }
- else
- {
- /* Ignore dest and len, don't store *srcp at the end, and
- don't clobber *ps. */
- mbstate_t state = *ps;
- size_t totalcount = 0;
-
- for (; srclen > 0; src++, srclen--)
- {
- wchar_t wc = *src;
- size_t ret = wcrtomb (buf, wc, &state);
-
- if (ret == (size_t)(-1))
- goto bad_input2;
- if (wc == 0)
- {
- /* Here mbsinit (&state). */
- break;
- }
- totalcount += ret;
- }
- return totalcount;
- }
-
- bad_input:
- *srcp = src;
- bad_input2:
- errno = EILSEQ;
- return (size_t)(-1);
- }
-}
+#include "wcsnrtombs-impl.h"
--- /dev/null
+/* Search a wide string for any of a set of wide characters.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcspbrk (const wchar_t *wcs, const wchar_t *accept)
+{
+ /* Optimize two cases. */
+ if (accept[0] == (wchar_t)'\0')
+ return NULL;
+
+ if (accept[1] == (wchar_t)'\0')
+ {
+ wchar_t wc = accept[0];
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (*ptr == wc)
+ return (wchar_t *) ptr;
+ }
+ return NULL;
+ }
+
+ /* General case. */
+ {
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (wcschr (accept, *ptr))
+ return (wchar_t *) ptr;
+ }
+ return NULL;
+ }
+}
--- /dev/null
+/* Search a wide string for any of a set of wide characters.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcspbrk-impl.h"
--- /dev/null
+/* Search wide string for a wide character.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcsrchr (const wchar_t *wcs, wchar_t wc)
+{
+ /* Calling wcslen and then searching from the other end would cause more
+ memory accesses. Avoid that, at the cost of a few more comparisons. */
+ wchar_t *result = NULL;
+
+ for (;; wcs++)
+ {
+ if (*wcs == wc)
+ result = (wchar_t *) wcs;
+ if (*wcs == (wchar_t)'\0')
+ break;
+ }
+ return result;
+}
--- /dev/null
+/* Search wide string for a wide character.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsrchr-impl.h"
--- /dev/null
+/* Convert wide string to string.
+ Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &_gl_wcsrtombs_state;
+ {
+ const wchar_t *src = *srcp;
+ size_t cur_max = MB_CUR_MAX;
+ char buf[64];
+
+ if (!(cur_max <= sizeof (buf)))
+ abort ();
+
+ if (dest != NULL)
+ {
+ char *destptr = dest;
+
+ for (; len > 0; src++)
+ {
+ wchar_t wc = *src;
+ size_t ret = wcrtomb (len >= cur_max ? destptr : buf, wc, ps);
+
+ if (ret == (size_t)(-1))
+ goto bad_input;
+ if (!(ret <= cur_max))
+ abort ();
+ if (len < ret)
+ break;
+ if (len < cur_max)
+ memcpy (destptr, buf, ret);
+ if (wc == 0)
+ {
+ src = NULL;
+ /* Here mbsinit (ps). */
+ break;
+ }
+ destptr += ret;
+ len -= ret;
+ }
+ *srcp = src;
+ return destptr - dest;
+ }
+ else
+ {
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (;; src++)
+ {
+ wchar_t wc = *src;
+ size_t ret = wcrtomb (buf, wc, &state);
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (wc == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ totalcount += ret;
+ }
+ return totalcount;
+ }
+
+ bad_input:
+ *srcp = src;
+ bad_input2:
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+}
# include <stdlib.h>
# include <string.h>
-size_t
-wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
-{
- if (ps == NULL)
- ps = &_gl_wcsrtombs_state;
- {
- const wchar_t *src = *srcp;
- size_t cur_max = MB_CUR_MAX;
- char buf[64];
-
- if (!(cur_max <= sizeof (buf)))
- abort ();
-
- if (dest != NULL)
- {
- char *destptr = dest;
-
- for (; len > 0; src++)
- {
- wchar_t wc = *src;
- size_t ret = wcrtomb (len >= cur_max ? destptr : buf, wc, ps);
-
- if (ret == (size_t)(-1))
- goto bad_input;
- if (!(ret <= cur_max))
- abort ();
- if (len < ret)
- break;
- if (len < cur_max)
- memcpy (destptr, buf, ret);
- if (wc == 0)
- {
- src = NULL;
- /* Here mbsinit (ps). */
- break;
- }
- destptr += ret;
- len -= ret;
- }
- *srcp = src;
- return destptr - dest;
- }
- else
- {
- /* Ignore dest and len, don't store *srcp at the end, and
- don't clobber *ps. */
- mbstate_t state = *ps;
- size_t totalcount = 0;
-
- for (;; src++)
- {
- wchar_t wc = *src;
- size_t ret = wcrtomb (buf, wc, &state);
-
- if (ret == (size_t)(-1))
- goto bad_input2;
- if (wc == 0)
- {
- /* Here mbsinit (&state). */
- break;
- }
- totalcount += ret;
- }
- return totalcount;
- }
-
- bad_input:
- *srcp = src;
- bad_input2:
- errno = EILSEQ;
- return (size_t)(-1);
- }
-}
+# include "wcsrtombs-impl.h"
#endif
--- /dev/null
+/* Advance in a wide string, skipping any of a set of wide characters.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcsspn (const wchar_t *wcs, const wchar_t *accept)
+{
+ /* Optimize two cases. */
+ if (accept[0] == (wchar_t)'\0')
+ return 0;
+
+ if (accept[1] == (wchar_t)'\0')
+ {
+ wchar_t wc = accept[0];
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (*ptr != wc)
+ break;
+ }
+ return ptr - wcs;
+ }
+
+ /* General case. */
+ {
+ const wchar_t *ptr = wcs;
+ for (; *ptr != (wchar_t)'\0'; ptr++)
+ {
+ if (!wcschr (accept, *ptr))
+ break;
+ }
+ return ptr - wcs;
+ }
+}
--- /dev/null
+/* Advance in a wide string, skipping any of a set of wide characters.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsspn-impl.h"
--- /dev/null
+/* Locate a substring in a wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcsstr (const wchar_t *haystack, const wchar_t *needle)
+{
+ wchar_t n = needle[0];
+
+ /* Is needle empty? */
+ if (n == (wchar_t)'\0')
+ return (wchar_t *) haystack;
+
+ /* Is needle nearly empty? */
+ if (needle[1] == (wchar_t)'\0')
+ return wcschr (haystack, n);
+
+ /* Search for needle's first character. */
+ for (; *haystack != (wchar_t)'\0'; haystack++)
+ {
+ if (*haystack == n)
+ {
+ /* Compare with needle's remaining characters. */
+ const wchar_t *hptr = haystack + 1;
+ const wchar_t *nptr = needle + 1;
+ for (;;)
+ {
+ if (*hptr != *nptr)
+ break;
+ hptr++; nptr++;
+ if (*nptr == (wchar_t)'\0')
+ return (wchar_t *) haystack;
+ }
+ }
+ }
+
+ return NULL;
+}
--- /dev/null
+/* Locate a substring in a wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcsstr-impl.h"
--- /dev/null
+/* Split a wide string into tokens.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wcstok (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)
+{
+ if (wcs == NULL)
+ {
+ wcs = *ptr;
+ if (wcs == NULL)
+ return NULL; /* reminder that end of token sequence has been reached */
+ }
+
+ /* Skip leading delimiters. */
+ wcs += wcsspn (wcs, delim);
+
+ /* Found a token? */
+ if (*wcs == (wchar_t)'\0')
+ {
+ *ptr = NULL;
+ return NULL;
+ }
+ /* Move past the token. */
+ {
+ wchar_t *token_end = wcspbrk (wcs, delim);
+ if (token_end)
+ {
+ /* NUL-terminate the token. */
+ *token_end = (wchar_t)'\0';
+ *ptr = token_end + 1;
+ }
+ else
+ *ptr = NULL;
+ }
+ return wcs;
+}
--- /dev/null
+/* Split a wide string into tokens.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcstok-impl.h"
--- /dev/null
+/* Determine number of screen columns needed for a size-bounded wide string.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wcswidth (const wchar_t *s, size_t n)
+{
+ int count = 0;
+ for (; n > 0; s++, n--)
+ {
+ wchar_t c = *s;
+ if (c == (wchar_t)'\0')
+ break;
+ {
+ int width = wcwidth (c);
+ if (width < 0)
+ goto found_nonprinting;
+ count += width;
+ }
+ }
+ return count;
+
+ found_nonprinting:
+ return -1;
+}
--- /dev/null
+/* Determine number of screen columns needed for a size-bounded wide string.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wcswidth-impl.h"
--- /dev/null
+/* Transform wide string for comparison using the current locale.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+size_t
+wcsxfrm (wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ char mbbuf2[1024];
+ char *mbs2;
+
+ {
+ int saved_errno = errno;
+ size_t result;
+
+ /* Convert s2 to a multibyte string, trying to avoid malloc(). */
+ {
+ size_t ret;
+
+ ret = wcstombs (mbbuf2, s2, sizeof (mbbuf2));
+ if (ret == (size_t)-1)
+ goto failed;
+ if (ret < sizeof (mbbuf2))
+ mbs2 = mbbuf2;
+ else
+ {
+ size_t need = wcstombs (NULL, s2, 0);
+ if (need == (size_t)-1)
+ goto failed;
+ mbs2 = (char *) malloc (need + 1);
+ if (mbs2 == NULL)
+ goto out_of_memory;
+ ret = wcstombs (mbs2, s2, need + 1);
+ if (ret != need)
+ abort ();
+ }
+ }
+
+ /* Transform the multibyte string. */
+ errno = 0;
+ result = strxfrm ((char *)s1, mbs2, n);
+ if (errno != 0)
+ {
+ /* An error occurred. */
+ if (mbs2 != mbbuf2)
+ {
+ saved_errno = errno;
+ free (mbs2);
+ errno = saved_errno;
+ }
+ return 0;
+ }
+
+ if (result < n)
+ {
+ /* Convert the result by mapping char[] -> wchar_t[].
+ Since strcmp() compares the elements as 'unsigned char' values,
+ whereas wcscmp() compares the elements as 'wchar_t' values, we need
+ to map 1 'unsigned char' to 1 'wchar_t'. (We could also map 2
+ consecutive 'unsigned char' values to 1 'wchar_t' value, but this is
+ not needed. */
+ wchar_t *wcp = s1 + n;
+ char *cp = (char *)s1 + n;
+
+ while (wcp > s1)
+ *--wcp = (wchar_t) (unsigned char) *--cp;
+ }
+
+ if (mbs2 != mbbuf2)
+ free (mbs2);
+
+ /* No error. */
+ errno = saved_errno;
+ return result;
+ }
+
+ out_of_memory:
+ errno = ENOMEM;
+ return 0;
+
+ failed:
+ errno = EILSEQ;
+ return 0;
+}
--- /dev/null
+/* Transform wide string for comparison using the current locale.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "wcsxfrm-impl.h"
--- /dev/null
+/* Get descriptor for a wide character case conversion.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wctrans_t
+wctrans (const char *name)
+{
+ if (name[0] == 't'
+ && name[1] == 'o')
+ switch (name[2])
+ {
+ case 'l':
+ if (strcmp (name + 3, "ower") == 0)
+ return (wctrans_t) towlower;
+ break;
+ case 'u':
+ if (strcmp (name + 3, "pper") == 0)
+ return (wctrans_t) towupper;
+ break;
+ default:
+ break;
+ }
+ return NULL;
+}
--- /dev/null
+/* Get descriptor for a wide character case conversion.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+#include <string.h>
+
+#include "wctrans-impl.h"
--- /dev/null
+/* Get descriptor for a wide character property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wctype_t
+wctype (const char* name)
+{
+ switch (name[0])
+ {
+ case 'a':
+ switch (name[1])
+ {
+ case 'l':
+ switch (name[2])
+ {
+ case 'n':
+ if (strcmp (name + 3, "um") == 0)
+ return (wctype_t) iswalnum;
+ break;
+ case 'p':
+ if (strcmp (name + 3, "ha") == 0)
+ return (wctype_t) iswalpha;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 'b':
+ if (strcmp (name + 1, "lank") == 0)
+ return (wctype_t) iswblank;
+ break;
+ case 'c':
+ if (strcmp (name + 1, "ntrl") == 0)
+ return (wctype_t) iswcntrl;
+ break;
+ case 'd':
+ if (strcmp (name + 1, "igit") == 0)
+ return (wctype_t) iswdigit;
+ break;
+ case 'g':
+ if (strcmp (name + 1, "raph") == 0)
+ return (wctype_t) iswgraph;
+ break;
+ case 'l':
+ if (strcmp (name + 1, "ower") == 0)
+ return (wctype_t) iswlower;
+ break;
+ case 'p':
+ switch (name[1])
+ {
+ case 'r':
+ if (strcmp (name + 2, "int") == 0)
+ return (wctype_t) iswprint;
+ break;
+ case 'u':
+ if (strcmp (name + 2, "nct") == 0)
+ return (wctype_t) iswpunct;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 's':
+ if (strcmp (name + 1, "pace") == 0)
+ return (wctype_t) iswspace;
+ break;
+ case 'u':
+ if (strcmp (name + 1, "pper") == 0)
+ return (wctype_t) iswupper;
+ break;
+ case 'x':
+ if (strcmp (name + 1, "digit") == 0)
+ return (wctype_t) iswxdigit;
+ break;
+ default:
+ break;
+ }
+ return NULL;
+}
--- /dev/null
+/* Get descriptor for a wide character property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+#include <string.h>
+
+#include "wctype-impl.h"
#endif
+#if !GNULIB_defined_wctype_functions
+
/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
Linux libc5 has <wctype.h> and the functions but they are broken.
Assume all 11 functions (all isw* except iswblank) are implemented the
same way, or not at all. */
-#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
refer to system functions like _iswctype that are not in the
standard C library. Rather than try to get ancient buggy
implementations like this to work, just disable them. */
-# undef iswalnum
-# undef iswalpha
-# undef iswblank
-# undef iswcntrl
-# undef iswdigit
-# undef iswgraph
-# undef iswlower
-# undef iswprint
-# undef iswpunct
-# undef iswspace
-# undef iswupper
-# undef iswxdigit
-# undef towlower
-# undef towupper
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
-# if @REPLACE_ISWCNTRL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iswalnum rpl_iswalnum
-# define iswalpha rpl_iswalpha
-# define iswblank rpl_iswblank
-# define iswcntrl rpl_iswcntrl
-# define iswdigit rpl_iswdigit
-# define iswgraph rpl_iswgraph
-# define iswlower rpl_iswlower
-# define iswprint rpl_iswprint
-# define iswpunct rpl_iswpunct
-# define iswspace rpl_iswspace
-# define iswupper rpl_iswupper
-# define iswxdigit rpl_iswxdigit
-# define towlower rpl_towlower
-# define towupper rpl_towupper
+# if @REPLACE_ISWCNTRL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
# endif
-# endif
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswalnum
-# else
+# else
iswalnum
-# endif
+# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswalpha
-# else
+# else
iswalpha
-# endif
+# endif
(wint_t wc)
{
return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswblank
-# else
+# else
iswblank
-# endif
+# endif
(wint_t wc)
{
return wc == ' ' || wc == '\t';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswcntrl
-# else
+# else
iswcntrl
-# endif
+# endif
(wint_t wc)
{
return (wc & ~0x1f) == 0 || wc == 0x7f;
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswdigit
-# else
+# else
iswdigit
-# endif
+# endif
(wint_t wc)
{
return wc >= '0' && wc <= '9';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswgraph
-# else
+# else
iswgraph
-# endif
+# endif
(wint_t wc)
{
return wc >= '!' && wc <= '~';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswlower
-# else
+# else
iswlower
-# endif
+# endif
(wint_t wc)
{
return wc >= 'a' && wc <= 'z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswprint
-# else
+# else
iswprint
-# endif
+# endif
(wint_t wc)
{
return wc >= ' ' && wc <= '~';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswpunct
-# else
+# else
iswpunct
-# endif
+# endif
(wint_t wc)
{
return (wc >= '!' && wc <= '~'
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswspace
-# else
+# else
iswspace
-# endif
+# endif
(wint_t wc)
{
return (wc == ' ' || wc == '\t'
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswupper
-# else
+# else
iswupper
-# endif
+# endif
(wint_t wc)
{
return wc >= 'A' && wc <= 'Z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswxdigit
-# else
+# else
iswxdigit
-# endif
+# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
}
static inline wint_t
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_towlower
-# else
+# else
towlower
-# endif
+# endif
(wint_t wc)
{
return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
}
static inline wint_t
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_towupper
-# else
+# else
towupper
-# endif
+# endif
(wint_t wc)
{
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
-#elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
+# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
/* Only the iswblank function is missing. */
-# if @REPLACE_ISWBLANK@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iswblank rpl_iswblank
-# endif
+# if @REPLACE_ISWBLANK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswblank rpl_iswblank
+# endif
_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
-# else
+# else
_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
-# endif
+# endif
-#endif
+# endif
-#if defined __MINGW32__
+# if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
{
return (wint_t) (wchar_t) towlower (wc);
}
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define towlower rpl_towlower
-# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# endif
static inline wint_t
rpl_towupper (wint_t wc)
{
return (wint_t) (wchar_t) towupper (wc);
}
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define towupper rpl_towupper
-# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towupper rpl_towupper
+# endif
-#endif /* __MINGW32__ */
+# endif /* __MINGW32__ */
+
+# define GNULIB_defined_wctype_functions 1
+#endif
#if @REPLACE_ISWCNTRL@
_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
#else
_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
-# if @REPLACE_ISWBLANK@
-_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
-# else
-_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
-# endif
_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
#endif
_GL_CXXALIASWARN (iswalnum);
_GL_CXXALIASWARN (iswalpha);
-_GL_CXXALIASWARN (iswblank);
_GL_CXXALIASWARN (iswcntrl);
_GL_CXXALIASWARN (iswdigit);
_GL_CXXALIASWARN (iswgraph);
_GL_CXXALIASWARN (iswupper);
_GL_CXXALIASWARN (iswxdigit);
+#if @GNULIB_ISWBLANK@
+# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+_GL_CXXALIASWARN (iswblank);
+#endif
+
+#if !@HAVE_WCTYPE_T@
+# if !GNULIB_defined_wctype_t
+typedef void * wctype_t;
+# define GNULIB_defined_wctype_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character property. */
+#if @GNULIB_WCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
+_GL_CXXALIASWARN (wctype);
+#elif defined GNULIB_POSIXCHECK
+# undef wctype
+# if HAVE_RAW_DECL_WCTYPE
+_GL_WARN_ON_USE (wctype, "wctype is unportable - "
+ "use gnulib module wctype for portability");
+# endif
+#endif
+
+/* Test whether a wide character has a given property.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctype() function. */
+#if @GNULIB_ISWCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIASWARN (iswctype);
+#elif defined GNULIB_POSIXCHECK
+# undef iswctype
+# if HAVE_RAW_DECL_ISWCTYPE
+_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
+ "use gnulib module iswctype for portability");
+# endif
+#endif
+
#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
_GL_CXXALIASWARN (towlower);
_GL_CXXALIASWARN (towupper);
+#if !@HAVE_WCTRANS_T@
+# if !GNULIB_defined_wctrans_t
+typedef void * wctrans_t;
+# define GNULIB_defined_wctrans_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character case conversion. */
+#if @GNULIB_WCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
+_GL_CXXALIASWARN (wctrans);
+#elif defined GNULIB_POSIXCHECK
+# undef wctrans
+# if HAVE_RAW_DECL_WCTRANS
+_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
+ "use gnulib module wctrans for portability");
+# endif
+#endif
+
+/* Perform a given case conversion on a wide character.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctrans() function. */
+#if @GNULIB_TOWCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# endif
+_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+_GL_CXXALIASWARN (towctrans);
+#elif defined GNULIB_POSIXCHECK
+# undef towctrans
+# if HAVE_RAW_DECL_TOWCTRANS
+_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
+ "use gnulib module towctrans for portability");
+# endif
+#endif
+
#endif /* _GL_WCTYPE_H */
#endif /* _GL_WCTYPE_H */
--- /dev/null
+/* Search wide character array for a wide character.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wmemchr (const wchar_t *s, wchar_t c, size_t n)
+{
+ for (; n > 0; s++, n--)
+ {
+ if (*s == c)
+ return (wchar_t *) s;
+ }
+ return NULL;
+}
--- /dev/null
+/* Search wide character array for a wide character.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemchr-impl.h"
--- /dev/null
+/* Compare wide character arrays.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ for (; n > 0;)
+ {
+ wchar_t wc1 = *s1++;
+ wchar_t wc2 = *s2++;
+ if (wc1 == wc2)
+ {
+ n--;
+ continue;
+ }
+ /* Note that wc1 and wc2 each have at most 31 bits. */
+ return (int)wc1 - (int)wc2;
+ /* > 0 if wc1 > wc2, < 0 if wc1 < wc2. */
+ }
+ return 0;
+}
--- /dev/null
+/* Compare wide character arrays.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemcmp-impl.h"
--- /dev/null
+/* Copy wide character array.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wmemcpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ wchar_t *destptr = dest;
+
+ for (; n > 0; n--)
+ *destptr++ = *src++;
+ return dest;
+}
--- /dev/null
+/* Copy wide character array.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemcpy-impl.h"
--- /dev/null
+/* Copy wide character array.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wmemmove (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ if (dest < src)
+ {
+ wchar_t *destptr = dest;
+ const wchar_t *srcptr = src;
+ for (; n > 0; n--)
+ *destptr++ = *srcptr++;
+ }
+ else if (dest > src)
+ {
+ wchar_t *destptr = dest + n - 1;
+ const wchar_t *srcptr = src + n - 1;
+ for (; n > 0; n--)
+ *destptr-- = *srcptr--;
+ }
+ return dest;
+}
--- /dev/null
+/* Copy wide character array.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemmove-impl.h"
--- /dev/null
+/* Fill wide character array.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+wchar_t *
+wmemset (wchar_t *s, wchar_t c, size_t n)
+{
+ wchar_t *ptr = s;
+
+ for (; n > 0; n--)
+ *ptr++ = c;
+ return s;
+}
--- /dev/null
+/* Fill wide character array.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemset-impl.h"
-# serial 4
+# serial 5
# See if we need to provide fdopendir.
dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <dirent.h>
#include <fcntl.h>
+#include <unistd.h>
#if !HAVE_DECL_FDOPENDIR
extern DIR *fdopendir (int);
#endif
-]], [int fd = open ("conftest.c", O_RDONLY);
- if (fd < 0) return 2;
- return !!fdopendir (fd);])],
+]], [int result = 0;
+ int fd = open ("conftest.c", O_RDONLY);
+ if (fd < 0) result |= 1;
+ if (fdopendir (fd)) result |= 2;
+ if (close (fd)) result |= 4;
+ return result;])],
[gl_cv_func_fdopendir_works=yes],
[gl_cv_func_fdopendir_works=no],
[gl_cv_func_fdopendir_works="guessing no"])])
--- /dev/null
+# iswblank.m4 serial 2
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWBLANK],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ dnl Persuade glibc <wctype.h> to declare iswblank().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([iswblank])
+ AC_CHECK_DECLS_ONCE([iswblank])
+ if test $ac_cv_func_iswblank = no; then
+ HAVE_ISWBLANK=0
+ if test $ac_cv_have_decl_iswblank = yes; then
+ REPLACE_ISWBLANK=1
+ fi
+ fi
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+ dnl Redefine only iswblank.
+ AC_LIBOBJ([iswblank])
+ fi
+ fi
+
+])
--- /dev/null
+# iswctype.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWCTYPE],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTYPE_T = 0; then
+ AC_LIBOBJ([iswctype])
+ fi
+])
-# serial 1
+# serial 3
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_RANDOM_R],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
+ if test $ac_cv_header_random_h = no; then
+ HAVE_RANDOM_H=0
+ fi
+
+ AC_CHECK_TYPES([struct random_data],
+ [], [HAVE_STRUCT_RANDOM_DATA=0],
+ [[#include <stdlib.h>
+ #if HAVE_RANDOM_H
+ # include <random.h>
+ #endif
+ ]])
+
AC_CHECK_FUNCS([random_r])
if test $ac_cv_func_random_r = no; then
HAVE_RANDOM_R=0
-# setenv.m4 serial 20
+# setenv.m4 serial 21
dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
fi
dnl Solaris 10 unsetenv does not remove all copies of a name.
+ dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
dnl OpenBSD 4.7 unsetenv("") does not fail.
AC_CACHE_CHECK([whether unsetenv obeys POSIX],
[gl_cv_func_unsetenv_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
#include <errno.h>
+ extern char **environ;
]], [[
- char entry[] = "b=2";
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
if (putenv ((char *) "a=1")) return 1;
- if (putenv (entry)) return 2;
- entry[0] = 'a';
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
unsetenv ("a");
if (getenv ("a")) return 3;
if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
]])],
[gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
[gl_cv_func_unsetenv_works="guessing no"])])
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-#serial 3
+#serial 4
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
[
- AC_REQUIRE([AC_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
# Define two additional variables used in the Makefile substitution.
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-# This version of the macro is needed in autoconf <= 2.67. Autoconf has
-# it built in since 2.60, but we want the tweaks from the 2.68 version
-# to avoid rejecting xlc and clang due to relying on extensions.
+# This version of the macro is needed in autoconf <= 2.68.
-AC_DEFUN([AC_HEADER_STDBOOL],
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
[AC_CACHE_CHECK([for stdbool.h that conforms to C99],
[ac_cv_header_stdbool_h],
[AC_COMPILE_IFELSE(
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
AC_CHECK_TYPES([_Bool])
- if test $ac_cv_header_stdbool_h = yes; then
- AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
- fi])
+])
-# stdlib_h.m4 serial 34
+# stdlib_h.m4 serial 36
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
gl_NEXT_HEADERS([stdlib.h])
- AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
- if test $ac_cv_header_random_h = yes; then
- HAVE_RANDOM_H=1
- else
- HAVE_RANDOM_H=0
- fi
- AC_SUBST([HAVE_RANDOM_H])
- AC_CHECK_TYPES([struct random_data],
- [], [HAVE_STRUCT_RANDOM_DATA=0],
- [[#include <stdlib.h>
- #if HAVE_RANDOM_H
- # include <random.h>
- #endif
- ]])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
if test $ac_cv_func_strerror_r = yes; then
if test -z "$ERRNO_H"; then
dnl The POSIX prototype is: int strerror_r (int, char *, size_t);
- dnl glibc's prototype: char *strerror_r (int, char *, size_t);
+ dnl glibc, Cygwin: char *strerror_r (int, char *, size_t);
dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int);
AC_CACHE_CHECK([for strerror_r with POSIX signature],
[gl_cv_func_strerror_r_posix_signature],
--- /dev/null
+# towctrans.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_TOWCTRANS],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTRANS_T = 0; then
+ AC_LIBOBJ([towctrans])
+ fi
+])
dnl Written by Eric Blake.
-# wchar_h.m4 serial 37
+# wchar_h.m4 serial 38
AC_DEFUN([gl_WCHAR_H],
[
# include <time.h>
#endif
#include <wchar.h>
- ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth])
+ ]],
+ [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+ wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+ wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+ wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+ wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+ ])
])
dnl Check whether <wchar.h> is usable at all.
AC_DEFUN([gl_WCHAR_H_DEFAULTS],
[
- GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
- GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
- GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
- GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
- GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
- GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
- GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
- GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
- GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
- GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
- GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+ GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
+ GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
+ GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
+ GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
+ GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
+ GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
+ GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
+ GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
+ GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
+ GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
+ GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+ GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR])
+ GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP])
+ GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY])
+ GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE])
+ GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET])
+ GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN])
+ GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN])
+ GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY])
+ GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY])
+ GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY])
+ GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY])
+ GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT])
+ GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT])
+ GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP])
+ GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP])
+ GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP])
+ GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP])
+ GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL])
+ GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM])
+ GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP])
+ GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR])
+ GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR])
+ GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN])
+ GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN])
+ GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK])
+ GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR])
+ GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK])
+ GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
+ HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR])
+ HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
+ HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY])
+ HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE])
+ HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET])
+ HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN])
+ HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN])
+ HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY])
+ HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY])
+ HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY])
+ HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY])
+ HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT])
+ HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT])
+ HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP])
+ HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP])
+ HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP])
+ HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP])
+ HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL])
+ HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM])
+ HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP])
+ HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR])
+ HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR])
+ HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN])
+ HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN])
+ HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK])
+ HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR])
+ HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK])
+ HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH])
HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
+ REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
])
--- /dev/null
+# wcpcpy.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCPCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcpcpy])
+ if test $ac_cv_func_wcpcpy = no; then
+ HAVE_WCPCPY=0
+ AC_LIBOBJ([wcpcpy])
+ fi
+])
--- /dev/null
+# wcpncpy.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCPNCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcpncpy])
+ if test $ac_cv_func_wcpncpy = no; then
+ HAVE_WCPNCPY=0
+ AC_LIBOBJ([wcpncpy])
+ fi
+])
--- /dev/null
+# wcscasecmp.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCASECMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscasecmp])
+ if test $ac_cv_func_wcscasecmp = no; then
+ HAVE_WCSCASECMP=0
+ AC_LIBOBJ([wcscasecmp])
+ fi
+])
--- /dev/null
+# wcscat.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCAT],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscat])
+ if test $ac_cv_func_wcscat = no; then
+ HAVE_WCSCAT=0
+ AC_LIBOBJ([wcscat])
+ fi
+])
--- /dev/null
+# wcschr.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCHR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcschr])
+ if test $ac_cv_func_wcschr = no; then
+ HAVE_WCSCHR=0
+ AC_LIBOBJ([wcschr])
+ fi
+])
--- /dev/null
+# wcscmp.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscmp])
+ if test $ac_cv_func_wcscmp = no; then
+ HAVE_WCSCMP=0
+ AC_LIBOBJ([wcscmp])
+ fi
+])
--- /dev/null
+# wcscoll.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCOLL],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscoll])
+ if test $ac_cv_func_wcscoll = no; then
+ HAVE_WCSCOLL=0
+ AC_LIBOBJ([wcscoll])
+ fi
+])
--- /dev/null
+# wcscpy.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscpy])
+ if test $ac_cv_func_wcscpy = no; then
+ HAVE_WCSCPY=0
+ AC_LIBOBJ([wcscpy])
+ fi
+])
--- /dev/null
+# wcscspn.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSCSPN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscspn])
+ if test $ac_cv_func_wcscspn = no; then
+ HAVE_WCSCSPN=0
+ AC_LIBOBJ([wcscspn])
+ fi
+])
--- /dev/null
+# wcsdup.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSDUP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsdup])
+ if test $ac_cv_func_wcsdup = no; then
+ HAVE_WCSDUP=0
+ AC_LIBOBJ([wcsdup])
+ fi
+])
--- /dev/null
+# wcslen.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSLEN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcslen])
+ if test $ac_cv_func_wcslen = no; then
+ HAVE_WCSLEN=0
+ AC_LIBOBJ([wcslen])
+ fi
+])
--- /dev/null
+# wcsncasecmp.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSNCASECMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsncasecmp])
+ if test $ac_cv_func_wcsncasecmp = no; then
+ HAVE_WCSNCASECMP=0
+ AC_LIBOBJ([wcsncasecmp])
+ fi
+])
--- /dev/null
+# wcsncat.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSNCAT],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsncat])
+ if test $ac_cv_func_wcsncat = no; then
+ HAVE_WCSNCAT=0
+ AC_LIBOBJ([wcsncat])
+ fi
+])
--- /dev/null
+# wcsncmp.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSNCMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsncmp])
+ if test $ac_cv_func_wcsncmp = no; then
+ HAVE_WCSNCMP=0
+ AC_LIBOBJ([wcsncmp])
+ fi
+])
--- /dev/null
+# wcsncpy.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSNCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsncpy])
+ if test $ac_cv_func_wcsncpy = no; then
+ HAVE_WCSNCPY=0
+ AC_LIBOBJ([wcsncpy])
+ fi
+])
--- /dev/null
+# wcsnlen.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSNLEN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsnlen])
+ if test $ac_cv_func_wcsnlen = no; then
+ HAVE_WCSNLEN=0
+ AC_LIBOBJ([wcsnlen])
+ fi
+])
--- /dev/null
+# wcspbrk.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSPBRK],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcspbrk])
+ if test $ac_cv_func_wcspbrk = no; then
+ HAVE_WCSPBRK=0
+ AC_LIBOBJ([wcspbrk])
+ fi
+])
--- /dev/null
+# wcsrchr.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSRCHR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsrchr])
+ if test $ac_cv_func_wcsrchr = no; then
+ HAVE_WCSRCHR=0
+ AC_LIBOBJ([wcsrchr])
+ fi
+])
--- /dev/null
+# wcsspn.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSSPN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsspn])
+ if test $ac_cv_func_wcsspn = no; then
+ HAVE_WCSSPN=0
+ AC_LIBOBJ([wcsspn])
+ fi
+])
--- /dev/null
+# wcsstr.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSSTR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsstr])
+ if test $ac_cv_func_wcsstr = no; then
+ HAVE_WCSSTR=0
+ AC_LIBOBJ([wcsstr])
+ fi
+])
--- /dev/null
+# wcstok.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSTOK],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcstok])
+ if test $ac_cv_func_wcstok = no; then
+ HAVE_WCSTOK=0
+ AC_LIBOBJ([wcstok])
+ fi
+])
--- /dev/null
+# wcswidth.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSWIDTH],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_WCWIDTH])
+ AC_CHECK_FUNCS_ONCE([wcswidth])
+ if test $ac_cv_func_wcswidth = no; then
+ HAVE_WCSWIDTH=0
+ else
+ if test $REPLACE_WCWIDTH = 1; then
+ dnl If wcwidth needed to be replaced, wcswidth needs to be replaced
+ dnl as well.
+ REPLACE_WCSWIDTH=1
+ fi
+ fi
+ if test $HAVE_WCSWIDTH = 0 || test $REPLACE_WCSWIDTH = 1; then
+ AC_LIBOBJ([wcswidth])
+ fi
+])
--- /dev/null
+# wcsxfrm.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCSXFRM],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcsxfrm])
+ if test $ac_cv_func_wcsxfrm = no; then
+ HAVE_WCSXFRM=0
+ AC_LIBOBJ([wcsxfrm])
+ fi
+])
--- /dev/null
+# wctrans.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCTRANS],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTRANS_T = 0; then
+ AC_LIBOBJ([wctrans])
+ fi
+])
--- /dev/null
+# wctype.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCTYPE],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTYPE_T = 0; then
+ AC_LIBOBJ([wctype])
+ fi
+])
-# wctype_h.m4 serial 12
+# wctype_h.m4 serial 14
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
AC_DEFUN([gl_WCTYPE_H],
[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS_ONCE([iswcntrl])
HAVE_ISWCNTRL=0
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_CHECK_FUNCS_ONCE([iswblank])
- AC_CHECK_DECLS_ONCE([iswblank])
- if test $ac_cv_func_iswblank = yes; then
- HAVE_ISWBLANK=1
- REPLACE_ISWBLANK=0
- else
- HAVE_ISWBLANK=0
- if test $ac_cv_have_decl_iswblank = yes; then
- REPLACE_ISWBLANK=1
- else
- REPLACE_ISWBLANK=0
- fi
- fi
- AC_SUBST([HAVE_ISWBLANK])
- AC_SUBST([REPLACE_ISWBLANK])
AC_REQUIRE([AC_C_INLINE])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
:
- else
- if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
- dnl Redefine only iswblank.
- AC_LIBOBJ([iswblank])
- fi
fi
+
+ dnl We assume that the wctype() and iswctype() functions exist if and only
+ dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that
+ dnl exists.
+ dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>.
+ AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctype_t=yes],
+ [gl_cv_type_wctype_t=no])
+ ])
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ dnl We assume that the wctrans() and towctrans() functions exist if and only
+ dnl if the type wctrans_t is defined in <wctype.h>.
+ AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctrans_t=yes],
+ [gl_cv_type_wctrans_t=no])
+ ])
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+ ]],
+ [wctype iswctype wctrans towctrans
+ ])
+])
+
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+ GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
+ GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
+ GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE])
+ GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS])
+ GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
+ HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
+ HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
+ REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
])
--- /dev/null
+# wmemchr.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMCHR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemchr])
+ if test $ac_cv_func_wmemchr = no; then
+ HAVE_WMEMCHR=0
+ AC_LIBOBJ([wmemchr])
+ fi
+])
--- /dev/null
+# wmemcmp.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMCMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemcmp])
+ if test $ac_cv_func_wmemcmp = no; then
+ HAVE_WMEMCMP=0
+ AC_LIBOBJ([wmemcmp])
+ fi
+])
--- /dev/null
+# wmemcpy.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemcpy])
+ if test $ac_cv_func_wmemcpy = no; then
+ HAVE_WMEMCPY=0
+ AC_LIBOBJ([wmemcpy])
+ fi
+])
--- /dev/null
+# wmemmove.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMMOVE],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemmove])
+ if test $ac_cv_func_wmemmove = no; then
+ HAVE_WMEMMOVE=0
+ AC_LIBOBJ([wmemmove])
+ fi
+])
--- /dev/null
+# wmemset.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WMEMSET],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemset])
+ if test $ac_cv_func_wmemset = no; then
+ HAVE_WMEMSET=0
+ AC_LIBOBJ([wmemset])
+ fi
+])
--- /dev/null
+Description:
+manipulate sets of device-inode pairs efficiently
+
+Files:
+lib/di-set.c
+lib/di-set.h
+
+Depends-on:
+ino-map
+hash
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += di-set.c di-set.h
+
+Include:
+"di-set.h"
+
+License
+GPL
+
+Maintainer:
+Jim Meyering
--- /dev/null
+Files:
+tests/test-di-set.c
+tests/macros.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-di-set
+check_PROGRAMS += test-di-set
alloca
stdbool
wchar
-wctype
+wctype-h
memchr
memcmp
mbsrtowcs
m4/getloadavg.m4
Depends-on:
-c-strtod
-cloexec
extensions
-fcntl-safer
intprops
stdbool
stdlib
--- /dev/null
+Description:
+maintain a mapping of ino_t numbers to small integers
+
+Files:
+lib/ino-map.c
+lib/ino-map.h
+
+Depends-on:
+hash
+verify
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += ino-map.c ino-map.h
+
+Include:
+"ino-map.h"
+
+License
+GPL
+
+Maintainer:
+Jim Meyering
--- /dev/null
+Files:
+tests/test-ino-map.c
+tests/macros.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-ino-map
+check_PROGRAMS += test-ino-map
--- /dev/null
+Description:
+iswblank() function: test wide character for being blank.
+
+Files:
+lib/iswblank.c
+m4/iswblank.m4
+
+Depends-on:
+wctype-h
+extensions
+
+configure.ac:
+gl_FUNC_ISWBLANK
+gl_WCTYPE_MODULE_INDICATOR([iswblank])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Files:
+tests/test-iswblank.c
+tests/macros.h
+
+Depends-on:
+wctype-h-c++-tests
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-iswblank
+check_PROGRAMS += test-iswblank
--- /dev/null
+Description:
+iswctype() function: test whether a wide character has a given property.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/iswctype.c
+lib/iswctype-impl.h
+m4/iswctype.m4
+
+Depends-on:
+wctype-h
+
+configure.ac:
+gl_FUNC_ISWCTYPE
+gl_WCTYPE_MODULE_INDICATOR([iswctype])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
-e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
-e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
-e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
- -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+ < $(srcdir)/math.in.h | \
+ sed -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
-e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
-e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
-e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
-e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
-e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
-e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
- -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
+ | \
+ sed -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
-e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
-e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
-e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
-e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/math.in.h; \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += math.h math.h-t
extensions
stdbool
wchar
-wctype
+wctype-h
+iswblank
wcwidth
memcmp
Files:
lib/mbsnrtowcs.c
+lib/mbsnrtowcs-impl.h
lib/mbsrtowcs-state.c
m4/mbsnrtowcs.m4
m4/mbstate_t.m4
Files:
lib/mbsrtowcs.c
+lib/mbsrtowcs-impl.h
lib/mbsrtowcs-state.c
m4/mbsrtowcs.m4
m4/mbstate_t.m4
Depends-on:
wchar
-wctype
+wctype-h
mbrtowc
mbsinit
wcwidth
quotearg-simple
stdbool
wchar
-wctype
+wctype-h
xalloc
configure.ac:
ssize_t
wchar
wcrtomb
-wctype
+wctype-h
configure.ac:
gl_REGEX
c++defs
include_next
stddef
-stdint
unistd
warn-on-use
-e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
-e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
-e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
- -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/stdlib.in.h; \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
--- /dev/null
+Description:
+towctrans() function: convert a wide character using a case mapping.
+
+Files:
+lib/towctrans.c
+lib/towctrans-impl.h
+m4/towctrans.m4
+
+Depends-on:
+wctype-h
+
+configure.ac:
+gl_FUNC_TOWCTRANS
+gl_WCTYPE_MODULE_INDICATOR([towctrans])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ | \
+ sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
-e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
-e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''GNULIB_WMEMCHR''@|$(GNULIB_WMEMCHR)|g' \
+ -e 's|@''GNULIB_WMEMCMP''@|$(GNULIB_WMEMCMP)|g' \
+ -e 's|@''GNULIB_WMEMCPY''@|$(GNULIB_WMEMCPY)|g' \
+ -e 's|@''GNULIB_WMEMMOVE''@|$(GNULIB_WMEMMOVE)|g' \
+ -e 's|@''GNULIB_WMEMSET''@|$(GNULIB_WMEMSET)|g' \
+ -e 's|@''GNULIB_WCSLEN''@|$(GNULIB_WCSLEN)|g' \
+ -e 's|@''GNULIB_WCSNLEN''@|$(GNULIB_WCSNLEN)|g' \
+ -e 's|@''GNULIB_WCSCPY''@|$(GNULIB_WCSCPY)|g' \
+ -e 's|@''GNULIB_WCPCPY''@|$(GNULIB_WCPCPY)|g' \
+ -e 's|@''GNULIB_WCSNCPY''@|$(GNULIB_WCSNCPY)|g' \
+ -e 's|@''GNULIB_WCPNCPY''@|$(GNULIB_WCPNCPY)|g' \
+ -e 's|@''GNULIB_WCSCAT''@|$(GNULIB_WCSCAT)|g' \
+ -e 's|@''GNULIB_WCSNCAT''@|$(GNULIB_WCSNCAT)|g' \
+ -e 's|@''GNULIB_WCSCMP''@|$(GNULIB_WCSCMP)|g' \
+ -e 's|@''GNULIB_WCSNCMP''@|$(GNULIB_WCSNCMP)|g' \
+ -e 's|@''GNULIB_WCSCASECMP''@|$(GNULIB_WCSCASECMP)|g' \
+ -e 's|@''GNULIB_WCSNCASECMP''@|$(GNULIB_WCSNCASECMP)|g' \
+ -e 's|@''GNULIB_WCSCOLL''@|$(GNULIB_WCSCOLL)|g' \
+ -e 's|@''GNULIB_WCSXFRM''@|$(GNULIB_WCSXFRM)|g' \
+ -e 's|@''GNULIB_WCSDUP''@|$(GNULIB_WCSDUP)|g' \
+ -e 's|@''GNULIB_WCSCHR''@|$(GNULIB_WCSCHR)|g' \
+ -e 's|@''GNULIB_WCSRCHR''@|$(GNULIB_WCSRCHR)|g' \
+ -e 's|@''GNULIB_WCSCSPN''@|$(GNULIB_WCSCSPN)|g' \
+ -e 's|@''GNULIB_WCSSPN''@|$(GNULIB_WCSSPN)|g' \
+ -e 's|@''GNULIB_WCSPBRK''@|$(GNULIB_WCSPBRK)|g' \
+ -e 's|@''GNULIB_WCSSTR''@|$(GNULIB_WCSSTR)|g' \
+ -e 's|@''GNULIB_WCSTOK''@|$(GNULIB_WCSTOK)|g' \
+ -e 's|@''GNULIB_WCSWIDTH''@|$(GNULIB_WCSWIDTH)|g' \
+ < $(srcdir)/wchar.in.h | \
+ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
-e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
-e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
-e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
-e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
-e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+ -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+ -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+ -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+ -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+ -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+ -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+ -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+ -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+ -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+ -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+ -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+ -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+ -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+ -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+ -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+ -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+ -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+ -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+ -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+ -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
-e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ | \
+ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
-e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
-e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
-e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
-e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
-e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+ -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/wchar.in.h; \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += wchar.h wchar.h-t
--- /dev/null
+Description:
+wcpcpy() function: copy a wide string.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcpcpy.c
+lib/wcpcpy-impl.h
+m4/wcpcpy.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCPCPY
+gl_WCHAR_MODULE_INDICATOR([wcpcpy])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcpncpy() function: copy a size-bounded wide string.
+
+Files:
+lib/wcpncpy.c
+lib/wcpncpy-impl.h
+m4/wcpncpy.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCPNCPY
+gl_WCHAR_MODULE_INDICATOR([wcpncpy])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscasecmp() function: compare two wide strings ignoring case.
+
+Files:
+lib/wcscasecmp.c
+lib/wcscasecmp-impl.h
+m4/wcscasecmp.m4
+
+Depends-on:
+wchar
+wctype-h
+
+configure.ac:
+gl_FUNC_WCSCASECMP
+gl_WCHAR_MODULE_INDICATOR([wcscasecmp])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscat() function: concatenate two wide strings.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcscat.c
+lib/wcscat-impl.h
+m4/wcscat.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSCAT
+gl_WCHAR_MODULE_INDICATOR([wcscat])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcschr() function: search wide string for a wide character.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcschr.c
+lib/wcschr-impl.h
+m4/wcschr.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSCHR
+gl_WCHAR_MODULE_INDICATOR([wcschr])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscmp() function: compare two wide strings.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcscmp.c
+lib/wcscmp-impl.h
+m4/wcscmp.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSCMP
+gl_WCHAR_MODULE_INDICATOR([wcscmp])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscoll() function: compare two wide strings using the current locale.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcscoll.c
+lib/wcscoll-impl.h
+m4/wcscoll.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSCOLL
+gl_WCHAR_MODULE_INDICATOR([wcscoll])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscpy() function: copy a wide string.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcscpy.c
+lib/wcscpy-impl.h
+m4/wcscpy.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSCPY
+gl_WCHAR_MODULE_INDICATOR([wcscpy])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcscspn() function: search a wide string for any of a set of wide characters.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcscspn.c
+lib/wcscspn-impl.h
+m4/wcscspn.m4
+
+Depends-on:
+wchar
+wcslen
+wcschr
+
+configure.ac:
+gl_FUNC_WCSCSPN
+gl_WCHAR_MODULE_INDICATOR([wcscspn])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsdup() function: duplicate a wide string.
+
+Files:
+lib/wcsdup.c
+lib/wcsdup-impl.h
+m4/wcsdup.m4
+
+Depends-on:
+wchar
+wcslen
+wmemcpy
+
+configure.ac:
+gl_FUNC_WCSDUP
+gl_WCHAR_MODULE_INDICATOR([wcsdup])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcslen() function: determine the length of a wide string.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcslen.c
+lib/wcslen-impl.h
+m4/wcslen.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSLEN
+gl_WCHAR_MODULE_INDICATOR([wcslen])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsncasecmp() function: compare two wide strings ignoring case.
+
+Files:
+lib/wcsncasecmp.c
+lib/wcsncasecmp-impl.h
+m4/wcsncasecmp.m4
+
+Depends-on:
+wchar
+wctype-h
+
+configure.ac:
+gl_FUNC_WCSNCASECMP
+gl_WCHAR_MODULE_INDICATOR([wcsncasecmp])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsncat() function: append part of a wide string to a wide string.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcsncat.c
+lib/wcsncat-impl.h
+m4/wcsncat.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSNCAT
+gl_WCHAR_MODULE_INDICATOR([wcsncat])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsncmp() function: compare two wide strings.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcsncmp.c
+lib/wcsncmp-impl.h
+m4/wcsncmp.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSNCMP
+gl_WCHAR_MODULE_INDICATOR([wcsncmp])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsncpy() function: copy a size-bounded wide string.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcsncpy.c
+lib/wcsncpy-impl.h
+m4/wcsncpy.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSNCPY
+gl_WCHAR_MODULE_INDICATOR([wcsncpy])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsnlen() function: determine the length of a size-bounded wide string.
+
+Files:
+lib/wcsnlen.c
+lib/wcsnlen-impl.h
+m4/wcsnlen.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSNLEN
+gl_WCHAR_MODULE_INDICATOR([wcsnlen])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
Files:
lib/wcsnrtombs.c
+lib/wcsnrtombs-impl.h
lib/wcsrtombs-state.c
m4/wcsnrtombs.m4
m4/mbrtowc.m4
--- /dev/null
+Description:
+wcspbrk() function: search a wide string for any of a set of wide characters.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcspbrk.c
+lib/wcspbrk-impl.h
+m4/wcspbrk.m4
+
+Depends-on:
+wchar
+wcschr
+
+configure.ac:
+gl_FUNC_WCSPBRK
+gl_WCHAR_MODULE_INDICATOR([wcspbrk])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsrchr() function: search wide string for a wide character.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcsrchr.c
+lib/wcsrchr-impl.h
+m4/wcsrchr.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSRCHR
+gl_WCHAR_MODULE_INDICATOR([wcsrchr])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
Files:
lib/wcsrtombs.c
+lib/wcsrtombs-impl.h
lib/wcsrtombs-state.c
m4/wcsrtombs.m4
m4/mbrtowc.m4
--- /dev/null
+Description:
+wcsspn() function: advance in a wide string, skipping any of a set of wide characters.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/wcsspn.c
+lib/wcsspn-impl.h
+m4/wcsspn.m4
+
+Depends-on:
+wchar
+wcschr
+
+configure.ac:
+gl_FUNC_WCSSPN
+gl_WCHAR_MODULE_INDICATOR([wcsspn])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsstr() function: locate a substring in a wide string.
+
+Files:
+lib/wcsstr.c
+lib/wcsstr-impl.h
+m4/wcsstr.m4
+
+Depends-on:
+wchar
+wcschr
+
+configure.ac:
+gl_FUNC_WCSSTR
+gl_WCHAR_MODULE_INDICATOR([wcsstr])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcstok() function: split a wide string into tokens.
+
+Files:
+lib/wcstok.c
+lib/wcstok-impl.h
+m4/wcstok.m4
+
+Depends-on:
+wchar
+wcsspn
+wcspbrk
+
+configure.ac:
+gl_FUNC_WCSTOK
+gl_WCHAR_MODULE_INDICATOR([wcstok])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcswidth() function: determine number of screen columns needed for a
+size-bounded wide string.
+
+Files:
+lib/wcswidth.c
+lib/wcswidth-impl.h
+m4/wcswidth.m4
+
+Depends-on:
+wchar
+wcwidth
+
+configure.ac:
+gl_FUNC_WCSWIDTH
+gl_WCHAR_MODULE_INDICATOR([wcswidth])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wcsxfrm() function: transform wide string for comparison using the current
+locale.
+
+Files:
+lib/wcsxfrm.c
+lib/wcsxfrm-impl.h
+m4/wcsxfrm.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WCSXFRM
+gl_WCHAR_MODULE_INDICATOR([wcsxfrm])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wctrans() function: get descriptor for a wide character case conversion.
+
+Files:
+lib/wctrans.c
+lib/wctrans-impl.h
+m4/wctrans.m4
+
+Depends-on:
+wctype-h
+
+configure.ac:
+gl_FUNC_WCTRANS
+gl_WCTYPE_MODULE_INDICATOR([wctrans])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
Description:
-A <wctype.h> that conforms better to C99.
+wctype() function: get descriptor for a wide character property.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
Files:
-lib/wctype.in.h
-lib/iswblank.c
-m4/wctype_h.m4
-m4/wint_t.m4
+lib/wctype.c
+lib/wctype-impl.h
+m4/wctype.m4
Depends-on:
-include_next
-c++defs
-warn-on-use
+wctype-h
+iswblank
configure.ac:
-gl_WCTYPE_H
+gl_FUNC_WCTYPE
+gl_WCTYPE_MODULE_INDICATOR([wctype])
Makefile.am:
-BUILT_SOURCES += wctype.h
-
-# We need the following in order to create <wctype.h> when the system
-# doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
- -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
- -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
- -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
- -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
- -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
- -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/wctype.in.h; \
- } > $@-t && \
- mv $@-t $@
-MOSTLYCLEANFILES += wctype.h wctype.h-t
Include:
<wctype.h>
License:
-LGPLv2+
+LGPL
Maintainer:
-all
+Bruno Haible
+++ /dev/null
-Files:
-tests/test-wctype-c++.cc
-tests/signature.h
-
-Status:
-c++-test
-
-Depends-on:
-ansi-c++-opt
-
-configure.ac:
-
-Makefile.am:
-if ANSICXX
-TESTS += test-wctype-c++
-check_PROGRAMS += test-wctype-c++
-test_wctype_c___SOURCES = test-wctype-c++.cc
-test_wctype_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
-endif
--- /dev/null
+Description:
+A <wctype.h> that conforms better to C99.
+
+Files:
+lib/wctype.in.h
+m4/wctype_h.m4
+m4/wint_t.m4
+
+Depends-on:
+include_next
+c++defs
+warn-on-use
+
+configure.ac:
+gl_WCTYPE_H
+
+Makefile.am:
+BUILT_SOURCES += wctype.h
+
+# We need the following in order to create <wctype.h> when the system
+# doesn't have one that works with the given compiler.
+wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
+ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+ -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+ -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
+ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/wctype.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += wctype.h wctype.h-t
+
+Include:
+<wctype.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
--- /dev/null
+Files:
+tests/test-wctype-h-c++.cc
+tests/signature.h
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-wctype-h-c++
+check_PROGRAMS += test-wctype-h-c++
+test_wctype_h_c___SOURCES = test-wctype-h-c++.cc
+test_wctype_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
+endif
--- /dev/null
+Files:
+tests/test-wctype-h.c
+tests/macros.h
+
+Depends-on:
+wctype-h-c++-tests
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-wctype-h
+check_PROGRAMS += test-wctype-h
+++ /dev/null
-Files:
-tests/test-wctype.c
-tests/macros.h
-
-Depends-on:
-wctype-c++-tests
-
-configure.ac:
-
-Makefile.am:
-TESTS += test-wctype
-check_PROGRAMS += test-wctype
Depends-on:
extensions
wchar
-wctype
+wctype-h
localcharset
streq
uniwidth/width
--- /dev/null
+Description:
+wmemchr() function: search wide character array for a wide character.
+
+Files:
+lib/wmemchr.c
+lib/wmemchr-impl.h
+m4/wmemchr.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WMEMCHR
+gl_WCHAR_MODULE_INDICATOR([wmemchr])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wmemcmp() function: compare wide character arrays.
+
+Files:
+lib/wmemcmp.c
+lib/wmemcmp-impl.h
+m4/wmemcmp.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WMEMCMP
+gl_WCHAR_MODULE_INDICATOR([wmemcmp])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wmemcpy() function: copy wide character array.
+
+Files:
+lib/wmemcpy.c
+lib/wmemcpy-impl.h
+m4/wmemcpy.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WMEMCPY
+gl_WCHAR_MODULE_INDICATOR([wmemcpy])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wmemmove() function: copy wide character array.
+
+Files:
+lib/wmemmove.c
+lib/wmemmove-impl.h
+m4/wmemmove.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WMEMMOVE
+gl_WCHAR_MODULE_INDICATOR([wmemmove])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Description:
+wmemset() function: fill wide character array.
+
+Files:
+lib/wmemset.c
+lib/wmemset-impl.h
+m4/wmemset.m4
+
+Depends-on:
+wchar
+
+configure.ac:
+gl_FUNC_WMEMSET
+gl_WCHAR_MODULE_INDICATOR([wmemset])
+
+Makefile.am:
+
+Include:
+<wchar.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+/* Test the di-set module.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "di-set.h"
+
+#include "macros.h"
+
+int
+main (void)
+{
+ struct di_set *dis = di_set_alloc ();
+ ASSERT (dis);
+
+ ASSERT (di_set_lookup (dis, 2, 5) == 0); /* initial lookup fails */
+ ASSERT (di_set_insert (dis, 2, 5) == 1); /* first insertion succeeds */
+ ASSERT (di_set_insert (dis, 2, 5) == 0); /* duplicate fails */
+ ASSERT (di_set_insert (dis, 3, 5) == 1); /* diff dev, duplicate inode is ok */
+ ASSERT (di_set_insert (dis, 2, 8) == 1); /* same dev, different inode is ok */
+ ASSERT (di_set_lookup (dis, 2, 5) == 1); /* now, the lookup succeeds */
+
+ /* very large (or negative) inode number */
+ ASSERT (di_set_insert (dis, 5, (ino_t) -1) == 1);
+ ASSERT (di_set_insert (dis, 5, (ino_t) -1) == 0); /* dup */
+
+ {
+ unsigned int i;
+ for (i = 0; i < 3000; i++)
+ ASSERT (di_set_insert (dis, 9, i) == 1);
+ for (i = 0; i < 3000; i++)
+ ASSERT (di_set_insert (dis, 9, i) == 0); /* duplicate fails */
+ }
+
+ di_set_free (dis);
+
+ return 0;
+}
--- /dev/null
+/* Test the ino-map module.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "ino-map.h"
+
+#include "macros.h"
+
+int
+main ()
+{
+ enum { INO_MAP_INIT = 123 };
+ struct ino_map *ino_map = ino_map_alloc (INO_MAP_INIT);
+ ASSERT (ino_map != NULL);
+
+ ASSERT (ino_map_insert (ino_map, 42) == INO_MAP_INIT);
+ ASSERT (ino_map_insert (ino_map, 42) == INO_MAP_INIT);
+ ASSERT (ino_map_insert (ino_map, 398) == INO_MAP_INIT + 1);
+ ASSERT (ino_map_insert (ino_map, 398) == INO_MAP_INIT + 1);
+ ASSERT (ino_map_insert (ino_map, 0) == INO_MAP_INIT + 2);
+ ASSERT (ino_map_insert (ino_map, 0) == INO_MAP_INIT + 2);
+
+ {
+ int i;
+ for (i = 0; i < 100; i++)
+ {
+ ASSERT (ino_map_insert (ino_map, 10000 + i) == INO_MAP_INIT + 3 + i);
+ }
+ }
+
+ ino_map_free (ino_map);
+
+ return 0;
+}
--- /dev/null
+/* Test of iswblank() function.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that WEOF is defined. */
+wint_t e = WEOF;
+
+int
+main (void)
+{
+ /* Check that the function exist as a function or as a macro. */
+ (void) iswblank (0);
+ /* Check that the isw* functions map WEOF to 0. */
+ ASSERT (!iswblank (e));
+
+ return 0;
+}
if (ret == 0)
{
/* Truncated result. POSIX allows this, and it actually
- happens on AIX 6.1. */
- ASSERT (strcmp (buf, "BADFACE") != 0);
+ happens on AIX 6.1 and Cygwin. */
+ ASSERT ((strcmp (buf, "BADFACE") == 0) == (i == 0));
}
else
{
SIGNATURE_CHECK (GNULIB_NAMESPACE::wcwidth, int, (wchar_t));
#endif
+#if GNULIB_TEST_WMEMCHR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemchr, wchar_t *,
+ (const wchar_t *, wchar_t, size_t));
+#endif
+
+#if GNULIB_TEST_WMEMCMP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemcmp, int,
+ (const wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WMEMCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemcpy, wchar_t *,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WMEMMOVE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemmove, wchar_t *,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WMEMSET
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemset, wchar_t *,
+ (wchar_t *, wchar_t, size_t));
+#endif
+
+#if GNULIB_TEST_WCSLEN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcslen, size_t, (const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSNLEN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsnlen, size_t, (const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscpy, wchar_t *,
+ (wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCPCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcpcpy, wchar_t *,
+ (wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSNCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsncpy, wchar_t *,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCPNCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcpncpy, wchar_t *,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSCAT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscat, wchar_t *,
+ (wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSNCAT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsncat, wchar_t *,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSCMP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscmp, int,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSNCMP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsncmp, int,
+ (const wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSCASECMP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscasecmp, int,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSNCASECMP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsncasecmp, int,
+ (const wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSCOLL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscoll, int,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSXFRM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsxfrm, size_t,
+ (wchar_t *, const wchar_t *, size_t));
+#endif
+
+#if GNULIB_TEST_WCSDUP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsdup, wchar_t *, (const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSCHR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcschr, wchar_t *,
+ (const wchar_t *, wchar_t));
+#endif
+
+#if GNULIB_TEST_WCSRCHR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsrchr, wchar_t *,
+ (const wchar_t *, wchar_t));
+#endif
+
+#if GNULIB_TEST_WCSCSPN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcscspn, size_t,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSSPN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsspn, size_t,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSPBRK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcspbrk, wchar_t *,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSSTR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsstr, wchar_t *,
+ (const wchar_t *, const wchar_t *));
+#endif
+
+#if GNULIB_TEST_WCSTOK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcstok, wchar_t *,
+ (wchar_t *, const wchar_t *, wchar_t **));
+#endif
+
+#if GNULIB_TEST_WCSWIDTH
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcswidth, int, (const wchar_t *, size_t));
+#endif
+
int
main ()
+++ /dev/null
-/* Test of <wctype.h> substitute in C++ mode.
- Copyright (C) 2010-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
-
-#define GNULIB_NAMESPACE gnulib
-#include <config.h>
-
-#include <wctype.h>
-
-#include "signature.h"
-
-
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalnum, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalpha, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswcntrl, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswdigit, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswgraph, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswlower, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswprint, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswpunct, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswspace, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswupper, int, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswxdigit, int, (wint_t));
-
-SIGNATURE_CHECK (GNULIB_NAMESPACE::towlower, wint_t, (wint_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::towupper, wint_t, (wint_t));
-
-
-int
-main ()
-{
-}
--- /dev/null
+/* Test of <wctype.h> substitute in C++ mode.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <wctype.h>
+
+#include "signature.h"
+
+
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalnum, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalpha, int, (wint_t));
+#if GNULIB_TEST_ISWBLANK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
+#endif
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswcntrl, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswdigit, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswgraph, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswlower, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswprint, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswpunct, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswspace, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswupper, int, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswxdigit, int, (wint_t));
+
+#if GNULIB_TEST_WCTYPE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wctype, wctype_t, (const char *));
+#endif
+
+#if GNULIB_TEST_ISWCTYPE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswctype, int, (wint_t, wctype_t));
+#endif
+
+SIGNATURE_CHECK (GNULIB_NAMESPACE::towlower, wint_t, (wint_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::towupper, wint_t, (wint_t));
+
+#if GNULIB_TEST_WCTRANS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wctrans, wctrans_t, (const char *));
+#endif
+
+#if GNULIB_TEST_TOWCTRANS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::towctrans, wint_t, (wint_t, wctrans_t));
+#endif
+
+
+int
+main ()
+{
+}
--- /dev/null
+/* Test of <wctype.h> substitute.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that the type wint_t is defined. */
+wint_t a = 'x';
+/* Check that WEOF is defined. */
+wint_t e = WEOF;
+
+/* Check that the type wctype_t is defined. */
+wctype_t p;
+
+/* Check that the type wctrans_t is defined. */
+wctrans_t q;
+
+int
+main (void)
+{
+ /* Check that the isw* functions exist as functions or as macros. */
+ (void) iswalnum (0);
+ (void) iswalpha (0);
+ (void) iswcntrl (0);
+ (void) iswdigit (0);
+ (void) iswgraph (0);
+ (void) iswlower (0);
+ (void) iswprint (0);
+ (void) iswpunct (0);
+ (void) iswspace (0);
+ (void) iswupper (0);
+ (void) iswxdigit (0);
+
+ /* Check that the isw* functions map WEOF to 0. */
+ ASSERT (!iswalnum (e));
+ ASSERT (!iswalpha (e));
+ ASSERT (!iswcntrl (e));
+ ASSERT (!iswdigit (e));
+ ASSERT (!iswgraph (e));
+ ASSERT (!iswlower (e));
+ ASSERT (!iswprint (e));
+ ASSERT (!iswpunct (e));
+ ASSERT (!iswspace (e));
+ ASSERT (!iswupper (e));
+ ASSERT (!iswxdigit (e));
+
+ /* Check that the tow* functions exist as functions or as macros. */
+ (void) towlower (0);
+ (void) towupper (0);
+
+ /* Check that the tow* functions map WEOF to WEOF. */
+ ASSERT (towlower (e) == e);
+ ASSERT (towupper (e) == e);
+
+ return 0;
+}
+++ /dev/null
-/* Test of <wctype.h> substitute.
- Copyright (C) 2007-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <wctype.h>
-
-#include "macros.h"
-
-/* Check that the type wint_t is defined. */
-wint_t a = 'x';
-/* Check that WEOF is defined. */
-wint_t e = WEOF;
-
-int
-main (void)
-{
- /* Check that the isw* functions exist as functions or as macros. */
- (void) iswalnum (0);
- (void) iswalpha (0);
- (void) iswblank (0);
- (void) iswcntrl (0);
- (void) iswdigit (0);
- (void) iswgraph (0);
- (void) iswlower (0);
- (void) iswprint (0);
- (void) iswpunct (0);
- (void) iswspace (0);
- (void) iswupper (0);
- (void) iswxdigit (0);
-
- /* Check that the isw* functions map WEOF to 0. */
- ASSERT (!iswalnum (e));
- ASSERT (!iswalpha (e));
- ASSERT (!iswblank (e));
- ASSERT (!iswcntrl (e));
- ASSERT (!iswdigit (e));
- ASSERT (!iswgraph (e));
- ASSERT (!iswlower (e));
- ASSERT (!iswprint (e));
- ASSERT (!iswpunct (e));
- ASSERT (!iswspace (e));
- ASSERT (!iswupper (e));
- ASSERT (!iswxdigit (e));
-
- /* Check that the tow* functions exist as functions or as macros. */
- (void) towlower (0);
- (void) towupper (0);
-
- /* Check that the tow* functions map WEOF to WEOF. */
- ASSERT (towlower (e) == e);
- ASSERT (towupper (e) == e);
-
- return 0;
-}