mirror of
https://git.zap.org.au/git/trader.git
synced 2025-01-03 14:57:41 -05:00
Add all auto-generated files
The auto-generated files are created by running ./build-aux/bootstrap with Gnulib as at commit 84b1687bd51d4d47773a434ec12812292c4c0942 (with a date stamp of Thu Aug 25 15:24:28 2011 -0700), Autoconf 2.68, Automake 1.11.1 and Gettext 0.18.1.1.
This commit is contained in:
parent
b528bbc9f0
commit
6705d160bc
231
Makefile.in
231
Makefile.in
@ -46,7 +46,6 @@ VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@ -65,52 +64,46 @@ subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure COPYING INSTALL NEWS build-aux/README \
|
||||
build-aux/config.guess build-aux/config.sub build-aux/depcomp \
|
||||
build-aux/compile build-aux/config.guess \
|
||||
build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
|
||||
build-aux/install-sh build-aux/missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
|
||||
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
|
||||
$(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 \
|
||||
$(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/ctype.m4 \
|
||||
$(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/exponentd.m4 \
|
||||
$(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
|
||||
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/float_h.m4 \
|
||||
$(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
|
||||
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnand.m4 \
|
||||
$(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
|
||||
$(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/locale_h.m4 \
|
||||
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/malloc.m4 \
|
||||
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 $(top_srcdir)/m4/btowc.m4 \
|
||||
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
|
||||
$(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/extensions.m4 \
|
||||
$(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/getopt.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/libunistring-base.m4 \
|
||||
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
|
||||
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
|
||||
$(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
|
||||
$(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \
|
||||
$(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/multiarch.m4 \
|
||||
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/printf-frexp.m4 \
|
||||
$(top_srcdir)/m4/printf-frexpl.m4 \
|
||||
$(top_srcdir)/m4/printf-posix-rpl.m4 \
|
||||
$(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/signbit.m4 \
|
||||
$(top_srcdir)/m4/size_max.m4 \
|
||||
$(top_srcdir)/m4/snprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/stat.m4 \
|
||||
$(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \
|
||||
$(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
|
||||
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strdup.m4 \
|
||||
$(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strncat.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \
|
||||
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
|
||||
$(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/string_h.m4 \
|
||||
$(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
|
||||
$(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/m4/vfprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wcsdup.m4 \
|
||||
$(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
|
||||
$(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
|
||||
$(top_srcdir)/m4/wmemcpy.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
@ -172,12 +165,12 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
AMTAR = @AMTAR@
|
||||
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
|
||||
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@ -200,36 +193,24 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
|
||||
EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
|
||||
ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
|
||||
ENOLINK_VALUE = @ENOLINK_VALUE@
|
||||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
EXEEXT = @EXEEXT@
|
||||
FLOAT_H = @FLOAT_H@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GNULIB_ACOSL = @GNULIB_ACOSL@
|
||||
GNULIB_ASINL = @GNULIB_ASINL@
|
||||
GNULIB_ATANL = @GNULIB_ATANL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GNULIB_ATOLL = @GNULIB_ATOLL@
|
||||
GNULIB_BTOWC = @GNULIB_BTOWC@
|
||||
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
|
||||
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
|
||||
GNULIB_CEIL = @GNULIB_CEIL@
|
||||
GNULIB_CEILF = @GNULIB_CEILF@
|
||||
GNULIB_CEILL = @GNULIB_CEILL@
|
||||
GNULIB_CHOWN = @GNULIB_CHOWN@
|
||||
GNULIB_CLOSE = @GNULIB_CLOSE@
|
||||
GNULIB_COSL = @GNULIB_COSL@
|
||||
GNULIB_DPRINTF = @GNULIB_DPRINTF@
|
||||
GNULIB_DUP2 = @GNULIB_DUP2@
|
||||
GNULIB_DUP3 = @GNULIB_DUP3@
|
||||
GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
|
||||
GNULIB_ENVIRON = @GNULIB_ENVIRON@
|
||||
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
|
||||
GNULIB_EXPL = @GNULIB_EXPL@
|
||||
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
|
||||
GNULIB_FCHDIR = @GNULIB_FCHDIR@
|
||||
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
|
||||
@ -240,9 +221,6 @@ GNULIB_FFSL = @GNULIB_FFSL@
|
||||
GNULIB_FFSLL = @GNULIB_FFSLL@
|
||||
GNULIB_FGETC = @GNULIB_FGETC@
|
||||
GNULIB_FGETS = @GNULIB_FGETS@
|
||||
GNULIB_FLOOR = @GNULIB_FLOOR@
|
||||
GNULIB_FLOORF = @GNULIB_FLOORF@
|
||||
GNULIB_FLOORL = @GNULIB_FLOORL@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF = @GNULIB_FPRINTF@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
@ -251,8 +229,6 @@ GNULIB_FPUTC = @GNULIB_FPUTC@
|
||||
GNULIB_FPUTS = @GNULIB_FPUTS@
|
||||
GNULIB_FREAD = @GNULIB_FREAD@
|
||||
GNULIB_FREOPEN = @GNULIB_FREOPEN@
|
||||
GNULIB_FREXP = @GNULIB_FREXP@
|
||||
GNULIB_FREXPL = @GNULIB_FREXPL@
|
||||
GNULIB_FSCANF = @GNULIB_FSCANF@
|
||||
GNULIB_FSEEK = @GNULIB_FSEEK@
|
||||
GNULIB_FSEEKO = @GNULIB_FSEEKO@
|
||||
@ -282,20 +258,13 @@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
|
||||
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
|
||||
GNULIB_GRANTPT = @GNULIB_GRANTPT@
|
||||
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
|
||||
GNULIB_ISBLANK = @GNULIB_ISBLANK@
|
||||
GNULIB_ISFINITE = @GNULIB_ISFINITE@
|
||||
GNULIB_ISINF = @GNULIB_ISINF@
|
||||
GNULIB_ISNAN = @GNULIB_ISNAN@
|
||||
GNULIB_ISNAND = @GNULIB_ISNAND@
|
||||
GNULIB_ISNANF = @GNULIB_ISNANF@
|
||||
GNULIB_ISNANL = @GNULIB_ISNANL@
|
||||
GNULIB_ICONV = @GNULIB_ICONV@
|
||||
GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
|
||||
GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
|
||||
GNULIB_LCHMOD = @GNULIB_LCHMOD@
|
||||
GNULIB_LCHOWN = @GNULIB_LCHOWN@
|
||||
GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LINK = @GNULIB_LINK@
|
||||
GNULIB_LINKAT = @GNULIB_LINKAT@
|
||||
GNULIB_LOGB = @GNULIB_LOGB@
|
||||
GNULIB_LOGL = @GNULIB_LOGL@
|
||||
GNULIB_LSEEK = @GNULIB_LSEEK@
|
||||
GNULIB_LSTAT = @GNULIB_LSTAT@
|
||||
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
|
||||
@ -361,19 +330,13 @@ GNULIB_REMOVE = @GNULIB_REMOVE@
|
||||
GNULIB_RENAME = @GNULIB_RENAME@
|
||||
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
|
||||
GNULIB_RMDIR = @GNULIB_RMDIR@
|
||||
GNULIB_ROUND = @GNULIB_ROUND@
|
||||
GNULIB_ROUNDF = @GNULIB_ROUNDF@
|
||||
GNULIB_ROUNDL = @GNULIB_ROUNDL@
|
||||
GNULIB_RPMATCH = @GNULIB_RPMATCH@
|
||||
GNULIB_SCANF = @GNULIB_SCANF@
|
||||
GNULIB_SETENV = @GNULIB_SETENV@
|
||||
GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
|
||||
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
|
||||
GNULIB_SINL = @GNULIB_SINL@
|
||||
GNULIB_SLEEP = @GNULIB_SLEEP@
|
||||
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
|
||||
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
|
||||
GNULIB_SQRTL = @GNULIB_SQRTL@
|
||||
GNULIB_STAT = @GNULIB_STAT@
|
||||
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
|
||||
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
|
||||
@ -400,13 +363,10 @@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
|
||||
GNULIB_SYMLINK = @GNULIB_SYMLINK@
|
||||
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
|
||||
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
|
||||
GNULIB_TANL = @GNULIB_TANL@
|
||||
GNULIB_TIMEGM = @GNULIB_TIMEGM@
|
||||
GNULIB_TIME_R = @GNULIB_TIME_R@
|
||||
GNULIB_TMPFILE = @GNULIB_TMPFILE@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
|
||||
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
|
||||
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
|
||||
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
|
||||
@ -455,6 +415,8 @@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
|
||||
GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
|
||||
GNULIB_WCTOB = @GNULIB_WCTOB@
|
||||
GNULIB_WCTOMB = @GNULIB_WCTOMB@
|
||||
GNULIB_WCTRANS = @GNULIB_WCTRANS@
|
||||
GNULIB_WCTYPE = @GNULIB_WCTYPE@
|
||||
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
|
||||
GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
|
||||
GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
|
||||
@ -464,27 +426,13 @@ GNULIB_WMEMSET = @GNULIB_WMEMSET@
|
||||
GNULIB_WRITE = @GNULIB_WRITE@
|
||||
GNULIB__EXIT = @GNULIB__EXIT@
|
||||
GREP = @GREP@
|
||||
HAVE_ACOSL = @HAVE_ACOSL@
|
||||
HAVE_ASINL = @HAVE_ASINL@
|
||||
HAVE_ATANL = @HAVE_ATANL@
|
||||
HAVE_ATOLL = @HAVE_ATOLL@
|
||||
HAVE_BTOWC = @HAVE_BTOWC@
|
||||
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
|
||||
HAVE_CHOWN = @HAVE_CHOWN@
|
||||
HAVE_COSL = @HAVE_COSL@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
|
||||
HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
|
||||
HAVE_DECL_COSL = @HAVE_DECL_COSL@
|
||||
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
|
||||
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
|
||||
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
|
||||
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
|
||||
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
|
||||
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
|
||||
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
|
||||
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
|
||||
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
|
||||
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
|
||||
@ -494,30 +442,18 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
|
||||
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
|
||||
HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
|
||||
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
|
||||
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
|
||||
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
|
||||
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
|
||||
HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
|
||||
HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
|
||||
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
|
||||
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
|
||||
HAVE_DECL_SINL = @HAVE_DECL_SINL@
|
||||
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
|
||||
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
|
||||
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
|
||||
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
|
||||
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
|
||||
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
|
||||
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
|
||||
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
||||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
|
||||
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
|
||||
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
|
||||
@ -528,7 +464,6 @@ HAVE_DUP2 = @HAVE_DUP2@
|
||||
HAVE_DUP3 = @HAVE_DUP3@
|
||||
HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
|
||||
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
|
||||
HAVE_EXPL = @HAVE_EXPL@
|
||||
HAVE_FACCESSAT = @HAVE_FACCESSAT@
|
||||
HAVE_FCHDIR = @HAVE_FCHDIR@
|
||||
HAVE_FCHMODAT = @HAVE_FCHMODAT@
|
||||
@ -553,15 +488,12 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
|
||||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISBLANK = @HAVE_ISBLANK@
|
||||
HAVE_ISNAND = @HAVE_ISNAND@
|
||||
HAVE_ISNANF = @HAVE_ISNANF@
|
||||
HAVE_ISNANL = @HAVE_ISNANL@
|
||||
HAVE_ISWBLANK = @HAVE_ISWBLANK@
|
||||
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
|
||||
HAVE_LCHMOD = @HAVE_LCHMOD@
|
||||
HAVE_LCHOWN = @HAVE_LCHOWN@
|
||||
HAVE_LINK = @HAVE_LINK@
|
||||
HAVE_LINKAT = @HAVE_LINKAT@
|
||||
HAVE_LOGL = @HAVE_LOGL@
|
||||
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
|
||||
HAVE_LSTAT = @HAVE_LSTAT@
|
||||
HAVE_MBRLEN = @HAVE_MBRLEN@
|
||||
@ -601,9 +533,7 @@ HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
|
||||
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
|
||||
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
|
||||
HAVE_SINL = @HAVE_SINL@
|
||||
HAVE_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_SQRTL = @HAVE_SQRTL@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
@ -626,7 +556,6 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
|
||||
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
|
||||
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
|
||||
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
|
||||
HAVE_TANL = @HAVE_TANL@
|
||||
HAVE_TIMEGM = @HAVE_TIMEGM@
|
||||
HAVE_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNLINKAT = @HAVE_UNLINKAT@
|
||||
@ -664,6 +593,9 @@ HAVE_WCSSTR = @HAVE_WCSSTR@
|
||||
HAVE_WCSTOK = @HAVE_WCSTOK@
|
||||
HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
|
||||
HAVE_WCSXFRM = @HAVE_WCSXFRM@
|
||||
HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
|
||||
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
|
||||
HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
|
||||
HAVE_WINT_T = @HAVE_WINT_T@
|
||||
HAVE_WMEMCHR = @HAVE_WMEMCHR@
|
||||
HAVE_WMEMCMP = @HAVE_WMEMCMP@
|
||||
@ -673,6 +605,8 @@ HAVE_WMEMSET = @HAVE_WMEMSET@
|
||||
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HAVE__EXIT = @HAVE__EXIT@
|
||||
ICONV_CONST = @ICONV_CONST@
|
||||
ICONV_H = @ICONV_H@
|
||||
INCLUDE_NEXT = @INCLUDE_NEXT@
|
||||
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
|
||||
INSTALL = @INSTALL@
|
||||
@ -680,23 +614,33 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
|
||||
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
|
||||
LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
LOCALE_FR = @LOCALE_FR@
|
||||
LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
|
||||
LOCALE_JA = @LOCALE_JA@
|
||||
LOCALE_ZH_CN = @LOCALE_ZH_CN@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
|
||||
@ -707,13 +651,10 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
|
||||
NEXT_CTYPE_H = @NEXT_CTYPE_H@
|
||||
NEXT_ERRNO_H = @NEXT_ERRNO_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
|
||||
NEXT_GETOPT_H = @NEXT_GETOPT_H@
|
||||
NEXT_ICONV_H = @NEXT_ICONV_H@
|
||||
NEXT_LOCALE_H = @NEXT_LOCALE_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
NEXT_STDARG_H = @NEXT_STDARG_H@
|
||||
NEXT_STDDEF_H = @NEXT_STDDEF_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
@ -724,6 +665,7 @@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
|
||||
NEXT_TIME_H = @NEXT_TIME_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NEXT_WCHAR_H = @NEXT_WCHAR_H@
|
||||
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -733,6 +675,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
|
||||
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
|
||||
@ -741,9 +684,6 @@ RANLIB = @RANLIB@
|
||||
REPLACE_BTOWC = @REPLACE_BTOWC@
|
||||
REPLACE_CALLOC = @REPLACE_CALLOC@
|
||||
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
|
||||
REPLACE_CEIL = @REPLACE_CEIL@
|
||||
REPLACE_CEILF = @REPLACE_CEILF@
|
||||
REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_CLOSE = @REPLACE_CLOSE@
|
||||
REPLACE_DPRINTF = @REPLACE_DPRINTF@
|
||||
@ -753,15 +693,10 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
|
||||
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
|
||||
REPLACE_FCLOSE = @REPLACE_FCLOSE@
|
||||
REPLACE_FFLUSH = @REPLACE_FFLUSH@
|
||||
REPLACE_FLOOR = @REPLACE_FLOOR@
|
||||
REPLACE_FLOORF = @REPLACE_FLOORF@
|
||||
REPLACE_FLOORL = @REPLACE_FLOORL@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FPURGE = @REPLACE_FPURGE@
|
||||
REPLACE_FREOPEN = @REPLACE_FREOPEN@
|
||||
REPLACE_FREXP = @REPLACE_FREXP@
|
||||
REPLACE_FREXPL = @REPLACE_FREXPL@
|
||||
REPLACE_FSEEK = @REPLACE_FSEEK@
|
||||
REPLACE_FSEEKO = @REPLACE_FSEEKO@
|
||||
REPLACE_FSTAT = @REPLACE_FSTAT@
|
||||
@ -777,12 +712,12 @@ REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
REPLACE_ISFINITE = @REPLACE_ISFINITE@
|
||||
REPLACE_ISINF = @REPLACE_ISINF@
|
||||
REPLACE_ISNAN = @REPLACE_ISNAN@
|
||||
REPLACE_ICONV = @REPLACE_ICONV@
|
||||
REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
|
||||
REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
|
||||
REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
|
||||
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
|
||||
REPLACE_LCHOWN = @REPLACE_LCHOWN@
|
||||
REPLACE_LDEXPL = @REPLACE_LDEXPL@
|
||||
REPLACE_LINK = @REPLACE_LINK@
|
||||
REPLACE_LINKAT = @REPLACE_LINKAT@
|
||||
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
|
||||
@ -803,7 +738,6 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
|
||||
REPLACE_MKNOD = @REPLACE_MKNOD@
|
||||
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
|
||||
REPLACE_MKTIME = @REPLACE_MKTIME@
|
||||
REPLACE_NAN = @REPLACE_NAN@
|
||||
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
|
||||
REPLACE_NULL = @REPLACE_NULL@
|
||||
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
|
||||
@ -821,13 +755,8 @@ REPLACE_REMOVE = @REPLACE_REMOVE@
|
||||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SLEEP = @REPLACE_SLEEP@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
@ -850,9 +779,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
|
||||
REPLACE_SYMLINK = @REPLACE_SYMLINK@
|
||||
REPLACE_TIMEGM = @REPLACE_TIMEGM@
|
||||
REPLACE_TMPFILE = @REPLACE_TMPFILE@
|
||||
REPLACE_TRUNC = @REPLACE_TRUNC@
|
||||
REPLACE_TRUNCF = @REPLACE_TRUNCF@
|
||||
REPLACE_TRUNCL = @REPLACE_TRUNCL@
|
||||
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
|
||||
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
|
||||
REPLACE_UNLINK = @REPLACE_UNLINK@
|
||||
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
|
||||
@ -877,7 +804,6 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
|
||||
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
|
||||
STDARG_H = @STDARG_H@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STDDEF_H = @STDDEF_H@
|
||||
STDINT_H = @STDINT_H@
|
||||
@ -887,9 +813,13 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
|
||||
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
|
||||
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
|
||||
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
@ -928,6 +858,7 @@ infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
lispdir = @lispdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
@ -950,7 +881,7 @@ top_srcdir = @top_srcdir@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# Subdirectories to recurse into
|
||||
SUBDIRS = lib src doc m4
|
||||
SUBDIRS = lib src doc po m4
|
||||
|
||||
# Additional files to distribute
|
||||
EXTRA_DIST = build-aux/bootstrap
|
||||
|
106
aclocal.m4
vendored
106
aclocal.m4
vendored
@ -639,6 +639,41 @@ AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
|
||||
if test "$am_t" != yes; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
dnl Make sure AC_PROG_CC is never called again, or it will override our
|
||||
dnl setting of CC.
|
||||
m4_define([AC_PROG_CC],
|
||||
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
|
||||
@ -950,74 +985,69 @@ AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([m4/00gnulib.m4])
|
||||
m4_include([m4/alloca.m4])
|
||||
m4_include([m4/asm-underscore.m4])
|
||||
m4_include([m4/assert.m4])
|
||||
m4_include([m4/ax_append_flag.m4])
|
||||
m4_include([m4/ax_c___attribute__.m4])
|
||||
m4_include([m4/ax_cflags_warn_all.m4])
|
||||
m4_include([m4/ax_with_curses.m4])
|
||||
m4_include([m4/btowc.m4])
|
||||
m4_include([m4/codeset.m4])
|
||||
m4_include([m4/config-h.m4])
|
||||
m4_include([m4/ctype.m4])
|
||||
m4_include([m4/errno_h.m4])
|
||||
m4_include([m4/exponentd.m4])
|
||||
m4_include([m4/exponentf.m4])
|
||||
m4_include([m4/exponentl.m4])
|
||||
m4_include([m4/configmake.m4])
|
||||
m4_include([m4/extensions.m4])
|
||||
m4_include([m4/float_h.m4])
|
||||
m4_include([m4/fpieee.m4])
|
||||
m4_include([m4/fprintf-posix.m4])
|
||||
m4_include([m4/frexp.m4])
|
||||
m4_include([m4/frexpl.m4])
|
||||
m4_include([m4/fcntl-o.m4])
|
||||
m4_include([m4/getopt.m4])
|
||||
m4_include([m4/gettext.m4])
|
||||
m4_include([m4/gettimeofday.m4])
|
||||
m4_include([m4/glibc21.m4])
|
||||
m4_include([m4/gnulib-common.m4])
|
||||
m4_include([m4/gnulib-comp.m4])
|
||||
m4_include([m4/iconv.m4])
|
||||
m4_include([m4/iconv_h.m4])
|
||||
m4_include([m4/iconv_open.m4])
|
||||
m4_include([m4/include_next.m4])
|
||||
m4_include([m4/intmax_t.m4])
|
||||
m4_include([m4/inttypes_h.m4])
|
||||
m4_include([m4/isnand.m4])
|
||||
m4_include([m4/isnanf.m4])
|
||||
m4_include([m4/isnanl.m4])
|
||||
m4_include([m4/ldexpl.m4])
|
||||
m4_include([m4/inline.m4])
|
||||
m4_include([m4/intlmacosx.m4])
|
||||
m4_include([m4/lib-ld.m4])
|
||||
m4_include([m4/lib-link.m4])
|
||||
m4_include([m4/lib-prefix.m4])
|
||||
m4_include([m4/libunistring-base.m4])
|
||||
m4_include([m4/localcharset.m4])
|
||||
m4_include([m4/locale-fr.m4])
|
||||
m4_include([m4/locale-ja.m4])
|
||||
m4_include([m4/locale-zh.m4])
|
||||
m4_include([m4/locale_h.m4])
|
||||
m4_include([m4/longlong.m4])
|
||||
m4_include([m4/malloc.m4])
|
||||
m4_include([m4/math_h.m4])
|
||||
m4_include([m4/mbrtowc.m4])
|
||||
m4_include([m4/mbsinit.m4])
|
||||
m4_include([m4/mbsrtowcs.m4])
|
||||
m4_include([m4/mbstate_t.m4])
|
||||
m4_include([m4/mbtowc.m4])
|
||||
m4_include([m4/memchr.m4])
|
||||
m4_include([m4/mmap-anon.m4])
|
||||
m4_include([m4/multiarch.m4])
|
||||
m4_include([m4/nls.m4])
|
||||
m4_include([m4/nocrash.m4])
|
||||
m4_include([m4/printf-frexp.m4])
|
||||
m4_include([m4/printf-frexpl.m4])
|
||||
m4_include([m4/printf-posix-rpl.m4])
|
||||
m4_include([m4/printf.m4])
|
||||
m4_include([m4/signbit.m4])
|
||||
m4_include([m4/size_max.m4])
|
||||
m4_include([m4/snprintf-posix.m4])
|
||||
m4_include([m4/snprintf.m4])
|
||||
m4_include([m4/stat.m4])
|
||||
m4_include([m4/stdarg.m4])
|
||||
m4_include([m4/po.m4])
|
||||
m4_include([m4/progtest.m4])
|
||||
m4_include([m4/stdbool.m4])
|
||||
m4_include([m4/stddef_h.m4])
|
||||
m4_include([m4/stdint.m4])
|
||||
m4_include([m4/stdint_h.m4])
|
||||
m4_include([m4/stdio_h.m4])
|
||||
m4_include([m4/stdlib_h.m4])
|
||||
m4_include([m4/strdup.m4])
|
||||
m4_include([m4/string_h.m4])
|
||||
m4_include([m4/strncat.m4])
|
||||
m4_include([m4/strstr.m4])
|
||||
m4_include([m4/sys_stat_h.m4])
|
||||
m4_include([m4/sys_time_h.m4])
|
||||
m4_include([m4/time_h.m4])
|
||||
m4_include([m4/unistd_h.m4])
|
||||
m4_include([m4/vasnprintf.m4])
|
||||
m4_include([m4/vfprintf-posix.m4])
|
||||
m4_include([m4/vsnprintf-posix.m4])
|
||||
m4_include([m4/vsnprintf.m4])
|
||||
m4_include([m4/warn-on-use.m4])
|
||||
m4_include([m4/wchar_h.m4])
|
||||
m4_include([m4/wchar_t.m4])
|
||||
m4_include([m4/wcrtomb.m4])
|
||||
m4_include([m4/wcsdup.m4])
|
||||
m4_include([m4/wctob.m4])
|
||||
m4_include([m4/wctomb.m4])
|
||||
m4_include([m4/wctype_h.m4])
|
||||
m4_include([m4/wint_t.m4])
|
||||
m4_include([m4/xsize.m4])
|
||||
m4_include([m4/wmemcpy.m4])
|
||||
|
143
build-aux/compile
Executable file
143
build-aux/compile
Executable file
@ -0,0 +1,143 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2009-10-06.20; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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 2, 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/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
690
build-aux/config.rpath
Executable file
690
build-aux/config.rpath
Executable file
@ -0,0 +1,690 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2011 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
haiku*)
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
*)
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
openbsd*)
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
tpf*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
36
build-aux/snippet/unused-parameter.h
Normal file
36
build-aux/snippet/unused-parameter.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* A C macro for declaring that specific function parameters are not used.
|
||||
Copyright (C) 2008-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/>. */
|
||||
|
||||
/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
|
||||
declarations for parameters that are not used. This helps to reduce
|
||||
warnings, such as from GCC -Wunused-parameter. The syntax is as follows:
|
||||
type param _GL_UNUSED_PARAMETER
|
||||
or more generally
|
||||
param_decl _GL_UNUSED_PARAMETER
|
||||
For example:
|
||||
int param _GL_UNUSED_PARAMETER
|
||||
int *(*param)(void) _GL_UNUSED_PARAMETER
|
||||
Other possible, but obscure and discouraged syntaxes:
|
||||
int _GL_UNUSED_PARAMETER *(*param)(void)
|
||||
_GL_UNUSED_PARAMETER int *(*param)(void)
|
||||
*/
|
||||
#ifndef _GL_UNUSED_PARAMETER
|
||||
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
|
||||
# else
|
||||
# define _GL_UNUSED_PARAMETER
|
||||
# endif
|
||||
#endif
|
514
config.h.in
514
config.h.in
@ -1,8 +1,5 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Define to the number of bits in type 'ptrdiff_t'. */
|
||||
#undef BITSIZEOF_PTRDIFF_T
|
||||
|
||||
@ -18,43 +15,9 @@
|
||||
/* Define to the number of bits in type 'wint_t'. */
|
||||
#undef BITSIZEOF_WINT_T
|
||||
|
||||
/* Define if you wish *printf() functions that have a safe handling of
|
||||
non-IEEE-754 'long double' values. */
|
||||
#undef CHECK_PRINTF_SAFE
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define as the bit index in the word where to find bit 0 of the exponent of
|
||||
'double'. */
|
||||
#undef DBL_EXPBIT0_BIT
|
||||
|
||||
/* Define as the word index where to find the exponent of 'double'. */
|
||||
#undef DBL_EXPBIT0_WORD
|
||||
|
||||
/* Define as the bit index in the word where to find the sign of 'double'. */
|
||||
#undef DBL_SIGNBIT_BIT
|
||||
|
||||
/* Define as the word index where to find the sign of 'double'. */
|
||||
#undef DBL_SIGNBIT_WORD
|
||||
|
||||
/* Define as the bit index in the word where to find bit 0 of the exponent of
|
||||
'float'. */
|
||||
#undef FLT_EXPBIT0_BIT
|
||||
|
||||
/* Define as the word index where to find the exponent of 'float'. */
|
||||
#undef FLT_EXPBIT0_WORD
|
||||
|
||||
/* Define as the bit index in the word where to find the sign of 'float'. */
|
||||
#undef FLT_SIGNBIT_BIT
|
||||
|
||||
/* Define as the word index where to find the sign of 'float'. */
|
||||
#undef FLT_SIGNBIT_WORD
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define if gettimeofday clobbers the localtime buffer. */
|
||||
#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
|
||||
@ -63,18 +26,8 @@
|
||||
declaration of the second argument to gettimeofday. */
|
||||
#undef GETTIMEOFDAY_TIMEZONE
|
||||
|
||||
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
|
||||
whether the gnulib module snprintf shall be considered present. */
|
||||
#undef GNULIB_SNPRINTF
|
||||
|
||||
/* Define to 1 when the gnulib module fprintf-posix should be tested. */
|
||||
#undef GNULIB_TEST_FPRINTF_POSIX
|
||||
|
||||
/* Define to 1 when the gnulib module frexp should be tested. */
|
||||
#undef GNULIB_TEST_FREXP
|
||||
|
||||
/* Define to 1 when the gnulib module frexpl should be tested. */
|
||||
#undef GNULIB_TEST_FREXPL
|
||||
/* Define to 1 when the gnulib module btowc should be tested. */
|
||||
#undef GNULIB_TEST_BTOWC
|
||||
|
||||
/* Define to 1 when the gnulib module getopt-gnu should be tested. */
|
||||
#undef GNULIB_TEST_GETOPT_GNU
|
||||
@ -82,61 +35,60 @@
|
||||
/* Define to 1 when the gnulib module gettimeofday should be tested. */
|
||||
#undef GNULIB_TEST_GETTIMEOFDAY
|
||||
|
||||
/* Define to 1 when the gnulib module malloc-posix should be tested. */
|
||||
#undef GNULIB_TEST_MALLOC_POSIX
|
||||
/* Define to 1 when the gnulib module mbrtowc should be tested. */
|
||||
#undef GNULIB_TEST_MBRTOWC
|
||||
|
||||
/* Define to 1 when the gnulib module mbsinit should be tested. */
|
||||
#undef GNULIB_TEST_MBSINIT
|
||||
|
||||
/* Define to 1 when the gnulib module mbsrtowcs should be tested. */
|
||||
#undef GNULIB_TEST_MBSRTOWCS
|
||||
|
||||
/* Define to 1 when the gnulib module mbtowc should be tested. */
|
||||
#undef GNULIB_TEST_MBTOWC
|
||||
|
||||
/* Define to 1 when the gnulib module memchr should be tested. */
|
||||
#undef GNULIB_TEST_MEMCHR
|
||||
|
||||
/* Define to 1 when the gnulib module printf-posix should be tested. */
|
||||
#undef GNULIB_TEST_PRINTF_POSIX
|
||||
|
||||
/* Define to 1 when the gnulib module signbit should be tested. */
|
||||
#undef GNULIB_TEST_SIGNBIT
|
||||
|
||||
/* Define to 1 when the gnulib module snprintf should be tested. */
|
||||
#undef GNULIB_TEST_SNPRINTF
|
||||
|
||||
/* Define to 1 when the gnulib module stat should be tested. */
|
||||
#undef GNULIB_TEST_STAT
|
||||
|
||||
/* Define to 1 when the gnulib module strdup should be tested. */
|
||||
#undef GNULIB_TEST_STRDUP
|
||||
|
||||
/* Define to 1 when the gnulib module strncat should be tested. */
|
||||
#undef GNULIB_TEST_STRNCAT
|
||||
|
||||
/* Define to 1 when the gnulib module strstr should be tested. */
|
||||
#undef GNULIB_TEST_STRSTR
|
||||
|
||||
/* Define to 1 when the gnulib module vfprintf-posix should be tested. */
|
||||
#undef GNULIB_TEST_VFPRINTF_POSIX
|
||||
/* Define to 1 when the gnulib module wcrtomb should be tested. */
|
||||
#undef GNULIB_TEST_WCRTOMB
|
||||
|
||||
/* Define to 1 when the gnulib module vsnprintf should be tested. */
|
||||
#undef GNULIB_TEST_VSNPRINTF
|
||||
/* Define to 1 when the gnulib module wcsdup should be tested. */
|
||||
#undef GNULIB_TEST_WCSDUP
|
||||
|
||||
/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
|
||||
may be supplied by this distribution. */
|
||||
#undef HAVE_ALLOCA
|
||||
/* Define to 1 when the gnulib module wctob should be tested. */
|
||||
#undef GNULIB_TEST_WCTOB
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
/* Define to 1 when the gnulib module wctomb should be tested. */
|
||||
#undef GNULIB_TEST_WCTOMB
|
||||
|
||||
/* Define to 1 when the gnulib module wmemcpy should be tested. */
|
||||
#undef GNULIB_TEST_WMEMCPY
|
||||
|
||||
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
|
||||
whether the gnulib module unistr/u8-mbtoucr shall be considered present. */
|
||||
#undef GNULIB_UNISTR_U8_MBTOUCR
|
||||
|
||||
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
|
||||
whether the gnulib module unistr/u8-uctomb shall be considered present. */
|
||||
#undef GNULIB_UNISTR_U8_UCTOMB
|
||||
|
||||
/* Define to 1 if you have the <bp-sym.h> header file. */
|
||||
#undef HAVE_BP_SYM_H
|
||||
|
||||
/* Define if the copysignf function is declared in <math.h> and available in
|
||||
libc. */
|
||||
#undef HAVE_COPYSIGNF_IN_LIBC
|
||||
/* Define to 1 if you have the `btowc' function. */
|
||||
#undef HAVE_BTOWC
|
||||
|
||||
/* Define if the copysignl function is declared in <math.h> and available in
|
||||
libc. */
|
||||
#undef HAVE_COPYSIGNL_IN_LIBC
|
||||
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
|
||||
CoreFoundation framework. */
|
||||
#undef HAVE_CFLOCALECOPYCURRENT
|
||||
|
||||
/* Define if the copysign function is declared in <math.h> and available in
|
||||
libc. */
|
||||
#undef HAVE_COPYSIGN_IN_LIBC
|
||||
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
|
||||
the CoreFoundation framework. */
|
||||
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
|
||||
|
||||
/* Define to 1 if a SysV or X/Open compatible Curses library is present */
|
||||
#undef HAVE_CURSES
|
||||
@ -153,100 +105,96 @@
|
||||
/* Define to 1 if library supports certain obsolete features */
|
||||
#undef HAVE_CURSES_OBSOLETE
|
||||
|
||||
/* Define to 1 if you have the declaration of `copysign', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_COPYSIGN
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the declaration of `copysignf', and to 0 if you
|
||||
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_COPYSIGNF
|
||||
|
||||
/* Define to 1 if you have the declaration of `copysignl', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_COPYSIGNL
|
||||
#undef HAVE_DECL_GETC_UNLOCKED
|
||||
|
||||
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_GETENV
|
||||
|
||||
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
|
||||
/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SNPRINTF
|
||||
#undef HAVE_DECL_MBRTOWC
|
||||
|
||||
/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't.
|
||||
/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_MBSINIT
|
||||
|
||||
/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_MBSRTOWCS
|
||||
|
||||
/* Define to 1 if you have the declaration of `towlower', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_TOWLOWER
|
||||
|
||||
/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_WCRTOMB
|
||||
|
||||
/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_STRDUP
|
||||
|
||||
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_VSNPRINTF
|
||||
|
||||
/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL__SNPRINTF
|
||||
#undef HAVE_DECL_WCTOB
|
||||
|
||||
/* Define to 1 if you have the <features.h> header file. */
|
||||
#undef HAVE_FEATURES_H
|
||||
|
||||
/* Define if the frexpl function is available in libc. */
|
||||
#undef HAVE_FREXPL_IN_LIBC
|
||||
|
||||
/* Define if the frexp function is available in libc. */
|
||||
#undef HAVE_FREXP_IN_LIBC
|
||||
|
||||
/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* Define to 1 if you have the `getopt_long_only' function. */
|
||||
#undef HAVE_GETOPT_LONG_ONLY
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
|
||||
#undef HAVE_INTMAX_T
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
#undef HAVE_ICONV_H
|
||||
|
||||
/* Define to 1 if the compiler supports one of the keywords 'inline',
|
||||
'__inline__', '__inline' and effectively inlines functions marked as such.
|
||||
*/
|
||||
#undef HAVE_INLINE
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
|
||||
declares uintmax_t. */
|
||||
#undef HAVE_INTTYPES_H_WITH_UINTMAX
|
||||
/* Define to 1 if you have the `iswcntrl' function. */
|
||||
#undef HAVE_ISWCNTRL
|
||||
|
||||
/* Define if the isnan(double) function is available in libc. */
|
||||
#undef HAVE_ISNAND_IN_LIBC
|
||||
|
||||
/* Define if the isnan(float) function is available in libc. */
|
||||
#undef HAVE_ISNANF_IN_LIBC
|
||||
|
||||
/* Define if the isnan(long double) function is available in libc. */
|
||||
#undef HAVE_ISNANL_IN_LIBC
|
||||
|
||||
/* Define if the ldexpl function is available in libc. */
|
||||
#undef HAVE_LDEXPL_IN_LIBC
|
||||
|
||||
/* Define if the ldexp function is available in libc. */
|
||||
#undef HAVE_LDEXP_IN_LIBC
|
||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||
#undef HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Define to 1 if the system has the type `long long int'. */
|
||||
#undef HAVE_LONG_LONG_INT
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
/* Define if the 'malloc' function is POSIX compliant. */
|
||||
#undef HAVE_MALLOC_POSIX
|
||||
|
||||
/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
|
||||
config.h and <sys/mman.h>. */
|
||||
#undef HAVE_MAP_ANONYMOUS
|
||||
|
||||
/* Define to 1 if you have the <math.h> header file. */
|
||||
#undef HAVE_MATH_H
|
||||
|
||||
/* Define to 1 if you have the `mbrtowc' function. */
|
||||
#undef HAVE_MBRTOWC
|
||||
|
||||
/* Define to 1 if you have the `mbsinit' function. */
|
||||
#undef HAVE_MBSINIT
|
||||
|
||||
/* Define to 1 if you have the `mbsrtowcs' function. */
|
||||
#undef HAVE_MBSRTOWCS
|
||||
|
||||
/* Define to 1 if <wchar.h> declares mbstate_t. */
|
||||
#undef HAVE_MBSTATE_T
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
@ -271,18 +219,6 @@
|
||||
/* Define to 1 if <ncurses.h> is present */
|
||||
#undef HAVE_NCURSES_H
|
||||
|
||||
/* Define to 1 if you have the `nl_langinfo' function. */
|
||||
#undef HAVE_NL_LANGINFO
|
||||
|
||||
/* Define to 1 if acosl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ACOSL
|
||||
|
||||
/* Define to 1 if asinl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ASINL
|
||||
|
||||
/* Define to 1 if atanl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ATANL
|
||||
|
||||
/* Define to 1 if atoll is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ATOLL
|
||||
|
||||
@ -293,18 +229,9 @@
|
||||
macros. */
|
||||
#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
|
||||
|
||||
/* Define to 1 if ceilf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_CEILF
|
||||
|
||||
/* Define to 1 if ceill is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_CEILL
|
||||
|
||||
/* Define to 1 if chown is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_CHOWN
|
||||
|
||||
/* Define to 1 if cosl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_COSL
|
||||
|
||||
/* Define to 1 if dprintf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_DPRINTF
|
||||
|
||||
@ -326,9 +253,6 @@
|
||||
/* Define to 1 if euidaccess is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_EUIDACCESS
|
||||
|
||||
/* Define to 1 if expl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_EXPL
|
||||
|
||||
/* Define to 1 if faccessat is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FACCESSAT
|
||||
|
||||
@ -347,18 +271,9 @@
|
||||
/* Define to 1 if ffsll is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FFSLL
|
||||
|
||||
/* Define to 1 if floorf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FLOORF
|
||||
|
||||
/* Define to 1 if floorl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FLOORL
|
||||
|
||||
/* Define to 1 if fpurge is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FPURGE
|
||||
|
||||
/* Define to 1 if frexpl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FREXPL
|
||||
|
||||
/* Define to 1 if fseeko is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_FSEEKO
|
||||
|
||||
@ -428,8 +343,8 @@
|
||||
/* Define to 1 if initstat_r is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_INITSTAT_R
|
||||
|
||||
/* Define to 1 if isblank is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ISBLANK
|
||||
/* Define to 1 if iswctype is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ISWCTYPE
|
||||
|
||||
/* Define to 1 if lchmod is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LCHMOD
|
||||
@ -437,21 +352,12 @@
|
||||
/* Define to 1 if lchown is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LCHOWN
|
||||
|
||||
/* Define to 1 if ldexpl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LDEXPL
|
||||
|
||||
/* Define to 1 if link is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LINK
|
||||
|
||||
/* Define to 1 if linkat is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LINKAT
|
||||
|
||||
/* Define to 1 if logb is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LOGB
|
||||
|
||||
/* Define to 1 if logl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LOGL
|
||||
|
||||
/* Define to 1 if lseek is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_LSEEK
|
||||
|
||||
@ -551,15 +457,6 @@
|
||||
/* Define to 1 if rmdir is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_RMDIR
|
||||
|
||||
/* Define to 1 if round is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ROUND
|
||||
|
||||
/* Define to 1 if roundf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ROUNDF
|
||||
|
||||
/* Define to 1 if roundl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_ROUNDL
|
||||
|
||||
/* Define to 1 if rpmatch is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_RPMATCH
|
||||
|
||||
@ -575,18 +472,12 @@
|
||||
/* Define to 1 if setusershell is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SETUSERSHELL
|
||||
|
||||
/* Define to 1 if sinl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SINL
|
||||
|
||||
/* Define to 1 if sleep is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SLEEP
|
||||
|
||||
/* Define to 1 if snprintf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SNPRINTF
|
||||
|
||||
/* Define to 1 if sqrtl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SQRTL
|
||||
|
||||
/* Define to 1 if srandom_r is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SRANDOM_R
|
||||
|
||||
@ -650,20 +541,11 @@
|
||||
/* Define to 1 if symlinkat is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_SYMLINKAT
|
||||
|
||||
/* Define to 1 if tanl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TANL
|
||||
|
||||
/* Define to 1 if tmpfile is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TMPFILE
|
||||
|
||||
/* Define to 1 if trunc is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TRUNC
|
||||
|
||||
/* Define to 1 if truncf is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TRUNCF
|
||||
|
||||
/* Define to 1 if truncl is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TRUNCL
|
||||
/* Define to 1 if towctrans is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TOWCTRANS
|
||||
|
||||
/* Define to 1 if ttyname_r is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_TTYNAME_R
|
||||
@ -773,6 +655,12 @@
|
||||
/* Define to 1 if wctob is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_WCTOB
|
||||
|
||||
/* Define to 1 if wctrans is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_WCTRANS
|
||||
|
||||
/* Define to 1 if wctype is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_WCTYPE
|
||||
|
||||
/* Define to 1 if wcwidth is declared even after undefining macros. */
|
||||
#undef HAVE_RAW_DECL_WCWIDTH
|
||||
|
||||
@ -803,36 +691,18 @@
|
||||
/* Define to 1 if 'wint_t' is a signed integer type. */
|
||||
#undef HAVE_SIGNED_WINT_T
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if the return value of the snprintf function is the number of of
|
||||
bytes (excluding the terminating NUL) that would have been produced if the
|
||||
buffer had been large enough. */
|
||||
#undef HAVE_SNPRINTF_RETVAL_C99
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
|
||||
uintmax_t. */
|
||||
#undef HAVE_STDINT_H_WITH_UINTMAX
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strnlen' function. */
|
||||
#undef HAVE_STRNLEN
|
||||
|
||||
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||
#undef HAVE_SYS_BITYPES_H
|
||||
|
||||
@ -854,18 +724,15 @@
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the `towlower' function. */
|
||||
#undef HAVE_TOWLOWER
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned long long int'. */
|
||||
#undef HAVE_UNSIGNED_LONG_LONG_INT
|
||||
|
||||
/* Define to 1 if you have the `vasnprintf' function. */
|
||||
#undef HAVE_VASNPRINTF
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
@ -875,15 +742,27 @@
|
||||
/* Define to 1 if you have the `wcrtomb' function. */
|
||||
#undef HAVE_WCRTOMB
|
||||
|
||||
/* Define to 1 if you have the `wcslen' function. */
|
||||
#undef HAVE_WCSLEN
|
||||
/* Define to 1 if you have the `wcsdup' function. */
|
||||
#undef HAVE_WCSDUP
|
||||
|
||||
/* Define to 1 if you have the `wcsnlen' function. */
|
||||
#undef HAVE_WCSNLEN
|
||||
/* Define to 1 if you have the `wctob' function. */
|
||||
#undef HAVE_WCTOB
|
||||
|
||||
/* Define to 1 if you have the <wctype.h> header file. */
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Define if you have the 'wint_t' type. */
|
||||
#undef HAVE_WINT_T
|
||||
|
||||
/* Define to 1 if you have the `wmemcpy' function. */
|
||||
#undef HAVE_WMEMCPY
|
||||
|
||||
/* Define to 1 if O_NOATIME works. */
|
||||
#undef HAVE_WORKING_O_NOATIME
|
||||
|
||||
/* Define to 1 if O_NOFOLLOW works. */
|
||||
#undef HAVE_WORKING_O_NOFOLLOW
|
||||
|
||||
/* Define to 1 if you have the <xlocale.h> header file. */
|
||||
#undef HAVE_XLOCALE_H
|
||||
|
||||
@ -896,73 +775,33 @@
|
||||
/* define if your compiler has __attribute__ */
|
||||
#undef HAVE___ATTRIBUTE__
|
||||
|
||||
/* Define as the bit index in the word where to find bit 0 of the exponent of
|
||||
'long double'. */
|
||||
#undef LDBL_EXPBIT0_BIT
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* Define as the word index where to find the exponent of 'long double'. */
|
||||
#undef LDBL_EXPBIT0_WORD
|
||||
|
||||
/* Define as the bit index in the word where to find the sign of 'long
|
||||
double'. */
|
||||
#undef LDBL_SIGNBIT_BIT
|
||||
|
||||
/* Define as the word index where to find the sign of 'long double'. */
|
||||
#undef LDBL_SIGNBIT_WORD
|
||||
/* Define to a symbolic name denoting the flavor of iconv_open()
|
||||
implementation. */
|
||||
#undef ICONV_FLAVOR
|
||||
|
||||
/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
|
||||
#undef MAP_ANONYMOUS
|
||||
|
||||
/* Define if the mbrtowc function has the NULL pwc argument bug. */
|
||||
#undef MBRTOWC_NULL_ARG1_BUG
|
||||
|
||||
/* Define if the mbrtowc function has the NULL string argument bug. */
|
||||
#undef MBRTOWC_NULL_ARG2_BUG
|
||||
|
||||
/* Define if the mbrtowc function does not return 0 for a NUL character. */
|
||||
#undef MBRTOWC_NUL_RETVAL_BUG
|
||||
|
||||
/* Define if the mbrtowc function returns a wrong return value. */
|
||||
#undef MBRTOWC_RETVAL_BUG
|
||||
|
||||
/* Define to 1 if assertions should be disabled. */
|
||||
#undef NDEBUG
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the 'a' and
|
||||
'A' directives. */
|
||||
#undef NEED_PRINTF_DIRECTIVE_A
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the 'F'
|
||||
directive. */
|
||||
#undef NEED_PRINTF_DIRECTIVE_F
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the 'ls'
|
||||
directive. */
|
||||
#undef NEED_PRINTF_DIRECTIVE_LS
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for 'double'
|
||||
arguments. */
|
||||
#undef NEED_PRINTF_DOUBLE
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for surviving
|
||||
out-of-memory conditions. */
|
||||
#undef NEED_PRINTF_ENOMEM
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the ' flag.
|
||||
*/
|
||||
#undef NEED_PRINTF_FLAG_GROUPING
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the '-'
|
||||
flag. */
|
||||
#undef NEED_PRINTF_FLAG_LEFTADJUST
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for the 0 flag.
|
||||
*/
|
||||
#undef NEED_PRINTF_FLAG_ZERO
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for infinite
|
||||
'double' arguments. */
|
||||
#undef NEED_PRINTF_INFINITE_DOUBLE
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for infinite
|
||||
'long double' arguments. */
|
||||
#undef NEED_PRINTF_INFINITE_LONG_DOUBLE
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for 'long
|
||||
double' arguments. */
|
||||
#undef NEED_PRINTF_LONG_DOUBLE
|
||||
|
||||
/* Define if the vasnprintf implementation needs special code for supporting
|
||||
large precisions without arbitrary bounds. */
|
||||
#undef NEED_PRINTF_UNBOUNDED_PRECISION
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
@ -992,61 +831,20 @@
|
||||
'ptrdiff_t'. */
|
||||
#undef PTRDIFF_T_SUFFIX
|
||||
|
||||
/* Define if fprintf is overridden by a POSIX compliant gnulib implementation.
|
||||
*/
|
||||
#undef REPLACE_FPRINTF_POSIX
|
||||
|
||||
/* Define to 1 if stat needs help when passed a directory name with a trailing
|
||||
slash */
|
||||
#undef REPLACE_FUNC_STAT_DIR
|
||||
|
||||
/* Define to 1 if stat needs help when passed a file name with a trailing
|
||||
slash */
|
||||
#undef REPLACE_FUNC_STAT_FILE
|
||||
|
||||
/* Define if printf is overridden by a POSIX compliant gnulib implementation.
|
||||
*/
|
||||
#undef REPLACE_PRINTF_POSIX
|
||||
|
||||
/* Define if vasnprintf exists but is overridden by gnulib. */
|
||||
#undef REPLACE_VASNPRINTF
|
||||
|
||||
/* Define if vfprintf is overridden by a POSIX compliant gnulib
|
||||
implementation. */
|
||||
#undef REPLACE_VFPRINTF_POSIX
|
||||
|
||||
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
|
||||
'sig_atomic_t'. */
|
||||
#undef SIG_ATOMIC_T_SUFFIX
|
||||
|
||||
/* Define as the maximum value of type 'size_t', if the system doesn't define
|
||||
it. */
|
||||
#ifndef SIZE_MAX
|
||||
# undef SIZE_MAX
|
||||
#endif
|
||||
|
||||
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
|
||||
'size_t'. */
|
||||
#undef SIZE_T_SUFFIX
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to the prefix of C symbols at the assembler and linker level, either
|
||||
an underscore or empty. */
|
||||
#undef USER_LABEL_PREFIX
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
@ -1058,18 +856,6 @@
|
||||
'wint_t'. */
|
||||
#undef WINT_T_SUFFIX
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
@ -1126,9 +912,6 @@
|
||||
used. */
|
||||
#undef __GETOPT_PREFIX
|
||||
|
||||
/* A replacement for va_copy, if needed. */
|
||||
#define gl_va_copy(a,b) ((a) = (b))
|
||||
|
||||
/* Define to rpl_gmtime if the replacement function should be used. */
|
||||
#undef gmtime
|
||||
|
||||
@ -1138,9 +921,6 @@
|
||||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */
|
||||
#undef intmax_t
|
||||
|
||||
/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
|
||||
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
|
||||
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
|
||||
@ -1154,13 +934,12 @@
|
||||
/* Define to rpl_localtime if the replacement function should be used. */
|
||||
#undef localtime
|
||||
|
||||
/* Define to a type if <wchar.h> does not define. */
|
||||
#undef mbstate_t
|
||||
|
||||
/* Define to the type of st_nlink in struct stat, or a supertype. */
|
||||
#undef nlink_t
|
||||
|
||||
/* Define as the type of the result of subtracting two pointers, if the system
|
||||
doesn't define it. */
|
||||
#undef ptrdiff_t
|
||||
|
||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
nothing if this is not supported. Do not define if restrict is
|
||||
supported directly. */
|
||||
@ -1207,6 +986,3 @@
|
||||
# define _GL_ATTRIBUTE_CONST /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
/* Define as a macro for copying va_list variables. */
|
||||
#undef va_copy
|
||||
|
226
doc/Makefile.in
226
doc/Makefile.in
@ -46,7 +46,6 @@ VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@ -66,48 +65,41 @@ DIST_COMMON = README $(dist_man6_MANS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
|
||||
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
|
||||
$(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 \
|
||||
$(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/ctype.m4 \
|
||||
$(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/exponentd.m4 \
|
||||
$(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
|
||||
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/float_h.m4 \
|
||||
$(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
|
||||
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnand.m4 \
|
||||
$(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
|
||||
$(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/locale_h.m4 \
|
||||
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/malloc.m4 \
|
||||
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 $(top_srcdir)/m4/btowc.m4 \
|
||||
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
|
||||
$(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/extensions.m4 \
|
||||
$(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/getopt.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/libunistring-base.m4 \
|
||||
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
|
||||
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
|
||||
$(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
|
||||
$(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \
|
||||
$(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/multiarch.m4 \
|
||||
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/printf-frexp.m4 \
|
||||
$(top_srcdir)/m4/printf-frexpl.m4 \
|
||||
$(top_srcdir)/m4/printf-posix-rpl.m4 \
|
||||
$(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/signbit.m4 \
|
||||
$(top_srcdir)/m4/size_max.m4 \
|
||||
$(top_srcdir)/m4/snprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/stat.m4 \
|
||||
$(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \
|
||||
$(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
|
||||
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strdup.m4 \
|
||||
$(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strncat.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \
|
||||
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
|
||||
$(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/string_h.m4 \
|
||||
$(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
|
||||
$(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/m4/vfprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wcsdup.m4 \
|
||||
$(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
|
||||
$(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
|
||||
$(top_srcdir)/m4/wmemcpy.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
@ -142,12 +134,12 @@ am__installdirs = "$(DESTDIR)$(man6dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(dist_man6_MANS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
AMTAR = @AMTAR@
|
||||
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
|
||||
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@ -170,36 +162,24 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
|
||||
EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
|
||||
ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
|
||||
ENOLINK_VALUE = @ENOLINK_VALUE@
|
||||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
EXEEXT = @EXEEXT@
|
||||
FLOAT_H = @FLOAT_H@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GNULIB_ACOSL = @GNULIB_ACOSL@
|
||||
GNULIB_ASINL = @GNULIB_ASINL@
|
||||
GNULIB_ATANL = @GNULIB_ATANL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GNULIB_ATOLL = @GNULIB_ATOLL@
|
||||
GNULIB_BTOWC = @GNULIB_BTOWC@
|
||||
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
|
||||
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
|
||||
GNULIB_CEIL = @GNULIB_CEIL@
|
||||
GNULIB_CEILF = @GNULIB_CEILF@
|
||||
GNULIB_CEILL = @GNULIB_CEILL@
|
||||
GNULIB_CHOWN = @GNULIB_CHOWN@
|
||||
GNULIB_CLOSE = @GNULIB_CLOSE@
|
||||
GNULIB_COSL = @GNULIB_COSL@
|
||||
GNULIB_DPRINTF = @GNULIB_DPRINTF@
|
||||
GNULIB_DUP2 = @GNULIB_DUP2@
|
||||
GNULIB_DUP3 = @GNULIB_DUP3@
|
||||
GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
|
||||
GNULIB_ENVIRON = @GNULIB_ENVIRON@
|
||||
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
|
||||
GNULIB_EXPL = @GNULIB_EXPL@
|
||||
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
|
||||
GNULIB_FCHDIR = @GNULIB_FCHDIR@
|
||||
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
|
||||
@ -210,9 +190,6 @@ GNULIB_FFSL = @GNULIB_FFSL@
|
||||
GNULIB_FFSLL = @GNULIB_FFSLL@
|
||||
GNULIB_FGETC = @GNULIB_FGETC@
|
||||
GNULIB_FGETS = @GNULIB_FGETS@
|
||||
GNULIB_FLOOR = @GNULIB_FLOOR@
|
||||
GNULIB_FLOORF = @GNULIB_FLOORF@
|
||||
GNULIB_FLOORL = @GNULIB_FLOORL@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF = @GNULIB_FPRINTF@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
@ -221,8 +198,6 @@ GNULIB_FPUTC = @GNULIB_FPUTC@
|
||||
GNULIB_FPUTS = @GNULIB_FPUTS@
|
||||
GNULIB_FREAD = @GNULIB_FREAD@
|
||||
GNULIB_FREOPEN = @GNULIB_FREOPEN@
|
||||
GNULIB_FREXP = @GNULIB_FREXP@
|
||||
GNULIB_FREXPL = @GNULIB_FREXPL@
|
||||
GNULIB_FSCANF = @GNULIB_FSCANF@
|
||||
GNULIB_FSEEK = @GNULIB_FSEEK@
|
||||
GNULIB_FSEEKO = @GNULIB_FSEEKO@
|
||||
@ -252,20 +227,13 @@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
|
||||
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
|
||||
GNULIB_GRANTPT = @GNULIB_GRANTPT@
|
||||
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
|
||||
GNULIB_ISBLANK = @GNULIB_ISBLANK@
|
||||
GNULIB_ISFINITE = @GNULIB_ISFINITE@
|
||||
GNULIB_ISINF = @GNULIB_ISINF@
|
||||
GNULIB_ISNAN = @GNULIB_ISNAN@
|
||||
GNULIB_ISNAND = @GNULIB_ISNAND@
|
||||
GNULIB_ISNANF = @GNULIB_ISNANF@
|
||||
GNULIB_ISNANL = @GNULIB_ISNANL@
|
||||
GNULIB_ICONV = @GNULIB_ICONV@
|
||||
GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
|
||||
GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
|
||||
GNULIB_LCHMOD = @GNULIB_LCHMOD@
|
||||
GNULIB_LCHOWN = @GNULIB_LCHOWN@
|
||||
GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LINK = @GNULIB_LINK@
|
||||
GNULIB_LINKAT = @GNULIB_LINKAT@
|
||||
GNULIB_LOGB = @GNULIB_LOGB@
|
||||
GNULIB_LOGL = @GNULIB_LOGL@
|
||||
GNULIB_LSEEK = @GNULIB_LSEEK@
|
||||
GNULIB_LSTAT = @GNULIB_LSTAT@
|
||||
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
|
||||
@ -331,19 +299,13 @@ GNULIB_REMOVE = @GNULIB_REMOVE@
|
||||
GNULIB_RENAME = @GNULIB_RENAME@
|
||||
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
|
||||
GNULIB_RMDIR = @GNULIB_RMDIR@
|
||||
GNULIB_ROUND = @GNULIB_ROUND@
|
||||
GNULIB_ROUNDF = @GNULIB_ROUNDF@
|
||||
GNULIB_ROUNDL = @GNULIB_ROUNDL@
|
||||
GNULIB_RPMATCH = @GNULIB_RPMATCH@
|
||||
GNULIB_SCANF = @GNULIB_SCANF@
|
||||
GNULIB_SETENV = @GNULIB_SETENV@
|
||||
GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
|
||||
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
|
||||
GNULIB_SINL = @GNULIB_SINL@
|
||||
GNULIB_SLEEP = @GNULIB_SLEEP@
|
||||
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
|
||||
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
|
||||
GNULIB_SQRTL = @GNULIB_SQRTL@
|
||||
GNULIB_STAT = @GNULIB_STAT@
|
||||
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
|
||||
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
|
||||
@ -370,13 +332,10 @@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
|
||||
GNULIB_SYMLINK = @GNULIB_SYMLINK@
|
||||
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
|
||||
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
|
||||
GNULIB_TANL = @GNULIB_TANL@
|
||||
GNULIB_TIMEGM = @GNULIB_TIMEGM@
|
||||
GNULIB_TIME_R = @GNULIB_TIME_R@
|
||||
GNULIB_TMPFILE = @GNULIB_TMPFILE@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
|
||||
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
|
||||
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
|
||||
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
|
||||
@ -425,6 +384,8 @@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
|
||||
GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
|
||||
GNULIB_WCTOB = @GNULIB_WCTOB@
|
||||
GNULIB_WCTOMB = @GNULIB_WCTOMB@
|
||||
GNULIB_WCTRANS = @GNULIB_WCTRANS@
|
||||
GNULIB_WCTYPE = @GNULIB_WCTYPE@
|
||||
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
|
||||
GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
|
||||
GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
|
||||
@ -434,27 +395,13 @@ GNULIB_WMEMSET = @GNULIB_WMEMSET@
|
||||
GNULIB_WRITE = @GNULIB_WRITE@
|
||||
GNULIB__EXIT = @GNULIB__EXIT@
|
||||
GREP = @GREP@
|
||||
HAVE_ACOSL = @HAVE_ACOSL@
|
||||
HAVE_ASINL = @HAVE_ASINL@
|
||||
HAVE_ATANL = @HAVE_ATANL@
|
||||
HAVE_ATOLL = @HAVE_ATOLL@
|
||||
HAVE_BTOWC = @HAVE_BTOWC@
|
||||
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
|
||||
HAVE_CHOWN = @HAVE_CHOWN@
|
||||
HAVE_COSL = @HAVE_COSL@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
|
||||
HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
|
||||
HAVE_DECL_COSL = @HAVE_DECL_COSL@
|
||||
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
|
||||
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
|
||||
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
|
||||
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
|
||||
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
|
||||
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
|
||||
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
|
||||
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
|
||||
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
|
||||
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
|
||||
@ -464,30 +411,18 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
|
||||
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
|
||||
HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
|
||||
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
|
||||
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
|
||||
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
|
||||
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
|
||||
HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
|
||||
HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
|
||||
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
|
||||
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
|
||||
HAVE_DECL_SINL = @HAVE_DECL_SINL@
|
||||
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
|
||||
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
|
||||
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
|
||||
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
|
||||
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
|
||||
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
|
||||
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
|
||||
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
||||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
|
||||
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
|
||||
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
|
||||
@ -498,7 +433,6 @@ HAVE_DUP2 = @HAVE_DUP2@
|
||||
HAVE_DUP3 = @HAVE_DUP3@
|
||||
HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
|
||||
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
|
||||
HAVE_EXPL = @HAVE_EXPL@
|
||||
HAVE_FACCESSAT = @HAVE_FACCESSAT@
|
||||
HAVE_FCHDIR = @HAVE_FCHDIR@
|
||||
HAVE_FCHMODAT = @HAVE_FCHMODAT@
|
||||
@ -523,15 +457,12 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
|
||||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISBLANK = @HAVE_ISBLANK@
|
||||
HAVE_ISNAND = @HAVE_ISNAND@
|
||||
HAVE_ISNANF = @HAVE_ISNANF@
|
||||
HAVE_ISNANL = @HAVE_ISNANL@
|
||||
HAVE_ISWBLANK = @HAVE_ISWBLANK@
|
||||
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
|
||||
HAVE_LCHMOD = @HAVE_LCHMOD@
|
||||
HAVE_LCHOWN = @HAVE_LCHOWN@
|
||||
HAVE_LINK = @HAVE_LINK@
|
||||
HAVE_LINKAT = @HAVE_LINKAT@
|
||||
HAVE_LOGL = @HAVE_LOGL@
|
||||
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
|
||||
HAVE_LSTAT = @HAVE_LSTAT@
|
||||
HAVE_MBRLEN = @HAVE_MBRLEN@
|
||||
@ -571,9 +502,7 @@ HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
|
||||
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
|
||||
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
|
||||
HAVE_SINL = @HAVE_SINL@
|
||||
HAVE_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_SQRTL = @HAVE_SQRTL@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
@ -596,7 +525,6 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
|
||||
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
|
||||
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
|
||||
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
|
||||
HAVE_TANL = @HAVE_TANL@
|
||||
HAVE_TIMEGM = @HAVE_TIMEGM@
|
||||
HAVE_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNLINKAT = @HAVE_UNLINKAT@
|
||||
@ -634,6 +562,9 @@ HAVE_WCSSTR = @HAVE_WCSSTR@
|
||||
HAVE_WCSTOK = @HAVE_WCSTOK@
|
||||
HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
|
||||
HAVE_WCSXFRM = @HAVE_WCSXFRM@
|
||||
HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
|
||||
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
|
||||
HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
|
||||
HAVE_WINT_T = @HAVE_WINT_T@
|
||||
HAVE_WMEMCHR = @HAVE_WMEMCHR@
|
||||
HAVE_WMEMCMP = @HAVE_WMEMCMP@
|
||||
@ -643,6 +574,8 @@ HAVE_WMEMSET = @HAVE_WMEMSET@
|
||||
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HAVE__EXIT = @HAVE__EXIT@
|
||||
ICONV_CONST = @ICONV_CONST@
|
||||
ICONV_H = @ICONV_H@
|
||||
INCLUDE_NEXT = @INCLUDE_NEXT@
|
||||
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
|
||||
INSTALL = @INSTALL@
|
||||
@ -650,23 +583,33 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
|
||||
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
|
||||
LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
LOCALE_FR = @LOCALE_FR@
|
||||
LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
|
||||
LOCALE_JA = @LOCALE_JA@
|
||||
LOCALE_ZH_CN = @LOCALE_ZH_CN@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
|
||||
@ -677,13 +620,10 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
|
||||
NEXT_CTYPE_H = @NEXT_CTYPE_H@
|
||||
NEXT_ERRNO_H = @NEXT_ERRNO_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
|
||||
NEXT_GETOPT_H = @NEXT_GETOPT_H@
|
||||
NEXT_ICONV_H = @NEXT_ICONV_H@
|
||||
NEXT_LOCALE_H = @NEXT_LOCALE_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
NEXT_STDARG_H = @NEXT_STDARG_H@
|
||||
NEXT_STDDEF_H = @NEXT_STDDEF_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
@ -694,6 +634,7 @@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
|
||||
NEXT_TIME_H = @NEXT_TIME_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NEXT_WCHAR_H = @NEXT_WCHAR_H@
|
||||
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -703,6 +644,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
|
||||
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
|
||||
@ -711,9 +653,6 @@ RANLIB = @RANLIB@
|
||||
REPLACE_BTOWC = @REPLACE_BTOWC@
|
||||
REPLACE_CALLOC = @REPLACE_CALLOC@
|
||||
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
|
||||
REPLACE_CEIL = @REPLACE_CEIL@
|
||||
REPLACE_CEILF = @REPLACE_CEILF@
|
||||
REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_CLOSE = @REPLACE_CLOSE@
|
||||
REPLACE_DPRINTF = @REPLACE_DPRINTF@
|
||||
@ -723,15 +662,10 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
|
||||
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
|
||||
REPLACE_FCLOSE = @REPLACE_FCLOSE@
|
||||
REPLACE_FFLUSH = @REPLACE_FFLUSH@
|
||||
REPLACE_FLOOR = @REPLACE_FLOOR@
|
||||
REPLACE_FLOORF = @REPLACE_FLOORF@
|
||||
REPLACE_FLOORL = @REPLACE_FLOORL@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FPURGE = @REPLACE_FPURGE@
|
||||
REPLACE_FREOPEN = @REPLACE_FREOPEN@
|
||||
REPLACE_FREXP = @REPLACE_FREXP@
|
||||
REPLACE_FREXPL = @REPLACE_FREXPL@
|
||||
REPLACE_FSEEK = @REPLACE_FSEEK@
|
||||
REPLACE_FSEEKO = @REPLACE_FSEEKO@
|
||||
REPLACE_FSTAT = @REPLACE_FSTAT@
|
||||
@ -747,12 +681,12 @@ REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
REPLACE_ISFINITE = @REPLACE_ISFINITE@
|
||||
REPLACE_ISINF = @REPLACE_ISINF@
|
||||
REPLACE_ISNAN = @REPLACE_ISNAN@
|
||||
REPLACE_ICONV = @REPLACE_ICONV@
|
||||
REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
|
||||
REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
|
||||
REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
|
||||
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
|
||||
REPLACE_LCHOWN = @REPLACE_LCHOWN@
|
||||
REPLACE_LDEXPL = @REPLACE_LDEXPL@
|
||||
REPLACE_LINK = @REPLACE_LINK@
|
||||
REPLACE_LINKAT = @REPLACE_LINKAT@
|
||||
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
|
||||
@ -773,7 +707,6 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
|
||||
REPLACE_MKNOD = @REPLACE_MKNOD@
|
||||
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
|
||||
REPLACE_MKTIME = @REPLACE_MKTIME@
|
||||
REPLACE_NAN = @REPLACE_NAN@
|
||||
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
|
||||
REPLACE_NULL = @REPLACE_NULL@
|
||||
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
|
||||
@ -791,13 +724,8 @@ REPLACE_REMOVE = @REPLACE_REMOVE@
|
||||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SLEEP = @REPLACE_SLEEP@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
@ -820,9 +748,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
|
||||
REPLACE_SYMLINK = @REPLACE_SYMLINK@
|
||||
REPLACE_TIMEGM = @REPLACE_TIMEGM@
|
||||
REPLACE_TMPFILE = @REPLACE_TMPFILE@
|
||||
REPLACE_TRUNC = @REPLACE_TRUNC@
|
||||
REPLACE_TRUNCF = @REPLACE_TRUNCF@
|
||||
REPLACE_TRUNCL = @REPLACE_TRUNCL@
|
||||
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
|
||||
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
|
||||
REPLACE_UNLINK = @REPLACE_UNLINK@
|
||||
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
|
||||
@ -847,7 +773,6 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
|
||||
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
|
||||
STDARG_H = @STDARG_H@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STDDEF_H = @STDDEF_H@
|
||||
STDINT_H = @STDINT_H@
|
||||
@ -857,9 +782,13 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
|
||||
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
|
||||
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
|
||||
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
@ -898,6 +827,7 @@ infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
lispdir = @lispdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
|
807
lib/Makefile.am
807
lib/Makefile.am
@ -9,9 +9,9 @@
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl assert config-h ctype fprintf-posix getopt-gnu gettimeofday locale printf-posix snprintf-posix stat stdarg stdbool stdio strdup-posix string strncat strstr sys_stat sys_time unistd vfprintf-posix vsnprintf-posix
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl assert btowc config-h getopt-gnu gettext gettext-h gettimeofday locale mbrtowc mbsrtowcs stdbool stdio striconv string strstr sys_stat sys_time unistd wchar wcrtomb wcsdup wctob wctype-h
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.5 gnits
|
||||
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
|
||||
|
||||
SUBDIRS =
|
||||
noinst_HEADERS =
|
||||
@ -36,168 +36,70 @@ libgnu_a_LIBADD = $(gl_LIBOBJS)
|
||||
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
|
||||
EXTRA_libgnu_a_SOURCES =
|
||||
|
||||
## begin gnulib module alloca-opt
|
||||
## begin gnulib module btowc
|
||||
|
||||
BUILT_SOURCES += $(ALLOCA_H)
|
||||
|
||||
# We need the following in order to create <alloca.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_ALLOCA_H
|
||||
alloca.h: alloca.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
EXTRA_DIST += btowc.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += btowc.c
|
||||
|
||||
## end gnulib module btowc
|
||||
|
||||
## begin gnulib module c-ctype
|
||||
|
||||
libgnu_a_SOURCES += c-ctype.h c-ctype.c
|
||||
|
||||
## end gnulib module c-ctype
|
||||
|
||||
## begin gnulib module c-strcase
|
||||
|
||||
libgnu_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
|
||||
|
||||
## end gnulib module c-strcase
|
||||
|
||||
## begin gnulib module configmake
|
||||
|
||||
# Listed in the same order as the GNU makefile conventions, and
|
||||
# provided by autoconf 2.59c+.
|
||||
# The Automake-defined pkg* macros are appended, in the order
|
||||
# listed in the Automake 1.10a+ documentation.
|
||||
configmake.h: Makefile
|
||||
$(AM_V_GEN)rm -f $@-t && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/alloca.in.h; \
|
||||
} > $@-t && \
|
||||
echo '#define PREFIX "$(prefix)"'; \
|
||||
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
|
||||
echo '#define BINDIR "$(bindir)"'; \
|
||||
echo '#define SBINDIR "$(sbindir)"'; \
|
||||
echo '#define LIBEXECDIR "$(libexecdir)"'; \
|
||||
echo '#define DATAROOTDIR "$(datarootdir)"'; \
|
||||
echo '#define DATADIR "$(datadir)"'; \
|
||||
echo '#define SYSCONFDIR "$(sysconfdir)"'; \
|
||||
echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
|
||||
echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
|
||||
echo '#define INCLUDEDIR "$(includedir)"'; \
|
||||
echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
|
||||
echo '#define DOCDIR "$(docdir)"'; \
|
||||
echo '#define INFODIR "$(infodir)"'; \
|
||||
echo '#define HTMLDIR "$(htmldir)"'; \
|
||||
echo '#define DVIDIR "$(dvidir)"'; \
|
||||
echo '#define PDFDIR "$(pdfdir)"'; \
|
||||
echo '#define PSDIR "$(psdir)"'; \
|
||||
echo '#define LIBDIR "$(libdir)"'; \
|
||||
echo '#define LISPDIR "$(lispdir)"'; \
|
||||
echo '#define LOCALEDIR "$(localedir)"'; \
|
||||
echo '#define MANDIR "$(mandir)"'; \
|
||||
echo '#define MANEXT "$(manext)"'; \
|
||||
echo '#define PKGDATADIR "$(pkgdatadir)"'; \
|
||||
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
|
||||
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
|
||||
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
|
||||
} | sed '/""/d' > $@-t
|
||||
mv -f $@-t $@
|
||||
else
|
||||
alloca.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += alloca.h alloca.h-t
|
||||
|
||||
EXTRA_DIST += alloca.in.h
|
||||
BUILT_SOURCES += configmake.h
|
||||
CLEANFILES += configmake.h configmake.h-t
|
||||
|
||||
## end gnulib module alloca-opt
|
||||
|
||||
## begin gnulib module ctype
|
||||
|
||||
BUILT_SOURCES += ctype.h
|
||||
|
||||
# We need the following in order to create <ctype.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|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_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
|
||||
-e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
|
||||
-e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/ctype.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += ctype.h ctype.h-t
|
||||
|
||||
EXTRA_DIST += ctype.in.h
|
||||
|
||||
## end gnulib module ctype
|
||||
|
||||
## begin gnulib module dosname
|
||||
|
||||
|
||||
EXTRA_DIST += dosname.h
|
||||
|
||||
## end gnulib module dosname
|
||||
|
||||
## begin gnulib module errno
|
||||
|
||||
BUILT_SOURCES += $(ERRNO_H)
|
||||
|
||||
# We need the following in order to create <errno.h> when the system
|
||||
# doesn't have one that is POSIX compliant.
|
||||
if GL_GENERATE_ERRNO_H
|
||||
errno.h: errno.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|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_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
|
||||
-e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
|
||||
-e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
|
||||
-e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
|
||||
-e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
|
||||
-e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
|
||||
-e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
|
||||
< $(srcdir)/errno.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
errno.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += errno.h errno.h-t
|
||||
|
||||
EXTRA_DIST += errno.in.h
|
||||
|
||||
## end gnulib module errno
|
||||
|
||||
## begin gnulib module float
|
||||
|
||||
BUILT_SOURCES += $(FLOAT_H)
|
||||
|
||||
# We need the following in order to create <float.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_FLOAT_H
|
||||
float.h: float.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|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_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
|
||||
< $(srcdir)/float.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
float.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += float.h float.h-t
|
||||
|
||||
EXTRA_DIST += float.c float.in.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += float.c
|
||||
|
||||
## end gnulib module float
|
||||
|
||||
## begin gnulib module fprintf-posix
|
||||
|
||||
|
||||
EXTRA_DIST += fprintf.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += fprintf.c
|
||||
|
||||
## end gnulib module fprintf-posix
|
||||
|
||||
## begin gnulib module fpucw
|
||||
|
||||
|
||||
EXTRA_DIST += fpucw.h
|
||||
|
||||
## end gnulib module fpucw
|
||||
|
||||
## begin gnulib module frexp-nolibm
|
||||
|
||||
|
||||
EXTRA_DIST += frexp.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += frexp.c
|
||||
|
||||
## end gnulib module frexp-nolibm
|
||||
|
||||
## begin gnulib module frexpl-nolibm
|
||||
|
||||
|
||||
EXTRA_DIST += frexp.c frexpl.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += frexp.c frexpl.c
|
||||
|
||||
## end gnulib module frexpl-nolibm
|
||||
|
||||
## begin gnulib module fseterr
|
||||
|
||||
libgnu_a_SOURCES += fseterr.c
|
||||
|
||||
EXTRA_DIST += fseterr.h stdio-impl.h
|
||||
|
||||
## end gnulib module fseterr
|
||||
## end gnulib module configmake
|
||||
|
||||
## begin gnulib module getopt-posix
|
||||
|
||||
@ -226,6 +128,22 @@ EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
|
||||
|
||||
## end gnulib module getopt-posix
|
||||
|
||||
## begin gnulib module gettext
|
||||
|
||||
# This is for those projects which use "gettextize --intl" to put a source-code
|
||||
# copy of libintl into their package. In such projects, every Makefile.am needs
|
||||
# -I$(top_builddir)/intl, so that <libintl.h> can be found in this directory.
|
||||
# For the Makefile.ams in other directories it is the maintainer's
|
||||
# responsibility; for the one from gnulib we do it here.
|
||||
# This option has no effect when the user disables NLS (because then the intl
|
||||
# directory contains no libintl.h file) or when the project does not use
|
||||
# "gettextize --intl".
|
||||
AM_CPPFLAGS += -I$(top_builddir)/intl
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
|
||||
|
||||
## end gnulib module gettext
|
||||
|
||||
## begin gnulib module gettext-h
|
||||
|
||||
libgnu_a_SOURCES += gettext.h
|
||||
@ -241,32 +159,156 @@ EXTRA_libgnu_a_SOURCES += gettimeofday.c
|
||||
|
||||
## end gnulib module gettimeofday
|
||||
|
||||
## begin gnulib module isnand-nolibm
|
||||
## begin gnulib module gperf
|
||||
|
||||
GPERF = gperf
|
||||
|
||||
## end gnulib module gperf
|
||||
|
||||
## begin gnulib module havelib
|
||||
|
||||
|
||||
EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c
|
||||
EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += isnan.c isnand.c
|
||||
## end gnulib module havelib
|
||||
|
||||
## end gnulib module isnand-nolibm
|
||||
## begin gnulib module iconv-h
|
||||
|
||||
## begin gnulib module isnanf-nolibm
|
||||
BUILT_SOURCES += $(ICONV_H)
|
||||
|
||||
# We need the following in order to create <iconv.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_ICONV_H
|
||||
iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|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_ICONV_H''@|$(NEXT_ICONV_H)|g' \
|
||||
-e 's/@''GNULIB_ICONV''@/$(GNULIB_ICONV)/g' \
|
||||
-e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
|
||||
-e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
|
||||
-e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
|
||||
-e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|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)/iconv.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
iconv.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += iconv.h iconv.h-t
|
||||
|
||||
EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c
|
||||
EXTRA_DIST += iconv.in.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += isnan.c isnanf.c
|
||||
## end gnulib module iconv-h
|
||||
|
||||
## end gnulib module isnanf-nolibm
|
||||
## begin gnulib module iconv_open
|
||||
|
||||
## begin gnulib module isnanl-nolibm
|
||||
iconv_open-aix.h: iconv_open-aix.gperf
|
||||
$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t
|
||||
mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
|
||||
iconv_open-hpux.h: iconv_open-hpux.gperf
|
||||
$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t
|
||||
mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
|
||||
iconv_open-irix.h: iconv_open-irix.gperf
|
||||
$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t
|
||||
mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
|
||||
iconv_open-osf.h: iconv_open-osf.gperf
|
||||
$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t
|
||||
mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
|
||||
iconv_open-solaris.h: iconv_open-solaris.gperf
|
||||
$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t
|
||||
mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
|
||||
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
|
||||
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
|
||||
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
|
||||
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
|
||||
|
||||
EXTRA_DIST += iconv.c iconv_close.c iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c
|
||||
|
||||
EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c
|
||||
EXTRA_libgnu_a_SOURCES += iconv.c iconv_close.c iconv_open.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += isnan.c isnanl.c
|
||||
## end gnulib module iconv_open
|
||||
|
||||
## end gnulib module isnanl-nolibm
|
||||
## begin gnulib module localcharset
|
||||
|
||||
libgnu_a_SOURCES += localcharset.h localcharset.c
|
||||
|
||||
# We need the following in order to install a simple file in $(libdir)
|
||||
# which is shared with other installed packages. We use a list of referencing
|
||||
# packages so that "make uninstall" will remove the file if and only if it
|
||||
# is not used by another installed package.
|
||||
# On systems with glibc-2.1 or newer, the file is redundant, therefore we
|
||||
# avoid installing it.
|
||||
|
||||
all-local: charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
charset_alias = $(DESTDIR)$(libdir)/charset.alias
|
||||
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
|
||||
install-exec-local: install-exec-localcharset
|
||||
install-exec-localcharset: all-local
|
||||
if test $(GLIBC21) = no; then \
|
||||
case '$(host_os)' in \
|
||||
darwin[56]*) \
|
||||
need_charset_alias=true ;; \
|
||||
darwin* | cygwin* | mingw* | pw32* | cegcc*) \
|
||||
need_charset_alias=false ;; \
|
||||
*) \
|
||||
need_charset_alias=true ;; \
|
||||
esac ; \
|
||||
else \
|
||||
need_charset_alias=false ; \
|
||||
fi ; \
|
||||
if $$need_charset_alias; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir) ; \
|
||||
fi ; \
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
||||
rm -f $(charset_tmp) ; \
|
||||
else \
|
||||
if $$need_charset_alias; then \
|
||||
sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
||||
rm -f $(charset_tmp) ; \
|
||||
fi ; \
|
||||
fi
|
||||
|
||||
uninstall-local: uninstall-localcharset
|
||||
uninstall-localcharset: all-local
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
|
||||
if grep '^# Packages using this file: $$' $(charset_tmp) \
|
||||
> /dev/null; then \
|
||||
rm -f $(charset_alias); \
|
||||
else \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
|
||||
fi; \
|
||||
rm -f $(charset_tmp); \
|
||||
fi
|
||||
|
||||
charset.alias: config.charset
|
||||
$(AM_V_GEN)rm -f t-$@ $@ && \
|
||||
$(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
|
||||
mv t-$@ $@
|
||||
|
||||
SUFFIXES += .sed .sin
|
||||
.sin.sed:
|
||||
$(AM_V_GEN)rm -f t-$@ $@ && \
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
|
||||
mv t-$@ $@
|
||||
|
||||
CLEANFILES += charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
EXTRA_DIST += config.charset ref-add.sin ref-del.sin
|
||||
|
||||
## end gnulib module localcharset
|
||||
|
||||
## begin gnulib module locale
|
||||
|
||||
@ -300,129 +342,41 @@ EXTRA_DIST += locale.in.h
|
||||
|
||||
## end gnulib module locale
|
||||
|
||||
## begin gnulib module malloc-posix
|
||||
## begin gnulib module mbrtowc
|
||||
|
||||
|
||||
EXTRA_DIST += malloc.c
|
||||
EXTRA_DIST += mbrtowc.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += malloc.c
|
||||
EXTRA_libgnu_a_SOURCES += mbrtowc.c
|
||||
|
||||
## end gnulib module malloc-posix
|
||||
## end gnulib module mbrtowc
|
||||
|
||||
## begin gnulib module math
|
||||
## begin gnulib module mbsinit
|
||||
|
||||
BUILT_SOURCES += math.h
|
||||
|
||||
# We need the following in order to create <math.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
|
||||
-e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
|
||||
-e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
|
||||
-e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
|
||||
-e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
|
||||
-e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
|
||||
-e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
|
||||
-e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
|
||||
-e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
|
||||
-e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
|
||||
-e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
|
||||
-e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
|
||||
-e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
|
||||
-e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
|
||||
-e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
|
||||
-e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
|
||||
-e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
|
||||
-e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
|
||||
-e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
|
||||
-e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
|
||||
-e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
|
||||
-e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
|
||||
-e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
|
||||
-e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
|
||||
-e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
|
||||
-e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
|
||||
-e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
|
||||
-e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
|
||||
-e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
|
||||
-e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
|
||||
-e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
|
||||
-e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
|
||||
-e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/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_EXPL''@|$(HAVE_EXPL)|g' \
|
||||
-e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
|
||||
-e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
|
||||
-e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
|
||||
-e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
|
||||
-e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
|
||||
-e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
|
||||
-e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
|
||||
-e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
|
||||
-e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
|
||||
-e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
|
||||
-e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
|
||||
-e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
|
||||
-e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
|
||||
-e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
|
||||
-e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
|
||||
-e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
|
||||
-e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
|
||||
-e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
|
||||
-e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
|
||||
-e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
|
||||
-e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
|
||||
-e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
|
||||
-e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
|
||||
-e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
|
||||
-e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
|
||||
-e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|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' \
|
||||
| \
|
||||
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_FLOORF''@|$(REPLACE_FLOORF)|g' \
|
||||
-e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
|
||||
-e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
|
||||
-e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
|
||||
-e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
|
||||
-e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
|
||||
-e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
|
||||
-e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
|
||||
-e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
|
||||
-e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
|
||||
-e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
|
||||
-e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
|
||||
-e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
|
||||
-e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
|
||||
-e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
|
||||
-e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
|
||||
-e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|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)'; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += math.h math.h-t
|
||||
EXTRA_DIST += mbsinit.c
|
||||
|
||||
EXTRA_DIST += math.in.h
|
||||
EXTRA_libgnu_a_SOURCES += mbsinit.c
|
||||
|
||||
## end gnulib module math
|
||||
## end gnulib module mbsinit
|
||||
|
||||
## begin gnulib module mbsrtowcs
|
||||
|
||||
|
||||
EXTRA_DIST += mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += mbsrtowcs-state.c mbsrtowcs.c
|
||||
|
||||
## end gnulib module mbsrtowcs
|
||||
|
||||
## begin gnulib module mbtowc
|
||||
|
||||
|
||||
EXTRA_DIST += mbtowc-impl.h mbtowc.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += mbtowc.c
|
||||
|
||||
## end gnulib module mbtowc
|
||||
|
||||
## begin gnulib module memchr
|
||||
|
||||
@ -433,48 +387,6 @@ EXTRA_libgnu_a_SOURCES += memchr.c
|
||||
|
||||
## end gnulib module memchr
|
||||
|
||||
## begin gnulib module printf-frexp
|
||||
|
||||
libgnu_a_SOURCES += printf-frexp.c
|
||||
|
||||
EXTRA_DIST += printf-frexp.h
|
||||
|
||||
## end gnulib module printf-frexp
|
||||
|
||||
## begin gnulib module printf-frexpl
|
||||
|
||||
libgnu_a_SOURCES += printf-frexpl.c
|
||||
|
||||
EXTRA_DIST += printf-frexp.c printf-frexpl.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += printf-frexp.c
|
||||
|
||||
## end gnulib module printf-frexpl
|
||||
|
||||
## begin gnulib module printf-posix
|
||||
|
||||
|
||||
EXTRA_DIST += printf.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += printf.c
|
||||
|
||||
## end gnulib module printf-posix
|
||||
|
||||
## begin gnulib module signbit
|
||||
|
||||
|
||||
EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += signbitd.c signbitf.c signbitl.c
|
||||
|
||||
## end gnulib module signbit
|
||||
|
||||
## begin gnulib module size_max
|
||||
|
||||
libgnu_a_SOURCES += size_max.h
|
||||
|
||||
## end gnulib module size_max
|
||||
|
||||
## begin gnulib module snippet/_Noreturn
|
||||
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
@ -536,6 +448,31 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
|
||||
|
||||
## end gnulib module snippet/c++defs
|
||||
|
||||
## begin gnulib module snippet/unused-parameter
|
||||
|
||||
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
|
||||
# statements but through direct file reference. Therefore this snippet must be
|
||||
# present in all Makefile.am that need it. This is ensured by the applicability
|
||||
# 'all' defined above.
|
||||
|
||||
BUILT_SOURCES += unused-parameter.h
|
||||
# The unused-parameter.h that gets inserted into generated .h files is the same
|
||||
# as build-aux/snippet/unused-parameter.h, except that it has the copyright
|
||||
# header cut off.
|
||||
unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
|
||||
< $(top_srcdir)/build-aux/snippet/unused-parameter.h \
|
||||
> $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
|
||||
|
||||
UNUSED_PARAMETER_H=unused-parameter.h
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
|
||||
|
||||
## end gnulib module snippet/unused-parameter
|
||||
|
||||
## begin gnulib module snippet/warn-on-use
|
||||
|
||||
BUILT_SOURCES += warn-on-use.h
|
||||
@ -556,52 +493,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
|
||||
|
||||
## end gnulib module snippet/warn-on-use
|
||||
|
||||
## begin gnulib module snprintf
|
||||
|
||||
|
||||
EXTRA_DIST += snprintf.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += snprintf.c
|
||||
|
||||
## end gnulib module snprintf
|
||||
|
||||
## begin gnulib module stat
|
||||
|
||||
|
||||
EXTRA_DIST += stat.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += stat.c
|
||||
|
||||
## end gnulib module stat
|
||||
|
||||
## begin gnulib module stdarg
|
||||
|
||||
BUILT_SOURCES += $(STDARG_H)
|
||||
|
||||
# We need the following in order to create <stdarg.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_STDARG_H
|
||||
stdarg.h: stdarg.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|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_STDARG_H''@|$(NEXT_STDARG_H)|g' \
|
||||
< $(srcdir)/stdarg.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
stdarg.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += stdarg.h stdarg.h-t
|
||||
|
||||
EXTRA_DIST += stdarg.in.h
|
||||
|
||||
## end gnulib module stdarg
|
||||
|
||||
## begin gnulib module stdbool
|
||||
|
||||
BUILT_SOURCES += $(STDBOOL_H)
|
||||
@ -921,14 +812,20 @@ EXTRA_DIST += stdlib.in.h
|
||||
|
||||
## end gnulib module stdlib
|
||||
|
||||
## begin gnulib module strdup-posix
|
||||
## begin gnulib module streq
|
||||
|
||||
|
||||
EXTRA_DIST += strdup.c
|
||||
EXTRA_DIST += streq.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += strdup.c
|
||||
## end gnulib module streq
|
||||
|
||||
## end gnulib module strdup-posix
|
||||
## begin gnulib module striconv
|
||||
|
||||
libgnu_a_SOURCES += striconv.h striconv.c
|
||||
if GL_COND_LIBTOOL
|
||||
endif
|
||||
|
||||
## end gnulib module striconv
|
||||
|
||||
## begin gnulib module string
|
||||
|
||||
@ -1030,14 +927,11 @@ EXTRA_DIST += string.in.h
|
||||
|
||||
## end gnulib module string
|
||||
|
||||
## begin gnulib module strncat
|
||||
## begin gnulib module strnlen1
|
||||
|
||||
libgnu_a_SOURCES += strnlen1.h strnlen1.c
|
||||
|
||||
EXTRA_DIST += strncat.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += strncat.c
|
||||
|
||||
## end gnulib module strncat
|
||||
## end gnulib module strnlen1
|
||||
|
||||
## begin gnulib module strstr-simple
|
||||
|
||||
@ -1320,14 +1214,53 @@ EXTRA_DIST += unistd.in.h
|
||||
|
||||
## end gnulib module unistd
|
||||
|
||||
## begin gnulib module vasnprintf
|
||||
## begin gnulib module unistr/base
|
||||
|
||||
BUILT_SOURCES += $(LIBUNISTRING_UNISTR_H)
|
||||
|
||||
EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
|
||||
unistr.h: unistr.in.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/unistr.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
MOSTLYCLEANFILES += unistr.h unistr.h-t
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
|
||||
EXTRA_DIST += unistr.in.h
|
||||
|
||||
## end gnulib module vasnprintf
|
||||
## end gnulib module unistr/base
|
||||
|
||||
## begin gnulib module unistr/u8-mbtoucr
|
||||
|
||||
if LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR
|
||||
libgnu_a_SOURCES += unistr/u8-mbtoucr.c
|
||||
endif
|
||||
|
||||
## end gnulib module unistr/u8-mbtoucr
|
||||
|
||||
## begin gnulib module unistr/u8-uctomb
|
||||
|
||||
if LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB
|
||||
libgnu_a_SOURCES += unistr/u8-uctomb.c unistr/u8-uctomb-aux.c
|
||||
endif
|
||||
|
||||
## end gnulib module unistr/u8-uctomb
|
||||
|
||||
## begin gnulib module unitypes
|
||||
|
||||
BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)
|
||||
|
||||
unitypes.h: unitypes.in.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/unitypes.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
MOSTLYCLEANFILES += unitypes.h unitypes.h-t
|
||||
|
||||
EXTRA_DIST += unitypes.in.h
|
||||
|
||||
## end gnulib module unitypes
|
||||
|
||||
## begin gnulib module verify
|
||||
|
||||
@ -1336,24 +1269,6 @@ EXTRA_DIST += verify.h
|
||||
|
||||
## end gnulib module verify
|
||||
|
||||
## begin gnulib module vfprintf-posix
|
||||
|
||||
|
||||
EXTRA_DIST += vfprintf.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += vfprintf.c
|
||||
|
||||
## end gnulib module vfprintf-posix
|
||||
|
||||
## begin gnulib module vsnprintf
|
||||
|
||||
|
||||
EXTRA_DIST += vsnprintf.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += vsnprintf.c
|
||||
|
||||
## end gnulib module vsnprintf
|
||||
|
||||
## begin gnulib module wchar
|
||||
|
||||
BUILT_SOURCES += wchar.h
|
||||
@ -1475,11 +1390,89 @@ EXTRA_DIST += wchar.in.h
|
||||
|
||||
## end gnulib module wchar
|
||||
|
||||
## begin gnulib module xsize
|
||||
## begin gnulib module wcrtomb
|
||||
|
||||
libgnu_a_SOURCES += xsize.h
|
||||
|
||||
## end gnulib module xsize
|
||||
EXTRA_DIST += wcrtomb.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += wcrtomb.c
|
||||
|
||||
## end gnulib module wcrtomb
|
||||
|
||||
## begin gnulib module wcsdup
|
||||
|
||||
|
||||
EXTRA_DIST += wcsdup-impl.h wcsdup.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += wcsdup.c
|
||||
|
||||
## end gnulib module wcsdup
|
||||
|
||||
## begin gnulib module wctob
|
||||
|
||||
|
||||
EXTRA_DIST += wctob.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += wctob.c
|
||||
|
||||
## end gnulib module wctob
|
||||
|
||||
## begin gnulib module wctomb
|
||||
|
||||
|
||||
EXTRA_DIST += wctomb-impl.h wctomb.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += wctomb.c
|
||||
|
||||
## end gnulib module wctomb
|
||||
|
||||
## begin gnulib module wctype-h
|
||||
|
||||
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 $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-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 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/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
|
||||
|
||||
EXTRA_DIST += wctype.in.h
|
||||
|
||||
## end gnulib module wctype-h
|
||||
|
||||
## begin gnulib module wmemcpy
|
||||
|
||||
|
||||
EXTRA_DIST += wmemcpy-impl.h wmemcpy.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += wmemcpy.c
|
||||
|
||||
## end gnulib module wmemcpy
|
||||
|
||||
|
||||
mostlyclean-local: mostlyclean-generic
|
||||
|
844
lib/Makefile.in
844
lib/Makefile.in
File diff suppressed because it is too large
Load Diff
@ -1,56 +0,0 @@
|
||||
/* Memory allocation on the stack.
|
||||
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-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, 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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
|
||||
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
|
||||
means there is a real alloca function. */
|
||||
#ifndef _GL_ALLOCA_H
|
||||
#define _GL_ALLOCA_H
|
||||
|
||||
/* alloca (N) returns a pointer to N bytes of memory
|
||||
allocated on the stack, which will last until the function returns.
|
||||
Use of alloca should be avoided:
|
||||
- inside arguments of function calls - undefined behaviour,
|
||||
- in inline functions - the allocation may actually last until the
|
||||
calling function returns,
|
||||
- for huge N (say, N >= 65536) - you never know how large (or small)
|
||||
the stack is, and when the stack cannot fulfill the memory allocation
|
||||
request, the program just crashes.
|
||||
*/
|
||||
|
||||
#ifndef alloca
|
||||
# ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined _AIX
|
||||
# define alloca __alloca
|
||||
# elif defined _MSC_VER
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# elif defined __DECC && defined __VMS
|
||||
# define alloca __ALLOCA
|
||||
# else
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *alloca (size_t);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _GL_ALLOCA_H */
|
@ -1,5 +1,6 @@
|
||||
/* Formatted output to a stream.
|
||||
Copyright (C) 2007, 2010-2011 Free Software Foundation, Inc.
|
||||
/* Convert unibyte character to wide character.
|
||||
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
|
||||
@ -14,27 +15,25 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if 1
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Print formatted output to standard output.
|
||||
Return string length of formatted string. On error, return a negative
|
||||
value. */
|
||||
int
|
||||
printf (const char *format, ...)
|
||||
wint_t
|
||||
btowc (int c)
|
||||
{
|
||||
int retval;
|
||||
va_list args;
|
||||
if (c != EOF)
|
||||
{
|
||||
char buf[1];
|
||||
wchar_t wc;
|
||||
|
||||
va_start (args, format);
|
||||
retval = vfprintf (stdout, format, args);
|
||||
va_end (args);
|
||||
|
||||
return retval;
|
||||
buf[0] = c;
|
||||
if (mbtowc (&wc, buf, 1) >= 0)
|
||||
return wc;
|
||||
}
|
||||
return WEOF;
|
||||
}
|
396
lib/c-ctype.c
Normal file
396
lib/c-ctype.c
Normal file
@ -0,0 +1,396 @@
|
||||
/* Character handling in C locale.
|
||||
|
||||
Copyright 2000-2003, 2006, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#define NO_C_CTYPE_MACROS
|
||||
#include "c-ctype.h"
|
||||
|
||||
/* The function isascii is not locale dependent. Its use in EBCDIC is
|
||||
questionable. */
|
||||
bool
|
||||
c_isascii (int c)
|
||||
{
|
||||
return (c >= 0x00 && c <= 0x7f);
|
||||
}
|
||||
|
||||
bool
|
||||
c_isalnum (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS \
|
||||
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
return ((c >= '0' && c <= '9')
|
||||
|| ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'));
|
||||
#else
|
||||
return ((c >= '0' && c <= '9')
|
||||
|| (c >= 'A' && c <= 'Z')
|
||||
|| (c >= 'a' && c <= 'z'));
|
||||
#endif
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isalpha (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z');
|
||||
#else
|
||||
return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
|
||||
#endif
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isblank (int c)
|
||||
{
|
||||
return (c == ' ' || c == '\t');
|
||||
}
|
||||
|
||||
bool
|
||||
c_iscntrl (int c)
|
||||
{
|
||||
#if C_CTYPE_ASCII
|
||||
return ((c & ~0x1f) == 0 || c == 0x7f);
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case ' ': case '!': case '"': case '#': case '$': case '%':
|
||||
case '&': case '\'': case '(': case ')': case '*': case '+':
|
||||
case ',': case '-': case '.': case '/':
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
case ':': case ';': case '<': case '=': case '>': case '?':
|
||||
case '@':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
case '[': case '\\': case ']': case '^': case '_': case '`':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
case '{': case '|': case '}': case '~':
|
||||
return 0;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isdigit (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS
|
||||
return (c >= '0' && c <= '9');
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_islower (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
return (c >= 'a' && c <= 'z');
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isgraph (int c)
|
||||
{
|
||||
#if C_CTYPE_ASCII
|
||||
return (c >= '!' && c <= '~');
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case '!': case '"': case '#': case '$': case '%': case '&':
|
||||
case '\'': case '(': case ')': case '*': case '+': case ',':
|
||||
case '-': case '.': case '/':
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
case ':': case ';': case '<': case '=': case '>': case '?':
|
||||
case '@':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
case '[': case '\\': case ']': case '^': case '_': case '`':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
case '{': case '|': case '}': case '~':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isprint (int c)
|
||||
{
|
||||
#if C_CTYPE_ASCII
|
||||
return (c >= ' ' && c <= '~');
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case ' ': case '!': case '"': case '#': case '$': case '%':
|
||||
case '&': case '\'': case '(': case ')': case '*': case '+':
|
||||
case ',': case '-': case '.': case '/':
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
case ':': case ';': case '<': case '=': case '>': case '?':
|
||||
case '@':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
case '[': case '\\': case ']': case '^': case '_': case '`':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
|
||||
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
|
||||
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
|
||||
case 'y': case 'z':
|
||||
case '{': case '|': case '}': case '~':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_ispunct (int c)
|
||||
{
|
||||
#if C_CTYPE_ASCII
|
||||
return ((c >= '!' && c <= '~')
|
||||
&& !((c >= '0' && c <= '9')
|
||||
|| ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')));
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case '!': case '"': case '#': case '$': case '%': case '&':
|
||||
case '\'': case '(': case ')': case '*': case '+': case ',':
|
||||
case '-': case '.': case '/':
|
||||
case ':': case ';': case '<': case '=': case '>': case '?':
|
||||
case '@':
|
||||
case '[': case '\\': case ']': case '^': case '_': case '`':
|
||||
case '{': case '|': case '}': case '~':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isspace (int c)
|
||||
{
|
||||
return (c == ' ' || c == '\t'
|
||||
|| c == '\n' || c == '\v' || c == '\f' || c == '\r');
|
||||
}
|
||||
|
||||
bool
|
||||
c_isupper (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE
|
||||
return (c >= 'A' && c <= 'Z');
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
c_isxdigit (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS \
|
||||
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
return ((c >= '0' && c <= '9')
|
||||
|| ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F'));
|
||||
#else
|
||||
return ((c >= '0' && c <= '9')
|
||||
|| (c >= 'A' && c <= 'F')
|
||||
|| (c >= 'a' && c <= 'f'));
|
||||
#endif
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
c_tolower (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case 'A': return 'a';
|
||||
case 'B': return 'b';
|
||||
case 'C': return 'c';
|
||||
case 'D': return 'd';
|
||||
case 'E': return 'e';
|
||||
case 'F': return 'f';
|
||||
case 'G': return 'g';
|
||||
case 'H': return 'h';
|
||||
case 'I': return 'i';
|
||||
case 'J': return 'j';
|
||||
case 'K': return 'k';
|
||||
case 'L': return 'l';
|
||||
case 'M': return 'm';
|
||||
case 'N': return 'n';
|
||||
case 'O': return 'o';
|
||||
case 'P': return 'p';
|
||||
case 'Q': return 'q';
|
||||
case 'R': return 'r';
|
||||
case 'S': return 's';
|
||||
case 'T': return 't';
|
||||
case 'U': return 'u';
|
||||
case 'V': return 'v';
|
||||
case 'W': return 'w';
|
||||
case 'X': return 'x';
|
||||
case 'Y': return 'y';
|
||||
case 'Z': return 'z';
|
||||
default: return c;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
c_toupper (int c)
|
||||
{
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
|
||||
#else
|
||||
switch (c)
|
||||
{
|
||||
case 'a': return 'A';
|
||||
case 'b': return 'B';
|
||||
case 'c': return 'C';
|
||||
case 'd': return 'D';
|
||||
case 'e': return 'E';
|
||||
case 'f': return 'F';
|
||||
case 'g': return 'G';
|
||||
case 'h': return 'H';
|
||||
case 'i': return 'I';
|
||||
case 'j': return 'J';
|
||||
case 'k': return 'K';
|
||||
case 'l': return 'L';
|
||||
case 'm': return 'M';
|
||||
case 'n': return 'N';
|
||||
case 'o': return 'O';
|
||||
case 'p': return 'P';
|
||||
case 'q': return 'Q';
|
||||
case 'r': return 'R';
|
||||
case 's': return 'S';
|
||||
case 't': return 'T';
|
||||
case 'u': return 'U';
|
||||
case 'v': return 'V';
|
||||
case 'w': return 'W';
|
||||
case 'x': return 'X';
|
||||
case 'y': return 'Y';
|
||||
case 'z': return 'Z';
|
||||
default: return c;
|
||||
}
|
||||
#endif
|
||||
}
|
295
lib/c-ctype.h
Normal file
295
lib/c-ctype.h
Normal file
@ -0,0 +1,295 @@
|
||||
/* Character handling in C locale.
|
||||
|
||||
These functions work like the corresponding functions in <ctype.h>,
|
||||
except that they have the C (POSIX) locale hardwired, whereas the
|
||||
<ctype.h> functions' behaviour depends on the current locale set via
|
||||
setlocale.
|
||||
|
||||
Copyright (C) 2000-2003, 2006, 2008-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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef C_CTYPE_H
|
||||
#define C_CTYPE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* The functions defined in this file assume the "C" locale and a character
|
||||
set without diacritics (ASCII-US or EBCDIC-US or something like that).
|
||||
Even if the "C" locale on a particular system is an extension of the ASCII
|
||||
character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
|
||||
is ISO-8859-1), the functions in this file recognize only the ASCII
|
||||
characters. */
|
||||
|
||||
|
||||
/* Check whether the ASCII optimizations apply. */
|
||||
|
||||
/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
|
||||
'0', '1', ..., '9' have consecutive integer values. */
|
||||
#define C_CTYPE_CONSECUTIVE_DIGITS 1
|
||||
|
||||
#if ('A' <= 'Z') \
|
||||
&& ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
|
||||
&& ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
|
||||
&& ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
|
||||
&& ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
|
||||
&& ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
|
||||
&& ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
|
||||
&& ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
|
||||
&& ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
|
||||
&& ('Y' + 1 == 'Z')
|
||||
#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
|
||||
#endif
|
||||
|
||||
#if ('a' <= 'z') \
|
||||
&& ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
|
||||
&& ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
|
||||
&& ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
|
||||
&& ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
|
||||
&& ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
|
||||
&& ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
|
||||
&& ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
|
||||
&& ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
|
||||
&& ('y' + 1 == 'z')
|
||||
#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
|
||||
#endif
|
||||
|
||||
#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
|
||||
/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
|
||||
Testing the value of '\n' and '\r' is not relevant. */
|
||||
#define C_CTYPE_ASCII 1
|
||||
#endif
|
||||
|
||||
|
||||
/* Function declarations. */
|
||||
|
||||
/* Unlike the functions in <ctype.h>, which require an argument in the range
|
||||
of the 'unsigned char' type, the functions here operate on values that are
|
||||
in the 'unsigned char' range or in the 'char' range. In other words,
|
||||
when you have a 'char' value, you need to cast it before using it as
|
||||
argument to a <ctype.h> function:
|
||||
|
||||
const char *s = ...;
|
||||
if (isalpha ((unsigned char) *s)) ...
|
||||
|
||||
but you don't need to cast it for the functions defined in this file:
|
||||
|
||||
const char *s = ...;
|
||||
if (c_isalpha (*s)) ...
|
||||
*/
|
||||
|
||||
extern bool c_isascii (int c); /* not locale dependent */
|
||||
|
||||
extern bool c_isalnum (int c);
|
||||
extern bool c_isalpha (int c);
|
||||
extern bool c_isblank (int c);
|
||||
extern bool c_iscntrl (int c);
|
||||
extern bool c_isdigit (int c);
|
||||
extern bool c_islower (int c);
|
||||
extern bool c_isgraph (int c);
|
||||
extern bool c_isprint (int c);
|
||||
extern bool c_ispunct (int c);
|
||||
extern bool c_isspace (int c);
|
||||
extern bool c_isupper (int c);
|
||||
extern bool c_isxdigit (int c);
|
||||
|
||||
extern int c_tolower (int c);
|
||||
extern int c_toupper (int c);
|
||||
|
||||
|
||||
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
|
||||
|
||||
/* ASCII optimizations. */
|
||||
|
||||
#undef c_isascii
|
||||
#define c_isascii(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= 0x00 && __c <= 0x7f); \
|
||||
})
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS \
|
||||
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_isalnum
|
||||
#define c_isalnum(c) \
|
||||
({ int __c = (c); \
|
||||
((__c >= '0' && __c <= '9') \
|
||||
|| ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
|
||||
})
|
||||
#else
|
||||
#undef c_isalnum
|
||||
#define c_isalnum(c) \
|
||||
({ int __c = (c); \
|
||||
((__c >= '0' && __c <= '9') \
|
||||
|| (__c >= 'A' && __c <= 'Z') \
|
||||
|| (__c >= 'a' && __c <= 'z')); \
|
||||
})
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_isalpha
|
||||
#define c_isalpha(c) \
|
||||
({ int __c = (c); \
|
||||
((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
|
||||
})
|
||||
#else
|
||||
#undef c_isalpha
|
||||
#define c_isalpha(c) \
|
||||
({ int __c = (c); \
|
||||
((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
|
||||
})
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef c_isblank
|
||||
#define c_isblank(c) \
|
||||
({ int __c = (c); \
|
||||
(__c == ' ' || __c == '\t'); \
|
||||
})
|
||||
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_iscntrl
|
||||
#define c_iscntrl(c) \
|
||||
({ int __c = (c); \
|
||||
((__c & ~0x1f) == 0 || __c == 0x7f); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS
|
||||
#undef c_isdigit
|
||||
#define c_isdigit(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= '0' && __c <= '9'); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#undef c_islower
|
||||
#define c_islower(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= 'a' && __c <= 'z'); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_isgraph
|
||||
#define c_isgraph(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= '!' && __c <= '~'); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_isprint
|
||||
#define c_isprint(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= ' ' && __c <= '~'); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_ispunct
|
||||
#define c_ispunct(c) \
|
||||
({ int _c = (c); \
|
||||
(c_isgraph (_c) && ! c_isalnum (_c)); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#undef c_isspace
|
||||
#define c_isspace(c) \
|
||||
({ int __c = (c); \
|
||||
(__c == ' ' || __c == '\t' \
|
||||
|| __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
|
||||
})
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE
|
||||
#undef c_isupper
|
||||
#define c_isupper(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= 'A' && __c <= 'Z'); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_DIGITS \
|
||||
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#if C_CTYPE_ASCII
|
||||
#undef c_isxdigit
|
||||
#define c_isxdigit(c) \
|
||||
({ int __c = (c); \
|
||||
((__c >= '0' && __c <= '9') \
|
||||
|| ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
|
||||
})
|
||||
#else
|
||||
#undef c_isxdigit
|
||||
#define c_isxdigit(c) \
|
||||
({ int __c = (c); \
|
||||
((__c >= '0' && __c <= '9') \
|
||||
|| (__c >= 'A' && __c <= 'F') \
|
||||
|| (__c >= 'a' && __c <= 'f')); \
|
||||
})
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
||||
#undef c_tolower
|
||||
#define c_tolower(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
|
||||
})
|
||||
#undef c_toupper
|
||||
#define c_toupper(c) \
|
||||
({ int __c = (c); \
|
||||
(__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#endif /* optimizing for speed */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* C_CTYPE_H */
|
56
lib/c-strcase.h
Normal file
56
lib/c-strcase.h
Normal file
@ -0,0 +1,56 @@
|
||||
/* Case-insensitive string comparison functions in C locale.
|
||||
Copyright (C) 1995-1996, 2001, 2003, 2005, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef C_STRCASE_H
|
||||
#define C_STRCASE_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* The functions defined in this file assume the "C" locale and a character
|
||||
set without diacritics (ASCII-US or EBCDIC-US or something like that).
|
||||
Even if the "C" locale on a particular system is an extension of the ASCII
|
||||
character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
|
||||
is ISO-8859-1), the functions in this file recognize only the ASCII
|
||||
characters. More precisely, one of the string arguments must be an ASCII
|
||||
string; the other one can also contain non-ASCII characters (but then
|
||||
the comparison result will be nonzero). */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
|
||||
greater than zero if S1 is lexicographically less than, equal to or greater
|
||||
than S2. */
|
||||
extern int c_strcasecmp (const char *s1, const char *s2);
|
||||
|
||||
/* Compare no more than N characters of strings S1 and S2, ignoring case,
|
||||
returning less than, equal to or greater than zero if S1 is
|
||||
lexicographically less than, equal to or greater than S2. */
|
||||
extern int c_strncasecmp (const char *s1, const char *s2, size_t n);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* C_STRCASE_H */
|
57
lib/c-strcasecmp.c
Normal file
57
lib/c-strcasecmp.c
Normal file
@ -0,0 +1,57 @@
|
||||
/* c-strcasecmp.c -- case insensitive string comparator in C locale
|
||||
Copyright (C) 1998-1999, 2005-2006, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "c-strcase.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "c-ctype.h"
|
||||
|
||||
int
|
||||
c_strcasecmp (const char *s1, const char *s2)
|
||||
{
|
||||
register const unsigned char *p1 = (const unsigned char *) s1;
|
||||
register const unsigned char *p2 = (const unsigned char *) s2;
|
||||
unsigned char c1, c2;
|
||||
|
||||
if (p1 == p2)
|
||||
return 0;
|
||||
|
||||
do
|
||||
{
|
||||
c1 = c_tolower (*p1);
|
||||
c2 = c_tolower (*p2);
|
||||
|
||||
if (c1 == '\0')
|
||||
break;
|
||||
|
||||
++p1;
|
||||
++p2;
|
||||
}
|
||||
while (c1 == c2);
|
||||
|
||||
if (UCHAR_MAX <= INT_MAX)
|
||||
return c1 - c2;
|
||||
else
|
||||
/* On machines where 'char' and 'int' are types of the same size, the
|
||||
difference of two 'unsigned char' values - including the sign bit -
|
||||
doesn't fit in an 'int'. */
|
||||
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
|
||||
}
|
57
lib/c-strncasecmp.c
Normal file
57
lib/c-strncasecmp.c
Normal file
@ -0,0 +1,57 @@
|
||||
/* c-strncasecmp.c -- case insensitive string comparator in C locale
|
||||
Copyright (C) 1998-1999, 2005-2006, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "c-strcase.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "c-ctype.h"
|
||||
|
||||
int
|
||||
c_strncasecmp (const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
register const unsigned char *p1 = (const unsigned char *) s1;
|
||||
register const unsigned char *p2 = (const unsigned char *) s2;
|
||||
unsigned char c1, c2;
|
||||
|
||||
if (p1 == p2 || n == 0)
|
||||
return 0;
|
||||
|
||||
do
|
||||
{
|
||||
c1 = c_tolower (*p1);
|
||||
c2 = c_tolower (*p2);
|
||||
|
||||
if (--n == 0 || c1 == '\0')
|
||||
break;
|
||||
|
||||
++p1;
|
||||
++p2;
|
||||
}
|
||||
while (c1 == c2);
|
||||
|
||||
if (UCHAR_MAX <= INT_MAX)
|
||||
return c1 - c2;
|
||||
else
|
||||
/* On machines where 'char' and 'int' are types of the same size, the
|
||||
difference of two 'unsigned char' values - including the sign bit -
|
||||
doesn't fit in an 'int'. */
|
||||
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
|
||||
}
|
683
lib/config.charset
Normal file
683
lib/config.charset
Normal file
@ -0,0 +1,683 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent table of character encoding aliases.
|
||||
#
|
||||
# Copyright (C) 2000-2004, 2006-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, 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The table consists of lines of the form
|
||||
# ALIAS CANONICAL
|
||||
#
|
||||
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
||||
# ALIAS is compared in a case sensitive way.
|
||||
#
|
||||
# CANONICAL is the GNU canonical name for this character encoding.
|
||||
# It must be an encoding supported by libiconv. Support by GNU libc is
|
||||
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
||||
# MIME charset name is preferred.
|
||||
# The current list of GNU canonical charset names is as follows.
|
||||
#
|
||||
# name MIME? used by which systems
|
||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
|
||||
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-3 Y glibc solaris cygwin
|
||||
# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
|
||||
# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-6 Y glibc aix hpux solaris cygwin
|
||||
# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
|
||||
# ISO-8859-8 Y glibc aix hpux osf solaris cygwin
|
||||
# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin
|
||||
# ISO-8859-13 glibc netbsd openbsd darwin cygwin
|
||||
# ISO-8859-14 glibc cygwin
|
||||
# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin
|
||||
# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
|
||||
# KOI8-T glibc
|
||||
# CP437 dos
|
||||
# CP775 dos
|
||||
# CP850 aix osf dos
|
||||
# CP852 dos
|
||||
# CP855 dos
|
||||
# CP856 aix
|
||||
# CP857 dos
|
||||
# CP861 dos
|
||||
# CP862 dos
|
||||
# CP864 dos
|
||||
# CP865 dos
|
||||
# CP866 freebsd netbsd openbsd darwin dos
|
||||
# CP869 dos
|
||||
# CP874 woe32 dos
|
||||
# CP922 aix
|
||||
# CP932 aix cygwin woe32 dos
|
||||
# CP943 aix
|
||||
# CP949 osf darwin woe32 dos
|
||||
# CP950 woe32 dos
|
||||
# CP1046 aix
|
||||
# CP1124 aix
|
||||
# CP1125 dos
|
||||
# CP1129 aix
|
||||
# CP1131 darwin
|
||||
# CP1250 woe32
|
||||
# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32
|
||||
# CP1252 aix woe32
|
||||
# CP1253 woe32
|
||||
# CP1254 woe32
|
||||
# CP1255 glibc woe32
|
||||
# CP1256 woe32
|
||||
# CP1257 woe32
|
||||
# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
|
||||
# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
|
||||
# EUC-TW glibc aix hpux irix osf solaris netbsd
|
||||
# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin
|
||||
# BIG5-HKSCS glibc solaris darwin
|
||||
# GBK glibc aix osf solaris darwin cygwin woe32 dos
|
||||
# GB18030 glibc solaris netbsd darwin
|
||||
# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
|
||||
# JOHAB glibc solaris woe32
|
||||
# TIS-620 glibc aix hpux osf solaris cygwin
|
||||
# VISCII Y glibc
|
||||
# TCVN5712-1 glibc
|
||||
# ARMSCII-8 glibc darwin
|
||||
# GEORGIAN-PS glibc cygwin
|
||||
# PT154 glibc
|
||||
# HP-ROMAN8 hpux
|
||||
# HP-ARABIC8 hpux
|
||||
# HP-GREEK8 hpux
|
||||
# HP-HEBREW8 hpux
|
||||
# HP-TURKISH8 hpux
|
||||
# HP-KANA8 hpux
|
||||
# DEC-KANJI osf
|
||||
# DEC-HANYU osf
|
||||
# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin
|
||||
#
|
||||
# Note: Names which are not marked as being a MIME name should not be used in
|
||||
# Internet protocols for information interchange (mail, news, etc.).
|
||||
#
|
||||
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
|
||||
# must understand both names and treat them as equivalent.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
|
||||
host="$1"
|
||||
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
||||
echo "# This file contains a table of character encoding aliases,"
|
||||
echo "# suitable for operating system '${os}'."
|
||||
echo "# It was automatically generated from config.charset."
|
||||
# List of references, updated during installation:
|
||||
echo "# Packages using this file: "
|
||||
case "$os" in
|
||||
linux-gnulibc1*)
|
||||
# Linux libc5 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
echo "POSIX ASCII"
|
||||
for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
|
||||
en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
|
||||
en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
|
||||
es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
|
||||
et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
|
||||
fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
|
||||
it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
|
||||
sv_FI sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.iso-8859-1 ISO-8859-1"
|
||||
echo "$l.iso-8859-15 ISO-8859-15"
|
||||
echo "$l.iso-8859-15@euro ISO-8859-15"
|
||||
echo "$l@euro ISO-8859-15"
|
||||
echo "$l.cp-437 CP437"
|
||||
echo "$l.cp-850 CP850"
|
||||
echo "$l.cp-1252 CP1252"
|
||||
echo "$l.cp-1252@euro CP1252"
|
||||
#echo "$l.atari-st ATARI-ST" # not a commonly used encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
|
||||
sl_SI sr sr_CS sr_YU; do
|
||||
echo "$l ISO-8859-2"
|
||||
echo "$l.iso-8859-2 ISO-8859-2"
|
||||
echo "$l.cp-852 CP852"
|
||||
echo "$l.cp-1250 CP1250"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in mk mk_MK ru ru_RU; do
|
||||
echo "$l ISO-8859-5"
|
||||
echo "$l.iso-8859-5 ISO-8859-5"
|
||||
echo "$l.koi8-r KOI8-R"
|
||||
echo "$l.cp-866 CP866"
|
||||
echo "$l.cp-1251 CP1251"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in ar ar_SA; do
|
||||
echo "$l ISO-8859-6"
|
||||
echo "$l.iso-8859-6 ISO-8859-6"
|
||||
echo "$l.cp-864 CP864"
|
||||
#echo "$l.cp-868 CP868" # not a commonly used encoding
|
||||
echo "$l.cp-1256 CP1256"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in el el_GR gr gr_GR; do
|
||||
echo "$l ISO-8859-7"
|
||||
echo "$l.iso-8859-7 ISO-8859-7"
|
||||
echo "$l.cp-869 CP869"
|
||||
echo "$l.cp-1253 CP1253"
|
||||
echo "$l.cp-1253@euro CP1253"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in he he_IL iw iw_IL; do
|
||||
echo "$l ISO-8859-8"
|
||||
echo "$l.iso-8859-8 ISO-8859-8"
|
||||
echo "$l.cp-862 CP862"
|
||||
echo "$l.cp-1255 CP1255"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in tr tr_TR; do
|
||||
echo "$l ISO-8859-9"
|
||||
echo "$l.iso-8859-9 ISO-8859-9"
|
||||
echo "$l.cp-857 CP857"
|
||||
echo "$l.cp-1254 CP1254"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in lt lt_LT lv lv_LV; do
|
||||
#echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l ISO-8859-13"
|
||||
done
|
||||
for l in ru_UA uk uk_UA; do
|
||||
echo "$l KOI8-U"
|
||||
done
|
||||
for l in zh zh_CN; do
|
||||
#echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l GB2312"
|
||||
done
|
||||
for l in ja ja_JP ja_JP.EUC; do
|
||||
echo "$l EUC-JP"
|
||||
done
|
||||
for l in ko ko_KR; do
|
||||
echo "$l EUC-KR"
|
||||
done
|
||||
for l in th th_TH; do
|
||||
echo "$l TIS-620"
|
||||
done
|
||||
for l in fa fa_IR; do
|
||||
#echo "$l ISIRI-3342" # a broken encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
;;
|
||||
linux* | *-gnu*)
|
||||
# With glibc-2.1 or newer, we don't need any canonicalization,
|
||||
# because glibc has iconv and both glibc and libiconv support all
|
||||
# GNU canonical names directly. Therefore, the Makefile does not
|
||||
# need to install the alias file at all.
|
||||
# The following applies only to glibc-2.0.x and older libcs.
|
||||
echo "ISO_646.IRV:1983 ASCII"
|
||||
;;
|
||||
aix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "IBM-850 CP850"
|
||||
echo "IBM-856 CP856"
|
||||
echo "IBM-921 ISO-8859-13"
|
||||
echo "IBM-922 CP922"
|
||||
echo "IBM-932 CP932"
|
||||
echo "IBM-943 CP943"
|
||||
echo "IBM-1046 CP1046"
|
||||
echo "IBM-1124 CP1124"
|
||||
echo "IBM-1129 CP1129"
|
||||
echo "IBM-1252 CP1252"
|
||||
echo "IBM-eucCN GB2312"
|
||||
echo "IBM-eucJP EUC-JP"
|
||||
echo "IBM-eucKR EUC-KR"
|
||||
echo "IBM-eucTW EUC-TW"
|
||||
echo "big5 BIG5"
|
||||
echo "GBK GBK"
|
||||
echo "TIS-620 TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
hpux*)
|
||||
echo "iso88591 ISO-8859-1"
|
||||
echo "iso88592 ISO-8859-2"
|
||||
echo "iso88595 ISO-8859-5"
|
||||
echo "iso88596 ISO-8859-6"
|
||||
echo "iso88597 ISO-8859-7"
|
||||
echo "iso88598 ISO-8859-8"
|
||||
echo "iso88599 ISO-8859-9"
|
||||
echo "iso885915 ISO-8859-15"
|
||||
echo "roman8 HP-ROMAN8"
|
||||
echo "arabic8 HP-ARABIC8"
|
||||
echo "greek8 HP-GREEK8"
|
||||
echo "hebrew8 HP-HEBREW8"
|
||||
echo "turkish8 HP-TURKISH8"
|
||||
echo "kana8 HP-KANA8"
|
||||
echo "tis620 TIS-620"
|
||||
echo "big5 BIG5"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "hp15CN GB2312"
|
||||
#echo "ccdc ?" # what is this?
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "utf8 UTF-8"
|
||||
;;
|
||||
irix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
;;
|
||||
osf*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "cp850 CP850"
|
||||
echo "big5 BIG5"
|
||||
echo "dechanyu DEC-HANYU"
|
||||
echo "dechanzi GB2312"
|
||||
echo "deckanji DEC-KANJI"
|
||||
echo "deckorean EUC-KR"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "GBK GBK"
|
||||
echo "KSC5601 CP949"
|
||||
echo "sdeckanji EUC-JP"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "TACTIS TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
solaris*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-3 ISO-8859-3"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "koi8-r KOI8-R"
|
||||
echo "ansi-1251 CP1251"
|
||||
echo "BIG5 BIG5"
|
||||
echo "Big5-HKSCS BIG5-HKSCS"
|
||||
echo "gb2312 GB2312"
|
||||
echo "GBK GBK"
|
||||
echo "GB18030 GB18030"
|
||||
echo "cns11643 EUC-TW"
|
||||
echo "5601 EUC-KR"
|
||||
echo "ko_KR.johap92 JOHAB"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "PCK SHIFT_JIS"
|
||||
echo "TIS620.2533 TIS-620"
|
||||
#echo "sun_eu_greek ?" # what is this?
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
freebsd* | os2*)
|
||||
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
|
||||
# reuse FreeBSD's locale data for OS/2.
|
||||
echo "C ASCII"
|
||||
echo "US-ASCII ASCII"
|
||||
for l in la_LN lt_LN; do
|
||||
echo "$l.ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
|
||||
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l.ISO_8859-1 ISO-8859-1"
|
||||
echo "$l.DIS_8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO_8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO_8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU ru_SU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO_8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ja_JP.Shift_JIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
netbsd*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "BIG5 BIG5"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
;;
|
||||
openbsd*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
;;
|
||||
darwin[56]*)
|
||||
# Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
for l in en_AU en_CA en_GB en_US la_LN; do
|
||||
echo "$l.US-ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
|
||||
nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in la_LN; do
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
for l in bg_BG; do
|
||||
echo "$l.CP1251 CP1251"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
darwin*)
|
||||
# Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
|
||||
# useless:
|
||||
# - It returns the empty string when LANG is set to a locale of the
|
||||
# form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
|
||||
# LC_CTYPE file.
|
||||
# - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
|
||||
# the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
|
||||
# - The documentation says:
|
||||
# "... all code that calls BSD system routines should ensure
|
||||
# that the const *char parameters of these routines are in UTF-8
|
||||
# encoding. All BSD system functions expect their string
|
||||
# parameters to be in UTF-8 encoding and nothing else."
|
||||
# It also says
|
||||
# "An additional caveat is that string parameters for files,
|
||||
# paths, and other file-system entities must be in canonical
|
||||
# UTF-8. In a canonical UTF-8 Unicode string, all decomposable
|
||||
# characters are decomposed ..."
|
||||
# but this is not true: You can pass non-decomposed UTF-8 strings
|
||||
# to file system functions, and it is the OS which will convert
|
||||
# them to decomposed UTF-8 before accessing the file system.
|
||||
# - The Apple Terminal application displays UTF-8 by default.
|
||||
# - However, other applications are free to use different encodings:
|
||||
# - xterm uses ISO-8859-1 by default.
|
||||
# - TextEdit uses MacRoman by default.
|
||||
# We prefer UTF-8 over decomposed UTF-8-MAC because one should
|
||||
# minimize the use of decomposed Unicode. Unfortunately, through the
|
||||
# Darwin file system, decomposed UTF-8 strings are leaked into user
|
||||
# space nevertheless.
|
||||
# Then there are also the locales with encodings other than US-ASCII
|
||||
# and UTF-8. These locales can be occasionally useful to users (e.g.
|
||||
# when grepping through ISO-8859-1 encoded text files), when all their
|
||||
# file names are in US-ASCII.
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "KOI8-R KOI8-R"
|
||||
echo "KOI8-U KOI8-U"
|
||||
echo "CP866 CP866"
|
||||
echo "CP949 CP949"
|
||||
echo "CP1131 CP1131"
|
||||
echo "CP1251 CP1251"
|
||||
echo "eucCN GB2312"
|
||||
echo "GB2312 GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "Big5 BIG5"
|
||||
echo "Big5HKSCS BIG5-HKSCS"
|
||||
echo "GBK GBK"
|
||||
echo "GB18030 GB18030"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "ARMSCII-8 ARMSCII-8"
|
||||
echo "PT154 PT154"
|
||||
#echo "ISCII-DEV ?"
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
beos* | haiku*)
|
||||
# BeOS and Haiku have a single locale, and it has UTF-8 encoding.
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
msdosdjgpp*)
|
||||
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "#"
|
||||
echo "# The encodings given here may not all be correct."
|
||||
echo "# If you find that the encoding given for your language and"
|
||||
echo "# country is not the one your DOS machine actually uses, just"
|
||||
echo "# correct it in this file, and send a mail to"
|
||||
echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
|
||||
echo "# and Bruno Haible <bruno@clisp.org>."
|
||||
echo "#"
|
||||
echo "C ASCII"
|
||||
# ISO-8859-1 languages
|
||||
echo "ca CP850"
|
||||
echo "ca_ES CP850"
|
||||
echo "da CP865" # not CP850 ??
|
||||
echo "da_DK CP865" # not CP850 ??
|
||||
echo "de CP850"
|
||||
echo "de_AT CP850"
|
||||
echo "de_CH CP850"
|
||||
echo "de_DE CP850"
|
||||
echo "en CP850"
|
||||
echo "en_AU CP850" # not CP437 ??
|
||||
echo "en_CA CP850"
|
||||
echo "en_GB CP850"
|
||||
echo "en_NZ CP437"
|
||||
echo "en_US CP437"
|
||||
echo "en_ZA CP850" # not CP437 ??
|
||||
echo "es CP850"
|
||||
echo "es_AR CP850"
|
||||
echo "es_BO CP850"
|
||||
echo "es_CL CP850"
|
||||
echo "es_CO CP850"
|
||||
echo "es_CR CP850"
|
||||
echo "es_CU CP850"
|
||||
echo "es_DO CP850"
|
||||
echo "es_EC CP850"
|
||||
echo "es_ES CP850"
|
||||
echo "es_GT CP850"
|
||||
echo "es_HN CP850"
|
||||
echo "es_MX CP850"
|
||||
echo "es_NI CP850"
|
||||
echo "es_PA CP850"
|
||||
echo "es_PY CP850"
|
||||
echo "es_PE CP850"
|
||||
echo "es_SV CP850"
|
||||
echo "es_UY CP850"
|
||||
echo "es_VE CP850"
|
||||
echo "et CP850"
|
||||
echo "et_EE CP850"
|
||||
echo "eu CP850"
|
||||
echo "eu_ES CP850"
|
||||
echo "fi CP850"
|
||||
echo "fi_FI CP850"
|
||||
echo "fr CP850"
|
||||
echo "fr_BE CP850"
|
||||
echo "fr_CA CP850"
|
||||
echo "fr_CH CP850"
|
||||
echo "fr_FR CP850"
|
||||
echo "ga CP850"
|
||||
echo "ga_IE CP850"
|
||||
echo "gd CP850"
|
||||
echo "gd_GB CP850"
|
||||
echo "gl CP850"
|
||||
echo "gl_ES CP850"
|
||||
echo "id CP850" # not CP437 ??
|
||||
echo "id_ID CP850" # not CP437 ??
|
||||
echo "is CP861" # not CP850 ??
|
||||
echo "is_IS CP861" # not CP850 ??
|
||||
echo "it CP850"
|
||||
echo "it_CH CP850"
|
||||
echo "it_IT CP850"
|
||||
echo "lt CP775"
|
||||
echo "lt_LT CP775"
|
||||
echo "lv CP775"
|
||||
echo "lv_LV CP775"
|
||||
echo "nb CP865" # not CP850 ??
|
||||
echo "nb_NO CP865" # not CP850 ??
|
||||
echo "nl CP850"
|
||||
echo "nl_BE CP850"
|
||||
echo "nl_NL CP850"
|
||||
echo "nn CP865" # not CP850 ??
|
||||
echo "nn_NO CP865" # not CP850 ??
|
||||
echo "no CP865" # not CP850 ??
|
||||
echo "no_NO CP865" # not CP850 ??
|
||||
echo "pt CP850"
|
||||
echo "pt_BR CP850"
|
||||
echo "pt_PT CP850"
|
||||
echo "sv CP850"
|
||||
echo "sv_SE CP850"
|
||||
# ISO-8859-2 languages
|
||||
echo "cs CP852"
|
||||
echo "cs_CZ CP852"
|
||||
echo "hr CP852"
|
||||
echo "hr_HR CP852"
|
||||
echo "hu CP852"
|
||||
echo "hu_HU CP852"
|
||||
echo "pl CP852"
|
||||
echo "pl_PL CP852"
|
||||
echo "ro CP852"
|
||||
echo "ro_RO CP852"
|
||||
echo "sk CP852"
|
||||
echo "sk_SK CP852"
|
||||
echo "sl CP852"
|
||||
echo "sl_SI CP852"
|
||||
echo "sq CP852"
|
||||
echo "sq_AL CP852"
|
||||
echo "sr CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
|
||||
# ISO-8859-3 languages
|
||||
echo "mt CP850"
|
||||
echo "mt_MT CP850"
|
||||
# ISO-8859-5 languages
|
||||
echo "be CP866"
|
||||
echo "be_BE CP866"
|
||||
echo "bg CP866" # not CP855 ??
|
||||
echo "bg_BG CP866" # not CP855 ??
|
||||
echo "mk CP866" # not CP855 ??
|
||||
echo "mk_MK CP866" # not CP855 ??
|
||||
echo "ru CP866"
|
||||
echo "ru_RU CP866"
|
||||
echo "uk CP1125"
|
||||
echo "uk_UA CP1125"
|
||||
# ISO-8859-6 languages
|
||||
echo "ar CP864"
|
||||
echo "ar_AE CP864"
|
||||
echo "ar_DZ CP864"
|
||||
echo "ar_EG CP864"
|
||||
echo "ar_IQ CP864"
|
||||
echo "ar_IR CP864"
|
||||
echo "ar_JO CP864"
|
||||
echo "ar_KW CP864"
|
||||
echo "ar_MA CP864"
|
||||
echo "ar_OM CP864"
|
||||
echo "ar_QA CP864"
|
||||
echo "ar_SA CP864"
|
||||
echo "ar_SY CP864"
|
||||
# ISO-8859-7 languages
|
||||
echo "el CP869"
|
||||
echo "el_GR CP869"
|
||||
# ISO-8859-8 languages
|
||||
echo "he CP862"
|
||||
echo "he_IL CP862"
|
||||
# ISO-8859-9 languages
|
||||
echo "tr CP857"
|
||||
echo "tr_TR CP857"
|
||||
# Japanese
|
||||
echo "ja CP932"
|
||||
echo "ja_JP CP932"
|
||||
# Chinese
|
||||
echo "zh_CN GBK"
|
||||
echo "zh_TW CP950" # not CP938 ??
|
||||
# Korean
|
||||
echo "kr CP949" # not CP934 ??
|
||||
echo "kr_KR CP949" # not CP934 ??
|
||||
# Thai
|
||||
echo "th CP874"
|
||||
echo "th_TH CP874"
|
||||
# Other
|
||||
echo "eo CP850"
|
||||
echo "eo_EO CP850"
|
||||
;;
|
||||
esac
|
@ -1,58 +0,0 @@
|
||||
/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
|
||||
|
||||
Copyright (C) 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Bruno Haible. */
|
||||
|
||||
/*
|
||||
* ISO C 99 <ctype.h> for platforms on which it is incomplete.
|
||||
* <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
|
||||
*/
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_CTYPE_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* Include the original <ctype.h>. */
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_CTYPE_H
|
||||
#define _@GUARD_PREFIX@_CTYPE_H
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
/* Return non-zero if c is a blank, i.e. a space or tab character. */
|
||||
#if @GNULIB_ISBLANK@
|
||||
# if !@HAVE_ISBLANK@
|
||||
_GL_EXTERN_C int isblank (int c);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef isblank
|
||||
# if HAVE_RAW_DECL_ISBLANK
|
||||
_GL_WARN_ON_USE (isblank, "isblank is unportable - "
|
||||
"use gnulib module isblank for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_CTYPE_H */
|
||||
#endif /* _@GUARD_PREFIX@_CTYPE_H */
|
@ -1,53 +0,0 @@
|
||||
/* File names on MS-DOS/Windows systems.
|
||||
|
||||
Copyright (C) 2000-2001, 2004-2006, 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/>.
|
||||
|
||||
From Paul Eggert and Jim Meyering. */
|
||||
|
||||
#ifndef _DOSNAME_H
|
||||
#define _DOSNAME_H
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__ || \
|
||||
defined __MSDOS__ || defined __CYGWIN__ || \
|
||||
defined __EMX__ || defined __DJGPP__)
|
||||
/* This internal macro assumes ASCII, but all hosts that support drive
|
||||
letters use ASCII. */
|
||||
# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
|
||||
<= 'z' - 'a')
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) \
|
||||
(_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
|
||||
# ifndef __CYGWIN__
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
|
||||
# endif
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
#else
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
|
||||
#endif
|
||||
|
||||
#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
|
||||
# else
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) \
|
||||
(ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
|
||||
#endif
|
||||
#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
|
||||
|
||||
#endif /* DOSNAME_H_ */
|
167
lib/errno.in.h
167
lib/errno.in.h
@ -1,167 +0,0 @@
|
||||
/* A POSIX-like <errno.h>.
|
||||
|
||||
Copyright (C) 2008-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ERRNO_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ERRNO_H
|
||||
#define _@GUARD_PREFIX@_ERRNO_H
|
||||
|
||||
|
||||
/* On native Windows platforms, many macros are not defined. */
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
|
||||
/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
|
||||
# define EWOULDBLOCK EAGAIN
|
||||
|
||||
/* Values >= 100 seem safe to use. */
|
||||
# define ETXTBSY 100
|
||||
# define GNULIB_defined_ETXTBSY 1
|
||||
|
||||
/* These are intentionally the same values as the WSA* error numbers, defined
|
||||
in <winsock2.h>. */
|
||||
# define EINPROGRESS 10036
|
||||
# define EALREADY 10037
|
||||
# define ENOTSOCK 10038
|
||||
# define EDESTADDRREQ 10039
|
||||
# define EMSGSIZE 10040
|
||||
# define EPROTOTYPE 10041
|
||||
# define ENOPROTOOPT 10042
|
||||
# define EPROTONOSUPPORT 10043
|
||||
# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
|
||||
# define EOPNOTSUPP 10045
|
||||
# define EPFNOSUPPORT 10046 /* not required by POSIX */
|
||||
# define EAFNOSUPPORT 10047
|
||||
# define EADDRINUSE 10048
|
||||
# define EADDRNOTAVAIL 10049
|
||||
# define ENETDOWN 10050
|
||||
# define ENETUNREACH 10051
|
||||
# define ENETRESET 10052
|
||||
# define ECONNABORTED 10053
|
||||
# define ECONNRESET 10054
|
||||
# define ENOBUFS 10055
|
||||
# define EISCONN 10056
|
||||
# define ENOTCONN 10057
|
||||
# define ESHUTDOWN 10058 /* not required by POSIX */
|
||||
# define ETOOMANYREFS 10059 /* not required by POSIX */
|
||||
# define ETIMEDOUT 10060
|
||||
# define ECONNREFUSED 10061
|
||||
# define ELOOP 10062
|
||||
# define EHOSTDOWN 10064 /* not required by POSIX */
|
||||
# define EHOSTUNREACH 10065
|
||||
# define EPROCLIM 10067 /* not required by POSIX */
|
||||
# define EUSERS 10068 /* not required by POSIX */
|
||||
# define EDQUOT 10069
|
||||
# define ESTALE 10070
|
||||
# define EREMOTE 10071 /* not required by POSIX */
|
||||
# define GNULIB_defined_ESOCK 1
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
|
||||
EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
|
||||
# if @EMULTIHOP_HIDDEN@
|
||||
# define EMULTIHOP @EMULTIHOP_VALUE@
|
||||
# define GNULIB_defined_EMULTIHOP 1
|
||||
# endif
|
||||
# if @ENOLINK_HIDDEN@
|
||||
# define ENOLINK @ENOLINK_VALUE@
|
||||
# define GNULIB_defined_ENOLINK 1
|
||||
# endif
|
||||
# if @EOVERFLOW_HIDDEN@
|
||||
# define EOVERFLOW @EOVERFLOW_VALUE@
|
||||
# define GNULIB_defined_EOVERFLOW 1
|
||||
# endif
|
||||
|
||||
|
||||
/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
|
||||
EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
|
||||
Likewise, on NonStop Kernel, EDQUOT is not defined.
|
||||
Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
|
||||
HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
|
||||
|
||||
Note: When one of these systems defines some of these macros some day,
|
||||
binaries will have to be recompiled so that they recognizes the new
|
||||
errno values from the system. */
|
||||
|
||||
# ifndef ENOMSG
|
||||
# define ENOMSG 2000
|
||||
# define GNULIB_defined_ENOMSG 1
|
||||
# endif
|
||||
|
||||
# ifndef EIDRM
|
||||
# define EIDRM 2001
|
||||
# define GNULIB_defined_EIDRM 1
|
||||
# endif
|
||||
|
||||
# ifndef ENOLINK
|
||||
# define ENOLINK 2002
|
||||
# define GNULIB_defined_ENOLINK 1
|
||||
# endif
|
||||
|
||||
# ifndef EPROTO
|
||||
# define EPROTO 2003
|
||||
# define GNULIB_defined_EPROTO 1
|
||||
# endif
|
||||
|
||||
# ifndef EMULTIHOP
|
||||
# define EMULTIHOP 2004
|
||||
# define GNULIB_defined_EMULTIHOP 1
|
||||
# endif
|
||||
|
||||
# ifndef EBADMSG
|
||||
# define EBADMSG 2005
|
||||
# define GNULIB_defined_EBADMSG 1
|
||||
# endif
|
||||
|
||||
# ifndef EOVERFLOW
|
||||
# define EOVERFLOW 2006
|
||||
# define GNULIB_defined_EOVERFLOW 1
|
||||
# endif
|
||||
|
||||
# ifndef ENOTSUP
|
||||
# define ENOTSUP 2007
|
||||
# define GNULIB_defined_ENOTSUP 1
|
||||
# endif
|
||||
|
||||
# ifndef ESTALE
|
||||
# define ESTALE 2009
|
||||
# define GNULIB_defined_ESTALE 1
|
||||
# endif
|
||||
|
||||
# ifndef EDQUOT
|
||||
# define EDQUOT 2010
|
||||
# define GNULIB_defined_EDQUOT 1
|
||||
# endif
|
||||
|
||||
# ifndef ECANCELED
|
||||
# define ECANCELED 2008
|
||||
# define GNULIB_defined_ECANCELED 1
|
||||
# endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
148
lib/float+.h
148
lib/float+.h
@ -1,148 +0,0 @@
|
||||
/* Supplemental information about the floating-point formats.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _FLOATPLUS_H
|
||||
#define _FLOATPLUS_H
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
||||
/* Number of bits in the mantissa of a floating-point number, including the
|
||||
"hidden bit". */
|
||||
#if FLT_RADIX == 2
|
||||
# define FLT_MANT_BIT FLT_MANT_DIG
|
||||
# define DBL_MANT_BIT DBL_MANT_DIG
|
||||
# define LDBL_MANT_BIT LDBL_MANT_DIG
|
||||
#elif FLT_RADIX == 4
|
||||
# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
|
||||
# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
|
||||
# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
|
||||
#elif FLT_RADIX == 16
|
||||
# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
|
||||
# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
|
||||
# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
|
||||
#endif
|
||||
|
||||
/* Bit mask that can be used to mask the exponent, as an unsigned number. */
|
||||
#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
|
||||
#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
|
||||
#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
|
||||
|
||||
/* Number of bits used for the exponent of a floating-point number, including
|
||||
the exponent's sign. */
|
||||
#define FLT_EXP_BIT \
|
||||
(FLT_EXP_MASK < 0x100 ? 8 : \
|
||||
FLT_EXP_MASK < 0x200 ? 9 : \
|
||||
FLT_EXP_MASK < 0x400 ? 10 : \
|
||||
FLT_EXP_MASK < 0x800 ? 11 : \
|
||||
FLT_EXP_MASK < 0x1000 ? 12 : \
|
||||
FLT_EXP_MASK < 0x2000 ? 13 : \
|
||||
FLT_EXP_MASK < 0x4000 ? 14 : \
|
||||
FLT_EXP_MASK < 0x8000 ? 15 : \
|
||||
FLT_EXP_MASK < 0x10000 ? 16 : \
|
||||
FLT_EXP_MASK < 0x20000 ? 17 : \
|
||||
FLT_EXP_MASK < 0x40000 ? 18 : \
|
||||
FLT_EXP_MASK < 0x80000 ? 19 : \
|
||||
FLT_EXP_MASK < 0x100000 ? 20 : \
|
||||
FLT_EXP_MASK < 0x200000 ? 21 : \
|
||||
FLT_EXP_MASK < 0x400000 ? 22 : \
|
||||
FLT_EXP_MASK < 0x800000 ? 23 : \
|
||||
FLT_EXP_MASK < 0x1000000 ? 24 : \
|
||||
FLT_EXP_MASK < 0x2000000 ? 25 : \
|
||||
FLT_EXP_MASK < 0x4000000 ? 26 : \
|
||||
FLT_EXP_MASK < 0x8000000 ? 27 : \
|
||||
FLT_EXP_MASK < 0x10000000 ? 28 : \
|
||||
FLT_EXP_MASK < 0x20000000 ? 29 : \
|
||||
FLT_EXP_MASK < 0x40000000 ? 30 : \
|
||||
FLT_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
#define DBL_EXP_BIT \
|
||||
(DBL_EXP_MASK < 0x100 ? 8 : \
|
||||
DBL_EXP_MASK < 0x200 ? 9 : \
|
||||
DBL_EXP_MASK < 0x400 ? 10 : \
|
||||
DBL_EXP_MASK < 0x800 ? 11 : \
|
||||
DBL_EXP_MASK < 0x1000 ? 12 : \
|
||||
DBL_EXP_MASK < 0x2000 ? 13 : \
|
||||
DBL_EXP_MASK < 0x4000 ? 14 : \
|
||||
DBL_EXP_MASK < 0x8000 ? 15 : \
|
||||
DBL_EXP_MASK < 0x10000 ? 16 : \
|
||||
DBL_EXP_MASK < 0x20000 ? 17 : \
|
||||
DBL_EXP_MASK < 0x40000 ? 18 : \
|
||||
DBL_EXP_MASK < 0x80000 ? 19 : \
|
||||
DBL_EXP_MASK < 0x100000 ? 20 : \
|
||||
DBL_EXP_MASK < 0x200000 ? 21 : \
|
||||
DBL_EXP_MASK < 0x400000 ? 22 : \
|
||||
DBL_EXP_MASK < 0x800000 ? 23 : \
|
||||
DBL_EXP_MASK < 0x1000000 ? 24 : \
|
||||
DBL_EXP_MASK < 0x2000000 ? 25 : \
|
||||
DBL_EXP_MASK < 0x4000000 ? 26 : \
|
||||
DBL_EXP_MASK < 0x8000000 ? 27 : \
|
||||
DBL_EXP_MASK < 0x10000000 ? 28 : \
|
||||
DBL_EXP_MASK < 0x20000000 ? 29 : \
|
||||
DBL_EXP_MASK < 0x40000000 ? 30 : \
|
||||
DBL_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
#define LDBL_EXP_BIT \
|
||||
(LDBL_EXP_MASK < 0x100 ? 8 : \
|
||||
LDBL_EXP_MASK < 0x200 ? 9 : \
|
||||
LDBL_EXP_MASK < 0x400 ? 10 : \
|
||||
LDBL_EXP_MASK < 0x800 ? 11 : \
|
||||
LDBL_EXP_MASK < 0x1000 ? 12 : \
|
||||
LDBL_EXP_MASK < 0x2000 ? 13 : \
|
||||
LDBL_EXP_MASK < 0x4000 ? 14 : \
|
||||
LDBL_EXP_MASK < 0x8000 ? 15 : \
|
||||
LDBL_EXP_MASK < 0x10000 ? 16 : \
|
||||
LDBL_EXP_MASK < 0x20000 ? 17 : \
|
||||
LDBL_EXP_MASK < 0x40000 ? 18 : \
|
||||
LDBL_EXP_MASK < 0x80000 ? 19 : \
|
||||
LDBL_EXP_MASK < 0x100000 ? 20 : \
|
||||
LDBL_EXP_MASK < 0x200000 ? 21 : \
|
||||
LDBL_EXP_MASK < 0x400000 ? 22 : \
|
||||
LDBL_EXP_MASK < 0x800000 ? 23 : \
|
||||
LDBL_EXP_MASK < 0x1000000 ? 24 : \
|
||||
LDBL_EXP_MASK < 0x2000000 ? 25 : \
|
||||
LDBL_EXP_MASK < 0x4000000 ? 26 : \
|
||||
LDBL_EXP_MASK < 0x8000000 ? 27 : \
|
||||
LDBL_EXP_MASK < 0x10000000 ? 28 : \
|
||||
LDBL_EXP_MASK < 0x20000000 ? 29 : \
|
||||
LDBL_EXP_MASK < 0x40000000 ? 30 : \
|
||||
LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
|
||||
32)
|
||||
|
||||
/* Number of bits used for a floating-point number: the mantissa (not
|
||||
counting the "hidden bit", since it may or may not be explicit), the
|
||||
exponent, and the sign. */
|
||||
#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
|
||||
#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
|
||||
#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
|
||||
|
||||
/* Number of bytes used for a floating-point number.
|
||||
This can be smaller than the 'sizeof'. For example, on i386 systems,
|
||||
'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
|
||||
LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
|
||||
sizeof (long double) = 12 or = 16. */
|
||||
#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
|
||||
/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
|
||||
typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
|
||||
typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
|
||||
typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
|
||||
|
||||
#endif /* _FLOATPLUS_H */
|
174
lib/float.in.h
174
lib/float.in.h
@ -1,174 +0,0 @@
|
||||
/* A correct <float.h>.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
#define _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
/* 'long double' properties. */
|
||||
|
||||
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
/* Number of decimal digits that is sufficient for representing a number. */
|
||||
# undef LDBL_DIG
|
||||
# define LDBL_DIG 18
|
||||
/* x-1 where x is the smallest representable number > 1. */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 1.0842021724855044340E-19L
|
||||
/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP (-16381)
|
||||
/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
|
||||
# undef LDBL_MAX_EXP
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.3621031431120935063E-4932L
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
# define LDBL_MAX 1.1897314953572317650E+4932L
|
||||
/* Minimum e such that 10^e is in the range of normalized numbers. */
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum e such that 10^e is in the range of representable finite numbers. */
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
|
||||
precision in the compiler but 64 bits of precision at runtime. See
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */
|
||||
#if defined __i386__ && defined __FreeBSD__
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
/* Number of decimal digits that is sufficient for representing a number. */
|
||||
# undef LDBL_DIG
|
||||
# define LDBL_DIG 18
|
||||
/* x-1 where x is the smallest representable number > 1. */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
|
||||
/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP (-16381)
|
||||
/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
|
||||
# undef LDBL_MAX_EXP
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.3621031431120935E-4932L /* = 0x1p-16382L */
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
|
||||
But the largest literal that GCC allows us to write is
|
||||
0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
Unfortunately, this is not a constant expression. */
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
|
||||
long double ld;
|
||||
};
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
/* Minimum e such that 10^e is in the range of normalized numbers. */
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum e such that 10^e is in the range of representable finite numbers. */
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
|
||||
wrong. */
|
||||
#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
|
||||
It is not easy to define:
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307166e308L
|
||||
is too small, whereas
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307167e308L
|
||||
is too large. Apparently a bug in GCC decimal-to-binary conversion.
|
||||
Also, I can't get values larger than
|
||||
#define LDBL63 ((long double) (1ULL << 63))
|
||||
#define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
|
||||
which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
or through a pointer cast
|
||||
|
||||
#define LDBL_MAX \
|
||||
(*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
|
||||
|
||||
Unfortunately, this is not a constant expression, and the latter expression
|
||||
does not work well when GCC is optimizing.. */
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { double hi; double lo; } dd;
|
||||
long double ld;
|
||||
};
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
#endif
|
||||
|
||||
/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
|
||||
On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
|
||||
are wrong. */
|
||||
#if defined __sgi && (LDBL_MANT_DIG >= 106)
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 106
|
||||
# if defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
@ -1,77 +0,0 @@
|
||||
/* Formatted output to a stream.
|
||||
Copyright (C) 2004, 2006-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/>. */
|
||||
|
||||
#if 1
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "fseterr.h"
|
||||
#include "vasnprintf.h"
|
||||
|
||||
/* Print formatted output to the stream FP.
|
||||
Return string length of formatted string. On error, return a negative
|
||||
value. */
|
||||
int
|
||||
fprintf (FILE *fp, const char *format, ...)
|
||||
{
|
||||
char buf[2000];
|
||||
char *output;
|
||||
size_t len;
|
||||
size_t lenbuf = sizeof (buf);
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
output = vasnprintf (buf, &lenbuf, format, args);
|
||||
len = lenbuf;
|
||||
va_end (args);
|
||||
|
||||
if (!output)
|
||||
{
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fwrite (output, 1, len, fp) < len)
|
||||
{
|
||||
if (output != buf)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (output);
|
||||
errno = saved_errno;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (output != buf)
|
||||
free (output);
|
||||
|
||||
if (len > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
107
lib/fpucw.h
107
lib/fpucw.h
@ -1,107 +0,0 @@
|
||||
/* Manipulating the FPU control word.
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifndef _FPUCW_H
|
||||
#define _FPUCW_H
|
||||
|
||||
/* The i386 floating point hardware (the 387 compatible FPU, not the modern
|
||||
SSE/SSE2 hardware) has a controllable rounding precision. It is specified
|
||||
through the 'PC' bits in the FPU control word ('fctrl' register). (See
|
||||
the GNU libc i386 <fpu_control.h> header for details.)
|
||||
|
||||
On some platforms, such as Linux or Solaris, the default precision setting
|
||||
is set to "extended precision". This means that 'long double' instructions
|
||||
operate correctly, but 'double' computations often produce slightly
|
||||
different results as on strictly IEEE 754 conforming systems.
|
||||
|
||||
On some platforms, such as NetBSD, the default precision is set to
|
||||
"double precision". This means that 'long double' instructions will operate
|
||||
only as 'double', i.e. lead wrong results.
|
||||
|
||||
The FPU control word is under control of the application, i.e. it is
|
||||
not required to be set either way by the ABI. (In fact, the i386 ABI
|
||||
http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38
|
||||
is not clear about it. But in any case, gcc treats the control word
|
||||
like a "preserved" register: it emits code that assumes that the control
|
||||
word is preserved across calls, and it restores the control word at the
|
||||
end of functions that modify it.)
|
||||
|
||||
See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html
|
||||
for a good explanation.
|
||||
See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
|
||||
some argumentation which setting should be the default. */
|
||||
|
||||
/* This header file provides the following facilities:
|
||||
fpucw_t integral type holding the value of 'fctrl'
|
||||
FPU_PC_MASK bit mask denoting the precision control
|
||||
FPU_PC_DOUBLE precision control for 53 bits mantissa
|
||||
FPU_PC_EXTENDED precision control for 64 bits mantissa
|
||||
GET_FPUCW () yields the current FPU control word
|
||||
SET_FPUCW (word) sets the FPU control word
|
||||
DECL_LONG_DOUBLE_ROUNDING variable declaration for
|
||||
BEGIN/END_LONG_DOUBLE_ROUNDING
|
||||
BEGIN_LONG_DOUBLE_ROUNDING () starts a sequence of instructions with
|
||||
'long double' safe operation precision
|
||||
END_LONG_DOUBLE_ROUNDING () ends a sequence of instructions with
|
||||
'long double' safe operation precision
|
||||
*/
|
||||
|
||||
/* Inline assembler like this works only with GNU C. */
|
||||
#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
|
||||
|
||||
typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
|
||||
|
||||
# define FPU_PC_MASK 0x0300
|
||||
# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
|
||||
# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
|
||||
|
||||
# define GET_FPUCW() \
|
||||
({ fpucw_t _cw; \
|
||||
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
|
||||
_cw; \
|
||||
})
|
||||
# define SET_FPUCW(word) \
|
||||
(void)({ fpucw_t _ncw = (word); \
|
||||
__asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
|
||||
})
|
||||
|
||||
# define DECL_LONG_DOUBLE_ROUNDING \
|
||||
fpucw_t oldcw;
|
||||
# define BEGIN_LONG_DOUBLE_ROUNDING() \
|
||||
(void)(oldcw = GET_FPUCW (), \
|
||||
SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED))
|
||||
# define END_LONG_DOUBLE_ROUNDING() \
|
||||
SET_FPUCW (oldcw)
|
||||
|
||||
#else
|
||||
|
||||
typedef unsigned int fpucw_t;
|
||||
|
||||
# define FPU_PC_MASK 0
|
||||
# define FPU_PC_DOUBLE 0
|
||||
# define FPU_PC_EXTENDED 0
|
||||
|
||||
# define GET_FPUCW() 0
|
||||
# define SET_FPUCW(word) (void)(word)
|
||||
|
||||
# define DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_LONG_DOUBLE_ROUNDING()
|
||||
# define END_LONG_DOUBLE_ROUNDING()
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _FPUCW_H */
|
166
lib/frexp.c
166
lib/frexp.c
@ -1,166 +0,0 @@
|
||||
/* Split a double into fraction and mantissa.
|
||||
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 Paolo Bonzini <bonzini@gnu.org>, 2003, and
|
||||
Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <float.h>
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "isnanl-nolibm.h"
|
||||
# include "fpucw.h"
|
||||
#else
|
||||
# include "isnand-nolibm.h"
|
||||
#endif
|
||||
|
||||
/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
|
||||
than 2, or not even a power of 2, some rounding errors can occur, so that
|
||||
then the returned mantissa is only guaranteed to be <= 1.0, not < 1.0. */
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC frexpl
|
||||
# define DOUBLE long double
|
||||
# define ISNAN isnanl
|
||||
# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
|
||||
# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
|
||||
# define L_(literal) literal##L
|
||||
#else
|
||||
# define FUNC frexp
|
||||
# define DOUBLE double
|
||||
# define ISNAN isnand
|
||||
# define DECL_ROUNDING
|
||||
# define BEGIN_ROUNDING()
|
||||
# define END_ROUNDING()
|
||||
# define L_(literal) literal
|
||||
#endif
|
||||
|
||||
DOUBLE
|
||||
FUNC (DOUBLE x, int *expptr)
|
||||
{
|
||||
int sign;
|
||||
int exponent;
|
||||
DECL_ROUNDING
|
||||
|
||||
/* Test for NaN, infinity, and zero. */
|
||||
if (ISNAN (x) || x + x == x)
|
||||
{
|
||||
*expptr = 0;
|
||||
return x;
|
||||
}
|
||||
|
||||
sign = 0;
|
||||
if (x < 0)
|
||||
{
|
||||
x = - x;
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
BEGIN_ROUNDING ();
|
||||
|
||||
{
|
||||
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
|
||||
loops are executed no more than 64 times. */
|
||||
DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
|
||||
DOUBLE powh[64]; /* powh[i] = 2^-2^i */
|
||||
int i;
|
||||
|
||||
exponent = 0;
|
||||
if (x >= L_(1.0))
|
||||
{
|
||||
/* A positive exponent. */
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x >= 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x >= pow2_i)
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
/* Avoid making x too small, as it could become a denormalized
|
||||
number and thus lose precision. */
|
||||
while (i > 0 && x < pow2[i - 1])
|
||||
{
|
||||
i--;
|
||||
powh_i = powh[i];
|
||||
}
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
/* Here 2^-2^i <= x < 1.0. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A negative or zero exponent. */
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x < 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x < powh_i)
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
/* Here 2^-2^i <= x < 1.0. */
|
||||
}
|
||||
|
||||
/* Invariants: x * 2^exponent = argument, and 2^-2^i <= x < 1.0. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (x < powh[i])
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2[i];
|
||||
}
|
||||
}
|
||||
/* Here 0.5 <= x < 1.0. */
|
||||
}
|
||||
|
||||
if (sign < 0)
|
||||
x = - x;
|
||||
|
||||
END_ROUNDING ();
|
||||
|
||||
*expptr = exponent;
|
||||
return x;
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
/* Set the error indicator of a stream.
|
||||
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>
|
||||
|
||||
/* Specification. */
|
||||
#include "fseterr.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "stdio-impl.h"
|
||||
|
||||
void
|
||||
fseterr (FILE *fp)
|
||||
{
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_flags |= _IO_ERR_SEEN;
|
||||
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
|
||||
fp_->_flags |= __SERR;
|
||||
#elif defined __EMX__ /* emx+gcc */
|
||||
fp->_flags |= _IOERR;
|
||||
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
|
||||
fp_->_flag |= _IOERR;
|
||||
#elif defined __UCLIBC__ /* uClibc */
|
||||
fp->__modeflags |= __FLAG_ERROR;
|
||||
#elif defined __QNX__ /* QNX */
|
||||
fp->_Mode |= 0x200 /* _MERR */;
|
||||
#elif defined __MINT__ /* Atari FreeMiNT */
|
||||
fp->__error = 1;
|
||||
#elif 0 /* unknown */
|
||||
/* Portable fallback, based on an idea by Rich Felker.
|
||||
Wow! 6 system calls for something that is just a bit operation!
|
||||
Not activated on any system, because there is no way to repair FP when
|
||||
the sequence of system calls fails, and library code should not call
|
||||
abort(). */
|
||||
int saved_errno;
|
||||
int fd;
|
||||
int fd2;
|
||||
|
||||
saved_errno = errno;
|
||||
fflush (fp);
|
||||
fd = fileno (fp);
|
||||
fd2 = dup (fd);
|
||||
if (fd2 >= 0)
|
||||
{
|
||||
close (fd);
|
||||
fputc ('\0', fp); /* This should set the error indicator. */
|
||||
fflush (fp); /* Or this. */
|
||||
if (dup2 (fd2, fd) < 0)
|
||||
/* Whee... we botched the stream and now cannot restore it! */
|
||||
abort ();
|
||||
close (fd2);
|
||||
}
|
||||
errno = saved_errno;
|
||||
#else
|
||||
#error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
|
||||
#endif
|
||||
}
|
450
lib/iconv.c
Normal file
450
lib/iconv.c
Normal file
@ -0,0 +1,450 @@
|
||||
/* Character set conversion.
|
||||
Copyright (C) 1999-2001, 2007, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <iconv.h>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if REPLACE_ICONV_UTF
|
||||
# include <errno.h>
|
||||
# include <stdint.h>
|
||||
# include <stdlib.h>
|
||||
# include "unistr.h"
|
||||
# ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if REPLACE_ICONV_UTF
|
||||
|
||||
/* UTF-{16,32}{BE,LE} converters taken from GNU libiconv 1.11. */
|
||||
|
||||
/* Return code if invalid. (xxx_mbtowc) */
|
||||
# define RET_ILSEQ -1
|
||||
/* Return code if no bytes were read. (xxx_mbtowc) */
|
||||
# define RET_TOOFEW -2
|
||||
|
||||
/* Return code if invalid. (xxx_wctomb) */
|
||||
# define RET_ILUNI -1
|
||||
/* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */
|
||||
# define RET_TOOSMALL -2
|
||||
|
||||
/*
|
||||
* UTF-16BE
|
||||
*/
|
||||
|
||||
/* Specification: RFC 2781 */
|
||||
|
||||
static int
|
||||
utf16be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
|
||||
{
|
||||
if (n >= 2)
|
||||
{
|
||||
ucs4_t wc = (s[0] << 8) + s[1];
|
||||
if (wc >= 0xd800 && wc < 0xdc00)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc2 = (s[2] << 8) + s[3];
|
||||
if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
|
||||
return RET_ILSEQ;
|
||||
*pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
else if (wc >= 0xdc00 && wc < 0xe000)
|
||||
{
|
||||
return RET_ILSEQ;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pwc = wc;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return RET_TOOFEW;
|
||||
}
|
||||
|
||||
static int
|
||||
utf16be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
|
||||
{
|
||||
if (!(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
if (wc < 0x10000)
|
||||
{
|
||||
if (n >= 2)
|
||||
{
|
||||
r[0] = (unsigned char) (wc >> 8);
|
||||
r[1] = (unsigned char) wc;
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
else if (wc < 0x110000)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
|
||||
ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
|
||||
r[0] = (unsigned char) (wc1 >> 8);
|
||||
r[1] = (unsigned char) wc1;
|
||||
r[2] = (unsigned char) (wc2 >> 8);
|
||||
r[3] = (unsigned char) wc2;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
}
|
||||
return RET_ILUNI;
|
||||
}
|
||||
|
||||
/*
|
||||
* UTF-16LE
|
||||
*/
|
||||
|
||||
/* Specification: RFC 2781 */
|
||||
|
||||
static int
|
||||
utf16le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
|
||||
{
|
||||
if (n >= 2)
|
||||
{
|
||||
ucs4_t wc = s[0] + (s[1] << 8);
|
||||
if (wc >= 0xd800 && wc < 0xdc00)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc2 = s[2] + (s[3] << 8);
|
||||
if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
|
||||
return RET_ILSEQ;
|
||||
*pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
else if (wc >= 0xdc00 && wc < 0xe000)
|
||||
{
|
||||
return RET_ILSEQ;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pwc = wc;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return RET_TOOFEW;
|
||||
}
|
||||
|
||||
static int
|
||||
utf16le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
|
||||
{
|
||||
if (!(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
if (wc < 0x10000)
|
||||
{
|
||||
if (n >= 2)
|
||||
{
|
||||
r[0] = (unsigned char) wc;
|
||||
r[1] = (unsigned char) (wc >> 8);
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
else if (wc < 0x110000)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
|
||||
ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
|
||||
r[0] = (unsigned char) wc1;
|
||||
r[1] = (unsigned char) (wc1 >> 8);
|
||||
r[2] = (unsigned char) wc2;
|
||||
r[3] = (unsigned char) (wc2 >> 8);
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
}
|
||||
return RET_ILUNI;
|
||||
}
|
||||
|
||||
/*
|
||||
* UTF-32BE
|
||||
*/
|
||||
|
||||
/* Specification: Unicode 3.1 Standard Annex #19 */
|
||||
|
||||
static int
|
||||
utf32be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3];
|
||||
if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
*pwc = wc;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_ILSEQ;
|
||||
}
|
||||
return RET_TOOFEW;
|
||||
}
|
||||
|
||||
static int
|
||||
utf32be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
|
||||
{
|
||||
if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
r[0] = 0;
|
||||
r[1] = (unsigned char) (wc >> 16);
|
||||
r[2] = (unsigned char) (wc >> 8);
|
||||
r[3] = (unsigned char) wc;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
return RET_ILUNI;
|
||||
}
|
||||
|
||||
/*
|
||||
* UTF-32LE
|
||||
*/
|
||||
|
||||
/* Specification: Unicode 3.1 Standard Annex #19 */
|
||||
|
||||
static int
|
||||
utf32le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24);
|
||||
if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
*pwc = wc;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_ILSEQ;
|
||||
}
|
||||
return RET_TOOFEW;
|
||||
}
|
||||
|
||||
static int
|
||||
utf32le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
|
||||
{
|
||||
if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
|
||||
{
|
||||
if (n >= 4)
|
||||
{
|
||||
r[0] = (unsigned char) wc;
|
||||
r[1] = (unsigned char) (wc >> 8);
|
||||
r[2] = (unsigned char) (wc >> 16);
|
||||
r[3] = 0;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
return RET_TOOSMALL;
|
||||
}
|
||||
return RET_ILUNI;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
size_t
|
||||
rpl_iconv (iconv_t cd,
|
||||
ICONV_CONST char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft)
|
||||
#undef iconv
|
||||
{
|
||||
#if REPLACE_ICONV_UTF
|
||||
switch ((uintptr_t) cd)
|
||||
{
|
||||
{
|
||||
int (*xxx_wctomb) (unsigned char *, ucs4_t, size_t);
|
||||
|
||||
case (uintptr_t) _ICONV_UTF8_UTF16BE:
|
||||
xxx_wctomb = utf16be_wctomb;
|
||||
goto loop_from_utf8;
|
||||
case (uintptr_t) _ICONV_UTF8_UTF16LE:
|
||||
xxx_wctomb = utf16le_wctomb;
|
||||
goto loop_from_utf8;
|
||||
case (uintptr_t) _ICONV_UTF8_UTF32BE:
|
||||
xxx_wctomb = utf32be_wctomb;
|
||||
goto loop_from_utf8;
|
||||
case (uintptr_t) _ICONV_UTF8_UTF32LE:
|
||||
xxx_wctomb = utf32le_wctomb;
|
||||
goto loop_from_utf8;
|
||||
|
||||
loop_from_utf8:
|
||||
if (inbuf == NULL || *inbuf == NULL)
|
||||
return 0;
|
||||
{
|
||||
ICONV_CONST char *inptr = *inbuf;
|
||||
size_t inleft = *inbytesleft;
|
||||
char *outptr = *outbuf;
|
||||
size_t outleft = *outbytesleft;
|
||||
size_t res = 0;
|
||||
while (inleft > 0)
|
||||
{
|
||||
ucs4_t uc;
|
||||
int m = u8_mbtoucr (&uc, (const uint8_t *) inptr, inleft);
|
||||
if (m <= 0)
|
||||
{
|
||||
if (m == -1)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
if (m == -2)
|
||||
{
|
||||
errno = EINVAL;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
{
|
||||
int n = xxx_wctomb ((uint8_t *) outptr, uc, outleft);
|
||||
if (n < 0)
|
||||
{
|
||||
if (n == RET_ILUNI)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
if (n == RET_TOOSMALL)
|
||||
{
|
||||
errno = E2BIG;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
{
|
||||
inptr += m;
|
||||
inleft -= m;
|
||||
outptr += n;
|
||||
outleft -= n;
|
||||
}
|
||||
}
|
||||
}
|
||||
*inbuf = inptr;
|
||||
*inbytesleft = inleft;
|
||||
*outbuf = outptr;
|
||||
*outbytesleft = outleft;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int (*xxx_mbtowc) (ucs4_t *, const unsigned char *, size_t);
|
||||
|
||||
case (uintptr_t) _ICONV_UTF16BE_UTF8:
|
||||
xxx_mbtowc = utf16be_mbtowc;
|
||||
goto loop_to_utf8;
|
||||
case (uintptr_t) _ICONV_UTF16LE_UTF8:
|
||||
xxx_mbtowc = utf16le_mbtowc;
|
||||
goto loop_to_utf8;
|
||||
case (uintptr_t) _ICONV_UTF32BE_UTF8:
|
||||
xxx_mbtowc = utf32be_mbtowc;
|
||||
goto loop_to_utf8;
|
||||
case (uintptr_t) _ICONV_UTF32LE_UTF8:
|
||||
xxx_mbtowc = utf32le_mbtowc;
|
||||
goto loop_to_utf8;
|
||||
|
||||
loop_to_utf8:
|
||||
if (inbuf == NULL || *inbuf == NULL)
|
||||
return 0;
|
||||
{
|
||||
ICONV_CONST char *inptr = *inbuf;
|
||||
size_t inleft = *inbytesleft;
|
||||
char *outptr = *outbuf;
|
||||
size_t outleft = *outbytesleft;
|
||||
size_t res = 0;
|
||||
while (inleft > 0)
|
||||
{
|
||||
ucs4_t uc;
|
||||
int m = xxx_mbtowc (&uc, (const uint8_t *) inptr, inleft);
|
||||
if (m <= 0)
|
||||
{
|
||||
if (m == RET_ILSEQ)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
if (m == RET_TOOFEW)
|
||||
{
|
||||
errno = EINVAL;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
{
|
||||
int n = u8_uctomb ((uint8_t *) outptr, uc, outleft);
|
||||
if (n < 0)
|
||||
{
|
||||
if (n == -1)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
if (n == -2)
|
||||
{
|
||||
errno = E2BIG;
|
||||
res = (size_t)(-1);
|
||||
break;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
{
|
||||
inptr += m;
|
||||
inleft -= m;
|
||||
outptr += n;
|
||||
outleft -= n;
|
||||
}
|
||||
}
|
||||
}
|
||||
*inbuf = inptr;
|
||||
*inbytesleft = inleft;
|
||||
*outbuf = outptr;
|
||||
*outbytesleft = outleft;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return iconv (cd, inbuf, inbytesleft, outbuf, outbytesleft);
|
||||
}
|
111
lib/iconv.in.h
Normal file
111
lib/iconv.in.h
Normal file
@ -0,0 +1,111 @@
|
||||
/* A GNU-like <iconv.h>.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ICONV_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_ICONV_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ICONV_H
|
||||
#define _@GUARD_PREFIX@_ICONV_H
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_ARG_NONNULL is copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
|
||||
#if @GNULIB_ICONV@
|
||||
# if @REPLACE_ICONV_OPEN@
|
||||
/* An iconv_open wrapper that supports the IANA standardized encoding names
|
||||
("ISO-8859-1" etc.) as far as possible. */
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define iconv_open rpl_iconv_open
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (iconv_open, iconv_t,
|
||||
(const char *tocode, const char *fromcode)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (iconv_open, iconv_t,
|
||||
(const char *tocode, const char *fromcode));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (iconv_open, iconv_t,
|
||||
(const char *tocode, const char *fromcode));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (iconv_open);
|
||||
#endif
|
||||
|
||||
#if @REPLACE_ICONV_UTF@
|
||||
/* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
|
||||
Not public. */
|
||||
# define _ICONV_UTF8_UTF16BE (iconv_t)(-161)
|
||||
# define _ICONV_UTF8_UTF16LE (iconv_t)(-162)
|
||||
# define _ICONV_UTF8_UTF32BE (iconv_t)(-163)
|
||||
# define _ICONV_UTF8_UTF32LE (iconv_t)(-164)
|
||||
# define _ICONV_UTF16BE_UTF8 (iconv_t)(-165)
|
||||
# define _ICONV_UTF16LE_UTF8 (iconv_t)(-166)
|
||||
# define _ICONV_UTF32BE_UTF8 (iconv_t)(-167)
|
||||
# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ICONV@
|
||||
# if @REPLACE_ICONV@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define iconv rpl_iconv
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (iconv, size_t,
|
||||
(iconv_t cd,
|
||||
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft));
|
||||
_GL_CXXALIAS_RPL (iconv, size_t,
|
||||
(iconv_t cd,
|
||||
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (iconv, size_t,
|
||||
(iconv_t cd,
|
||||
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (iconv);
|
||||
# ifndef ICONV_CONST
|
||||
# define ICONV_CONST @ICONV_CONST@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ICONV@
|
||||
# if @REPLACE_ICONV@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define iconv_close rpl_iconv_close
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
|
||||
_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (iconv_close);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_ICONV_H */
|
||||
#endif /* _@GUARD_PREFIX@_ICONV_H */
|
@ -1,5 +1,5 @@
|
||||
/* Formatted output to strings.
|
||||
Copyright (C) 1999, 2002, 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Character set conversion.
|
||||
Copyright (C) 2007, 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
|
||||
@ -18,18 +18,30 @@
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "vasnprintf.h"
|
||||
#include <iconv.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
#endif
|
||||
|
||||
char *
|
||||
asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
|
||||
int
|
||||
rpl_iconv_close (iconv_t cd)
|
||||
#undef iconv_close
|
||||
{
|
||||
va_list args;
|
||||
char *result;
|
||||
|
||||
va_start (args, format);
|
||||
result = vasnprintf (resultbuf, lengthp, format, args);
|
||||
va_end (args);
|
||||
return result;
|
||||
#if REPLACE_ICONV_UTF
|
||||
switch ((uintptr_t) cd)
|
||||
{
|
||||
case (uintptr_t) _ICONV_UTF8_UTF16BE:
|
||||
case (uintptr_t) _ICONV_UTF8_UTF16LE:
|
||||
case (uintptr_t) _ICONV_UTF8_UTF32BE:
|
||||
case (uintptr_t) _ICONV_UTF8_UTF32LE:
|
||||
case (uintptr_t) _ICONV_UTF16BE_UTF8:
|
||||
case (uintptr_t) _ICONV_UTF16LE_UTF8:
|
||||
case (uintptr_t) _ICONV_UTF32BE_UTF8:
|
||||
case (uintptr_t) _ICONV_UTF32LE_UTF8:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return iconv_close (cd);
|
||||
}
|
44
lib/iconv_open-aix.gperf
Normal file
44
lib/iconv_open-aix.gperf
Normal file
@ -0,0 +1,44 @@
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
%struct-type
|
||||
%language=ANSI-C
|
||||
%define slot-name standard_name
|
||||
%define hash-function-name mapping_hash
|
||||
%define lookup-function-name mapping_lookup
|
||||
%readonly-tables
|
||||
%global-table
|
||||
%define word-array-name mappings
|
||||
%pic
|
||||
%%
|
||||
# On AIX 5.1, look in /usr/lib/nls/loc/uconvTable.
|
||||
ISO-8859-1, "ISO8859-1"
|
||||
ISO-8859-2, "ISO8859-2"
|
||||
ISO-8859-3, "ISO8859-3"
|
||||
ISO-8859-4, "ISO8859-4"
|
||||
ISO-8859-5, "ISO8859-5"
|
||||
ISO-8859-6, "ISO8859-6"
|
||||
ISO-8859-7, "ISO8859-7"
|
||||
ISO-8859-8, "ISO8859-8"
|
||||
ISO-8859-9, "ISO8859-9"
|
||||
ISO-8859-15, "ISO8859-15"
|
||||
CP437, "IBM-437"
|
||||
CP850, "IBM-850"
|
||||
CP852, "IBM-852"
|
||||
CP856, "IBM-856"
|
||||
CP857, "IBM-857"
|
||||
CP861, "IBM-861"
|
||||
CP865, "IBM-865"
|
||||
CP869, "IBM-869"
|
||||
ISO-8859-13, "IBM-921"
|
||||
CP922, "IBM-922"
|
||||
CP932, "IBM-932"
|
||||
CP943, "IBM-943"
|
||||
CP1046, "IBM-1046"
|
||||
CP1124, "IBM-1124"
|
||||
CP1125, "IBM-1125"
|
||||
CP1129, "IBM-1129"
|
||||
CP1252, "IBM-1252"
|
||||
GB2312, "IBM-eucCN"
|
||||
EUC-JP, "IBM-eucJP"
|
||||
EUC-KR, "IBM-eucKR"
|
||||
EUC-TW, "IBM-eucTW"
|
||||
BIG5, "big5"
|
256
lib/iconv_open-aix.h
Normal file
256
lib/iconv_open-aix.h
Normal file
@ -0,0 +1,256 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */
|
||||
/* Computed positions: -k'4,$' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "./iconv_open-aix.gperf"
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
|
||||
#define TOTAL_KEYWORDS 32
|
||||
#define MIN_WORD_LENGTH 4
|
||||
#define MAX_WORD_LENGTH 11
|
||||
#define MIN_HASH_VALUE 6
|
||||
#define MAX_HASH_VALUE 44
|
||||
/* maximum key range = 39, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
mapping_hash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 0, 4, 25,
|
||||
0, 11, 24, 9, 17, 3, 14, 21, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
3, 45, 1, 45, 45, 45, 45, 0, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45
|
||||
};
|
||||
return len + asso_values[(unsigned char)str[3]+2] + asso_values[(unsigned char)str[len - 1]];
|
||||
}
|
||||
|
||||
struct stringpool_t
|
||||
{
|
||||
char stringpool_str6[sizeof("EUC-TW")];
|
||||
char stringpool_str7[sizeof("EUC-KR")];
|
||||
char stringpool_str8[sizeof("CP852")];
|
||||
char stringpool_str9[sizeof("EUC-JP")];
|
||||
char stringpool_str10[sizeof("ISO-8859-2")];
|
||||
char stringpool_str11[sizeof("CP857")];
|
||||
char stringpool_str12[sizeof("CP850")];
|
||||
char stringpool_str13[sizeof("ISO-8859-7")];
|
||||
char stringpool_str14[sizeof("CP932")];
|
||||
char stringpool_str15[sizeof("GB2312")];
|
||||
char stringpool_str16[sizeof("BIG5")];
|
||||
char stringpool_str17[sizeof("CP437")];
|
||||
char stringpool_str19[sizeof("ISO-8859-5")];
|
||||
char stringpool_str20[sizeof("ISO-8859-15")];
|
||||
char stringpool_str21[sizeof("ISO-8859-3")];
|
||||
char stringpool_str22[sizeof("ISO-8859-13")];
|
||||
char stringpool_str23[sizeof("CP1046")];
|
||||
char stringpool_str24[sizeof("ISO-8859-8")];
|
||||
char stringpool_str25[sizeof("CP856")];
|
||||
char stringpool_str26[sizeof("CP1125")];
|
||||
char stringpool_str27[sizeof("ISO-8859-6")];
|
||||
char stringpool_str28[sizeof("CP865")];
|
||||
char stringpool_str29[sizeof("CP922")];
|
||||
char stringpool_str30[sizeof("CP1252")];
|
||||
char stringpool_str31[sizeof("ISO-8859-9")];
|
||||
char stringpool_str33[sizeof("CP943")];
|
||||
char stringpool_str34[sizeof("ISO-8859-4")];
|
||||
char stringpool_str35[sizeof("ISO-8859-1")];
|
||||
char stringpool_str38[sizeof("CP1129")];
|
||||
char stringpool_str40[sizeof("CP869")];
|
||||
char stringpool_str41[sizeof("CP1124")];
|
||||
char stringpool_str44[sizeof("CP861")];
|
||||
};
|
||||
static const struct stringpool_t stringpool_contents =
|
||||
{
|
||||
"EUC-TW",
|
||||
"EUC-KR",
|
||||
"CP852",
|
||||
"EUC-JP",
|
||||
"ISO-8859-2",
|
||||
"CP857",
|
||||
"CP850",
|
||||
"ISO-8859-7",
|
||||
"CP932",
|
||||
"GB2312",
|
||||
"BIG5",
|
||||
"CP437",
|
||||
"ISO-8859-5",
|
||||
"ISO-8859-15",
|
||||
"ISO-8859-3",
|
||||
"ISO-8859-13",
|
||||
"CP1046",
|
||||
"ISO-8859-8",
|
||||
"CP856",
|
||||
"CP1125",
|
||||
"ISO-8859-6",
|
||||
"CP865",
|
||||
"CP922",
|
||||
"CP1252",
|
||||
"ISO-8859-9",
|
||||
"CP943",
|
||||
"ISO-8859-4",
|
||||
"ISO-8859-1",
|
||||
"CP1129",
|
||||
"CP869",
|
||||
"CP1124",
|
||||
"CP861"
|
||||
};
|
||||
#define stringpool ((const char *) &stringpool_contents)
|
||||
|
||||
static const struct mapping mappings[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 43 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
|
||||
#line 42 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
|
||||
#line 25 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
|
||||
#line 41 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
|
||||
#line 14 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
|
||||
#line 27 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
|
||||
#line 24 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
|
||||
#line 19 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
|
||||
#line 33 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
|
||||
#line 40 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
|
||||
#line 44 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
|
||||
#line 23 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
|
||||
{-1},
|
||||
#line 17 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
|
||||
#line 22 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
|
||||
#line 15 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
|
||||
#line 31 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
|
||||
#line 35 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
|
||||
#line 20 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
|
||||
#line 26 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
|
||||
#line 37 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
|
||||
#line 18 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
|
||||
#line 29 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
|
||||
#line 32 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
|
||||
#line 39 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
|
||||
#line 21 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
|
||||
{-1},
|
||||
#line 34 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
|
||||
#line 16 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
|
||||
#line 13 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
|
||||
{-1}, {-1},
|
||||
#line 38 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
|
||||
{-1},
|
||||
#line 30 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
|
||||
#line 36 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
|
||||
{-1}, {-1},
|
||||
#line 28 "./iconv_open-aix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct mapping *
|
||||
mapping_lookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = mapping_hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = mappings[key].standard_name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + stringpool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &mappings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
56
lib/iconv_open-hpux.gperf
Normal file
56
lib/iconv_open-hpux.gperf
Normal file
@ -0,0 +1,56 @@
|
||||
struct mapping { int standard_name; const char vendor_name[9 + 1]; };
|
||||
%struct-type
|
||||
%language=ANSI-C
|
||||
%define slot-name standard_name
|
||||
%define hash-function-name mapping_hash
|
||||
%define lookup-function-name mapping_lookup
|
||||
%readonly-tables
|
||||
%global-table
|
||||
%define word-array-name mappings
|
||||
%pic
|
||||
%%
|
||||
# On HP-UX 11.11, look in /usr/lib/nls/iconv.
|
||||
ISO-8859-1, "iso88591"
|
||||
ISO-8859-2, "iso88592"
|
||||
ISO-8859-5, "iso88595"
|
||||
ISO-8859-6, "iso88596"
|
||||
ISO-8859-7, "iso88597"
|
||||
ISO-8859-8, "iso88598"
|
||||
ISO-8859-9, "iso88599"
|
||||
ISO-8859-15, "iso885915"
|
||||
CP437, "cp437"
|
||||
CP775, "cp775"
|
||||
CP850, "cp850"
|
||||
CP852, "cp852"
|
||||
CP855, "cp855"
|
||||
CP857, "cp857"
|
||||
CP861, "cp861"
|
||||
CP862, "cp862"
|
||||
CP864, "cp864"
|
||||
CP865, "cp865"
|
||||
CP866, "cp866"
|
||||
CP869, "cp869"
|
||||
CP874, "cp874"
|
||||
CP1250, "cp1250"
|
||||
CP1251, "cp1251"
|
||||
CP1252, "cp1252"
|
||||
CP1253, "cp1253"
|
||||
CP1254, "cp1254"
|
||||
CP1255, "cp1255"
|
||||
CP1256, "cp1256"
|
||||
CP1257, "cp1257"
|
||||
CP1258, "cp1258"
|
||||
HP-ROMAN8, "roman8"
|
||||
HP-ARABIC8, "arabic8"
|
||||
HP-GREEK8, "greek8"
|
||||
HP-HEBREW8, "hebrew8"
|
||||
HP-TURKISH8, "turkish8"
|
||||
HP-KANA8, "kana8"
|
||||
TIS-620, "tis620"
|
||||
GB2312, "hp15CN"
|
||||
EUC-JP, "eucJP"
|
||||
EUC-KR, "eucKR"
|
||||
EUC-TW, "eucTW"
|
||||
BIG5, "big5"
|
||||
SHIFT_JIS, "sjis"
|
||||
UTF-8, "utf8"
|
299
lib/iconv_open-hpux.h
Normal file
299
lib/iconv_open-hpux.h
Normal file
@ -0,0 +1,299 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */
|
||||
/* Computed positions: -k'4,$' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "./iconv_open-hpux.gperf"
|
||||
struct mapping { int standard_name; const char vendor_name[9 + 1]; };
|
||||
|
||||
#define TOTAL_KEYWORDS 44
|
||||
#define MIN_WORD_LENGTH 4
|
||||
#define MAX_WORD_LENGTH 11
|
||||
#define MIN_HASH_VALUE 6
|
||||
#define MAX_HASH_VALUE 49
|
||||
/* maximum key range = 44, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
mapping_hash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 1, 2,
|
||||
24, 43, 5, 10, 0, 13, 32, 3, 19, 18,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 5,
|
||||
50, 50, 50, 50, 14, 5, 0, 50, 50, 0,
|
||||
27, 50, 12, 14, 50, 50, 0, 5, 2, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
|
||||
50, 50, 50, 50, 50, 50, 50, 50, 50, 50
|
||||
};
|
||||
return len + asso_values[(unsigned char)str[3]+4] + asso_values[(unsigned char)str[len - 1]];
|
||||
}
|
||||
|
||||
struct stringpool_t
|
||||
{
|
||||
char stringpool_str6[sizeof("CP1256")];
|
||||
char stringpool_str7[sizeof("CP1250")];
|
||||
char stringpool_str8[sizeof("CP1251")];
|
||||
char stringpool_str9[sizeof("CP850")];
|
||||
char stringpool_str10[sizeof("TIS-620")];
|
||||
char stringpool_str11[sizeof("CP1254")];
|
||||
char stringpool_str12[sizeof("ISO-8859-6")];
|
||||
char stringpool_str13[sizeof("EUC-TW")];
|
||||
char stringpool_str14[sizeof("ISO-8859-1")];
|
||||
char stringpool_str15[sizeof("ISO-8859-9")];
|
||||
char stringpool_str16[sizeof("CP1255")];
|
||||
char stringpool_str17[sizeof("BIG5")];
|
||||
char stringpool_str18[sizeof("CP855")];
|
||||
char stringpool_str19[sizeof("CP1257")];
|
||||
char stringpool_str20[sizeof("EUC-KR")];
|
||||
char stringpool_str21[sizeof("CP857")];
|
||||
char stringpool_str22[sizeof("ISO-8859-5")];
|
||||
char stringpool_str23[sizeof("ISO-8859-15")];
|
||||
char stringpool_str24[sizeof("CP866")];
|
||||
char stringpool_str25[sizeof("ISO-8859-7")];
|
||||
char stringpool_str26[sizeof("CP861")];
|
||||
char stringpool_str27[sizeof("CP869")];
|
||||
char stringpool_str28[sizeof("CP874")];
|
||||
char stringpool_str29[sizeof("CP864")];
|
||||
char stringpool_str30[sizeof("CP1252")];
|
||||
char stringpool_str31[sizeof("CP437")];
|
||||
char stringpool_str32[sizeof("CP852")];
|
||||
char stringpool_str33[sizeof("CP775")];
|
||||
char stringpool_str34[sizeof("CP865")];
|
||||
char stringpool_str35[sizeof("EUC-JP")];
|
||||
char stringpool_str36[sizeof("ISO-8859-2")];
|
||||
char stringpool_str37[sizeof("SHIFT_JIS")];
|
||||
char stringpool_str38[sizeof("CP1258")];
|
||||
char stringpool_str39[sizeof("UTF-8")];
|
||||
char stringpool_str40[sizeof("HP-KANA8")];
|
||||
char stringpool_str41[sizeof("HP-ROMAN8")];
|
||||
char stringpool_str42[sizeof("HP-HEBREW8")];
|
||||
char stringpool_str43[sizeof("GB2312")];
|
||||
char stringpool_str44[sizeof("ISO-8859-8")];
|
||||
char stringpool_str45[sizeof("HP-TURKISH8")];
|
||||
char stringpool_str46[sizeof("HP-GREEK8")];
|
||||
char stringpool_str47[sizeof("HP-ARABIC8")];
|
||||
char stringpool_str48[sizeof("CP862")];
|
||||
char stringpool_str49[sizeof("CP1253")];
|
||||
};
|
||||
static const struct stringpool_t stringpool_contents =
|
||||
{
|
||||
"CP1256",
|
||||
"CP1250",
|
||||
"CP1251",
|
||||
"CP850",
|
||||
"TIS-620",
|
||||
"CP1254",
|
||||
"ISO-8859-6",
|
||||
"EUC-TW",
|
||||
"ISO-8859-1",
|
||||
"ISO-8859-9",
|
||||
"CP1255",
|
||||
"BIG5",
|
||||
"CP855",
|
||||
"CP1257",
|
||||
"EUC-KR",
|
||||
"CP857",
|
||||
"ISO-8859-5",
|
||||
"ISO-8859-15",
|
||||
"CP866",
|
||||
"ISO-8859-7",
|
||||
"CP861",
|
||||
"CP869",
|
||||
"CP874",
|
||||
"CP864",
|
||||
"CP1252",
|
||||
"CP437",
|
||||
"CP852",
|
||||
"CP775",
|
||||
"CP865",
|
||||
"EUC-JP",
|
||||
"ISO-8859-2",
|
||||
"SHIFT_JIS",
|
||||
"CP1258",
|
||||
"UTF-8",
|
||||
"HP-KANA8",
|
||||
"HP-ROMAN8",
|
||||
"HP-HEBREW8",
|
||||
"GB2312",
|
||||
"ISO-8859-8",
|
||||
"HP-TURKISH8",
|
||||
"HP-GREEK8",
|
||||
"HP-ARABIC8",
|
||||
"CP862",
|
||||
"CP1253"
|
||||
};
|
||||
#define stringpool ((const char *) &stringpool_contents)
|
||||
|
||||
static const struct mapping mappings[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 40 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
|
||||
#line 34 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
|
||||
#line 35 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
|
||||
#line 23 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
|
||||
#line 49 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
|
||||
#line 38 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
|
||||
#line 16 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
|
||||
#line 53 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
|
||||
#line 13 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
|
||||
#line 19 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
|
||||
#line 39 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
|
||||
#line 54 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
|
||||
#line 25 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
|
||||
#line 41 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
|
||||
#line 52 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
|
||||
#line 26 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
|
||||
#line 15 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
|
||||
#line 20 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
|
||||
#line 31 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
|
||||
#line 17 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
|
||||
#line 27 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
|
||||
#line 32 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
|
||||
#line 33 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
|
||||
#line 29 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
|
||||
#line 36 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
|
||||
#line 21 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
|
||||
#line 24 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
|
||||
#line 22 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
|
||||
#line 30 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
|
||||
#line 51 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
|
||||
#line 14 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
|
||||
#line 55 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
|
||||
#line 42 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
|
||||
#line 56 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
|
||||
#line 48 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
|
||||
#line 43 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
|
||||
#line 46 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
|
||||
#line 50 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
|
||||
#line 18 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
|
||||
#line 47 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
|
||||
#line 45 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
|
||||
#line 44 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
|
||||
#line 28 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
|
||||
#line 37 "./iconv_open-hpux.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct mapping *
|
||||
mapping_lookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = mapping_hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = mappings[key].standard_name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + stringpool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &mappings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
31
lib/iconv_open-irix.gperf
Normal file
31
lib/iconv_open-irix.gperf
Normal file
@ -0,0 +1,31 @@
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
%struct-type
|
||||
%language=ANSI-C
|
||||
%define slot-name standard_name
|
||||
%define hash-function-name mapping_hash
|
||||
%define lookup-function-name mapping_lookup
|
||||
%readonly-tables
|
||||
%global-table
|
||||
%define word-array-name mappings
|
||||
%pic
|
||||
%%
|
||||
# On IRIX 6.5, look in /usr/lib/iconv and /usr/lib/international/encodings.
|
||||
ISO-8859-1, "ISO8859-1"
|
||||
ISO-8859-2, "ISO8859-2"
|
||||
ISO-8859-3, "ISO8859-3"
|
||||
ISO-8859-4, "ISO8859-4"
|
||||
ISO-8859-5, "ISO8859-5"
|
||||
ISO-8859-6, "ISO8859-6"
|
||||
ISO-8859-7, "ISO8859-7"
|
||||
ISO-8859-8, "ISO8859-8"
|
||||
ISO-8859-9, "ISO8859-9"
|
||||
ISO-8859-15, "ISO8859-15"
|
||||
KOI8-R, "KOI8"
|
||||
CP855, "DOS855"
|
||||
CP1251, "WIN1251"
|
||||
GB2312, "eucCN"
|
||||
EUC-JP, "eucJP"
|
||||
EUC-KR, "eucKR"
|
||||
EUC-TW, "eucTW"
|
||||
SHIFT_JIS, "sjis"
|
||||
TIS-620, "TIS620"
|
199
lib/iconv_open-irix.h
Normal file
199
lib/iconv_open-irix.h
Normal file
@ -0,0 +1,199 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */
|
||||
/* Computed positions: -k'1,$' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "./iconv_open-irix.gperf"
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
|
||||
#define TOTAL_KEYWORDS 19
|
||||
#define MIN_WORD_LENGTH 5
|
||||
#define MAX_WORD_LENGTH 11
|
||||
#define MIN_HASH_VALUE 5
|
||||
#define MAX_HASH_VALUE 23
|
||||
/* maximum key range = 19, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
mapping_hash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 8, 2,
|
||||
5, 12, 11, 0, 10, 9, 8, 7, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 0, 24, 0,
|
||||
24, 5, 24, 0, 24, 7, 24, 24, 24, 24,
|
||||
7, 24, 1, 0, 8, 24, 24, 0, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 24
|
||||
};
|
||||
return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
|
||||
}
|
||||
|
||||
struct stringpool_t
|
||||
{
|
||||
char stringpool_str5[sizeof("CP855")];
|
||||
char stringpool_str6[sizeof("EUC-TW")];
|
||||
char stringpool_str7[sizeof("EUC-KR")];
|
||||
char stringpool_str8[sizeof("CP1251")];
|
||||
char stringpool_str9[sizeof("SHIFT_JIS")];
|
||||
char stringpool_str10[sizeof("ISO-8859-5")];
|
||||
char stringpool_str11[sizeof("ISO-8859-15")];
|
||||
char stringpool_str12[sizeof("ISO-8859-1")];
|
||||
char stringpool_str13[sizeof("EUC-JP")];
|
||||
char stringpool_str14[sizeof("KOI8-R")];
|
||||
char stringpool_str15[sizeof("ISO-8859-2")];
|
||||
char stringpool_str16[sizeof("GB2312")];
|
||||
char stringpool_str17[sizeof("ISO-8859-9")];
|
||||
char stringpool_str18[sizeof("ISO-8859-8")];
|
||||
char stringpool_str19[sizeof("ISO-8859-7")];
|
||||
char stringpool_str20[sizeof("ISO-8859-6")];
|
||||
char stringpool_str21[sizeof("ISO-8859-4")];
|
||||
char stringpool_str22[sizeof("ISO-8859-3")];
|
||||
char stringpool_str23[sizeof("TIS-620")];
|
||||
};
|
||||
static const struct stringpool_t stringpool_contents =
|
||||
{
|
||||
"CP855",
|
||||
"EUC-TW",
|
||||
"EUC-KR",
|
||||
"CP1251",
|
||||
"SHIFT_JIS",
|
||||
"ISO-8859-5",
|
||||
"ISO-8859-15",
|
||||
"ISO-8859-1",
|
||||
"EUC-JP",
|
||||
"KOI8-R",
|
||||
"ISO-8859-2",
|
||||
"GB2312",
|
||||
"ISO-8859-9",
|
||||
"ISO-8859-8",
|
||||
"ISO-8859-7",
|
||||
"ISO-8859-6",
|
||||
"ISO-8859-4",
|
||||
"ISO-8859-3",
|
||||
"TIS-620"
|
||||
};
|
||||
#define stringpool ((const char *) &stringpool_contents)
|
||||
|
||||
static const struct mapping mappings[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 24 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
|
||||
#line 29 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
|
||||
#line 28 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
|
||||
#line 25 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
|
||||
#line 30 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
|
||||
#line 17 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
|
||||
#line 22 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
|
||||
#line 13 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
|
||||
#line 27 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
|
||||
#line 23 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
|
||||
#line 14 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
|
||||
#line 26 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
|
||||
#line 21 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
|
||||
#line 20 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
|
||||
#line 19 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
|
||||
#line 18 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
|
||||
#line 16 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
|
||||
#line 15 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
|
||||
#line 31 "./iconv_open-irix.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct mapping *
|
||||
mapping_lookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = mapping_hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = mappings[key].standard_name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + stringpool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &mappings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
50
lib/iconv_open-osf.gperf
Normal file
50
lib/iconv_open-osf.gperf
Normal file
@ -0,0 +1,50 @@
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
%struct-type
|
||||
%language=ANSI-C
|
||||
%define slot-name standard_name
|
||||
%define hash-function-name mapping_hash
|
||||
%define lookup-function-name mapping_lookup
|
||||
%readonly-tables
|
||||
%global-table
|
||||
%define word-array-name mappings
|
||||
%pic
|
||||
%%
|
||||
# On OSF/1 5.1, look in /usr/lib/nls/loc/iconv.
|
||||
ISO-8859-1, "ISO8859-1"
|
||||
ISO-8859-2, "ISO8859-2"
|
||||
ISO-8859-3, "ISO8859-3"
|
||||
ISO-8859-4, "ISO8859-4"
|
||||
ISO-8859-5, "ISO8859-5"
|
||||
ISO-8859-6, "ISO8859-6"
|
||||
ISO-8859-7, "ISO8859-7"
|
||||
ISO-8859-8, "ISO8859-8"
|
||||
ISO-8859-9, "ISO8859-9"
|
||||
ISO-8859-15, "ISO8859-15"
|
||||
CP437, "cp437"
|
||||
CP775, "cp775"
|
||||
CP850, "cp850"
|
||||
CP852, "cp852"
|
||||
CP855, "cp855"
|
||||
CP857, "cp857"
|
||||
CP861, "cp861"
|
||||
CP862, "cp862"
|
||||
CP865, "cp865"
|
||||
CP866, "cp866"
|
||||
CP869, "cp869"
|
||||
CP874, "cp874"
|
||||
CP949, "KSC5601"
|
||||
CP1250, "cp1250"
|
||||
CP1251, "cp1251"
|
||||
CP1252, "cp1252"
|
||||
CP1253, "cp1253"
|
||||
CP1254, "cp1254"
|
||||
CP1255, "cp1255"
|
||||
CP1256, "cp1256"
|
||||
CP1257, "cp1257"
|
||||
CP1258, "cp1258"
|
||||
EUC-JP, "eucJP"
|
||||
EUC-KR, "eucKR"
|
||||
EUC-TW, "eucTW"
|
||||
BIG5, "big5"
|
||||
SHIFT_JIS, "SJIS"
|
||||
TIS-620, "TACTIS"
|
278
lib/iconv_open-osf.h
Normal file
278
lib/iconv_open-osf.h
Normal file
@ -0,0 +1,278 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */
|
||||
/* Computed positions: -k'4,$' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "./iconv_open-osf.gperf"
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
|
||||
#define TOTAL_KEYWORDS 38
|
||||
#define MIN_WORD_LENGTH 4
|
||||
#define MAX_WORD_LENGTH 11
|
||||
#define MIN_HASH_VALUE 6
|
||||
#define MAX_HASH_VALUE 47
|
||||
/* maximum key range = 42, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
mapping_hash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 2, 29,
|
||||
24, 34, 31, 0, 15, 14, 10, 13, 2, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 7, 48, 48, 48, 48, 48, 48,
|
||||
11, 48, 2, 7, 48, 48, 48, 1, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48
|
||||
};
|
||||
return len + asso_values[(unsigned char)str[3]+3] + asso_values[(unsigned char)str[len - 1]];
|
||||
}
|
||||
|
||||
struct stringpool_t
|
||||
{
|
||||
char stringpool_str6[sizeof("CP1255")];
|
||||
char stringpool_str7[sizeof("CP775")];
|
||||
char stringpool_str8[sizeof("CP1250")];
|
||||
char stringpool_str9[sizeof("EUC-TW")];
|
||||
char stringpool_str10[sizeof("EUC-KR")];
|
||||
char stringpool_str11[sizeof("TIS-620")];
|
||||
char stringpool_str12[sizeof("ISO-8859-5")];
|
||||
char stringpool_str13[sizeof("ISO-8859-15")];
|
||||
char stringpool_str14[sizeof("BIG5")];
|
||||
char stringpool_str15[sizeof("CP855")];
|
||||
char stringpool_str16[sizeof("CP1258")];
|
||||
char stringpool_str17[sizeof("CP850")];
|
||||
char stringpool_str18[sizeof("CP865")];
|
||||
char stringpool_str19[sizeof("EUC-JP")];
|
||||
char stringpool_str20[sizeof("CP1257")];
|
||||
char stringpool_str21[sizeof("CP1256")];
|
||||
char stringpool_str22[sizeof("ISO-8859-8")];
|
||||
char stringpool_str23[sizeof("SHIFT_JIS")];
|
||||
char stringpool_str25[sizeof("ISO-8859-9")];
|
||||
char stringpool_str26[sizeof("ISO-8859-7")];
|
||||
char stringpool_str27[sizeof("ISO-8859-6")];
|
||||
char stringpool_str29[sizeof("CP857")];
|
||||
char stringpool_str30[sizeof("CP1252")];
|
||||
char stringpool_str31[sizeof("CP869")];
|
||||
char stringpool_str32[sizeof("CP949")];
|
||||
char stringpool_str33[sizeof("CP866")];
|
||||
char stringpool_str34[sizeof("CP437")];
|
||||
char stringpool_str35[sizeof("CP1251")];
|
||||
char stringpool_str36[sizeof("ISO-8859-2")];
|
||||
char stringpool_str37[sizeof("CP1254")];
|
||||
char stringpool_str38[sizeof("CP874")];
|
||||
char stringpool_str39[sizeof("CP852")];
|
||||
char stringpool_str40[sizeof("CP1253")];
|
||||
char stringpool_str41[sizeof("ISO-8859-1")];
|
||||
char stringpool_str42[sizeof("CP862")];
|
||||
char stringpool_str43[sizeof("ISO-8859-4")];
|
||||
char stringpool_str46[sizeof("ISO-8859-3")];
|
||||
char stringpool_str47[sizeof("CP861")];
|
||||
};
|
||||
static const struct stringpool_t stringpool_contents =
|
||||
{
|
||||
"CP1255",
|
||||
"CP775",
|
||||
"CP1250",
|
||||
"EUC-TW",
|
||||
"EUC-KR",
|
||||
"TIS-620",
|
||||
"ISO-8859-5",
|
||||
"ISO-8859-15",
|
||||
"BIG5",
|
||||
"CP855",
|
||||
"CP1258",
|
||||
"CP850",
|
||||
"CP865",
|
||||
"EUC-JP",
|
||||
"CP1257",
|
||||
"CP1256",
|
||||
"ISO-8859-8",
|
||||
"SHIFT_JIS",
|
||||
"ISO-8859-9",
|
||||
"ISO-8859-7",
|
||||
"ISO-8859-6",
|
||||
"CP857",
|
||||
"CP1252",
|
||||
"CP869",
|
||||
"CP949",
|
||||
"CP866",
|
||||
"CP437",
|
||||
"CP1251",
|
||||
"ISO-8859-2",
|
||||
"CP1254",
|
||||
"CP874",
|
||||
"CP852",
|
||||
"CP1253",
|
||||
"ISO-8859-1",
|
||||
"CP862",
|
||||
"ISO-8859-4",
|
||||
"ISO-8859-3",
|
||||
"CP861"
|
||||
};
|
||||
#define stringpool ((const char *) &stringpool_contents)
|
||||
|
||||
static const struct mapping mappings[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 41 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
|
||||
#line 24 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
|
||||
#line 36 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
|
||||
#line 47 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
|
||||
#line 46 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
|
||||
#line 50 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
|
||||
#line 17 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
|
||||
#line 22 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
|
||||
#line 48 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
|
||||
#line 27 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
|
||||
#line 44 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
|
||||
#line 25 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
|
||||
#line 31 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
|
||||
#line 45 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
|
||||
#line 43 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
|
||||
#line 42 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
|
||||
#line 20 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
|
||||
#line 49 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
|
||||
{-1},
|
||||
#line 21 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
|
||||
#line 19 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
|
||||
#line 18 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
|
||||
{-1},
|
||||
#line 28 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
|
||||
#line 38 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
|
||||
#line 33 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
|
||||
#line 35 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
|
||||
#line 32 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
|
||||
#line 23 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
|
||||
#line 37 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
|
||||
#line 14 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
|
||||
#line 40 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
|
||||
#line 34 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
|
||||
#line 26 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
|
||||
#line 39 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
|
||||
#line 13 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
|
||||
#line 30 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
|
||||
#line 16 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
|
||||
{-1}, {-1},
|
||||
#line 15 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
|
||||
#line 29 "./iconv_open-osf.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct mapping *
|
||||
mapping_lookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = mapping_hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = mappings[key].standard_name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + stringpool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &mappings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
30
lib/iconv_open-solaris.gperf
Normal file
30
lib/iconv_open-solaris.gperf
Normal file
@ -0,0 +1,30 @@
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
%struct-type
|
||||
%language=ANSI-C
|
||||
%define slot-name standard_name
|
||||
%define hash-function-name mapping_hash
|
||||
%define lookup-function-name mapping_lookup
|
||||
%readonly-tables
|
||||
%global-table
|
||||
%define word-array-name mappings
|
||||
%pic
|
||||
%%
|
||||
# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
|
||||
# not actually supported by the iconv() function and by the 'iconv' program.
|
||||
# For example:
|
||||
# $ echo abc | iconv -f 646 -t ISO-8859-1
|
||||
# Not supported 646 to ISO-8859-1
|
||||
# $ echo abc | iconv -f 646 -t ISO8859-1
|
||||
$ abc
|
||||
ASCII, "646"
|
||||
ISO-8859-1, "ISO8859-1"
|
||||
ISO-8859-2, "ISO8859-2"
|
||||
ISO-8859-3, "ISO8859-3"
|
||||
ISO-8859-4, "ISO8859-4"
|
||||
ISO-8859-5, "ISO8859-5"
|
||||
ISO-8859-6, "ISO8859-6"
|
||||
ISO-8859-7, "ISO8859-7"
|
||||
ISO-8859-8, "ISO8859-8"
|
||||
ISO-8859-9, "ISO8859-9"
|
||||
ISO-8859-15, "ISO8859-15"
|
||||
CP1251, "ansi-1251"
|
190
lib/iconv_open-solaris.h
Normal file
190
lib/iconv_open-solaris.h
Normal file
@ -0,0 +1,190 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */
|
||||
/* Computed positions: -k'10' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "./iconv_open-solaris.gperf"
|
||||
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
|
||||
|
||||
#define TOTAL_KEYWORDS 13
|
||||
#define MIN_WORD_LENGTH 5
|
||||
#define MAX_WORD_LENGTH 11
|
||||
#define MIN_HASH_VALUE 5
|
||||
#define MAX_HASH_VALUE 19
|
||||
/* maximum key range = 15, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
mapping_hash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 0,
|
||||
9, 8, 7, 6, 5, 4, 3, 2, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20
|
||||
};
|
||||
register int hval = len;
|
||||
|
||||
switch (hval)
|
||||
{
|
||||
default:
|
||||
hval += asso_values[(unsigned char)str[9]];
|
||||
/*FALLTHROUGH*/
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
return hval;
|
||||
}
|
||||
|
||||
struct stringpool_t
|
||||
{
|
||||
char stringpool_str5[sizeof("ASCII")];
|
||||
char stringpool_str6[sizeof("CP1251")];
|
||||
char stringpool_str7[sizeof("$ abc")];
|
||||
char stringpool_str10[sizeof("ISO-8859-1")];
|
||||
char stringpool_str11[sizeof("ISO-8859-15")];
|
||||
char stringpool_str12[sizeof("ISO-8859-9")];
|
||||
char stringpool_str13[sizeof("ISO-8859-8")];
|
||||
char stringpool_str14[sizeof("ISO-8859-7")];
|
||||
char stringpool_str15[sizeof("ISO-8859-6")];
|
||||
char stringpool_str16[sizeof("ISO-8859-5")];
|
||||
char stringpool_str17[sizeof("ISO-8859-4")];
|
||||
char stringpool_str18[sizeof("ISO-8859-3")];
|
||||
char stringpool_str19[sizeof("ISO-8859-2")];
|
||||
};
|
||||
static const struct stringpool_t stringpool_contents =
|
||||
{
|
||||
"ASCII",
|
||||
"CP1251",
|
||||
"$ abc",
|
||||
"ISO-8859-1",
|
||||
"ISO-8859-15",
|
||||
"ISO-8859-9",
|
||||
"ISO-8859-8",
|
||||
"ISO-8859-7",
|
||||
"ISO-8859-6",
|
||||
"ISO-8859-5",
|
||||
"ISO-8859-4",
|
||||
"ISO-8859-3",
|
||||
"ISO-8859-2"
|
||||
};
|
||||
#define stringpool ((const char *) &stringpool_contents)
|
||||
|
||||
static const struct mapping mappings[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 19 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"},
|
||||
#line 30 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
|
||||
#line 18 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7},
|
||||
{-1}, {-1},
|
||||
#line 20 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
|
||||
#line 29 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
|
||||
#line 28 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
|
||||
#line 27 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
|
||||
#line 26 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
|
||||
#line 25 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
|
||||
#line 24 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
|
||||
#line 23 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
|
||||
#line 22 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
|
||||
#line 21 "./iconv_open-solaris.gperf"
|
||||
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct mapping *
|
||||
mapping_lookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = mapping_hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = mappings[key].standard_name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + stringpool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &mappings[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
173
lib/iconv_open.c
Normal file
173
lib/iconv_open.c
Normal file
@ -0,0 +1,173 @@
|
||||
/* Character set conversion.
|
||||
Copyright (C) 2007, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <iconv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include "c-ctype.h"
|
||||
#include "c-strcase.h"
|
||||
|
||||
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
/* Namespace cleanliness. */
|
||||
#define mapping_lookup rpl_iconv_open_mapping_lookup
|
||||
|
||||
/* The macro ICONV_FLAVOR is defined to one of these or undefined. */
|
||||
|
||||
#define ICONV_FLAVOR_AIX "iconv_open-aix.h"
|
||||
#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h"
|
||||
#define ICONV_FLAVOR_IRIX "iconv_open-irix.h"
|
||||
#define ICONV_FLAVOR_OSF "iconv_open-osf.h"
|
||||
#define ICONV_FLAVOR_SOLARIS "iconv_open-solaris.h"
|
||||
|
||||
#ifdef ICONV_FLAVOR
|
||||
# include ICONV_FLAVOR
|
||||
#endif
|
||||
|
||||
iconv_t
|
||||
rpl_iconv_open (const char *tocode, const char *fromcode)
|
||||
#undef iconv_open
|
||||
{
|
||||
char fromcode_upper[32];
|
||||
char tocode_upper[32];
|
||||
char *fromcode_upper_end;
|
||||
char *tocode_upper_end;
|
||||
|
||||
#if REPLACE_ICONV_UTF
|
||||
/* Special handling of conversion between UTF-8 and UTF-{16,32}{BE,LE}.
|
||||
Do this here, before calling the real iconv_open(), because OSF/1 5.1
|
||||
iconv() to these encoding inserts a BOM, which is wrong.
|
||||
We do not need to handle conversion between arbitrary encodings and
|
||||
UTF-{16,32}{BE,LE}, because the 'striconveh' module implements two-step
|
||||
conversion throough UTF-8.
|
||||
The _ICONV_* constants are chosen to be disjoint from any iconv_t
|
||||
returned by the system's iconv_open() functions. Recall that iconv_t
|
||||
is a scalar type. */
|
||||
if (c_toupper (fromcode[0]) == 'U'
|
||||
&& c_toupper (fromcode[1]) == 'T'
|
||||
&& c_toupper (fromcode[2]) == 'F'
|
||||
&& fromcode[3] == '-')
|
||||
{
|
||||
if (c_toupper (tocode[0]) == 'U'
|
||||
&& c_toupper (tocode[1]) == 'T'
|
||||
&& c_toupper (tocode[2]) == 'F'
|
||||
&& tocode[3] == '-')
|
||||
{
|
||||
if (strcmp (fromcode + 4, "8") == 0)
|
||||
{
|
||||
if (c_strcasecmp (tocode + 4, "16BE") == 0)
|
||||
return _ICONV_UTF8_UTF16BE;
|
||||
if (c_strcasecmp (tocode + 4, "16LE") == 0)
|
||||
return _ICONV_UTF8_UTF16LE;
|
||||
if (c_strcasecmp (tocode + 4, "32BE") == 0)
|
||||
return _ICONV_UTF8_UTF32BE;
|
||||
if (c_strcasecmp (tocode + 4, "32LE") == 0)
|
||||
return _ICONV_UTF8_UTF32LE;
|
||||
}
|
||||
else if (strcmp (tocode + 4, "8") == 0)
|
||||
{
|
||||
if (c_strcasecmp (fromcode + 4, "16BE") == 0)
|
||||
return _ICONV_UTF16BE_UTF8;
|
||||
if (c_strcasecmp (fromcode + 4, "16LE") == 0)
|
||||
return _ICONV_UTF16LE_UTF8;
|
||||
if (c_strcasecmp (fromcode + 4, "32BE") == 0)
|
||||
return _ICONV_UTF32BE_UTF8;
|
||||
if (c_strcasecmp (fromcode + 4, "32LE") == 0)
|
||||
return _ICONV_UTF32LE_UTF8;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Do *not* add special support for 8-bit encodings like ASCII or ISO-8859-1
|
||||
here. This would lead to programs that work in some locales (such as the
|
||||
"C" or "en_US" locales) but do not work in East Asian locales. It is
|
||||
better if programmers make their programs depend on GNU libiconv (except
|
||||
on glibc systems), e.g. by using the AM_ICONV macro and documenting the
|
||||
dependency in an INSTALL or DEPENDENCIES file. */
|
||||
|
||||
/* Try with the original names first.
|
||||
This covers the case when fromcode or tocode is a lowercase encoding name
|
||||
that is understood by the system's iconv_open but not listed in our
|
||||
mappings table. */
|
||||
{
|
||||
iconv_t cd = iconv_open (tocode, fromcode);
|
||||
if (cd != (iconv_t)(-1))
|
||||
return cd;
|
||||
}
|
||||
|
||||
/* Convert the encodings to upper case, because
|
||||
1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case
|
||||
matters,
|
||||
2. it makes searching in the table faster. */
|
||||
{
|
||||
const char *p = fromcode;
|
||||
char *q = fromcode_upper;
|
||||
while ((*q = c_toupper (*p)) != '\0')
|
||||
{
|
||||
p++;
|
||||
q++;
|
||||
if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (iconv_t)(-1);
|
||||
}
|
||||
}
|
||||
fromcode_upper_end = q;
|
||||
}
|
||||
|
||||
{
|
||||
const char *p = tocode;
|
||||
char *q = tocode_upper;
|
||||
while ((*q = c_toupper (*p)) != '\0')
|
||||
{
|
||||
p++;
|
||||
q++;
|
||||
if (q == &tocode_upper[SIZEOF (tocode_upper)])
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (iconv_t)(-1);
|
||||
}
|
||||
}
|
||||
tocode_upper_end = q;
|
||||
}
|
||||
|
||||
#ifdef ICONV_FLAVOR
|
||||
/* Apply the mappings. */
|
||||
{
|
||||
const struct mapping *m =
|
||||
mapping_lookup (fromcode_upper, fromcode_upper_end - fromcode_upper);
|
||||
|
||||
fromcode = (m != NULL ? m->vendor_name : fromcode_upper);
|
||||
}
|
||||
{
|
||||
const struct mapping *m =
|
||||
mapping_lookup (tocode_upper, tocode_upper_end - tocode_upper);
|
||||
|
||||
tocode = (m != NULL ? m->vendor_name : tocode_upper);
|
||||
}
|
||||
#else
|
||||
fromcode = fromcode_upper;
|
||||
tocode = tocode_upper;
|
||||
#endif
|
||||
|
||||
return iconv_open (tocode, fromcode);
|
||||
}
|
174
lib/isnan.c
174
lib/isnan.c
@ -1,174 +0,0 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
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>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
/* Specification found in math.h or isnanl-nolibm.h. */
|
||||
extern int rpl_isnanl (long double x);
|
||||
#elif ! defined USE_FLOAT
|
||||
/* Specification found in math.h or isnand-nolibm.h. */
|
||||
extern int rpl_isnand (double x);
|
||||
#else /* defined USE_FLOAT */
|
||||
/* Specification found in math.h or isnanf-nolibm.h. */
|
||||
extern int rpl_isnanf (float x);
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC rpl_isnanl
|
||||
# define DOUBLE long double
|
||||
# define MAX_EXP LDBL_MAX_EXP
|
||||
# define MIN_EXP LDBL_MIN_EXP
|
||||
# if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD LDBL_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT LDBL_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_LDBL
|
||||
# define L_(literal) literal##L
|
||||
#elif ! defined USE_FLOAT
|
||||
# define FUNC rpl_isnand
|
||||
# define DOUBLE double
|
||||
# define MAX_EXP DBL_MAX_EXP
|
||||
# define MIN_EXP DBL_MIN_EXP
|
||||
# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD DBL_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT DBL_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_DBL
|
||||
# define L_(literal) literal
|
||||
#else /* defined USE_FLOAT */
|
||||
# define FUNC rpl_isnanf
|
||||
# define DOUBLE float
|
||||
# define MAX_EXP FLT_MAX_EXP
|
||||
# define MIN_EXP FLT_MIN_EXP
|
||||
# if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
|
||||
# define KNOWN_EXPBIT0_LOCATION
|
||||
# define EXPBIT0_WORD FLT_EXPBIT0_WORD
|
||||
# define EXPBIT0_BIT FLT_EXPBIT0_BIT
|
||||
# endif
|
||||
# define SIZE SIZEOF_FLT
|
||||
# define L_(literal) literal##f
|
||||
#endif
|
||||
|
||||
#define EXP_MASK ((MAX_EXP - MIN_EXP) | 7)
|
||||
|
||||
#define NWORDS \
|
||||
((sizeof (DOUBLE) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
|
||||
|
||||
int
|
||||
FUNC (DOUBLE x)
|
||||
{
|
||||
#ifdef KNOWN_EXPBIT0_LOCATION
|
||||
# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
|
||||
/* Special CPU dependent code is needed to treat bit patterns outside the
|
||||
IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities,
|
||||
Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals) as NaNs.
|
||||
These bit patterns are:
|
||||
- exponent = 0x0001..0x7FFF, mantissa bit 63 = 0,
|
||||
- exponent = 0x0000, mantissa bit 63 = 1.
|
||||
The NaN bit pattern is:
|
||||
- exponent = 0x7FFF, mantissa >= 0x8000000000000001. */
|
||||
memory_double m;
|
||||
unsigned int exponent;
|
||||
|
||||
m.value = x;
|
||||
exponent = (m.word[EXPBIT0_WORD] >> EXPBIT0_BIT) & EXP_MASK;
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
/* Big endian: EXPBIT0_WORD = 0, EXPBIT0_BIT = 16. */
|
||||
if (exponent == 0)
|
||||
return 1 & (m.word[0] >> 15);
|
||||
else if (exponent == EXP_MASK)
|
||||
return (((m.word[0] ^ 0x8000U) << 16) | m.word[1] | (m.word[2] >> 16)) != 0;
|
||||
else
|
||||
return 1 & ~(m.word[0] >> 15);
|
||||
# else
|
||||
/* Little endian: EXPBIT0_WORD = 2, EXPBIT0_BIT = 0. */
|
||||
if (exponent == 0)
|
||||
return (m.word[1] >> 31);
|
||||
else if (exponent == EXP_MASK)
|
||||
return ((m.word[1] ^ 0x80000000U) | m.word[0]) != 0;
|
||||
else
|
||||
return (m.word[1] >> 31) ^ 1;
|
||||
# endif
|
||||
# else
|
||||
/* Be careful to not do any floating-point operation on x, such as x == x,
|
||||
because x may be a signaling NaN. */
|
||||
# if defined __TINYC__ || defined __SUNPRO_C || defined __DECC \
|
||||
|| (defined __sgi && !defined __GNUC__) || defined __ICC
|
||||
/* The Sun C 5.0, Intel ICC 10.0, and Compaq (ex-DEC) 6.4 compilers don't
|
||||
recognize the initializers as constant expressions. The latter compiler
|
||||
also fails when constant-folding 0.0 / 0.0 even when constant-folding is
|
||||
not required. The SGI MIPSpro C compiler complains about "floating-point
|
||||
operation result is out of range". */
|
||||
static DOUBLE zero = L_(0.0);
|
||||
memory_double nan;
|
||||
DOUBLE plus_inf = L_(1.0) / L_(0.0);
|
||||
DOUBLE minus_inf = -L_(1.0) / L_(0.0);
|
||||
nan.value = zero / zero;
|
||||
# else
|
||||
static memory_double nan = { L_(0.0) / L_(0.0) };
|
||||
static DOUBLE plus_inf = L_(1.0) / L_(0.0);
|
||||
static DOUBLE minus_inf = -L_(1.0) / L_(0.0);
|
||||
# endif
|
||||
{
|
||||
memory_double m;
|
||||
|
||||
/* A NaN can be recognized through its exponent. But exclude +Infinity and
|
||||
-Infinity, which have the same exponent. */
|
||||
m.value = x;
|
||||
if (((m.word[EXPBIT0_WORD] ^ nan.word[EXPBIT0_WORD])
|
||||
& (EXP_MASK << EXPBIT0_BIT))
|
||||
== 0)
|
||||
return (memcmp (&m.value, &plus_inf, SIZE) != 0
|
||||
&& memcmp (&m.value, &minus_inf, SIZE) != 0);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
#else
|
||||
/* The configuration did not find sufficient information. Give up about
|
||||
the signaling NaNs, handle only the quiet NaNs. */
|
||||
if (x == x)
|
||||
{
|
||||
# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
|
||||
/* Detect any special bit patterns that pass ==; see comment above. */
|
||||
memory_double m1;
|
||||
memory_double m2;
|
||||
|
||||
memset (&m1.value, 0, SIZE);
|
||||
memset (&m2.value, 0, SIZE);
|
||||
m1.value = x;
|
||||
m2.value = x + (x ? 0.0L : -0.0L);
|
||||
if (memcmp (&m1.value, &m2.value, SIZE) != 0)
|
||||
return 1;
|
||||
# endif
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
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/>. */
|
||||
|
||||
#if HAVE_ISNAND_IN_LIBC
|
||||
/* Get declaration of isnan macro. */
|
||||
# include <math.h>
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnand
|
||||
# define isnand(x) __builtin_isnan ((double)(x))
|
||||
# else
|
||||
# undef isnand
|
||||
# define isnand(x) isnan ((double)(x))
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnand
|
||||
# define isnand rpl_isnand
|
||||
extern int isnand (double x);
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
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/>. */
|
||||
|
||||
#if HAVE_ISNANF_IN_LIBC
|
||||
/* Get declaration of isnan macro or (older) isnanf function. */
|
||||
# include <math.h>
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnanf
|
||||
# define isnanf(x) __builtin_isnanf ((float)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanf
|
||||
# define isnanf(x) isnan ((float)(x))
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanf
|
||||
# define isnanf rpl_isnanf
|
||||
extern int isnanf (float x);
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
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/>. */
|
||||
|
||||
#if HAVE_ISNANL_IN_LIBC
|
||||
/* Get declaration of isnan macro or (older) isnanl function. */
|
||||
# include <math.h>
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnanl
|
||||
# define isnanl(x) __builtin_isnanl ((long double)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanl
|
||||
# define isnanl(x) isnan ((long double)(x))
|
||||
# endif
|
||||
#else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanl
|
||||
# define isnanl rpl_isnanl
|
||||
extern int isnanl (long double x);
|
||||
#endif
|
547
lib/localcharset.c
Normal file
547
lib/localcharset.c
Normal file
@ -0,0 +1,547 @@
|
||||
/* Determine a canonical name for the current locale's character encoding.
|
||||
|
||||
Copyright (C) 2000-2006, 2008-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "localcharset.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
|
||||
# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__
|
||||
# define WIN32_NATIVE
|
||||
#endif
|
||||
|
||||
#if defined __EMX__
|
||||
/* Assume EMX program runs on OS/2, even if compiled under DOS. */
|
||||
# ifndef OS2
|
||||
# define OS2
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined WIN32_NATIVE
|
||||
# include <unistd.h>
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
# else
|
||||
# if 0 /* see comment below */
|
||||
# include <locale.h>
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __CYGWIN__
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# endif
|
||||
#elif defined WIN32_NATIVE
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#if defined OS2
|
||||
# define INCL_DOS
|
||||
# include <os2.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_RELOCATABLE
|
||||
# include "relocatable.h"
|
||||
#else
|
||||
# define relocate(pathname) (pathname)
|
||||
#endif
|
||||
|
||||
/* Get LIBDIR. */
|
||||
#ifndef LIBDIR
|
||||
# include "configmake.h"
|
||||
#endif
|
||||
|
||||
/* Define O_NOFOLLOW to 0 on platforms where it does not exist. */
|
||||
#ifndef O_NOFOLLOW
|
||||
# define O_NOFOLLOW 0
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Win32, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
#endif
|
||||
|
||||
#ifndef DIRECTORY_SEPARATOR
|
||||
# define DIRECTORY_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_GETC_UNLOCKED
|
||||
# undef getc
|
||||
# define getc getc_unlocked
|
||||
#endif
|
||||
|
||||
/* The following static variable is declared 'volatile' to avoid a
|
||||
possible multithread problem in the function get_charset_aliases. If we
|
||||
are running in a threaded environment, and if two threads initialize
|
||||
'charset_aliases' simultaneously, both will produce the same value,
|
||||
and everything will be ok if the two assignments to 'charset_aliases'
|
||||
are atomic. But I don't know what will happen if the two assignments mix. */
|
||||
#if __STDC__ != 1
|
||||
# define volatile /* empty */
|
||||
#endif
|
||||
/* Pointer to the contents of the charset.alias file, if it has already been
|
||||
read, else NULL. Its format is:
|
||||
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
|
||||
static const char * volatile charset_aliases;
|
||||
|
||||
/* Return a pointer to the contents of the charset.alias file. */
|
||||
static const char *
|
||||
get_charset_aliases (void)
|
||||
{
|
||||
const char *cp;
|
||||
|
||||
cp = charset_aliases;
|
||||
if (cp == NULL)
|
||||
{
|
||||
#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
|
||||
const char *dir;
|
||||
const char *base = "charset.alias";
|
||||
char *file_name;
|
||||
|
||||
/* Make it possible to override the charset.alias location. This is
|
||||
necessary for running the testsuite before "make install". */
|
||||
dir = getenv ("CHARSETALIASDIR");
|
||||
if (dir == NULL || dir[0] == '\0')
|
||||
dir = relocate (LIBDIR);
|
||||
|
||||
/* Concatenate dir and base into freshly allocated file_name. */
|
||||
{
|
||||
size_t dir_len = strlen (dir);
|
||||
size_t base_len = strlen (base);
|
||||
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
|
||||
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
|
||||
if (file_name != NULL)
|
||||
{
|
||||
memcpy (file_name, dir, dir_len);
|
||||
if (add_slash)
|
||||
file_name[dir_len] = DIRECTORY_SEPARATOR;
|
||||
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_name == NULL)
|
||||
/* Out of memory. Treat the file as empty. */
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
int fd;
|
||||
|
||||
/* Open the file. Reject symbolic links on platforms that support
|
||||
O_NOFOLLOW. This is a security feature. Without it, an attacker
|
||||
could retrieve parts of the contents (namely, the tail of the
|
||||
first line that starts with "* ") of an arbitrary file by placing
|
||||
a symbolic link to that file under the name "charset.alias" in
|
||||
some writable directory and defining the environment variable
|
||||
CHARSETALIASDIR to point to that directory. */
|
||||
fd = open (file_name,
|
||||
O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
|
||||
if (fd < 0)
|
||||
/* File not found. Treat it as empty. */
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fdopen (fd, "r");
|
||||
if (fp == NULL)
|
||||
{
|
||||
/* Out of memory. Treat the file as empty. */
|
||||
close (fd);
|
||||
cp = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Parse the file's contents. */
|
||||
char *res_ptr = NULL;
|
||||
size_t res_size = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int c;
|
||||
char buf1[50+1];
|
||||
char buf2[50+1];
|
||||
size_t l1, l2;
|
||||
char *old_res_ptr;
|
||||
|
||||
c = getc (fp);
|
||||
if (c == EOF)
|
||||
break;
|
||||
if (c == '\n' || c == ' ' || c == '\t')
|
||||
continue;
|
||||
if (c == '#')
|
||||
{
|
||||
/* Skip comment, to end of line. */
|
||||
do
|
||||
c = getc (fp);
|
||||
while (!(c == EOF || c == '\n'));
|
||||
if (c == EOF)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
ungetc (c, fp);
|
||||
if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
|
||||
break;
|
||||
l1 = strlen (buf1);
|
||||
l2 = strlen (buf2);
|
||||
old_res_ptr = res_ptr;
|
||||
if (res_size == 0)
|
||||
{
|
||||
res_size = l1 + 1 + l2 + 1;
|
||||
res_ptr = (char *) malloc (res_size + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
res_size += l1 + 1 + l2 + 1;
|
||||
res_ptr = (char *) realloc (res_ptr, res_size + 1);
|
||||
}
|
||||
if (res_ptr == NULL)
|
||||
{
|
||||
/* Out of memory. */
|
||||
res_size = 0;
|
||||
free (old_res_ptr);
|
||||
break;
|
||||
}
|
||||
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
|
||||
strcpy (res_ptr + res_size - (l2 + 1), buf2);
|
||||
}
|
||||
fclose (fp);
|
||||
if (res_size == 0)
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
*(res_ptr + res_size) = '\0';
|
||||
cp = res_ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free (file_name);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# if defined DARWIN7
|
||||
/* To avoid the trouble of installing a file that is shared by many
|
||||
GNU packages -- many packaging systems have problems with this --,
|
||||
simply inline the aliases here. */
|
||||
cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
|
||||
"ISO8859-2" "\0" "ISO-8859-2" "\0"
|
||||
"ISO8859-4" "\0" "ISO-8859-4" "\0"
|
||||
"ISO8859-5" "\0" "ISO-8859-5" "\0"
|
||||
"ISO8859-7" "\0" "ISO-8859-7" "\0"
|
||||
"ISO8859-9" "\0" "ISO-8859-9" "\0"
|
||||
"ISO8859-13" "\0" "ISO-8859-13" "\0"
|
||||
"ISO8859-15" "\0" "ISO-8859-15" "\0"
|
||||
"KOI8-R" "\0" "KOI8-R" "\0"
|
||||
"KOI8-U" "\0" "KOI8-U" "\0"
|
||||
"CP866" "\0" "CP866" "\0"
|
||||
"CP949" "\0" "CP949" "\0"
|
||||
"CP1131" "\0" "CP1131" "\0"
|
||||
"CP1251" "\0" "CP1251" "\0"
|
||||
"eucCN" "\0" "GB2312" "\0"
|
||||
"GB2312" "\0" "GB2312" "\0"
|
||||
"eucJP" "\0" "EUC-JP" "\0"
|
||||
"eucKR" "\0" "EUC-KR" "\0"
|
||||
"Big5" "\0" "BIG5" "\0"
|
||||
"Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
|
||||
"GBK" "\0" "GBK" "\0"
|
||||
"GB18030" "\0" "GB18030" "\0"
|
||||
"SJIS" "\0" "SHIFT_JIS" "\0"
|
||||
"ARMSCII-8" "\0" "ARMSCII-8" "\0"
|
||||
"PT154" "\0" "PT154" "\0"
|
||||
/*"ISCII-DEV" "\0" "?" "\0"*/
|
||||
"*" "\0" "UTF-8" "\0";
|
||||
# endif
|
||||
|
||||
# if defined VMS
|
||||
/* To avoid the troubles of an extra file charset.alias_vms in the
|
||||
sources of many GNU packages, simply inline the aliases here. */
|
||||
/* The list of encodings is taken from the OpenVMS 7.3-1 documentation
|
||||
"Compaq C Run-Time Library Reference Manual for OpenVMS systems"
|
||||
section 10.7 "Handling Different Character Sets". */
|
||||
cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
|
||||
"ISO8859-2" "\0" "ISO-8859-2" "\0"
|
||||
"ISO8859-5" "\0" "ISO-8859-5" "\0"
|
||||
"ISO8859-7" "\0" "ISO-8859-7" "\0"
|
||||
"ISO8859-8" "\0" "ISO-8859-8" "\0"
|
||||
"ISO8859-9" "\0" "ISO-8859-9" "\0"
|
||||
/* Japanese */
|
||||
"eucJP" "\0" "EUC-JP" "\0"
|
||||
"SJIS" "\0" "SHIFT_JIS" "\0"
|
||||
"DECKANJI" "\0" "DEC-KANJI" "\0"
|
||||
"SDECKANJI" "\0" "EUC-JP" "\0"
|
||||
/* Chinese */
|
||||
"eucTW" "\0" "EUC-TW" "\0"
|
||||
"DECHANYU" "\0" "DEC-HANYU" "\0"
|
||||
"DECHANZI" "\0" "GB2312" "\0"
|
||||
/* Korean */
|
||||
"DECKOREAN" "\0" "EUC-KR" "\0";
|
||||
# endif
|
||||
|
||||
# if defined WIN32_NATIVE || defined __CYGWIN__
|
||||
/* To avoid the troubles of installing a separate file in the same
|
||||
directory as the DLL and of retrieving the DLL's directory at
|
||||
runtime, simply inline the aliases here. */
|
||||
|
||||
cp = "CP936" "\0" "GBK" "\0"
|
||||
"CP1361" "\0" "JOHAB" "\0"
|
||||
"CP20127" "\0" "ASCII" "\0"
|
||||
"CP20866" "\0" "KOI8-R" "\0"
|
||||
"CP20936" "\0" "GB2312" "\0"
|
||||
"CP21866" "\0" "KOI8-RU" "\0"
|
||||
"CP28591" "\0" "ISO-8859-1" "\0"
|
||||
"CP28592" "\0" "ISO-8859-2" "\0"
|
||||
"CP28593" "\0" "ISO-8859-3" "\0"
|
||||
"CP28594" "\0" "ISO-8859-4" "\0"
|
||||
"CP28595" "\0" "ISO-8859-5" "\0"
|
||||
"CP28596" "\0" "ISO-8859-6" "\0"
|
||||
"CP28597" "\0" "ISO-8859-7" "\0"
|
||||
"CP28598" "\0" "ISO-8859-8" "\0"
|
||||
"CP28599" "\0" "ISO-8859-9" "\0"
|
||||
"CP28605" "\0" "ISO-8859-15" "\0"
|
||||
"CP38598" "\0" "ISO-8859-8" "\0"
|
||||
"CP51932" "\0" "EUC-JP" "\0"
|
||||
"CP51936" "\0" "GB2312" "\0"
|
||||
"CP51949" "\0" "EUC-KR" "\0"
|
||||
"CP51950" "\0" "EUC-TW" "\0"
|
||||
"CP54936" "\0" "GB18030" "\0"
|
||||
"CP65001" "\0" "UTF-8" "\0";
|
||||
# endif
|
||||
#endif
|
||||
|
||||
charset_aliases = cp;
|
||||
}
|
||||
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Determine the current locale's character encoding, and canonicalize it
|
||||
into one of the canonical names listed in config.charset.
|
||||
The result must not be freed; it is statically allocated.
|
||||
If the canonical name cannot be determined, the result is a non-canonical
|
||||
name. */
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
const char *
|
||||
locale_charset (void)
|
||||
{
|
||||
const char *codeset;
|
||||
const char *aliases;
|
||||
|
||||
#if !(defined WIN32_NATIVE || defined OS2)
|
||||
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
||||
codeset = nl_langinfo (CODESET);
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
/* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
|
||||
returns "US-ASCII". Return the suffix of the locale name from the
|
||||
environment variables (if present) or the codepage as a number. */
|
||||
if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
|
||||
{
|
||||
const char *locale;
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
if (locale != NULL && locale[0] != '\0')
|
||||
{
|
||||
/* If the locale name contains an encoding after the dot, return
|
||||
it. */
|
||||
const char *dot = strchr (locale, '.');
|
||||
|
||||
if (dot != NULL)
|
||||
{
|
||||
const char *modifier;
|
||||
|
||||
dot++;
|
||||
/* Look for the possible @... trailer and remove it, if any. */
|
||||
modifier = strchr (dot, '@');
|
||||
if (modifier == NULL)
|
||||
return dot;
|
||||
if (modifier - dot < sizeof (buf))
|
||||
{
|
||||
memcpy (buf, dot, modifier - dot);
|
||||
buf [modifier - dot] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Woe32 has a function returning the locale's codepage as a number:
|
||||
GetACP(). This encoding is used by Cygwin, unless the user has set
|
||||
the environment variable CYGWIN=codepage:oem (which very few people
|
||||
do).
|
||||
Output directed to console windows needs to be converted (to
|
||||
GetOEMCP() if the console is using a raster font, or to
|
||||
GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
|
||||
this conversion transparently (see winsup/cygwin/fhandler_console.cc),
|
||||
converting to GetConsoleOutputCP(). This leads to correct results,
|
||||
except when SetConsoleOutputCP has been called and a raster font is
|
||||
in use. */
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
codeset = buf;
|
||||
}
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
/* On old systems which lack it, use setlocale or getenv. */
|
||||
const char *locale = NULL;
|
||||
|
||||
/* But most old systems don't have a complete set of locales. Some
|
||||
(like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
|
||||
use setlocale here; it would return "C" when it doesn't support the
|
||||
locale name the user has set. */
|
||||
# if 0
|
||||
locale = setlocale (LC_CTYPE, NULL);
|
||||
# endif
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
}
|
||||
|
||||
/* On some old systems, one used to set locale = "iso8859_1". On others,
|
||||
you set it to "language_COUNTRY.charset". In any case, we resolve it
|
||||
through the charset.alias file. */
|
||||
codeset = locale;
|
||||
|
||||
# endif
|
||||
|
||||
#elif defined WIN32_NATIVE
|
||||
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
/* Woe32 has a function returning the locale's codepage as a number:
|
||||
GetACP().
|
||||
When the output goes to a console window, it needs to be provided in
|
||||
GetOEMCP() encoding if the console is using a raster font, or in
|
||||
GetConsoleOutputCP() encoding if it is using a TrueType font.
|
||||
But in GUI programs and for output sent to files and pipes, GetACP()
|
||||
encoding is the best bet. */
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
codeset = buf;
|
||||
|
||||
#elif defined OS2
|
||||
|
||||
const char *locale;
|
||||
static char buf[2 + 10 + 1];
|
||||
ULONG cp[3];
|
||||
ULONG cplen;
|
||||
|
||||
/* Allow user to override the codeset, as set in the operating system,
|
||||
with standard language environment variables. */
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
if (locale != NULL && locale[0] != '\0')
|
||||
{
|
||||
/* If the locale name contains an encoding after the dot, return it. */
|
||||
const char *dot = strchr (locale, '.');
|
||||
|
||||
if (dot != NULL)
|
||||
{
|
||||
const char *modifier;
|
||||
|
||||
dot++;
|
||||
/* Look for the possible @... trailer and remove it, if any. */
|
||||
modifier = strchr (dot, '@');
|
||||
if (modifier == NULL)
|
||||
return dot;
|
||||
if (modifier - dot < sizeof (buf))
|
||||
{
|
||||
memcpy (buf, dot, modifier - dot);
|
||||
buf [modifier - dot] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
/* Resolve through the charset.alias file. */
|
||||
codeset = locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* OS/2 has a function returning the locale's codepage as a number. */
|
||||
if (DosQueryCp (sizeof (cp), cp, &cplen))
|
||||
codeset = "";
|
||||
else
|
||||
{
|
||||
sprintf (buf, "CP%u", cp[0]);
|
||||
codeset = buf;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (codeset == NULL)
|
||||
/* The canonical name cannot be determined. */
|
||||
codeset = "";
|
||||
|
||||
/* Resolve alias. */
|
||||
for (aliases = get_charset_aliases ();
|
||||
*aliases != '\0';
|
||||
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
|
||||
if (strcmp (codeset, aliases) == 0
|
||||
|| (aliases[0] == '*' && aliases[1] == '\0'))
|
||||
{
|
||||
codeset = aliases + strlen (aliases) + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Don't return an empty string. GNU libc and GNU libiconv interpret
|
||||
the empty string as denoting "the locale's character encoding",
|
||||
thus GNU libiconv would call this function a second time. */
|
||||
if (codeset[0] == '\0')
|
||||
codeset = "ASCII";
|
||||
|
||||
return codeset;
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2011 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
/* Determine a canonical name for the current locale's character encoding.
|
||||
Copyright (C) 2000-2003, 2009-2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU CHARSET Library.
|
||||
|
||||
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
|
||||
@ -17,39 +16,26 @@
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <config.h>
|
||||
#ifndef _LOCALCHARSET_H
|
||||
#define _LOCALCHARSET_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Get specification. */
|
||||
#include <string.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
/* Determine the current locale's character encoding, and canonicalize it
|
||||
into one of the canonical names listed in config.charset.
|
||||
The result must not be freed; it is statically allocated.
|
||||
If the canonical name cannot be determined, the result is a non-canonical
|
||||
name. */
|
||||
extern const char * locale_charset (void);
|
||||
|
||||
#undef __strdup
|
||||
#ifdef _LIBC
|
||||
# undef strdup
|
||||
#endif
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __strdup strdup
|
||||
#endif
|
||||
|
||||
/* Duplicate S, returning an identical malloc'd string. */
|
||||
char *
|
||||
__strdup (const char *s)
|
||||
{
|
||||
size_t len = strlen (s) + 1;
|
||||
void *new = malloc (len);
|
||||
|
||||
if (new == NULL)
|
||||
return NULL;
|
||||
|
||||
return (char *) memcpy (new, s, len);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#ifdef libc_hidden_def
|
||||
libc_hidden_def (__strdup)
|
||||
#endif
|
||||
#ifdef weak_alias
|
||||
weak_alias (__strdup, strdup)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _LOCALCHARSET_H */
|
57
lib/malloc.c
57
lib/malloc.c
@ -1,57 +0,0 @@
|
||||
/* malloc() function that is glibc compatible.
|
||||
|
||||
Copyright (C) 1997-1998, 2006-2007, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* written by Jim Meyering and Bruno Haible */
|
||||
|
||||
#define _GL_USE_STDLIB_ALLOC 1
|
||||
#include <config.h>
|
||||
/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
|
||||
#ifdef malloc
|
||||
# define NEED_MALLOC_GNU 1
|
||||
# undef malloc
|
||||
/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
|
||||
#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
|
||||
# define NEED_MALLOC_GNU 1
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
/* Allocate an N-byte block of memory from the heap.
|
||||
If N is zero, allocate a 1-byte block. */
|
||||
|
||||
void *
|
||||
rpl_malloc (size_t n)
|
||||
{
|
||||
void *result;
|
||||
|
||||
#if NEED_MALLOC_GNU
|
||||
if (n == 0)
|
||||
n = 1;
|
||||
#endif
|
||||
|
||||
result = malloc (n);
|
||||
|
||||
#if !HAVE_MALLOC_POSIX
|
||||
if (result == NULL)
|
||||
errno = ENOMEM;
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
810
lib/math.in.h
810
lib/math.in.h
@ -1,810 +0,0 @@
|
||||
/* A GNU-like <math.h>.
|
||||
|
||||
Copyright (C) 2002-2003, 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/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_MATH_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_MATH_H
|
||||
#define _@GUARD_PREFIX@_MATH_H
|
||||
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_ARG_NONNULL is copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
/* Helper macros to define a portability warning for the
|
||||
classification macro FUNC called with VALUE. POSIX declares the
|
||||
classification macros with an argument of real-floating (that is,
|
||||
one of float, double, or long double). */
|
||||
#define _GL_WARN_REAL_FLOATING_DECL(func) \
|
||||
static inline int \
|
||||
rpl_ ## func ## f (float f) \
|
||||
{ \
|
||||
return func (f); \
|
||||
} \
|
||||
static inline int \
|
||||
rpl_ ## func ## d (double d) \
|
||||
{ \
|
||||
return func (d); \
|
||||
} \
|
||||
static inline int \
|
||||
rpl_ ## func ## l (long double l) \
|
||||
{ \
|
||||
return func (l); \
|
||||
} \
|
||||
_GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - " \
|
||||
"use gnulib module " #func " for portability"); \
|
||||
_GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - " \
|
||||
"use gnulib module " #func " for portability"); \
|
||||
_GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - " \
|
||||
"use gnulib module " #func " for portability")
|
||||
#define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
|
||||
(sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
|
||||
: sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
|
||||
: rpl_ ## func ## l (value))
|
||||
|
||||
|
||||
/* POSIX allows platforms that don't support NAN. But all major
|
||||
machines in the past 15 years have supported something close to
|
||||
IEEE NaN, so we define this unconditionally. We also must define
|
||||
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@
|
||||
# if !GNULIB_defined_NAN
|
||||
# undef NAN
|
||||
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
|
||||
# ifdef __DECC
|
||||
static float
|
||||
_NaN ()
|
||||
{
|
||||
static float zero = 0.0f;
|
||||
return zero / zero;
|
||||
}
|
||||
# define NAN (_NaN())
|
||||
# else
|
||||
# define NAN (0.0f / 0.0f)
|
||||
# endif
|
||||
# define GNULIB_defined_NAN 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
|
||||
than a floating point constant. */
|
||||
#if @REPLACE_HUGE_VAL@
|
||||
# undef HUGE_VAL
|
||||
# define HUGE_VAL (1.0 / 0.0)
|
||||
#endif
|
||||
|
||||
|
||||
/* Write x as
|
||||
x = mantissa * 2^exp
|
||||
where
|
||||
If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
|
||||
If x is zero: mantissa = x, exp = 0.
|
||||
If x is infinite or NaN: mantissa = x, exp unspecified.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
#if @GNULIB_FREXP@
|
||||
# if @REPLACE_FREXP@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define frexp rpl_frexp
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
|
||||
_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (frexp);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef frexp
|
||||
/* Assume frexp is always declared. */
|
||||
_GL_WARN_ON_USE (frexp, "frexp is unportable - "
|
||||
"use gnulib module frexp for portability");
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_LOGB@
|
||||
# if !@HAVE_DECL_LOGB@
|
||||
_GL_EXTERN_C double logb (double x);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef logb
|
||||
# if HAVE_RAW_DECL_LOGB
|
||||
_GL_WARN_ON_USE (logb, "logb is unportable - "
|
||||
"use gnulib module logb for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ACOSL@
|
||||
# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
|
||||
_GL_FUNCDECL_SYS (acosl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (acosl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (acosl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef acosl
|
||||
# if HAVE_RAW_DECL_ACOSL
|
||||
_GL_WARN_ON_USE (acosl, "acosl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ASINL@
|
||||
# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
|
||||
_GL_FUNCDECL_SYS (asinl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (asinl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (asinl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef asinl
|
||||
# if HAVE_RAW_DECL_ASINL
|
||||
_GL_WARN_ON_USE (asinl, "asinl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ATANL@
|
||||
# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
|
||||
_GL_FUNCDECL_SYS (atanl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (atanl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (atanl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef atanl
|
||||
# if HAVE_RAW_DECL_ATANL
|
||||
_GL_WARN_ON_USE (atanl, "atanl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_CEILF@
|
||||
# if @REPLACE_CEILF@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define ceilf rpl_ceilf
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ceilf, float, (float x));
|
||||
_GL_CXXALIAS_RPL (ceilf, float, (float x));
|
||||
# else
|
||||
# if !@HAVE_DECL_CEILF@
|
||||
_GL_FUNCDECL_SYS (ceilf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (ceilf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ceilf);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef ceilf
|
||||
# if HAVE_RAW_DECL_CEILF
|
||||
_GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
|
||||
"use gnulib module ceilf for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_CEIL@
|
||||
# if @REPLACE_CEIL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define ceil rpl_ceil
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ceil, double, (double x));
|
||||
_GL_CXXALIAS_RPL (ceil, double, (double x));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (ceil, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ceil);
|
||||
#endif
|
||||
|
||||
#if @GNULIB_CEILL@
|
||||
# if @REPLACE_CEILL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define ceill rpl_ceill
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ceill, long double, (long double x));
|
||||
_GL_CXXALIAS_RPL (ceill, long double, (long double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_CEILL@
|
||||
_GL_FUNCDECL_SYS (ceill, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (ceill, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ceill);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef ceill
|
||||
# if HAVE_RAW_DECL_CEILL
|
||||
_GL_WARN_ON_USE (ceill, "ceill is unportable - "
|
||||
"use gnulib module ceill for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_COSL@
|
||||
# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
|
||||
_GL_FUNCDECL_SYS (cosl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (cosl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (cosl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef cosl
|
||||
# if HAVE_RAW_DECL_COSL
|
||||
_GL_WARN_ON_USE (cosl, "cosl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_EXPL@
|
||||
# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
|
||||
_GL_FUNCDECL_SYS (expl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (expl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (expl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef expl
|
||||
# if HAVE_RAW_DECL_EXPL
|
||||
_GL_WARN_ON_USE (expl, "expl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_FLOORF@
|
||||
# if @REPLACE_FLOORF@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define floorf rpl_floorf
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (floorf, float, (float x));
|
||||
_GL_CXXALIAS_RPL (floorf, float, (float x));
|
||||
# else
|
||||
# if !@HAVE_DECL_FLOORF@
|
||||
_GL_FUNCDECL_SYS (floorf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (floorf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (floorf);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef floorf
|
||||
# if HAVE_RAW_DECL_FLOORF
|
||||
_GL_WARN_ON_USE (floorf, "floorf is unportable - "
|
||||
"use gnulib module floorf for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_FLOOR@
|
||||
# if @REPLACE_FLOOR@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define floor rpl_floor
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (floor, double, (double x));
|
||||
_GL_CXXALIAS_RPL (floor, double, (double x));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (floor, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (floor);
|
||||
#endif
|
||||
|
||||
#if @GNULIB_FLOORL@
|
||||
# if @REPLACE_FLOORL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define floorl rpl_floorl
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (floorl, long double, (long double x));
|
||||
_GL_CXXALIAS_RPL (floorl, long double, (long double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_FLOORL@
|
||||
_GL_FUNCDECL_SYS (floorl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (floorl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (floorl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef floorl
|
||||
# if HAVE_RAW_DECL_FLOORL
|
||||
_GL_WARN_ON_USE (floorl, "floorl is unportable - "
|
||||
"use gnulib module floorl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Write x as
|
||||
x = mantissa * 2^exp
|
||||
where
|
||||
If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
|
||||
If x is zero: mantissa = x, exp = 0.
|
||||
If x is infinite or NaN: mantissa = x, exp unspecified.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define frexpl rpl_frexpl
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (frexpl, long double,
|
||||
(long double x, int *expptr) _GL_ARG_NONNULL ((2)));
|
||||
_GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
|
||||
#else
|
||||
# if !@HAVE_DECL_FREXPL@
|
||||
_GL_FUNCDECL_SYS (frexpl, long double,
|
||||
(long double x, int *expptr) _GL_ARG_NONNULL ((2)));
|
||||
# endif
|
||||
# if @GNULIB_FREXPL@
|
||||
_GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
|
||||
# endif
|
||||
#endif
|
||||
#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
|
||||
_GL_CXXALIASWARN (frexpl);
|
||||
#endif
|
||||
#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
|
||||
# undef frexpl
|
||||
# if HAVE_RAW_DECL_FREXPL
|
||||
_GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
|
||||
"use gnulib module frexpl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Return x * 2^exp. */
|
||||
#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define ldexpl rpl_ldexpl
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
|
||||
_GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
|
||||
#else
|
||||
# if !@HAVE_DECL_LDEXPL@
|
||||
_GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
|
||||
# endif
|
||||
# if @GNULIB_LDEXPL@
|
||||
_GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
|
||||
# endif
|
||||
#endif
|
||||
#if @GNULIB_LDEXPL@
|
||||
_GL_CXXALIASWARN (ldexpl);
|
||||
#endif
|
||||
#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
|
||||
# undef ldexpl
|
||||
# if HAVE_RAW_DECL_LDEXPL
|
||||
_GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
|
||||
"use gnulib module ldexpl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_LOGL@
|
||||
# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
|
||||
_GL_FUNCDECL_SYS (logl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (logl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (logl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef logl
|
||||
# if HAVE_RAW_DECL_LOGL
|
||||
_GL_WARN_ON_USE (logl, "logl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ROUNDF@
|
||||
# if @REPLACE_ROUNDF@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef roundf
|
||||
# define roundf rpl_roundf
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (roundf, float, (float x));
|
||||
_GL_CXXALIAS_RPL (roundf, float, (float x));
|
||||
# else
|
||||
# if !@HAVE_DECL_ROUNDF@
|
||||
_GL_FUNCDECL_SYS (roundf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (roundf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (roundf);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef roundf
|
||||
# if HAVE_RAW_DECL_ROUNDF
|
||||
_GL_WARN_ON_USE (roundf, "roundf is unportable - "
|
||||
"use gnulib module roundf for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ROUND@
|
||||
# if @REPLACE_ROUND@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef round
|
||||
# define round rpl_round
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (round, double, (double x));
|
||||
_GL_CXXALIAS_RPL (round, double, (double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_ROUND@
|
||||
_GL_FUNCDECL_SYS (round, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (round, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (round);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef round
|
||||
# if HAVE_RAW_DECL_ROUND
|
||||
_GL_WARN_ON_USE (round, "round is unportable - "
|
||||
"use gnulib module round for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ROUNDL@
|
||||
# if @REPLACE_ROUNDL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef roundl
|
||||
# define roundl rpl_roundl
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (roundl, long double, (long double x));
|
||||
_GL_CXXALIAS_RPL (roundl, long double, (long double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_ROUNDL@
|
||||
_GL_FUNCDECL_SYS (roundl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (roundl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (roundl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef roundl
|
||||
# if HAVE_RAW_DECL_ROUNDL
|
||||
_GL_WARN_ON_USE (roundl, "roundl is unportable - "
|
||||
"use gnulib module roundl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_SINL@
|
||||
# if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
|
||||
_GL_FUNCDECL_SYS (sinl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (sinl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (sinl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef sinl
|
||||
# if HAVE_RAW_DECL_SINL
|
||||
_GL_WARN_ON_USE (sinl, "sinl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_SQRTL@
|
||||
# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
|
||||
_GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (sqrtl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef sqrtl
|
||||
# if HAVE_RAW_DECL_SQRTL
|
||||
_GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_TANL@
|
||||
# if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
|
||||
_GL_FUNCDECL_SYS (tanl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (tanl, long double, (long double x));
|
||||
_GL_CXXALIASWARN (tanl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef tanl
|
||||
# if HAVE_RAW_DECL_TANL
|
||||
_GL_WARN_ON_USE (tanl, "tanl is unportable - "
|
||||
"use gnulib module mathl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_TRUNCF@
|
||||
# if @REPLACE_TRUNCF@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define truncf rpl_truncf
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (truncf, float, (float x));
|
||||
_GL_CXXALIAS_RPL (truncf, float, (float x));
|
||||
# else
|
||||
# if !@HAVE_DECL_TRUNCF@
|
||||
_GL_FUNCDECL_SYS (truncf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (truncf, float, (float x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (truncf);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef truncf
|
||||
# if HAVE_RAW_DECL_TRUNCF
|
||||
_GL_WARN_ON_USE (truncf, "truncf is unportable - "
|
||||
"use gnulib module truncf for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_TRUNC@
|
||||
# if @REPLACE_TRUNC@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define trunc rpl_trunc
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (trunc, double, (double x));
|
||||
_GL_CXXALIAS_RPL (trunc, double, (double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_TRUNC@
|
||||
_GL_FUNCDECL_SYS (trunc, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (trunc, double, (double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (trunc);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef trunc
|
||||
# if HAVE_RAW_DECL_TRUNC
|
||||
_GL_WARN_ON_USE (trunc, "trunc is unportable - "
|
||||
"use gnulib module trunc for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_TRUNCL@
|
||||
# if @REPLACE_TRUNCL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef truncl
|
||||
# define truncl rpl_truncl
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (truncl, long double, (long double x));
|
||||
_GL_CXXALIAS_RPL (truncl, long double, (long double x));
|
||||
# else
|
||||
# if !@HAVE_DECL_TRUNCL@
|
||||
_GL_FUNCDECL_SYS (truncl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (truncl, long double, (long double x));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (truncl);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef truncl
|
||||
# if HAVE_RAW_DECL_TRUNCL
|
||||
_GL_WARN_ON_USE (truncl, "truncl is unportable - "
|
||||
"use gnulib module truncl for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ISFINITE@
|
||||
# if @REPLACE_ISFINITE@
|
||||
_GL_EXTERN_C int gl_isfinitef (float x);
|
||||
_GL_EXTERN_C int gl_isfinited (double x);
|
||||
_GL_EXTERN_C int gl_isfinitel (long double x);
|
||||
# undef isfinite
|
||||
# define isfinite(x) \
|
||||
(sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
|
||||
sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
|
||||
gl_isfinitef (x))
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# if defined isfinite
|
||||
_GL_WARN_REAL_FLOATING_DECL (isfinite);
|
||||
# undef isfinite
|
||||
# define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ISINF@
|
||||
# if @REPLACE_ISINF@
|
||||
_GL_EXTERN_C int gl_isinff (float x);
|
||||
_GL_EXTERN_C int gl_isinfd (double x);
|
||||
_GL_EXTERN_C int gl_isinfl (long double x);
|
||||
# undef isinf
|
||||
# define isinf(x) \
|
||||
(sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
|
||||
sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
|
||||
gl_isinff (x))
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# if defined isinf
|
||||
_GL_WARN_REAL_FLOATING_DECL (isinf);
|
||||
# undef isinf
|
||||
# define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ISNANF@
|
||||
/* Test for NaN for 'float' numbers. */
|
||||
# if @HAVE_ISNANF@
|
||||
/* The original <math.h> included above provides a declaration of isnan macro
|
||||
or (older) isnanf function. */
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnanf
|
||||
# define isnanf(x) __builtin_isnanf ((float)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanf
|
||||
# define isnanf(x) isnan ((float)(x))
|
||||
# endif
|
||||
# else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanf
|
||||
# define isnanf rpl_isnanf
|
||||
_GL_EXTERN_C int isnanf (float x);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ISNAND@
|
||||
/* Test for NaN for 'double' numbers.
|
||||
This function is a gnulib extension, unlike isnan() which applied only
|
||||
to 'double' numbers earlier but now is a type-generic macro. */
|
||||
# if @HAVE_ISNAND@
|
||||
/* The original <math.h> included above provides a declaration of isnan
|
||||
macro. */
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnand
|
||||
# define isnand(x) __builtin_isnan ((double)(x))
|
||||
# else
|
||||
# undef isnand
|
||||
# define isnand(x) isnan ((double)(x))
|
||||
# endif
|
||||
# else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnand
|
||||
# define isnand rpl_isnand
|
||||
_GL_EXTERN_C int isnand (double x);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_ISNANL@
|
||||
/* Test for NaN for 'long double' numbers. */
|
||||
# if @HAVE_ISNANL@
|
||||
/* The original <math.h> included above provides a declaration of isnan
|
||||
macro or (older) isnanl function. */
|
||||
# if __GNUC__ >= 4
|
||||
/* GCC 4.0 and newer provides three built-ins for isnan. */
|
||||
# undef isnanl
|
||||
# define isnanl(x) __builtin_isnanl ((long double)(x))
|
||||
# elif defined isnan
|
||||
# undef isnanl
|
||||
# define isnanl(x) isnan ((long double)(x))
|
||||
# endif
|
||||
# else
|
||||
/* Test whether X is a NaN. */
|
||||
# undef isnanl
|
||||
# define isnanl rpl_isnanl
|
||||
_GL_EXTERN_C int isnanl (long double x);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */
|
||||
#if @GNULIB_ISNAN@
|
||||
# if @REPLACE_ISNAN@
|
||||
/* We can't just use the isnanf macro (e.g.) as exposed by
|
||||
isnanf.h (e.g.) here, because those may end up being macros
|
||||
that recursively expand back to isnan. So use the gnulib
|
||||
replacements for them directly. */
|
||||
# if @HAVE_ISNANF@ && __GNUC__ >= 4
|
||||
# define gl_isnan_f(x) __builtin_isnanf ((float)(x))
|
||||
# else
|
||||
_GL_EXTERN_C int rpl_isnanf (float x);
|
||||
# define gl_isnan_f(x) rpl_isnanf (x)
|
||||
# endif
|
||||
# if @HAVE_ISNAND@ && __GNUC__ >= 4
|
||||
# define gl_isnan_d(x) __builtin_isnan ((double)(x))
|
||||
# else
|
||||
_GL_EXTERN_C int rpl_isnand (double x);
|
||||
# define gl_isnan_d(x) rpl_isnand (x)
|
||||
# endif
|
||||
# if @HAVE_ISNANL@ && __GNUC__ >= 4
|
||||
# define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
|
||||
# else
|
||||
_GL_EXTERN_C int rpl_isnanl (long double x);
|
||||
# define gl_isnan_l(x) rpl_isnanl (x)
|
||||
# endif
|
||||
# undef isnan
|
||||
# define isnan(x) \
|
||||
(sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
|
||||
sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
|
||||
gl_isnan_f (x))
|
||||
# elif __GNUC__ >= 4
|
||||
# undef isnan
|
||||
# define isnan(x) \
|
||||
(sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
|
||||
sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
|
||||
__builtin_isnanf ((float)(x)))
|
||||
# endif
|
||||
/* Ensure isnan is a macro. */
|
||||
# ifndef isnan
|
||||
# define isnan isnan
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# if defined isnan
|
||||
_GL_WARN_REAL_FLOATING_DECL (isnan);
|
||||
# undef isnan
|
||||
# define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_SIGNBIT@
|
||||
# if @REPLACE_SIGNBIT_USING_GCC@
|
||||
# undef signbit
|
||||
/* GCC 4.0 and newer provides three built-ins for signbit. */
|
||||
# define signbit(x) \
|
||||
(sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
|
||||
sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
|
||||
__builtin_signbitf (x))
|
||||
# endif
|
||||
# if @REPLACE_SIGNBIT@
|
||||
# undef signbit
|
||||
_GL_EXTERN_C int gl_signbitf (float arg);
|
||||
_GL_EXTERN_C int gl_signbitd (double arg);
|
||||
_GL_EXTERN_C int gl_signbitl (long double arg);
|
||||
# if __GNUC__ >= 2 && !__STRICT_ANSI__
|
||||
# define _GL_NUM_UINT_WORDS(type) \
|
||||
((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
|
||||
# define gl_signbitf_OPTIMIZED_MACRO
|
||||
# define gl_signbitf(arg) \
|
||||
({ union { float _value; \
|
||||
unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
|
||||
} _m; \
|
||||
_m._value = (arg); \
|
||||
(_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
|
||||
})
|
||||
# endif
|
||||
# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
|
||||
# define gl_signbitd_OPTIMIZED_MACRO
|
||||
# define gl_signbitd(arg) \
|
||||
({ union { double _value; \
|
||||
unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
|
||||
} _m; \
|
||||
_m._value = (arg); \
|
||||
(_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
|
||||
})
|
||||
# endif
|
||||
# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
|
||||
# define gl_signbitl_OPTIMIZED_MACRO
|
||||
# define gl_signbitl(arg) \
|
||||
({ union { long double _value; \
|
||||
unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
|
||||
} _m; \
|
||||
_m._value = (arg); \
|
||||
(_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
|
||||
})
|
||||
# endif
|
||||
# endif
|
||||
# define signbit(x) \
|
||||
(sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
|
||||
sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
|
||||
gl_signbitf (x))
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# if defined signbit
|
||||
_GL_WARN_REAL_FLOATING_DECL (signbit);
|
||||
# undef signbit
|
||||
# define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_MATH_H */
|
||||
#endif /* _@GUARD_PREFIX@_MATH_H */
|
396
lib/mbrtowc.c
Normal file
396
lib/mbrtowc.c
Normal file
@ -0,0 +1,396 @@
|
||||
/* Convert multibyte character to wide character.
|
||||
Copyright (C) 1999-2002, 2005-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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#if GNULIB_defined_mbstate_t
|
||||
/* Implement mbrtowc() on top of mbtowc(). */
|
||||
|
||||
# include <errno.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# include "localcharset.h"
|
||||
# include "streq.h"
|
||||
# include "verify.h"
|
||||
|
||||
|
||||
verify (sizeof (mbstate_t) >= 4);
|
||||
|
||||
static char internal_state[4];
|
||||
|
||||
size_t
|
||||
mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||
{
|
||||
char *pstate = (char *)ps;
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
pwc = NULL;
|
||||
s = "";
|
||||
n = 1;
|
||||
}
|
||||
|
||||
if (n == 0)
|
||||
return (size_t)(-2);
|
||||
|
||||
/* Here n > 0. */
|
||||
|
||||
if (pstate == NULL)
|
||||
pstate = internal_state;
|
||||
|
||||
{
|
||||
size_t nstate = pstate[0];
|
||||
char buf[4];
|
||||
const char *p;
|
||||
size_t m;
|
||||
|
||||
switch (nstate)
|
||||
{
|
||||
case 0:
|
||||
p = s;
|
||||
m = n;
|
||||
break;
|
||||
case 3:
|
||||
buf[2] = pstate[3];
|
||||
/*FALLTHROUGH*/
|
||||
case 2:
|
||||
buf[1] = pstate[2];
|
||||
/*FALLTHROUGH*/
|
||||
case 1:
|
||||
buf[0] = pstate[1];
|
||||
p = buf;
|
||||
m = nstate;
|
||||
buf[m++] = s[0];
|
||||
if (n >= 2 && m < 4)
|
||||
{
|
||||
buf[m++] = s[1];
|
||||
if (n >= 3 && m < 4)
|
||||
buf[m++] = s[2];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return (size_t)(-1);
|
||||
}
|
||||
|
||||
/* Here m > 0. */
|
||||
|
||||
# if __GLIBC__ || defined __UCLIBC__
|
||||
/* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
|
||||
mbtowc (NULL, NULL, 0);
|
||||
# endif
|
||||
{
|
||||
int res = mbtowc (pwc, p, m);
|
||||
|
||||
if (res >= 0)
|
||||
{
|
||||
if (pwc != NULL && ((*pwc == 0) != (res == 0)))
|
||||
abort ();
|
||||
if (nstate >= (res > 0 ? res : 1))
|
||||
abort ();
|
||||
res -= nstate;
|
||||
pstate[0] = 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* mbtowc does not distinguish between invalid and incomplete multibyte
|
||||
sequences. But mbrtowc needs to make this distinction.
|
||||
There are two possible approaches:
|
||||
- Use iconv() and its return value.
|
||||
- Use built-in knowledge about the possible encodings.
|
||||
Given the low quality of implementation of iconv() on the systems that
|
||||
lack mbrtowc(), we use the second approach.
|
||||
The possible encodings are:
|
||||
- 8-bit encodings,
|
||||
- EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
|
||||
- UTF-8.
|
||||
Use specialized code for each. */
|
||||
if (m >= 4 || m >= MB_CUR_MAX)
|
||||
goto invalid;
|
||||
/* Here MB_CUR_MAX > 1 and 0 < m < 4. */
|
||||
{
|
||||
const char *encoding = locale_charset ();
|
||||
|
||||
if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
|
||||
{
|
||||
/* Cf. unistr/u8-mblen.c. */
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if (c >= 0xc2)
|
||||
{
|
||||
if (c < 0xe0)
|
||||
{
|
||||
if (m == 1)
|
||||
goto incomplete;
|
||||
}
|
||||
else if (c < 0xf0)
|
||||
{
|
||||
if (m == 1)
|
||||
goto incomplete;
|
||||
if (m == 2)
|
||||
{
|
||||
unsigned char c2 = (unsigned char) p[1];
|
||||
|
||||
if ((c2 ^ 0x80) < 0x40
|
||||
&& (c >= 0xe1 || c2 >= 0xa0)
|
||||
&& (c != 0xed || c2 < 0xa0))
|
||||
goto incomplete;
|
||||
}
|
||||
}
|
||||
else if (c <= 0xf4)
|
||||
{
|
||||
if (m == 1)
|
||||
goto incomplete;
|
||||
else /* m == 2 || m == 3 */
|
||||
{
|
||||
unsigned char c2 = (unsigned char) p[1];
|
||||
|
||||
if ((c2 ^ 0x80) < 0x40
|
||||
&& (c >= 0xf1 || c2 >= 0x90)
|
||||
&& (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
|
||||
{
|
||||
if (m == 2)
|
||||
goto incomplete;
|
||||
else /* m == 3 */
|
||||
{
|
||||
unsigned char c3 = (unsigned char) p[2];
|
||||
|
||||
if ((c3 ^ 0x80) < 0x40)
|
||||
goto incomplete;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
/* As a reference for this code, you can use the GNU libiconv
|
||||
implementation. Look for uses of the RET_TOOFEW macro. */
|
||||
|
||||
if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
|
||||
{
|
||||
if (m == 1)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
|
||||
goto incomplete;
|
||||
}
|
||||
if (m == 2)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if (c == 0x8f)
|
||||
{
|
||||
unsigned char c2 = (unsigned char) p[1];
|
||||
|
||||
if (c2 >= 0xa1 && c2 < 0xff)
|
||||
goto incomplete;
|
||||
}
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
|
||||
|| STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
|
||||
|| STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
|
||||
{
|
||||
if (m == 1)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if (c >= 0xa1 && c < 0xff)
|
||||
goto incomplete;
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
|
||||
{
|
||||
if (m == 1)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
|
||||
goto incomplete;
|
||||
}
|
||||
else /* m == 2 || m == 3 */
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if (c == 0x8e)
|
||||
goto incomplete;
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
|
||||
{
|
||||
if (m == 1)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
|
||||
goto incomplete;
|
||||
}
|
||||
else /* m == 2 || m == 3 */
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if (c >= 0x90 && c <= 0xe3)
|
||||
{
|
||||
unsigned char c2 = (unsigned char) p[1];
|
||||
|
||||
if (c2 >= 0x30 && c2 <= 0x39)
|
||||
{
|
||||
if (m == 2)
|
||||
goto incomplete;
|
||||
else /* m == 3 */
|
||||
{
|
||||
unsigned char c3 = (unsigned char) p[2];
|
||||
|
||||
if (c3 >= 0x81 && c3 <= 0xfe)
|
||||
goto incomplete;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
|
||||
{
|
||||
if (m == 1)
|
||||
{
|
||||
unsigned char c = (unsigned char) p[0];
|
||||
|
||||
if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
|
||||
|| (c >= 0xf0 && c <= 0xf9))
|
||||
goto incomplete;
|
||||
}
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
/* An unknown multibyte encoding. */
|
||||
goto incomplete;
|
||||
}
|
||||
|
||||
incomplete:
|
||||
{
|
||||
size_t k = nstate;
|
||||
/* Here 0 <= k < m < 4. */
|
||||
pstate[++k] = s[0];
|
||||
if (k < m)
|
||||
{
|
||||
pstate[++k] = s[1];
|
||||
if (k < m)
|
||||
pstate[++k] = s[2];
|
||||
}
|
||||
if (k != m)
|
||||
abort ();
|
||||
}
|
||||
pstate[0] = m;
|
||||
return (size_t)(-2);
|
||||
|
||||
invalid:
|
||||
errno = EILSEQ;
|
||||
/* The conversion state is undefined, says POSIX. */
|
||||
return (size_t)(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
/* Override the system's mbrtowc() function. */
|
||||
|
||||
# undef mbrtowc
|
||||
|
||||
size_t
|
||||
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||
{
|
||||
# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG
|
||||
if (s == NULL)
|
||||
{
|
||||
pwc = NULL;
|
||||
s = "";
|
||||
n = 1;
|
||||
}
|
||||
# endif
|
||||
|
||||
# if MBRTOWC_RETVAL_BUG
|
||||
{
|
||||
static mbstate_t internal_state;
|
||||
|
||||
/* Override mbrtowc's internal state. We cannot call mbsinit() on the
|
||||
hidden internal state, but we can call it on our variable. */
|
||||
if (ps == NULL)
|
||||
ps = &internal_state;
|
||||
|
||||
if (!mbsinit (ps))
|
||||
{
|
||||
/* Parse the rest of the multibyte character byte for byte. */
|
||||
size_t count = 0;
|
||||
for (; n > 0; s++, n--)
|
||||
{
|
||||
wchar_t wc;
|
||||
size_t ret = mbrtowc (&wc, s, 1, ps);
|
||||
|
||||
if (ret == (size_t)(-1))
|
||||
return (size_t)(-1);
|
||||
count++;
|
||||
if (ret != (size_t)(-2))
|
||||
{
|
||||
/* The multibyte character has been completed. */
|
||||
if (pwc != NULL)
|
||||
*pwc = wc;
|
||||
return (wc == 0 ? 0 : count);
|
||||
}
|
||||
}
|
||||
return (size_t)(-2);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
# if MBRTOWC_NUL_RETVAL_BUG
|
||||
{
|
||||
wchar_t wc;
|
||||
size_t ret = mbrtowc (&wc, s, n, ps);
|
||||
|
||||
if (ret != (size_t)(-1) && ret != (size_t)(-2))
|
||||
{
|
||||
if (pwc != NULL)
|
||||
*pwc = wc;
|
||||
if (wc == 0)
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
# else
|
||||
{
|
||||
# if MBRTOWC_NULL_ARG1_BUG
|
||||
wchar_t dummy;
|
||||
|
||||
if (pwc == NULL)
|
||||
pwc = &dummy;
|
||||
# endif
|
||||
|
||||
return mbrtowc (pwc, s, n, ps);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif
|
61
lib/mbsinit.c
Normal file
61
lib/mbsinit.c
Normal file
@ -0,0 +1,61 @@
|
||||
/* Test for initial conversion state.
|
||||
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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include "verify.h"
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
|
||||
|
||||
/* On native Windows, 'mbstate_t' is defined as 'int'. */
|
||||
|
||||
int
|
||||
mbsinit (const mbstate_t *ps)
|
||||
{
|
||||
return ps == NULL || *ps == 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
|
||||
and wcrtomb(), wcsrtombs().
|
||||
We assume that
|
||||
- sizeof (mbstate_t) >= 4,
|
||||
- only stateless encodings are supported (such as UTF-8 and EUC-JP, but
|
||||
not ISO-2022 variants),
|
||||
- for each encoding, the number of bytes for a wide character is <= 4.
|
||||
(This maximum is attained for UTF-8, GB18030, EUC-TW.)
|
||||
We define the meaning of mbstate_t as follows:
|
||||
- In mb -> wc direction, mbstate_t's first byte contains the number of
|
||||
buffered bytes (in the range 0..3), followed by up to 3 buffered bytes.
|
||||
- In wc -> mb direction, mbstate_t contains no information. In other
|
||||
words, it is always in the initial state. */
|
||||
|
||||
verify (sizeof (mbstate_t) >= 4);
|
||||
|
||||
int
|
||||
mbsinit (const mbstate_t *ps)
|
||||
{
|
||||
const char *pstate = (const char *)ps;
|
||||
|
||||
return pstate == NULL || pstate[0] == 0;
|
||||
}
|
||||
|
||||
#endif
|
122
lib/mbsrtowcs-impl.h
Normal file
122
lib/mbsrtowcs-impl.h
Normal file
@ -0,0 +1,122 @@
|
||||
/* 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);
|
||||
}
|
||||
}
|
37
lib/mbsrtowcs-state.c
Normal file
37
lib/mbsrtowcs-state.c
Normal file
@ -0,0 +1,37 @@
|
||||
/* 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
|
||||
mbstate_t _gl_mbsrtowcs_state
|
||||
/* The state must initially be in the "initial state"; so, zero-initialize it.
|
||||
On most systems, putting it into BSS is sufficient. Not so on MacOS X 10.3,
|
||||
see <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>.
|
||||
When it needs an initializer, use 0 or {0} as initializer? 0 only works
|
||||
when mbstate_t is a scalar type (such as when gnulib defines it, or on
|
||||
AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct
|
||||
or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */
|
||||
#if defined __ELF__
|
||||
/* On ELF systems, variables in BSS behave well. */
|
||||
#else
|
||||
/* Use braces, to be on the safe side. */
|
||||
= { 0 }
|
||||
#endif
|
||||
;
|
32
lib/mbsrtowcs.c
Normal file
32
lib/mbsrtowcs.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "strnlen1.h"
|
||||
|
||||
|
||||
extern mbstate_t _gl_mbsrtowcs_state;
|
||||
|
||||
#include "mbsrtowcs-impl.h"
|
@ -1,4 +1,4 @@
|
||||
/* Auxiliary definitions for <float.h>.
|
||||
/* Convert multibyte character to wide character.
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
@ -15,19 +15,30 @@
|
||||
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>
|
||||
/* We don't need a static internal state, because the encoding is not state
|
||||
dependent, and when mbrtowc returns (size_t)(-2). we throw the result
|
||||
away. */
|
||||
|
||||
/* Specification. */
|
||||
#include <float.h>
|
||||
int
|
||||
mbtowc (wchar_t *pwc, const char *s, size_t n)
|
||||
{
|
||||
if (s == NULL)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
mbstate_t state;
|
||||
wchar_t wc;
|
||||
size_t result;
|
||||
|
||||
#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
|
||||
#elif defined __i386__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
|
||||
#else
|
||||
/* This declaration is solely to ensure that after preprocessing
|
||||
this file is never empty. */
|
||||
typedef int dummy;
|
||||
#endif
|
||||
memset (&state, 0, sizeof (mbstate_t));
|
||||
result = mbrtowc (&wc, s, n, &state);
|
||||
if (result == (size_t)-1 || result == (size_t)-2)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
if (pwc != NULL)
|
||||
*pwc = wc;
|
||||
return (wc == 0 ? 0 : result);
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
/* Split a 'long double' into fraction and mantissa.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Convert multibyte character to 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
|
||||
@ -14,5 +15,12 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define USE_LONG_DOUBLE
|
||||
#include "frexp.c"
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "mbtowc-impl.h"
|
@ -1,188 +0,0 @@
|
||||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2005-2007, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be defined.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# include "printf-args.h"
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_FETCHARGS (va_list args, arguments *a)
|
||||
{
|
||||
size_t i;
|
||||
argument *ap;
|
||||
|
||||
for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
|
||||
switch (ap->type)
|
||||
{
|
||||
case TYPE_SCHAR:
|
||||
ap->a.a_schar = va_arg (args, /*signed char*/ int);
|
||||
break;
|
||||
case TYPE_UCHAR:
|
||||
ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
|
||||
break;
|
||||
case TYPE_SHORT:
|
||||
ap->a.a_short = va_arg (args, /*short*/ int);
|
||||
break;
|
||||
case TYPE_USHORT:
|
||||
ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
|
||||
break;
|
||||
case TYPE_INT:
|
||||
ap->a.a_int = va_arg (args, int);
|
||||
break;
|
||||
case TYPE_UINT:
|
||||
ap->a.a_uint = va_arg (args, unsigned int);
|
||||
break;
|
||||
case TYPE_LONGINT:
|
||||
ap->a.a_longint = va_arg (args, long int);
|
||||
break;
|
||||
case TYPE_ULONGINT:
|
||||
ap->a.a_ulongint = va_arg (args, unsigned long int);
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_LONGLONGINT:
|
||||
ap->a.a_longlongint = va_arg (args, long long int);
|
||||
break;
|
||||
case TYPE_ULONGLONGINT:
|
||||
ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
|
||||
break;
|
||||
#endif
|
||||
case TYPE_DOUBLE:
|
||||
ap->a.a_double = va_arg (args, double);
|
||||
break;
|
||||
case TYPE_LONGDOUBLE:
|
||||
ap->a.a_longdouble = va_arg (args, long double);
|
||||
break;
|
||||
case TYPE_CHAR:
|
||||
ap->a.a_char = va_arg (args, int);
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case TYPE_WIDE_CHAR:
|
||||
/* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
|
||||
default argument promotions", this is not the case in mingw32,
|
||||
where wint_t is 'unsigned short'. */
|
||||
ap->a.a_wide_char =
|
||||
(sizeof (wint_t) < sizeof (int)
|
||||
? (wint_t) va_arg (args, int)
|
||||
: va_arg (args, wint_t));
|
||||
break;
|
||||
#endif
|
||||
case TYPE_STRING:
|
||||
ap->a.a_string = va_arg (args, const char *);
|
||||
/* A null pointer is an invalid argument for "%s", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_string == NULL)
|
||||
ap->a.a_string = "(NULL)";
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case TYPE_WIDE_STRING:
|
||||
ap->a.a_wide_string = va_arg (args, const wchar_t *);
|
||||
/* A null pointer is an invalid argument for "%ls", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_wide_string == NULL)
|
||||
{
|
||||
static const wchar_t wide_null_string[] =
|
||||
{
|
||||
(wchar_t)'(',
|
||||
(wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
|
||||
(wchar_t)')',
|
||||
(wchar_t)0
|
||||
};
|
||||
ap->a.a_wide_string = wide_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_POINTER:
|
||||
ap->a.a_pointer = va_arg (args, void *);
|
||||
break;
|
||||
case TYPE_COUNT_SCHAR_POINTER:
|
||||
ap->a.a_count_schar_pointer = va_arg (args, signed char *);
|
||||
break;
|
||||
case TYPE_COUNT_SHORT_POINTER:
|
||||
ap->a.a_count_short_pointer = va_arg (args, short *);
|
||||
break;
|
||||
case TYPE_COUNT_INT_POINTER:
|
||||
ap->a.a_count_int_pointer = va_arg (args, int *);
|
||||
break;
|
||||
case TYPE_COUNT_LONGINT_POINTER:
|
||||
ap->a.a_count_longint_pointer = va_arg (args, long int *);
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_COUNT_LONGLONGINT_POINTER:
|
||||
ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
|
||||
break;
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case TYPE_U8_STRING:
|
||||
ap->a.a_u8_string = va_arg (args, const uint8_t *);
|
||||
/* A null pointer is an invalid argument for "%U", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u8_string == NULL)
|
||||
{
|
||||
static const uint8_t u8_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u8_string = u8_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U16_STRING:
|
||||
ap->a.a_u16_string = va_arg (args, const uint16_t *);
|
||||
/* A null pointer is an invalid argument for "%lU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u16_string == NULL)
|
||||
{
|
||||
static const uint16_t u16_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u16_string = u16_null_string;
|
||||
}
|
||||
break;
|
||||
case TYPE_U32_STRING:
|
||||
ap->a.a_u32_string = va_arg (args, const uint32_t *);
|
||||
/* A null pointer is an invalid argument for "%llU", but in practice
|
||||
it occurs quite frequently in printf statements that produce
|
||||
debug output. Use a fallback in this case. */
|
||||
if (ap->a.a_u32_string == NULL)
|
||||
{
|
||||
static const uint32_t u32_null_string[] =
|
||||
{ '(', 'N', 'U', 'L', 'L', ')', 0 };
|
||||
ap->a.a_u32_string = u32_null_string;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* Unknown type. */
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
/* Decomposed printf argument list.
|
||||
Copyright (C) 1999, 2002-2003, 2006-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _PRINTF_ARGS_H
|
||||
#define _PRINTF_ARGS_H
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
PRINTF_FETCHARGS Name of the function to be declared.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_FETCHARGS
|
||||
# define PRINTF_FETCHARGS printf_fetchargs
|
||||
#endif
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get wchar_t. */
|
||||
#if HAVE_WCHAR_T
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* Get wint_t. */
|
||||
#if HAVE_WINT_T
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
/* Argument types */
|
||||
typedef enum
|
||||
{
|
||||
TYPE_NONE,
|
||||
TYPE_SCHAR,
|
||||
TYPE_UCHAR,
|
||||
TYPE_SHORT,
|
||||
TYPE_USHORT,
|
||||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_LONGINT,
|
||||
TYPE_ULONGINT,
|
||||
#if HAVE_LONG_LONG_INT
|
||||
TYPE_LONGLONGINT,
|
||||
TYPE_ULONGLONGINT,
|
||||
#endif
|
||||
TYPE_DOUBLE,
|
||||
TYPE_LONGDOUBLE,
|
||||
TYPE_CHAR,
|
||||
#if HAVE_WINT_T
|
||||
TYPE_WIDE_CHAR,
|
||||
#endif
|
||||
TYPE_STRING,
|
||||
#if HAVE_WCHAR_T
|
||||
TYPE_WIDE_STRING,
|
||||
#endif
|
||||
TYPE_POINTER,
|
||||
TYPE_COUNT_SCHAR_POINTER,
|
||||
TYPE_COUNT_SHORT_POINTER,
|
||||
TYPE_COUNT_INT_POINTER,
|
||||
TYPE_COUNT_LONGINT_POINTER
|
||||
#if HAVE_LONG_LONG_INT
|
||||
, TYPE_COUNT_LONGLONGINT_POINTER
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
, TYPE_U8_STRING
|
||||
, TYPE_U16_STRING
|
||||
, TYPE_U32_STRING
|
||||
#endif
|
||||
} arg_type;
|
||||
|
||||
/* Polymorphic argument */
|
||||
typedef struct
|
||||
{
|
||||
arg_type type;
|
||||
union
|
||||
{
|
||||
signed char a_schar;
|
||||
unsigned char a_uchar;
|
||||
short a_short;
|
||||
unsigned short a_ushort;
|
||||
int a_int;
|
||||
unsigned int a_uint;
|
||||
long int a_longint;
|
||||
unsigned long int a_ulongint;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
long long int a_longlongint;
|
||||
unsigned long long int a_ulonglongint;
|
||||
#endif
|
||||
float a_float;
|
||||
double a_double;
|
||||
long double a_longdouble;
|
||||
int a_char;
|
||||
#if HAVE_WINT_T
|
||||
wint_t a_wide_char;
|
||||
#endif
|
||||
const char* a_string;
|
||||
#if HAVE_WCHAR_T
|
||||
const wchar_t* a_wide_string;
|
||||
#endif
|
||||
void* a_pointer;
|
||||
signed char * a_count_schar_pointer;
|
||||
short * a_count_short_pointer;
|
||||
int * a_count_int_pointer;
|
||||
long int * a_count_longint_pointer;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
long long int * a_count_longlongint_pointer;
|
||||
#endif
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
const uint8_t * a_u8_string;
|
||||
const uint16_t * a_u16_string;
|
||||
const uint32_t * a_u32_string;
|
||||
#endif
|
||||
}
|
||||
a;
|
||||
}
|
||||
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;
|
||||
|
||||
|
||||
/* Fetch the arguments, putting them into a. */
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int PRINTF_FETCHARGS (va_list args, arguments *a);
|
||||
|
||||
#endif /* _PRINTF_ARGS_H */
|
@ -1,188 +0,0 @@
|
||||
/* Split a double into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "printf-frexpl.h"
|
||||
#else
|
||||
# include "printf-frexp.h"
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# include "fpucw.h"
|
||||
#endif
|
||||
|
||||
/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
|
||||
than 2, or not even a power of 2, some rounding errors can occur, so that
|
||||
then the returned mantissa is only guaranteed to be <= 2.0, not < 2.0. */
|
||||
|
||||
#ifdef USE_LONG_DOUBLE
|
||||
# define FUNC printf_frexpl
|
||||
# define DOUBLE long double
|
||||
# define MIN_EXP LDBL_MIN_EXP
|
||||
# if HAVE_FREXPL_IN_LIBC && HAVE_LDEXPL_IN_LIBC
|
||||
# define USE_FREXP_LDEXP
|
||||
# define FREXP frexpl
|
||||
# define LDEXP ldexpl
|
||||
# endif
|
||||
# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
|
||||
# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
|
||||
# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
|
||||
# define L_(literal) literal##L
|
||||
#else
|
||||
# define FUNC printf_frexp
|
||||
# define DOUBLE double
|
||||
# define MIN_EXP DBL_MIN_EXP
|
||||
# if HAVE_FREXP_IN_LIBC && HAVE_LDEXP_IN_LIBC
|
||||
# define USE_FREXP_LDEXP
|
||||
# define FREXP frexp
|
||||
# define LDEXP ldexp
|
||||
# endif
|
||||
# define DECL_ROUNDING
|
||||
# define BEGIN_ROUNDING()
|
||||
# define END_ROUNDING()
|
||||
# define L_(literal) literal
|
||||
#endif
|
||||
|
||||
DOUBLE
|
||||
FUNC (DOUBLE x, int *expptr)
|
||||
{
|
||||
int exponent;
|
||||
DECL_ROUNDING
|
||||
|
||||
BEGIN_ROUNDING ();
|
||||
|
||||
#ifdef USE_FREXP_LDEXP
|
||||
/* frexp and ldexp are usually faster than the loop below. */
|
||||
x = FREXP (x, &exponent);
|
||||
|
||||
x = x + x;
|
||||
exponent -= 1;
|
||||
|
||||
if (exponent < MIN_EXP - 1)
|
||||
{
|
||||
x = LDEXP (x, exponent - (MIN_EXP - 1));
|
||||
exponent = MIN_EXP - 1;
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
|
||||
loops are executed no more than 64 times. */
|
||||
DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
|
||||
DOUBLE powh[64]; /* powh[i] = 2^-2^i */
|
||||
int i;
|
||||
|
||||
exponent = 0;
|
||||
if (x >= L_(1.0))
|
||||
{
|
||||
/* A nonnegative exponent. */
|
||||
{
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x >= 1.0. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (x >= pow2_i)
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh_i;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
}
|
||||
/* Here 1.0 <= x < 2^2^i. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A negative exponent. */
|
||||
{
|
||||
DOUBLE pow2_i; /* = pow2[i] */
|
||||
DOUBLE powh_i; /* = powh[i] */
|
||||
|
||||
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
|
||||
x * 2^exponent = argument, x < 1.0, exponent >= MIN_EXP - 1. */
|
||||
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
|
||||
;
|
||||
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
|
||||
{
|
||||
if (exponent - (1 << i) < MIN_EXP - 1)
|
||||
break;
|
||||
|
||||
exponent -= (1 << i);
|
||||
x *= pow2_i;
|
||||
if (x >= L_(1.0))
|
||||
break;
|
||||
|
||||
pow2[i] = pow2_i;
|
||||
powh[i] = powh_i;
|
||||
}
|
||||
}
|
||||
/* Here either x < 1.0 and exponent - 2^i < MIN_EXP - 1 <= exponent,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
|
||||
if (x < L_(1.0))
|
||||
/* Invariants: x * 2^exponent = argument, x < 1.0 and
|
||||
exponent - 2^i < MIN_EXP - 1 <= exponent. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (exponent - (1 << i) >= MIN_EXP - 1)
|
||||
{
|
||||
exponent -= (1 << i);
|
||||
x *= pow2[i];
|
||||
if (x >= L_(1.0))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
}
|
||||
|
||||
/* Invariants: x * 2^exponent = argument, and
|
||||
either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
if (x >= pow2[i])
|
||||
{
|
||||
exponent += (1 << i);
|
||||
x *= powh[i];
|
||||
}
|
||||
}
|
||||
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
|
||||
or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */
|
||||
}
|
||||
#endif
|
||||
|
||||
END_ROUNDING ();
|
||||
|
||||
*expptr = exponent;
|
||||
return x;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
#define USE_LONG_DOUBLE
|
||||
#include "printf-frexp.c"
|
@ -1,23 +0,0 @@
|
||||
/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
/* Write a finite, positive number x as
|
||||
x = mantissa * 2^exp
|
||||
where exp >= LDBL_MIN_EXP - 1,
|
||||
mantissa < 2.0,
|
||||
if x is not a denormalized number then mantissa >= 1.0.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
extern long double printf_frexpl (long double x, int *expptr);
|
@ -1,639 +0,0 @@
|
||||
/* Formatted output to strings.
|
||||
Copyright (C) 1999-2000, 2002-2003, 2006-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
CHAR_T The element type of the format string.
|
||||
CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
|
||||
in the format string are ASCII.
|
||||
DIRECTIVE Structure denoting a format directive.
|
||||
Depends on CHAR_T.
|
||||
DIRECTIVES Structure denoting the set of format directives of a
|
||||
format string. Depends on CHAR_T.
|
||||
PRINTF_PARSE Function that parses a format string.
|
||||
Depends on CHAR_T.
|
||||
STATIC Set to 'static' to declare the function static.
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
|
||||
|
||||
#ifndef PRINTF_PARSE
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# include "printf-parse.h"
|
||||
#endif
|
||||
|
||||
/* Default parameters. */
|
||||
#ifndef PRINTF_PARSE
|
||||
# define PRINTF_PARSE printf_parse
|
||||
# define CHAR_T char
|
||||
# define DIRECTIVE char_directive
|
||||
# define DIRECTIVES char_directives
|
||||
#endif
|
||||
|
||||
/* Get size_t, NULL. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get intmax_t. */
|
||||
#if defined IN_LIBINTL || defined IN_LIBASPRINTF
|
||||
# if HAVE_STDINT_H_WITH_UINTMAX
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
# if HAVE_INTTYPES_H_WITH_UINTMAX
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* malloc(), realloc(), free(). */
|
||||
#include <stdlib.h>
|
||||
|
||||
/* memcpy(). */
|
||||
#include <string.h>
|
||||
|
||||
/* errno. */
|
||||
#include <errno.h>
|
||||
|
||||
/* Checked size_t computations. */
|
||||
#include "xsize.h"
|
||||
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
/* c_isascii(). */
|
||||
# include "c-ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
|
||||
{
|
||||
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 max_width_length = 0;
|
||||
size_t max_precision_length = 0;
|
||||
|
||||
d->count = 0;
|
||||
d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
|
||||
d->dir = d->direct_alloc_dir;
|
||||
|
||||
a->count = 0;
|
||||
a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
|
||||
a->arg = a->direct_alloc_arg;
|
||||
|
||||
#define REGISTER_ARG(_index_,_type_) \
|
||||
{ \
|
||||
size_t n = (_index_); \
|
||||
if (n >= a_allocated) \
|
||||
{ \
|
||||
size_t memory_size; \
|
||||
argument *memory; \
|
||||
\
|
||||
a_allocated = xtimes (a_allocated, 2); \
|
||||
if (a_allocated <= n) \
|
||||
a_allocated = xsum (n, 1); \
|
||||
memory_size = xtimes (a_allocated, sizeof (argument)); \
|
||||
if (size_overflow_p (memory_size)) \
|
||||
/* Overflow, would lead to out of memory. */ \
|
||||
goto out_of_memory; \
|
||||
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) \
|
||||
a->arg[a->count++].type = TYPE_NONE; \
|
||||
if (a->arg[n].type == TYPE_NONE) \
|
||||
a->arg[n].type = (_type_); \
|
||||
else if (a->arg[n].type != (_type_)) \
|
||||
/* Ambiguous type for positional argument. */ \
|
||||
goto error; \
|
||||
}
|
||||
|
||||
while (*cp != '\0')
|
||||
{
|
||||
CHAR_T c = *cp++;
|
||||
if (c == '%')
|
||||
{
|
||||
size_t arg_index = ARG_NONE;
|
||||
DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
|
||||
|
||||
/* Initialize the next directive. */
|
||||
dp->dir_start = cp - 1;
|
||||
dp->flags = 0;
|
||||
dp->width_start = NULL;
|
||||
dp->width_end = NULL;
|
||||
dp->width_arg_index = ARG_NONE;
|
||||
dp->precision_start = NULL;
|
||||
dp->precision_end = NULL;
|
||||
dp->precision_arg_index = ARG_NONE;
|
||||
dp->arg_index = ARG_NONE;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the flags. */
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == '\'')
|
||||
{
|
||||
dp->flags |= FLAG_GROUP;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '-')
|
||||
{
|
||||
dp->flags |= FLAG_LEFT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '+')
|
||||
{
|
||||
dp->flags |= FLAG_SHOWSIGN;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == ' ')
|
||||
{
|
||||
dp->flags |= FLAG_SPACE;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '#')
|
||||
{
|
||||
dp->flags |= FLAG_ALT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '0')
|
||||
{
|
||||
dp->flags |= FLAG_ZERO;
|
||||
cp++;
|
||||
}
|
||||
#if __GLIBC__ >= 2 && !defined __UCLIBC__
|
||||
else if (*cp == 'I')
|
||||
{
|
||||
dp->flags |= FLAG_LOCALIZED;
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Parse the field width. */
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->width_start = cp;
|
||||
cp++;
|
||||
dp->width_end = cp;
|
||||
if (max_width_length < 1)
|
||||
max_width_length = 1;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory later. */
|
||||
goto error;
|
||||
dp->width_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->width_arg_index = arg_posn++;
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->width_arg_index, TYPE_INT);
|
||||
}
|
||||
else if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
size_t width_length;
|
||||
|
||||
dp->width_start = cp;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->width_end = cp;
|
||||
width_length = dp->width_end - dp->width_start;
|
||||
if (max_width_length < width_length)
|
||||
max_width_length = width_length;
|
||||
}
|
||||
|
||||
/* Parse the precision. */
|
||||
if (*cp == '.')
|
||||
{
|
||||
cp++;
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->precision_start = cp - 1;
|
||||
cp++;
|
||||
dp->precision_end = cp;
|
||||
if (max_precision_length < 2)
|
||||
max_precision_length = 2;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
n = xsum (xtimes (n, 10), *np - '0');
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
if (size_overflow_p (n))
|
||||
/* n too large, would lead to out of memory
|
||||
later. */
|
||||
goto error;
|
||||
dp->precision_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->precision_arg_index = arg_posn++;
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t precision_length;
|
||||
|
||||
dp->precision_start = cp - 1;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->precision_end = cp;
|
||||
precision_length = dp->precision_end - dp->precision_start;
|
||||
if (max_precision_length < precision_length)
|
||||
max_precision_length = precision_length;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
arg_type type;
|
||||
|
||||
/* Parse argument type/size specifiers. */
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == 'h')
|
||||
{
|
||||
flags |= (1 << (flags & 1));
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'L')
|
||||
{
|
||||
flags |= 4;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'l')
|
||||
{
|
||||
flags += 8;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'j')
|
||||
{
|
||||
if (sizeof (intmax_t) > sizeof (long))
|
||||
{
|
||||
/* intmax_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (intmax_t) > sizeof (int))
|
||||
{
|
||||
/* intmax_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'z' || *cp == 'Z')
|
||||
{
|
||||
/* 'z' is standardized in ISO C 99, but glibc uses 'Z'
|
||||
because the warning facility in gcc-2.95.2 understands
|
||||
only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
|
||||
if (sizeof (size_t) > sizeof (long))
|
||||
{
|
||||
/* size_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (size_t) > sizeof (int))
|
||||
{
|
||||
/* size_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 't')
|
||||
{
|
||||
if (sizeof (ptrdiff_t) > sizeof (long))
|
||||
{
|
||||
/* ptrdiff_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (ptrdiff_t) > sizeof (int))
|
||||
{
|
||||
/* ptrdiff_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
/* On MacOS X 10.3, PRIdMAX is defined as "qd".
|
||||
We cannot change it to "lld" because PRIdMAX must also
|
||||
be understood by the system's printf routines. */
|
||||
else if (*cp == 'q')
|
||||
{
|
||||
if (64 / 8 > sizeof (long))
|
||||
{
|
||||
/* int64_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* int64_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
/* On native Win32, PRIdMAX is defined as "I64d".
|
||||
We cannot change it to "lld" because PRIdMAX must also
|
||||
be understood by the system's printf routines. */
|
||||
else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
|
||||
{
|
||||
if (64 / 8 > sizeof (long))
|
||||
{
|
||||
/* __int64 = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* __int64 = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp += 3;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read the conversion character. */
|
||||
c = *cp++;
|
||||
switch (c)
|
||||
{
|
||||
case 'd': case 'i':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lld" into TYPE_LONGINT. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_LONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_SCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_SHORT;
|
||||
else
|
||||
type = TYPE_INT;
|
||||
break;
|
||||
case 'o': case 'u': case 'x': case 'X':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_ULONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'unsigned long long' exists and is the same as
|
||||
'unsigned long', we parse "llu" into TYPE_ULONGINT. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_ULONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_UCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_USHORT;
|
||||
else
|
||||
type = TYPE_UINT;
|
||||
break;
|
||||
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
|
||||
case 'a': case 'A':
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGDOUBLE;
|
||||
else
|
||||
type = TYPE_DOUBLE;
|
||||
break;
|
||||
case 'c':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WINT_T
|
||||
type = TYPE_WIDE_CHAR;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_CHAR;
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case 'C':
|
||||
type = TYPE_WIDE_CHAR;
|
||||
c = 'c';
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WCHAR_T
|
||||
type = TYPE_WIDE_STRING;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_STRING;
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case 'S':
|
||||
type = TYPE_WIDE_STRING;
|
||||
c = 's';
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
type = TYPE_POINTER;
|
||||
break;
|
||||
case 'n':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lln" into TYPE_COUNT_LONGINT_POINTER. */
|
||||
if (flags >= 8)
|
||||
type = TYPE_COUNT_LONGINT_POINTER;
|
||||
else if (flags & 2)
|
||||
type = TYPE_COUNT_SCHAR_POINTER;
|
||||
else if (flags & 1)
|
||||
type = TYPE_COUNT_SHORT_POINTER;
|
||||
else
|
||||
type = TYPE_COUNT_INT_POINTER;
|
||||
break;
|
||||
#if ENABLE_UNISTDIO
|
||||
/* The unistdio extensions. */
|
||||
case 'U':
|
||||
if (flags >= 16)
|
||||
type = TYPE_U32_STRING;
|
||||
else if (flags >= 8)
|
||||
type = TYPE_U16_STRING;
|
||||
else
|
||||
type = TYPE_U8_STRING;
|
||||
break;
|
||||
#endif
|
||||
case '%':
|
||||
type = TYPE_NONE;
|
||||
break;
|
||||
default:
|
||||
/* Unknown conversion character. */
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != TYPE_NONE)
|
||||
{
|
||||
dp->arg_index = arg_index;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
{
|
||||
dp->arg_index = arg_posn++;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->arg_index, type);
|
||||
}
|
||||
dp->conversion = c;
|
||||
dp->dir_end = cp;
|
||||
}
|
||||
|
||||
d->count++;
|
||||
if (d->count >= d_allocated)
|
||||
{
|
||||
size_t memory_size;
|
||||
DIRECTIVE *memory;
|
||||
|
||||
d_allocated = xtimes (d_allocated, 2);
|
||||
memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
|
||||
if (size_overflow_p (memory_size))
|
||||
/* Overflow, would lead to out of memory. */
|
||||
goto out_of_memory;
|
||||
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;
|
||||
}
|
||||
}
|
||||
#if CHAR_T_ONLY_ASCII
|
||||
else if (!c_isascii (c))
|
||||
{
|
||||
/* Non-ASCII character. Not supported. */
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
d->dir[d->count].dir_start = cp;
|
||||
|
||||
d->max_width_length = max_width_length;
|
||||
d->max_precision_length = max_precision_length;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (a->arg != a->direct_alloc_arg)
|
||||
free (a->arg);
|
||||
if (d->dir != d->direct_alloc_dir)
|
||||
free (d->dir);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
out_of_memory:
|
||||
if (a->arg != a->direct_alloc_arg)
|
||||
free (a->arg);
|
||||
if (d->dir != d->direct_alloc_dir)
|
||||
free (d->dir);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#undef PRINTF_PARSE
|
||||
#undef DIRECTIVES
|
||||
#undef DIRECTIVE
|
||||
#undef CHAR_T_ONLY_ASCII
|
||||
#undef CHAR_T
|
@ -1,194 +0,0 @@
|
||||
/* Parse printf format string.
|
||||
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
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _PRINTF_PARSE_H
|
||||
#define _PRINTF_PARSE_H
|
||||
|
||||
/* This file can be parametrized with the following macros:
|
||||
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
|
||||
STATIC Set to 'static' to declare the function static. */
|
||||
|
||||
#if HAVE_FEATURES_H
|
||||
# include <features.h> /* for __GLIBC__, __UCLIBC__ */
|
||||
#endif
|
||||
|
||||
#include "printf-args.h"
|
||||
|
||||
|
||||
/* Flags */
|
||||
#define FLAG_GROUP 1 /* ' flag */
|
||||
#define FLAG_LEFT 2 /* - flag */
|
||||
#define FLAG_SHOWSIGN 4 /* + flag */
|
||||
#define FLAG_SPACE 8 /* space flag */
|
||||
#define FLAG_ALT 16 /* # flag */
|
||||
#define FLAG_ZERO 32
|
||||
#if __GLIBC__ >= 2 && !defined __UCLIBC__
|
||||
# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
|
||||
#endif
|
||||
|
||||
/* arg_index value indicating that no argument is consumed. */
|
||||
#define ARG_NONE (~(size_t)0)
|
||||
|
||||
/* 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
|
||||
{
|
||||
const char* dir_start;
|
||||
const char* dir_end;
|
||||
int flags;
|
||||
const char* width_start;
|
||||
const char* width_end;
|
||||
size_t width_arg_index;
|
||||
const char* precision_start;
|
||||
const char* precision_end;
|
||||
size_t precision_arg_index;
|
||||
char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
char_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
char_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
char_directives;
|
||||
|
||||
#if ENABLE_UNISTDIO
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint8_t* dir_start;
|
||||
const uint8_t* dir_end;
|
||||
int flags;
|
||||
const uint8_t* width_start;
|
||||
const uint8_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint8_t* precision_start;
|
||||
const uint8_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u8_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u8_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u8_directives;
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint16_t* dir_start;
|
||||
const uint16_t* dir_end;
|
||||
int flags;
|
||||
const uint16_t* width_start;
|
||||
const uint16_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint16_t* precision_start;
|
||||
const uint16_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u16_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u16_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u16_directives;
|
||||
|
||||
/* A parsed directive. */
|
||||
typedef struct
|
||||
{
|
||||
const uint32_t* dir_start;
|
||||
const uint32_t* dir_end;
|
||||
int flags;
|
||||
const uint32_t* width_start;
|
||||
const uint32_t* width_end;
|
||||
size_t width_arg_index;
|
||||
const uint32_t* precision_start;
|
||||
const uint32_t* precision_end;
|
||||
size_t precision_arg_index;
|
||||
uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
|
||||
size_t arg_index;
|
||||
}
|
||||
u32_directive;
|
||||
|
||||
/* A parsed format string. */
|
||||
typedef struct
|
||||
{
|
||||
size_t count;
|
||||
u32_directive *dir;
|
||||
size_t max_width_length;
|
||||
size_t max_precision_length;
|
||||
u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
|
||||
}
|
||||
u32_directives;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Parses the format string. Fills in the number N of directives, and fills
|
||||
in directives[0], ..., directives[N-1], and sets directives[N].dir_start
|
||||
to the end of the format string. Also fills in the arg_type fields of the
|
||||
arguments and the needed count of arguments. */
|
||||
#if ENABLE_UNISTDIO
|
||||
extern int
|
||||
ulc_printf_parse (const char *format, char_directives *d, arguments *a);
|
||||
extern int
|
||||
u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
|
||||
extern int
|
||||
u16_printf_parse (const uint16_t *format, u16_directives *d,
|
||||
arguments *a);
|
||||
extern int
|
||||
u32_printf_parse (const uint32_t *format, u32_directives *d,
|
||||
arguments *a);
|
||||
#else
|
||||
# ifdef STATIC
|
||||
STATIC
|
||||
# else
|
||||
extern
|
||||
# endif
|
||||
int printf_parse (const char *format, char_directives *d, arguments *a);
|
||||
#endif
|
||||
|
||||
#endif /* _PRINTF_PARSE_H */
|
30
lib/ref-add.sin
Normal file
30
lib/ref-add.sin
Normal file
@ -0,0 +1,30 @@
|
||||
# Add this package to a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000, 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, 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
ta
|
||||
:a
|
||||
s/ @PACKAGE@ / @PACKAGE@ /
|
||||
tb
|
||||
s/ $/ @PACKAGE@ /
|
||||
:b
|
||||
s/^/# Packages using this file:/
|
||||
}
|
25
lib/ref-del.sin
Normal file
25
lib/ref-del.sin
Normal file
@ -0,0 +1,25 @@
|
||||
# Remove this package from a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000, 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, 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
s/ @PACKAGE@ / /
|
||||
s/^/# Packages using this file:/
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
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>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnand-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitd_OPTIMIZED_MACRO
|
||||
# undef gl_signbitd
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitd (double arg)
|
||||
{
|
||||
#if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { double value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGN_IN_LIBC
|
||||
return copysign (1.0, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnand (arg))
|
||||
return 0;
|
||||
if (arg < 0.0)
|
||||
return 1;
|
||||
else if (arg == 0.0)
|
||||
{
|
||||
/* Distinguish 0.0 and -0.0. */
|
||||
static double plus_zero = 0.0;
|
||||
double arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_DBL) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnanf-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitf_OPTIMIZED_MACRO
|
||||
# undef gl_signbitf
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitf (float arg)
|
||||
{
|
||||
#if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { float value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGNF_IN_LIBC
|
||||
return copysignf (1.0f, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnanf (arg))
|
||||
return 0;
|
||||
if (arg < 0.0f)
|
||||
return 1;
|
||||
else if (arg == 0.0f)
|
||||
{
|
||||
/* Distinguish 0.0f and -0.0f. */
|
||||
static float plus_zero = 0.0f;
|
||||
float arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_FLT) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
/* signbit() macro: Determine the sign bit of a floating-point number.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <math.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "isnanl-nolibm.h"
|
||||
#include "float+.h"
|
||||
|
||||
#ifdef gl_signbitl_OPTIMIZED_MACRO
|
||||
# undef gl_signbitl
|
||||
#endif
|
||||
|
||||
int
|
||||
gl_signbitl (long double arg)
|
||||
{
|
||||
#if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT
|
||||
/* The use of a union to extract the bits of the representation of a
|
||||
'long double' is safe in practice, despite of the "aliasing rules" of
|
||||
C99, because the GCC docs say
|
||||
"Even with '-fstrict-aliasing', type-punning is allowed, provided the
|
||||
memory is accessed through the union type."
|
||||
and similarly for other compilers. */
|
||||
# define NWORDS \
|
||||
((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
union { long double value; unsigned int word[NWORDS]; } m;
|
||||
m.value = arg;
|
||||
return (m.word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;
|
||||
#elif HAVE_COPYSIGNL_IN_LIBC
|
||||
return copysignl (1.0L, arg) < 0;
|
||||
#else
|
||||
/* This does not do the right thing for NaN, but this is irrelevant for
|
||||
most use cases. */
|
||||
if (isnanl (arg))
|
||||
return 0;
|
||||
if (arg < 0.0L)
|
||||
return 1;
|
||||
else if (arg == 0.0L)
|
||||
{
|
||||
/* Distinguish 0.0L and -0.0L. */
|
||||
static long double plus_zero = 0.0L;
|
||||
long double arg_mem = arg;
|
||||
return (memcmp (&plus_zero, &arg_mem, SIZEOF_LDBL) != 0);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/* size_max.h -- declare SIZE_MAX through system headers
|
||||
Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Written by Simon Josefsson.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef GNULIB_SIZE_MAX_H
|
||||
#define GNULIB_SIZE_MAX_H
|
||||
|
||||
/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
|
||||
# include <limits.h>
|
||||
/* Get SIZE_MAX declaration on systems like glibc 2. */
|
||||
# if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
/* On systems where these include files don't define it, SIZE_MAX is defined
|
||||
in config.h. */
|
||||
|
||||
#endif /* GNULIB_SIZE_MAX_H */
|
@ -1,72 +0,0 @@
|
||||
/* Formatted output to strings.
|
||||
Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
|
||||
Written by Simon Josefsson and Paul Eggert.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "vasnprintf.h"
|
||||
|
||||
/* Print formatted output to string STR. Similar to sprintf, but
|
||||
additional length SIZE limit how much is written into STR. Returns
|
||||
string length of formatted string (which may be larger than SIZE).
|
||||
STR may be NULL, in which case nothing will be written. On error,
|
||||
return a negative value. */
|
||||
int
|
||||
snprintf (char *str, size_t size, const char *format, ...)
|
||||
{
|
||||
char *output;
|
||||
size_t len;
|
||||
size_t lenbuf = size;
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
output = vasnprintf (str, &lenbuf, format, args);
|
||||
len = lenbuf;
|
||||
va_end (args);
|
||||
|
||||
if (!output)
|
||||
return -1;
|
||||
|
||||
if (output != str)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
size_t pruned_len = (len < size ? len : size - 1);
|
||||
memcpy (str, output, pruned_len);
|
||||
str[pruned_len] = '\0';
|
||||
}
|
||||
|
||||
free (output);
|
||||
}
|
||||
|
||||
if (INT_MAX < len)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
113
lib/stat.c
113
lib/stat.c
@ -1,113 +0,0 @@
|
||||
/* Work around platform bugs in stat.
|
||||
Copyright (C) 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 Eric Blake */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Get the original definition of stat. It might be defined as a macro. */
|
||||
#define __need_system_sys_stat_h
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#undef __need_system_sys_stat_h
|
||||
|
||||
static inline int
|
||||
orig_stat (const char *filename, struct stat *buf)
|
||||
{
|
||||
return stat (filename, buf);
|
||||
}
|
||||
|
||||
/* Specification. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "dosname.h"
|
||||
#include "verify.h"
|
||||
|
||||
/* Store information about NAME into ST. Work around bugs with
|
||||
trailing slashes. Mingw has other bugs (such as st_ino always
|
||||
being 0 on success) which this wrapper does not work around. But
|
||||
at least this implementation provides the ability to emulate fchdir
|
||||
correctly. */
|
||||
|
||||
int
|
||||
rpl_stat (char const *name, struct stat *st)
|
||||
{
|
||||
int result = orig_stat (name, st);
|
||||
#if REPLACE_FUNC_STAT_FILE
|
||||
/* Solaris 9 mistakenly succeeds when given a non-directory with a
|
||||
trailing slash. */
|
||||
if (result == 0 && !S_ISDIR (st->st_mode))
|
||||
{
|
||||
size_t len = strlen (name);
|
||||
if (ISSLASH (name[len - 1]))
|
||||
{
|
||||
errno = ENOTDIR;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif /* REPLACE_FUNC_STAT_FILE */
|
||||
#if REPLACE_FUNC_STAT_DIR
|
||||
/* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
|
||||
have a constant PATH_MAX. */
|
||||
# ifndef PATH_MAX
|
||||
# error "Please port this replacement to your platform"
|
||||
# endif
|
||||
|
||||
if (result == -1 && errno == ENOENT)
|
||||
{
|
||||
/* Due to mingw's oddities, there are some directories (like
|
||||
c:\) where stat() only succeeds with a trailing slash, and
|
||||
other directories (like c:\windows) where stat() only
|
||||
succeeds without a trailing slash. But we want the two to be
|
||||
synonymous, since chdir() manages either style. Likewise, Mingw also
|
||||
reports ENOENT for names longer than PATH_MAX, when we want
|
||||
ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR.
|
||||
Fortunately, mingw PATH_MAX is small enough for stack
|
||||
allocation. */
|
||||
char fixed_name[PATH_MAX + 1] = {0};
|
||||
size_t len = strlen (name);
|
||||
bool check_dir = false;
|
||||
verify (PATH_MAX <= 4096);
|
||||
if (PATH_MAX <= len)
|
||||
errno = ENAMETOOLONG;
|
||||
else if (len)
|
||||
{
|
||||
strcpy (fixed_name, name);
|
||||
if (ISSLASH (fixed_name[len - 1]))
|
||||
{
|
||||
check_dir = true;
|
||||
while (len && ISSLASH (fixed_name[len - 1]))
|
||||
fixed_name[--len] = '\0';
|
||||
if (!len)
|
||||
fixed_name[0] = '/';
|
||||
}
|
||||
else
|
||||
fixed_name[len++] = '/';
|
||||
result = orig_stat (fixed_name, st);
|
||||
if (result == 0 && check_dir && !S_ISDIR (st->st_mode))
|
||||
{
|
||||
result = -1;
|
||||
errno = ENOTDIR;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* REPLACE_FUNC_STAT_DIR */
|
||||
return result;
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
/* Substitute for and wrapper around <stdarg.h>.
|
||||
Copyright (C) 2008-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_STDARG_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_STDARG_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_STDARG_H
|
||||
#define _@GUARD_PREFIX@_STDARG_H
|
||||
|
||||
#ifndef va_copy
|
||||
# define va_copy(a,b) ((a) = (b))
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_STDARG_H */
|
||||
#endif /* _@GUARD_PREFIX@_STDARG_H */
|
110
lib/stdio-impl.h
110
lib/stdio-impl.h
@ -1,110 +0,0 @@
|
||||
/* Implementation details of FILE streams.
|
||||
Copyright (C) 2007-2008, 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/>. */
|
||||
|
||||
/* Many stdio implementations have the same logic and therefore can share
|
||||
the same implementation of stdio extension API, except that some fields
|
||||
have different naming conventions, or their access requires some casts. */
|
||||
|
||||
|
||||
/* BSD stdio derived implementations. */
|
||||
|
||||
#if defined __NetBSD__ /* NetBSD */
|
||||
/* Get __NetBSD_Version__. */
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
|
||||
|
||||
# if defined __DragonFly__ /* DragonFly */
|
||||
/* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */
|
||||
# define fp_ ((struct { struct __FILE_public pub; \
|
||||
struct { unsigned char *_base; int _size; } _bf; \
|
||||
void *cookie; \
|
||||
void *_close; \
|
||||
void *_read; \
|
||||
void *_seek; \
|
||||
void *_write; \
|
||||
struct { unsigned char *_base; int _size; } _ub; \
|
||||
int _ur; \
|
||||
unsigned char _ubuf[3]; \
|
||||
unsigned char _nbuf[1]; \
|
||||
struct { unsigned char *_base; int _size; } _lb; \
|
||||
int _blksize; \
|
||||
fpos_t _offset; \
|
||||
/* More fields, not relevant here. */ \
|
||||
} *) fp)
|
||||
/* See <http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */
|
||||
# define _p pub._p
|
||||
# define _flags pub._flags
|
||||
# define _r pub._r
|
||||
# define _w pub._w
|
||||
# else
|
||||
# define fp_ fp
|
||||
# endif
|
||||
|
||||
# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
|
||||
/* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
|
||||
and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
|
||||
struct __sfileext
|
||||
{
|
||||
struct __sbuf _ub; /* ungetc buffer */
|
||||
/* More fields, not relevant here. */
|
||||
};
|
||||
# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
|
||||
# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */
|
||||
# define fp_ub fp_->_ub
|
||||
# endif
|
||||
|
||||
# define HASUB(fp) (fp_ub._base != NULL)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* SystemV derived implementations. */
|
||||
|
||||
#ifdef __TANDEM /* NonStop Kernel */
|
||||
# ifndef _IOERR
|
||||
/* These values were determined by the program 'stdioext-flags' at
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
|
||||
# define _IOERR 0x40
|
||||
# define _IOREAD 0x80
|
||||
# define _IOWRT 0x4
|
||||
# define _IORW 0x100
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined _IOERR
|
||||
|
||||
# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
|
||||
# define fp_ ((struct { unsigned char *_ptr; \
|
||||
unsigned char *_base; \
|
||||
unsigned char *_end; \
|
||||
long _cnt; \
|
||||
int _file; \
|
||||
unsigned int _flag; \
|
||||
} *) fp)
|
||||
# else
|
||||
# define fp_ fp
|
||||
# endif
|
||||
|
||||
# if defined _SCO_DS /* OpenServer */
|
||||
# define _cnt __cnt
|
||||
# define _ptr __ptr
|
||||
# define _base __base
|
||||
# define _flag __flag
|
||||
# endif
|
||||
|
||||
#endif
|
176
lib/streq.h
Normal file
176
lib/streq.h
Normal file
@ -0,0 +1,176 @@
|
||||
/* Optimized string comparison.
|
||||
Copyright (C) 2001-2002, 2007, 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 Bruno Haible <bruno@clisp.org>. */
|
||||
|
||||
#ifndef _GL_STREQ_H
|
||||
#define _GL_STREQ_H
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* STREQ allows to optimize string comparison with a small literal string.
|
||||
STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
|
||||
is semantically equivalent to
|
||||
strcmp (s, "EUC-KR") == 0
|
||||
just faster. */
|
||||
|
||||
/* Help GCC to generate good code for string comparisons with
|
||||
immediate strings. */
|
||||
#if defined (__GNUC__) && defined (__OPTIMIZE__)
|
||||
|
||||
static inline int
|
||||
streq9 (const char *s1, const char *s2)
|
||||
{
|
||||
return strcmp (s1 + 9, s2 + 9) == 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq8 (const char *s1, const char *s2, char s28)
|
||||
{
|
||||
if (s1[8] == s28)
|
||||
{
|
||||
if (s28 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq9 (s1, s2);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq7 (const char *s1, const char *s2, char s27, char s28)
|
||||
{
|
||||
if (s1[7] == s27)
|
||||
{
|
||||
if (s27 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq8 (s1, s2, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq6 (const char *s1, const char *s2, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[6] == s26)
|
||||
{
|
||||
if (s26 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq7 (s1, s2, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[5] == s25)
|
||||
{
|
||||
if (s25 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq6 (s1, s2, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[4] == s24)
|
||||
{
|
||||
if (s24 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq5 (s1, s2, s25, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[3] == s23)
|
||||
{
|
||||
if (s23 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq4 (s1, s2, s24, s25, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[2] == s22)
|
||||
{
|
||||
if (s22 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq3 (s1, s2, s23, s24, s25, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[1] == s21)
|
||||
{
|
||||
if (s21 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
|
||||
{
|
||||
if (s1[0] == s20)
|
||||
{
|
||||
if (s20 == 0)
|
||||
return 1;
|
||||
else
|
||||
return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
|
||||
streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
|
||||
|
||||
#else
|
||||
|
||||
#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
|
||||
(strcmp (s1, s2) == 0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _GL_STREQ_H */
|
464
lib/striconv.c
Normal file
464
lib/striconv.c
Normal file
@ -0,0 +1,464 @@
|
||||
/* Charset conversion.
|
||||
Copyright (C) 2001-2007, 2010-2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible and Simon Josefsson.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "striconv.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
/* Get MB_LEN_MAX, CHAR_BIT. */
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "c-strcase.h"
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t) -1)
|
||||
#endif
|
||||
|
||||
|
||||
#if HAVE_ICONV
|
||||
|
||||
int
|
||||
mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
|
||||
char **resultp, size_t *lengthp)
|
||||
{
|
||||
# define tmpbufsize 4096
|
||||
size_t length;
|
||||
char *result;
|
||||
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
/* Set to the initial state. */
|
||||
iconv (cd, NULL, NULL, NULL, NULL);
|
||||
# endif
|
||||
|
||||
/* Determine the length we need. */
|
||||
{
|
||||
size_t count = 0;
|
||||
/* The alignment is needed when converting e.g. to glibc's WCHAR_T or
|
||||
libiconv's UCS-4-INTERNAL encoding. */
|
||||
union { unsigned int align; char buf[tmpbufsize]; } tmp;
|
||||
# define tmpbuf tmp.buf
|
||||
const char *inptr = src;
|
||||
size_t insize = srclen;
|
||||
|
||||
while (insize > 0)
|
||||
{
|
||||
char *outptr = tmpbuf;
|
||||
size_t outsize = tmpbufsize;
|
||||
size_t res = iconv (cd,
|
||||
(ICONV_CONST char **) &inptr, &insize,
|
||||
&outptr, &outsize);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
{
|
||||
if (errno == E2BIG)
|
||||
;
|
||||
else if (errno == EINVAL)
|
||||
break;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert.
|
||||
NetBSD iconv() inserts a question mark if it cannot convert.
|
||||
Only GNU libiconv and GNU libc are known to prefer to fail rather
|
||||
than doing a lossy conversion. */
|
||||
else if (res > 0)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
# endif
|
||||
count += outptr - tmpbuf;
|
||||
}
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
{
|
||||
char *outptr = tmpbuf;
|
||||
size_t outsize = tmpbufsize;
|
||||
size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
return -1;
|
||||
count += outptr - tmpbuf;
|
||||
}
|
||||
# endif
|
||||
length = count;
|
||||
# undef tmpbuf
|
||||
}
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
*lengthp = 0;
|
||||
return 0;
|
||||
}
|
||||
if (*resultp != NULL && *lengthp >= length)
|
||||
result = *resultp;
|
||||
else
|
||||
{
|
||||
result = (char *) malloc (length);
|
||||
if (result == NULL)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
/* Return to the initial state. */
|
||||
iconv (cd, NULL, NULL, NULL, NULL);
|
||||
# endif
|
||||
|
||||
/* Do the conversion for real. */
|
||||
{
|
||||
const char *inptr = src;
|
||||
size_t insize = srclen;
|
||||
char *outptr = result;
|
||||
size_t outsize = length;
|
||||
|
||||
while (insize > 0)
|
||||
{
|
||||
size_t res = iconv (cd,
|
||||
(ICONV_CONST char **) &inptr, &insize,
|
||||
&outptr, &outsize);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
break;
|
||||
else
|
||||
goto fail;
|
||||
}
|
||||
# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert.
|
||||
NetBSD iconv() inserts a question mark if it cannot convert.
|
||||
Only GNU libiconv and GNU libc are known to prefer to fail rather
|
||||
than doing a lossy conversion. */
|
||||
else if (res > 0)
|
||||
{
|
||||
errno = EILSEQ;
|
||||
goto fail;
|
||||
}
|
||||
# endif
|
||||
}
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
{
|
||||
size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
goto fail;
|
||||
}
|
||||
# endif
|
||||
if (outsize != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
*resultp = result;
|
||||
*lengthp = length;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
{
|
||||
if (result != *resultp)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (result);
|
||||
errno = saved_errno;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
# undef tmpbufsize
|
||||
}
|
||||
|
||||
char *
|
||||
str_cd_iconv (const char *src, iconv_t cd)
|
||||
{
|
||||
/* For most encodings, a trailing NUL byte in the input will be converted
|
||||
to a trailing NUL byte in the output. But not for UTF-7. So that this
|
||||
function is usable for UTF-7, we have to exclude the NUL byte from the
|
||||
conversion and add it by hand afterwards. */
|
||||
# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert.
|
||||
NetBSD iconv() inserts a question mark if it cannot convert.
|
||||
Only GNU libiconv and GNU libc are known to prefer to fail rather
|
||||
than doing a lossy conversion. For other iconv() implementations,
|
||||
we have to look at the number of irreversible conversions returned;
|
||||
but this information is lost when iconv() returns for an E2BIG reason.
|
||||
Therefore we cannot use the second, faster algorithm. */
|
||||
|
||||
char *result = NULL;
|
||||
size_t length = 0;
|
||||
int retval = mem_cd_iconv (src, strlen (src), cd, &result, &length);
|
||||
char *final_result;
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
if (result != NULL)
|
||||
abort ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Add the terminating NUL byte. */
|
||||
final_result =
|
||||
(result != NULL ? realloc (result, length + 1) : malloc (length + 1));
|
||||
if (final_result == NULL)
|
||||
{
|
||||
free (result);
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
final_result[length] = '\0';
|
||||
|
||||
return final_result;
|
||||
|
||||
# else
|
||||
/* This algorithm is likely faster than the one above. But it may produce
|
||||
iconv() returns for an E2BIG reason, when the output size guess is too
|
||||
small. Therefore it can only be used when we don't need the number of
|
||||
irreversible conversions performed. */
|
||||
char *result;
|
||||
size_t result_size;
|
||||
size_t length;
|
||||
const char *inptr = src;
|
||||
size_t inbytes_remaining = strlen (src);
|
||||
|
||||
/* Make a guess for the worst-case output size, in order to avoid a
|
||||
realloc. It's OK if the guess is wrong as long as it is not zero and
|
||||
doesn't lead to an integer overflow. */
|
||||
result_size = inbytes_remaining;
|
||||
{
|
||||
size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2);
|
||||
if (result_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX)
|
||||
result_size *= MB_LEN_MAX;
|
||||
}
|
||||
result_size += 1; /* for the terminating NUL */
|
||||
|
||||
result = (char *) malloc (result_size);
|
||||
if (result == NULL)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
/* Set to the initial state. */
|
||||
iconv (cd, NULL, NULL, NULL, NULL);
|
||||
# endif
|
||||
|
||||
/* Do the conversion. */
|
||||
{
|
||||
char *outptr = result;
|
||||
size_t outbytes_remaining = result_size - 1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* Here inptr + inbytes_remaining = src + strlen (src),
|
||||
outptr + outbytes_remaining = result + result_size - 1. */
|
||||
size_t res = iconv (cd,
|
||||
(ICONV_CONST char **) &inptr, &inbytes_remaining,
|
||||
&outptr, &outbytes_remaining);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
break;
|
||||
else if (errno == E2BIG)
|
||||
{
|
||||
size_t used = outptr - result;
|
||||
size_t newsize = result_size * 2;
|
||||
char *newresult;
|
||||
|
||||
if (!(newsize > result_size))
|
||||
{
|
||||
errno = ENOMEM;
|
||||
goto failed;
|
||||
}
|
||||
newresult = (char *) realloc (result, newsize);
|
||||
if (newresult == NULL)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
goto failed;
|
||||
}
|
||||
result = newresult;
|
||||
result_size = newsize;
|
||||
outptr = result + used;
|
||||
outbytes_remaining = result_size - 1 - used;
|
||||
}
|
||||
else
|
||||
goto failed;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
|| defined __sun)
|
||||
for (;;)
|
||||
{
|
||||
/* Here outptr + outbytes_remaining = result + result_size - 1. */
|
||||
size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining);
|
||||
|
||||
if (res == (size_t)(-1))
|
||||
{
|
||||
if (errno == E2BIG)
|
||||
{
|
||||
size_t used = outptr - result;
|
||||
size_t newsize = result_size * 2;
|
||||
char *newresult;
|
||||
|
||||
if (!(newsize > result_size))
|
||||
{
|
||||
errno = ENOMEM;
|
||||
goto failed;
|
||||
}
|
||||
newresult = (char *) realloc (result, newsize);
|
||||
if (newresult == NULL)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
goto failed;
|
||||
}
|
||||
result = newresult;
|
||||
result_size = newsize;
|
||||
outptr = result + used;
|
||||
outbytes_remaining = result_size - 1 - used;
|
||||
}
|
||||
else
|
||||
goto failed;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
# endif
|
||||
|
||||
/* Add the terminating NUL byte. */
|
||||
*outptr++ = '\0';
|
||||
|
||||
length = outptr - result;
|
||||
}
|
||||
|
||||
/* Give away unused memory. */
|
||||
if (length < result_size)
|
||||
{
|
||||
char *smaller_result = (char *) realloc (result, length);
|
||||
|
||||
if (smaller_result != NULL)
|
||||
result = smaller_result;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
failed:
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (result);
|
||||
errno = saved_errno;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
char *
|
||||
str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
|
||||
{
|
||||
if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
|
||||
{
|
||||
char *result = strdup (src);
|
||||
|
||||
if (result == NULL)
|
||||
errno = ENOMEM;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *result;
|
||||
|
||||
/* Avoid glibc-2.1 bug with EUC-KR. */
|
||||
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
|
||||
&& !defined _LIBICONV_VERSION
|
||||
if (c_strcasecmp (from_codeset, "EUC-KR") == 0
|
||||
|| c_strcasecmp (to_codeset, "EUC-KR") == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
# endif
|
||||
cd = iconv_open (to_codeset, from_codeset);
|
||||
if (cd == (iconv_t) -1)
|
||||
return NULL;
|
||||
|
||||
result = str_cd_iconv (src, cd);
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
/* Close cd, but preserve the errno from str_cd_iconv. */
|
||||
int saved_errno = errno;
|
||||
iconv_close (cd);
|
||||
errno = saved_errno;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iconv_close (cd) < 0)
|
||||
{
|
||||
/* Return NULL, but free the allocated memory, and while doing
|
||||
that, preserve the errno from iconv_close. */
|
||||
int saved_errno = errno;
|
||||
free (result);
|
||||
errno = saved_errno;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
#else
|
||||
/* This is a different error code than if iconv_open existed but didn't
|
||||
support from_codeset and to_codeset, so that the caller can emit
|
||||
an error message such as
|
||||
"iconv() is not supported. Installing GNU libiconv and
|
||||
then reinstalling this package would fix this." */
|
||||
errno = ENOSYS;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
76
lib/striconv.h
Normal file
76
lib/striconv.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* Charset conversion.
|
||||
Copyright (C) 2001-2004, 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible and Simon Josefsson.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _STRICONV_H
|
||||
#define _STRICONV_H
|
||||
|
||||
#include <stddef.h>
|
||||
#if HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if HAVE_ICONV
|
||||
|
||||
/* Convert an entire string from one encoding to another, using iconv.
|
||||
The original string is at [SRC,...,SRC+SRCLEN-1].
|
||||
The conversion descriptor is passed as CD.
|
||||
*RESULTP and *LENGTH should initially be a scratch buffer and its size,
|
||||
or *RESULTP can initially be NULL.
|
||||
May erase the contents of the memory at *RESULTP.
|
||||
Return value: 0 if successful, otherwise -1 and errno set.
|
||||
If successful: The resulting string is stored in *RESULTP and its length
|
||||
in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is
|
||||
unchanged if no dynamic memory allocation was necessary. */
|
||||
extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
|
||||
char **resultp, size_t *lengthp);
|
||||
|
||||
/* Convert an entire string from one encoding to another, using iconv.
|
||||
The original string is the NUL-terminated string starting at SRC.
|
||||
The conversion descriptor is passed as CD. Both the "from" and the "to"
|
||||
encoding must use a single NUL byte at the end of the string (i.e. not
|
||||
UCS-2, UCS-4, UTF-16, UTF-32).
|
||||
Allocate a malloced memory block for the result.
|
||||
Return value: the freshly allocated resulting NUL-terminated string if
|
||||
successful, otherwise NULL and errno set. */
|
||||
extern char * str_cd_iconv (const char *src, iconv_t cd);
|
||||
|
||||
#endif
|
||||
|
||||
/* Convert an entire string from one encoding to another, using iconv.
|
||||
The original string is the NUL-terminated string starting at SRC.
|
||||
Both the "from" and the "to" encoding must use a single NUL byte at the
|
||||
end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32).
|
||||
Allocate a malloced memory block for the result.
|
||||
Return value: the freshly allocated resulting NUL-terminated string if
|
||||
successful, otherwise NULL and errno set. */
|
||||
extern char * str_iconv (const char *src,
|
||||
const char *from_codeset, const char *to_codeset);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _STRICONV_H */
|
35
lib/strnlen1.c
Normal file
35
lib/strnlen1.c
Normal file
@ -0,0 +1,35 @@
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
Copyright (C) 2005-2006, 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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "strnlen1.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
||||
/* This is the same as strnlen (string, maxlen - 1) + 1. */
|
||||
size_t
|
||||
strnlen1 (const char *string, size_t maxlen)
|
||||
{
|
||||
const char *end = (const char *) memchr (string, '\0', maxlen);
|
||||
if (end != NULL)
|
||||
return end - string + 1;
|
||||
else
|
||||
return maxlen;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Set the error indicator of a stream.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
Copyright (C) 2005, 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
|
||||
@ -14,24 +14,26 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FSETERR_H
|
||||
#define _FSETERR_H
|
||||
#ifndef _STRNLEN1_H
|
||||
#define _STRNLEN1_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Set the error indicator of the stream FP.
|
||||
The "error indicator" is set when an I/O operation on the stream fails, and
|
||||
is cleared (together with the "end-of-file" indicator) by clearerr (FP). */
|
||||
extern void fseterr (FILE *fp);
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
||||
/* This is the same as strnlen (string, maxlen - 1) + 1. */
|
||||
extern size_t strnlen1 (const char *string, size_t maxlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FSETERR_H */
|
||||
|
||||
#endif /* _STRNLEN1_H */
|
@ -85,7 +85,8 @@
|
||||
/* mingw declares getcwd in <io.h>, not in <unistd.h>. */
|
||||
#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
|
||||
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
|
||||
# include <io.h>
|
||||
# include <io.h> /* mingw32, mingw64 */
|
||||
# include <direct.h> /* mingw64 */
|
||||
#endif
|
||||
|
||||
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
|
||||
|
692
lib/unistr.in.h
Normal file
692
lib/unistr.in.h
Normal file
@ -0,0 +1,692 @@
|
||||
/* Elementary Unicode string functions.
|
||||
Copyright (C) 2001-2002, 2005-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/>. */
|
||||
|
||||
#ifndef _UNISTR_H
|
||||
#define _UNISTR_H
|
||||
|
||||
#include "unitypes.h"
|
||||
|
||||
/* Get common macros for C. */
|
||||
#include "unused-parameter.h"
|
||||
|
||||
/* Get bool. */
|
||||
#include <stdbool.h>
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Conventions:
|
||||
|
||||
All functions prefixed with u8_ operate on UTF-8 encoded strings.
|
||||
Their unit is an uint8_t (1 byte).
|
||||
|
||||
All functions prefixed with u16_ operate on UTF-16 encoded strings.
|
||||
Their unit is an uint16_t (a 2-byte word).
|
||||
|
||||
All functions prefixed with u32_ operate on UCS-4 encoded strings.
|
||||
Their unit is an uint32_t (a 4-byte word).
|
||||
|
||||
All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly
|
||||
n units.
|
||||
|
||||
All arguments starting with "str" and the arguments of functions starting
|
||||
with u8_str/u16_str/u32_str denote a NUL terminated string, i.e. a string
|
||||
which terminates at the first NUL unit. This termination unit is
|
||||
considered part of the string for all memory allocation purposes, but
|
||||
is not considered part of the string for all other logical purposes.
|
||||
|
||||
Functions returning a string result take a (resultbuf, lengthp) argument
|
||||
pair. If resultbuf is not NULL and the result fits into *lengthp units,
|
||||
it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly
|
||||
allocated string is returned. In both cases, *lengthp is set to the
|
||||
length (number of units) of the returned string. In case of error,
|
||||
NULL is returned and errno is set. */
|
||||
|
||||
|
||||
/* Elementary string checks. */
|
||||
|
||||
/* Check whether an UTF-8 string is well-formed.
|
||||
Return NULL if valid, or a pointer to the first invalid unit otherwise. */
|
||||
extern const uint8_t *
|
||||
u8_check (const uint8_t *s, size_t n);
|
||||
|
||||
/* Check whether an UTF-16 string is well-formed.
|
||||
Return NULL if valid, or a pointer to the first invalid unit otherwise. */
|
||||
extern const uint16_t *
|
||||
u16_check (const uint16_t *s, size_t n);
|
||||
|
||||
/* Check whether an UCS-4 string is well-formed.
|
||||
Return NULL if valid, or a pointer to the first invalid unit otherwise. */
|
||||
extern const uint32_t *
|
||||
u32_check (const uint32_t *s, size_t n);
|
||||
|
||||
|
||||
/* Elementary string conversions. */
|
||||
|
||||
/* Convert an UTF-8 string to an UTF-16 string. */
|
||||
extern uint16_t *
|
||||
u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
/* Convert an UTF-8 string to an UCS-4 string. */
|
||||
extern uint32_t *
|
||||
u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
/* Convert an UTF-16 string to an UTF-8 string. */
|
||||
extern uint8_t *
|
||||
u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
/* Convert an UTF-16 string to an UCS-4 string. */
|
||||
extern uint32_t *
|
||||
u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
/* Convert an UCS-4 string to an UTF-8 string. */
|
||||
extern uint8_t *
|
||||
u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
/* Convert an UCS-4 string to an UTF-16 string. */
|
||||
extern uint16_t *
|
||||
u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf,
|
||||
size_t *lengthp);
|
||||
|
||||
|
||||
/* Elementary string functions. */
|
||||
|
||||
/* Return the length (number of units) of the first character in S, which is
|
||||
no longer than N. Return 0 if it is the NUL character. Return -1 upon
|
||||
failure. */
|
||||
/* Similar to mblen(), except that s must not be NULL. */
|
||||
extern int
|
||||
u8_mblen (const uint8_t *s, size_t n);
|
||||
extern int
|
||||
u16_mblen (const uint16_t *s, size_t n);
|
||||
extern int
|
||||
u32_mblen (const uint32_t *s, size_t n);
|
||||
|
||||
/* Return the length (number of units) of the first character in S, putting
|
||||
its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd,
|
||||
and an appropriate number of units is returned.
|
||||
The number of available units, N, must be > 0. */
|
||||
/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0,
|
||||
and the NUL character is not treated specially. */
|
||||
/* The variants with _safe suffix are safe, even if the library is compiled
|
||||
without --enable-safety. */
|
||||
|
||||
#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
|
||||
# else
|
||||
extern int
|
||||
u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n);
|
||||
static inline int
|
||||
u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
|
||||
{
|
||||
uint8_t c = *s;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
*puc = c;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u8_mbtouc_unsafe_aux (puc, s, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
|
||||
# else
|
||||
extern int
|
||||
u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n);
|
||||
static inline int
|
||||
u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
|
||||
{
|
||||
uint16_t c = *s;
|
||||
|
||||
if (c < 0xd800 || c >= 0xe000)
|
||||
{
|
||||
*puc = c;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u16_mbtouc_unsafe_aux (puc, s, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
|
||||
# else
|
||||
static inline int
|
||||
u32_mbtouc_unsafe (ucs4_t *puc,
|
||||
const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
|
||||
{
|
||||
uint32_t c = *s;
|
||||
|
||||
# if CONFIG_UNICODE_SAFETY
|
||||
if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
|
||||
# endif
|
||||
*puc = c;
|
||||
# if CONFIG_UNICODE_SAFETY
|
||||
else
|
||||
/* invalid multibyte character */
|
||||
*puc = 0xfffd;
|
||||
# endif
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
|
||||
# else
|
||||
extern int
|
||||
u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n);
|
||||
static inline int
|
||||
u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
|
||||
{
|
||||
uint8_t c = *s;
|
||||
|
||||
if (c < 0x80)
|
||||
{
|
||||
*puc = c;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u8_mbtouc_aux (puc, s, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
|
||||
# else
|
||||
extern int
|
||||
u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n);
|
||||
static inline int
|
||||
u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
|
||||
{
|
||||
uint16_t c = *s;
|
||||
|
||||
if (c < 0xd800 || c >= 0xe000)
|
||||
{
|
||||
*puc = c;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u16_mbtouc_aux (puc, s, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
|
||||
# else
|
||||
static inline int
|
||||
u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
|
||||
{
|
||||
uint32_t c = *s;
|
||||
|
||||
if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
|
||||
*puc = c;
|
||||
else
|
||||
/* invalid multibyte character */
|
||||
*puc = 0xfffd;
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Return the length (number of units) of the first character in S, putting
|
||||
its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd,
|
||||
and -1 is returned for an invalid sequence of units, -2 is returned for an
|
||||
incomplete sequence of units.
|
||||
The number of available units, N, must be > 0. */
|
||||
/* Similar to u*_mbtouc(), except that the return value gives more details
|
||||
about the failure, similar to mbrtowc(). */
|
||||
|
||||
#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
|
||||
extern int
|
||||
u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
|
||||
extern int
|
||||
u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
|
||||
extern int
|
||||
u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
|
||||
#endif
|
||||
|
||||
/* Put the multibyte character represented by UC in S, returning its
|
||||
length. Return -1 upon failure, -2 if the number of available units, N,
|
||||
is too small. The latter case cannot occur if N >= 6/2/1, respectively. */
|
||||
/* Similar to wctomb(), except that s must not be NULL, and the argument n
|
||||
must be specified. */
|
||||
|
||||
#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
|
||||
/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */
|
||||
extern int
|
||||
u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u8_uctomb (uint8_t *s, ucs4_t uc, int n);
|
||||
# else
|
||||
static inline int
|
||||
u8_uctomb (uint8_t *s, ucs4_t uc, int n)
|
||||
{
|
||||
if (uc < 0x80 && n > 0)
|
||||
{
|
||||
s[0] = uc;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u8_uctomb_aux (s, uc, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
|
||||
/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */
|
||||
extern int
|
||||
u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u16_uctomb (uint16_t *s, ucs4_t uc, int n);
|
||||
# else
|
||||
static inline int
|
||||
u16_uctomb (uint16_t *s, ucs4_t uc, int n)
|
||||
{
|
||||
if (uc < 0xd800 && n > 0)
|
||||
{
|
||||
s[0] = uc;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return u16_uctomb_aux (s, uc, n);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
|
||||
# if !HAVE_INLINE
|
||||
extern int
|
||||
u32_uctomb (uint32_t *s, ucs4_t uc, int n);
|
||||
# else
|
||||
static inline int
|
||||
u32_uctomb (uint32_t *s, ucs4_t uc, int n)
|
||||
{
|
||||
if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000))
|
||||
{
|
||||
if (n > 0)
|
||||
{
|
||||
*s = uc;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Copy N units from SRC to DEST. */
|
||||
/* Similar to memcpy(). */
|
||||
extern uint8_t *
|
||||
u8_cpy (uint8_t *dest, const uint8_t *src, size_t n);
|
||||
extern uint16_t *
|
||||
u16_cpy (uint16_t *dest, const uint16_t *src, size_t n);
|
||||
extern uint32_t *
|
||||
u32_cpy (uint32_t *dest, const uint32_t *src, size_t n);
|
||||
|
||||
/* Copy N units from SRC to DEST, guaranteeing correct behavior for
|
||||
overlapping memory areas. */
|
||||
/* Similar to memmove(). */
|
||||
extern uint8_t *
|
||||
u8_move (uint8_t *dest, const uint8_t *src, size_t n);
|
||||
extern uint16_t *
|
||||
u16_move (uint16_t *dest, const uint16_t *src, size_t n);
|
||||
extern uint32_t *
|
||||
u32_move (uint32_t *dest, const uint32_t *src, size_t n);
|
||||
|
||||
/* Set the first N characters of S to UC. UC should be a character that
|
||||
occupies only 1 unit. */
|
||||
/* Similar to memset(). */
|
||||
extern uint8_t *
|
||||
u8_set (uint8_t *s, ucs4_t uc, size_t n);
|
||||
extern uint16_t *
|
||||
u16_set (uint16_t *s, ucs4_t uc, size_t n);
|
||||
extern uint32_t *
|
||||
u32_set (uint32_t *s, ucs4_t uc, size_t n);
|
||||
|
||||
/* Compare S1 and S2, each of length N. */
|
||||
/* Similar to memcmp(). */
|
||||
extern int
|
||||
u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n);
|
||||
extern int
|
||||
u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n);
|
||||
extern int
|
||||
u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n);
|
||||
|
||||
/* Compare S1 and S2. */
|
||||
/* Similar to the gnulib function memcmp2(). */
|
||||
extern int
|
||||
u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2);
|
||||
extern int
|
||||
u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2);
|
||||
extern int
|
||||
u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2);
|
||||
|
||||
/* Search the string at S for UC. */
|
||||
/* Similar to memchr(). */
|
||||
extern uint8_t *
|
||||
u8_chr (const uint8_t *s, size_t n, ucs4_t uc);
|
||||
extern uint16_t *
|
||||
u16_chr (const uint16_t *s, size_t n, ucs4_t uc);
|
||||
extern uint32_t *
|
||||
u32_chr (const uint32_t *s, size_t n, ucs4_t uc);
|
||||
|
||||
/* Count the number of Unicode characters in the N units from S. */
|
||||
/* Similar to mbsnlen(). */
|
||||
extern size_t
|
||||
u8_mbsnlen (const uint8_t *s, size_t n);
|
||||
extern size_t
|
||||
u16_mbsnlen (const uint16_t *s, size_t n);
|
||||
extern size_t
|
||||
u32_mbsnlen (const uint32_t *s, size_t n);
|
||||
|
||||
/* Elementary string functions with memory allocation. */
|
||||
|
||||
/* Make a freshly allocated copy of S, of length N. */
|
||||
extern uint8_t *
|
||||
u8_cpy_alloc (const uint8_t *s, size_t n);
|
||||
extern uint16_t *
|
||||
u16_cpy_alloc (const uint16_t *s, size_t n);
|
||||
extern uint32_t *
|
||||
u32_cpy_alloc (const uint32_t *s, size_t n);
|
||||
|
||||
/* Elementary string functions on NUL terminated strings. */
|
||||
|
||||
/* Return the length (number of units) of the first character in S.
|
||||
Return 0 if it is the NUL character. Return -1 upon failure. */
|
||||
extern int
|
||||
u8_strmblen (const uint8_t *s);
|
||||
extern int
|
||||
u16_strmblen (const uint16_t *s);
|
||||
extern int
|
||||
u32_strmblen (const uint32_t *s);
|
||||
|
||||
/* Return the length (number of units) of the first character in S, putting
|
||||
its 'ucs4_t' representation in *PUC. Return 0 if it is the NUL
|
||||
character. Return -1 upon failure. */
|
||||
extern int
|
||||
u8_strmbtouc (ucs4_t *puc, const uint8_t *s);
|
||||
extern int
|
||||
u16_strmbtouc (ucs4_t *puc, const uint16_t *s);
|
||||
extern int
|
||||
u32_strmbtouc (ucs4_t *puc, const uint32_t *s);
|
||||
|
||||
/* Forward iteration step. Advances the pointer past the next character,
|
||||
or returns NULL if the end of the string has been reached. Puts the
|
||||
character's 'ucs4_t' representation in *PUC. */
|
||||
extern const uint8_t *
|
||||
u8_next (ucs4_t *puc, const uint8_t *s);
|
||||
extern const uint16_t *
|
||||
u16_next (ucs4_t *puc, const uint16_t *s);
|
||||
extern const uint32_t *
|
||||
u32_next (ucs4_t *puc, const uint32_t *s);
|
||||
|
||||
/* Backward iteration step. Advances the pointer to point to the previous
|
||||
character, or returns NULL if the beginning of the string had been reached.
|
||||
Puts the character's 'ucs4_t' representation in *PUC. */
|
||||
extern const uint8_t *
|
||||
u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start);
|
||||
extern const uint16_t *
|
||||
u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start);
|
||||
extern const uint32_t *
|
||||
u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start);
|
||||
|
||||
/* Return the number of units in S. */
|
||||
/* Similar to strlen(), wcslen(). */
|
||||
extern size_t
|
||||
u8_strlen (const uint8_t *s);
|
||||
extern size_t
|
||||
u16_strlen (const uint16_t *s);
|
||||
extern size_t
|
||||
u32_strlen (const uint32_t *s);
|
||||
|
||||
/* Return the number of units in S, but at most MAXLEN. */
|
||||
/* Similar to strnlen(), wcsnlen(). */
|
||||
extern size_t
|
||||
u8_strnlen (const uint8_t *s, size_t maxlen);
|
||||
extern size_t
|
||||
u16_strnlen (const uint16_t *s, size_t maxlen);
|
||||
extern size_t
|
||||
u32_strnlen (const uint32_t *s, size_t maxlen);
|
||||
|
||||
/* Copy SRC to DEST. */
|
||||
/* Similar to strcpy(), wcscpy(). */
|
||||
extern uint8_t *
|
||||
u8_strcpy (uint8_t *dest, const uint8_t *src);
|
||||
extern uint16_t *
|
||||
u16_strcpy (uint16_t *dest, const uint16_t *src);
|
||||
extern uint32_t *
|
||||
u32_strcpy (uint32_t *dest, const uint32_t *src);
|
||||
|
||||
/* Copy SRC to DEST, returning the address of the terminating NUL in DEST. */
|
||||
/* Similar to stpcpy(). */
|
||||
extern uint8_t *
|
||||
u8_stpcpy (uint8_t *dest, const uint8_t *src);
|
||||
extern uint16_t *
|
||||
u16_stpcpy (uint16_t *dest, const uint16_t *src);
|
||||
extern uint32_t *
|
||||
u32_stpcpy (uint32_t *dest, const uint32_t *src);
|
||||
|
||||
/* Copy no more than N units of SRC to DEST. */
|
||||
/* Similar to strncpy(), wcsncpy(). */
|
||||
extern uint8_t *
|
||||
u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n);
|
||||
extern uint16_t *
|
||||
u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n);
|
||||
extern uint32_t *
|
||||
u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n);
|
||||
|
||||
/* Copy no more than N units of SRC to DEST. Return a pointer past the last
|
||||
non-NUL unit written into DEST. */
|
||||
/* Similar to stpncpy(). */
|
||||
extern uint8_t *
|
||||
u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n);
|
||||
extern uint16_t *
|
||||
u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n);
|
||||
extern uint32_t *
|
||||
u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n);
|
||||
|
||||
/* Append SRC onto DEST. */
|
||||
/* Similar to strcat(), wcscat(). */
|
||||
extern uint8_t *
|
||||
u8_strcat (uint8_t *dest, const uint8_t *src);
|
||||
extern uint16_t *
|
||||
u16_strcat (uint16_t *dest, const uint16_t *src);
|
||||
extern uint32_t *
|
||||
u32_strcat (uint32_t *dest, const uint32_t *src);
|
||||
|
||||
/* Append no more than N units of SRC onto DEST. */
|
||||
/* Similar to strncat(), wcsncat(). */
|
||||
extern uint8_t *
|
||||
u8_strncat (uint8_t *dest, const uint8_t *src, size_t n);
|
||||
extern uint16_t *
|
||||
u16_strncat (uint16_t *dest, const uint16_t *src, size_t n);
|
||||
extern uint32_t *
|
||||
u32_strncat (uint32_t *dest, const uint32_t *src, size_t n);
|
||||
|
||||
/* Compare S1 and S2. */
|
||||
/* Similar to strcmp(), wcscmp(). */
|
||||
#ifdef __sun
|
||||
/* Avoid a collision with the u8_strcmp() function in Solaris 11 libc. */
|
||||
extern int
|
||||
u8_strcmp_gnu (const uint8_t *s1, const uint8_t *s2);
|
||||
# define u8_strcmp u8_strcmp_gnu
|
||||
#else
|
||||
extern int
|
||||
u8_strcmp (const uint8_t *s1, const uint8_t *s2);
|
||||
#endif
|
||||
extern int
|
||||
u16_strcmp (const uint16_t *s1, const uint16_t *s2);
|
||||
extern int
|
||||
u32_strcmp (const uint32_t *s1, const uint32_t *s2);
|
||||
|
||||
/* Compare S1 and S2 using the collation rules of the current locale.
|
||||
Return -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2.
|
||||
Upon failure, set errno and return any value. */
|
||||
/* Similar to strcoll(), wcscoll(). */
|
||||
extern int
|
||||
u8_strcoll (const uint8_t *s1, const uint8_t *s2);
|
||||
extern int
|
||||
u16_strcoll (const uint16_t *s1, const uint16_t *s2);
|
||||
extern int
|
||||
u32_strcoll (const uint32_t *s1, const uint32_t *s2);
|
||||
|
||||
/* Compare no more than N units of S1 and S2. */
|
||||
/* Similar to strncmp(), wcsncmp(). */
|
||||
extern int
|
||||
u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n);
|
||||
extern int
|
||||
u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n);
|
||||
extern int
|
||||
u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n);
|
||||
|
||||
/* Duplicate S, returning an identical malloc'd string. */
|
||||
/* Similar to strdup(), wcsdup(). */
|
||||
extern uint8_t *
|
||||
u8_strdup (const uint8_t *s);
|
||||
extern uint16_t *
|
||||
u16_strdup (const uint16_t *s);
|
||||
extern uint32_t *
|
||||
u32_strdup (const uint32_t *s);
|
||||
|
||||
/* Find the first occurrence of UC in STR. */
|
||||
/* Similar to strchr(), wcschr(). */
|
||||
extern uint8_t *
|
||||
u8_strchr (const uint8_t *str, ucs4_t uc);
|
||||
extern uint16_t *
|
||||
u16_strchr (const uint16_t *str, ucs4_t uc);
|
||||
extern uint32_t *
|
||||
u32_strchr (const uint32_t *str, ucs4_t uc);
|
||||
|
||||
/* Find the last occurrence of UC in STR. */
|
||||
/* Similar to strrchr(), wcsrchr(). */
|
||||
extern uint8_t *
|
||||
u8_strrchr (const uint8_t *str, ucs4_t uc);
|
||||
extern uint16_t *
|
||||
u16_strrchr (const uint16_t *str, ucs4_t uc);
|
||||
extern uint32_t *
|
||||
u32_strrchr (const uint32_t *str, ucs4_t uc);
|
||||
|
||||
/* Return the length of the initial segment of STR which consists entirely
|
||||
of Unicode characters not in REJECT. */
|
||||
/* Similar to strcspn(), wcscspn(). */
|
||||
extern size_t
|
||||
u8_strcspn (const uint8_t *str, const uint8_t *reject);
|
||||
extern size_t
|
||||
u16_strcspn (const uint16_t *str, const uint16_t *reject);
|
||||
extern size_t
|
||||
u32_strcspn (const uint32_t *str, const uint32_t *reject);
|
||||
|
||||
/* Return the length of the initial segment of STR which consists entirely
|
||||
of Unicode characters in ACCEPT. */
|
||||
/* Similar to strspn(), wcsspn(). */
|
||||
extern size_t
|
||||
u8_strspn (const uint8_t *str, const uint8_t *accept);
|
||||
extern size_t
|
||||
u16_strspn (const uint16_t *str, const uint16_t *accept);
|
||||
extern size_t
|
||||
u32_strspn (const uint32_t *str, const uint32_t *accept);
|
||||
|
||||
/* Find the first occurrence in STR of any character in ACCEPT. */
|
||||
/* Similar to strpbrk(), wcspbrk(). */
|
||||
extern uint8_t *
|
||||
u8_strpbrk (const uint8_t *str, const uint8_t *accept);
|
||||
extern uint16_t *
|
||||
u16_strpbrk (const uint16_t *str, const uint16_t *accept);
|
||||
extern uint32_t *
|
||||
u32_strpbrk (const uint32_t *str, const uint32_t *accept);
|
||||
|
||||
/* Find the first occurrence of NEEDLE in HAYSTACK. */
|
||||
/* Similar to strstr(), wcsstr(). */
|
||||
extern uint8_t *
|
||||
u8_strstr (const uint8_t *haystack, const uint8_t *needle);
|
||||
extern uint16_t *
|
||||
u16_strstr (const uint16_t *haystack, const uint16_t *needle);
|
||||
extern uint32_t *
|
||||
u32_strstr (const uint32_t *haystack, const uint32_t *needle);
|
||||
|
||||
/* Test whether STR starts with PREFIX. */
|
||||
extern bool
|
||||
u8_startswith (const uint8_t *str, const uint8_t *prefix);
|
||||
extern bool
|
||||
u16_startswith (const uint16_t *str, const uint16_t *prefix);
|
||||
extern bool
|
||||
u32_startswith (const uint32_t *str, const uint32_t *prefix);
|
||||
|
||||
/* Test whether STR ends with SUFFIX. */
|
||||
extern bool
|
||||
u8_endswith (const uint8_t *str, const uint8_t *suffix);
|
||||
extern bool
|
||||
u16_endswith (const uint16_t *str, const uint16_t *suffix);
|
||||
extern bool
|
||||
u32_endswith (const uint32_t *str, const uint32_t *suffix);
|
||||
|
||||
/* Divide STR into tokens separated by characters in DELIM.
|
||||
This interface is actually more similar to wcstok than to strtok. */
|
||||
/* Similar to strtok_r(), wcstok(). */
|
||||
extern uint8_t *
|
||||
u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr);
|
||||
extern uint16_t *
|
||||
u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr);
|
||||
extern uint32_t *
|
||||
u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _UNISTR_H */
|
@ -1,6 +1,5 @@
|
||||
/* Concatenate strings.
|
||||
Copyright (C) 1999, 2002, 2006, 2010-2011 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2002.
|
||||
/* Elementary types for the GNU UniString library.
|
||||
Copyright (C) 2002, 2005-2006, 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
|
||||
@ -15,19 +14,13 @@
|
||||
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>
|
||||
#ifndef _UNITYPES_H
|
||||
#define _UNITYPES_H
|
||||
|
||||
/* Specification. */
|
||||
#include <string.h>
|
||||
/* Get uint8_t, uint16_t, uint32_t. */
|
||||
#include <stdint.h>
|
||||
|
||||
char *
|
||||
strncat (char *dest, const char *src, size_t n)
|
||||
{
|
||||
char *destptr = dest + strlen (dest);
|
||||
/* Type representing a Unicode character. */
|
||||
typedef uint32_t ucs4_t;
|
||||
|
||||
for (; n > 0 && (*destptr = *src) != '\0'; src++, destptr++, n--)
|
||||
;
|
||||
if (n == 0)
|
||||
*destptr = '\0';
|
||||
return dest;
|
||||
}
|
||||
#endif /* _UNITYPES_H */
|
5578
lib/vasnprintf.c
5578
lib/vasnprintf.c
File diff suppressed because it is too large
Load Diff
@ -1,80 +0,0 @@
|
||||
/* vsprintf with automatic memory allocation.
|
||||
Copyright (C) 2002-2004, 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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _VASNPRINTF_H
|
||||
#define _VASNPRINTF_H
|
||||
|
||||
/* Get va_list. */
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
The __-protected variants of the attributes 'format' and 'printf' are
|
||||
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
|
||||
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
|
||||
gnulib and libintl do '#define printf __printf__' when they override
|
||||
the 'printf' function. */
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
If successful, return the address of the string (this may be = RESULTBUF
|
||||
if no dynamic memory allocation was necessary) and set *LENGTHP to the
|
||||
number of resulting bytes, excluding the trailing NUL. Upon error, set
|
||||
errno and return NULL.
|
||||
|
||||
When dynamic memory allocation occurs, the preallocated buffer is left
|
||||
alone (with possibly modified contents). This makes it possible to use
|
||||
a statically allocated or stack-allocated buffer, like this:
|
||||
|
||||
char buf[100];
|
||||
size_t len = sizeof (buf);
|
||||
char *output = vasnprintf (buf, &len, format, args);
|
||||
if (output == NULL)
|
||||
... error handling ...;
|
||||
else
|
||||
{
|
||||
... use the output string ...;
|
||||
if (output != buf)
|
||||
free (output);
|
||||
}
|
||||
*/
|
||||
#if REPLACE_VASNPRINTF
|
||||
# define asnprintf rpl_asnprintf
|
||||
# define vasnprintf rpl_vasnprintf
|
||||
#endif
|
||||
extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
|
||||
extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _VASNPRINTF_H */
|
@ -1,74 +0,0 @@
|
||||
/* Formatted output to a stream.
|
||||
Copyright (C) 2004, 2006-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/>. */
|
||||
|
||||
#if 1
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "fseterr.h"
|
||||
#include "vasnprintf.h"
|
||||
|
||||
/* Print formatted output to the stream FP.
|
||||
Return string length of formatted string. On error, return a negative
|
||||
value. */
|
||||
int
|
||||
vfprintf (FILE *fp, const char *format, va_list args)
|
||||
{
|
||||
char buf[2000];
|
||||
char *output;
|
||||
size_t len;
|
||||
size_t lenbuf = sizeof (buf);
|
||||
|
||||
output = vasnprintf (buf, &lenbuf, format, args);
|
||||
len = lenbuf;
|
||||
|
||||
if (!output)
|
||||
{
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fwrite (output, 1, len, fp) < len)
|
||||
{
|
||||
if (output != buf)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (output);
|
||||
errno = saved_errno;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (output != buf)
|
||||
free (output);
|
||||
|
||||
if (len > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
fseterr (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
/* Formatted output to strings.
|
||||
Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
|
||||
Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
|
||||
|
||||
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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#if 1
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "vasnprintf.h"
|
||||
|
||||
/* Print formatted output to string STR. Similar to vsprintf, but
|
||||
additional length SIZE limit how much is written into STR. Returns
|
||||
string length of formatted string (which may be larger than SIZE).
|
||||
STR may be NULL, in which case nothing will be written. On error,
|
||||
return a negative value. */
|
||||
int
|
||||
vsnprintf (char *str, size_t size, const char *format, va_list args)
|
||||
{
|
||||
char *output;
|
||||
size_t len;
|
||||
size_t lenbuf = size;
|
||||
|
||||
output = vasnprintf (str, &lenbuf, format, args);
|
||||
len = lenbuf;
|
||||
|
||||
if (!output)
|
||||
return -1;
|
||||
|
||||
if (output != str)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
size_t pruned_len = (len < size ? len : size - 1);
|
||||
memcpy (str, output, pruned_len);
|
||||
str[pruned_len] = '\0';
|
||||
}
|
||||
|
||||
free (output);
|
||||
}
|
||||
|
||||
if (len > INT_MAX)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
53
lib/wcrtomb.c
Normal file
53
lib/wcrtomb.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* Convert wide character to multibyte character.
|
||||
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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
size_t
|
||||
wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
|
||||
{
|
||||
/* This implementation of wcrtomb on top of wctomb() supports only
|
||||
stateless encodings. ps must be in the initial state. */
|
||||
if (ps != NULL && !mbsinit (ps))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (size_t)(-1);
|
||||
}
|
||||
|
||||
if (s == NULL)
|
||||
/* We know the NUL wide character corresponds to the NUL character. */
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
int ret = wctomb (s, wc);
|
||||
|
||||
if (ret >= 0)
|
||||
return ret;
|
||||
else
|
||||
{
|
||||
errno = EILSEQ;
|
||||
return (size_t)(-1);
|
||||
}
|
||||
}
|
||||
}
|
29
lib/wcsdup-impl.h
Normal file
29
lib/wcsdup-impl.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* 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;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* 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
|
||||
@ -14,7 +15,11 @@
|
||||
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>
|
||||
|
||||
#define USE_FLOAT
|
||||
#include "isnan.c"
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "wcsdup-impl.h"
|
38
lib/wctob.c
Normal file
38
lib/wctob.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Convert wide character to unibyte character.
|
||||
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/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
wctob (wint_t wc)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
if (!(MB_CUR_MAX <= sizeof (buf)))
|
||||
abort ();
|
||||
/* Handle the case where WEOF is a value that does not fit in a wchar_t. */
|
||||
if (wc == (wchar_t)wc)
|
||||
if (wctomb (buf, (wchar_t)wc) == 1)
|
||||
return (unsigned char) buf[0];
|
||||
return EOF;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
/* Split a double into fraction and mantissa, for hexadecimal printf.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Convert wide character to multibyte 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
|
||||
@ -14,10 +15,20 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Write a finite, positive number x as
|
||||
x = mantissa * 2^exp
|
||||
where exp >= DBL_MIN_EXP - 1,
|
||||
mantissa < 2.0,
|
||||
if x is not a denormalized number then mantissa >= 1.0.
|
||||
Store exp in *EXPPTR and return mantissa. */
|
||||
extern double printf_frexp (double x, int *expptr);
|
||||
int
|
||||
wctomb (char *s, wchar_t wc)
|
||||
{
|
||||
if (s == NULL)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
mbstate_t state;
|
||||
size_t result;
|
||||
|
||||
memset (&state, 0, sizeof (mbstate_t));
|
||||
result = wcrtomb (s, wc, &state);
|
||||
if (result == (size_t)-1)
|
||||
return -1;
|
||||
return result;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||
/* Convert wide character to multibyte 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
|
||||
@ -14,6 +15,11 @@
|
||||
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>, 2008. */
|
||||
#include <config.h>
|
||||
|
||||
#include "isnan.c"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "wctomb-impl.h"
|
487
lib/wctype.in.h
Normal file
487
lib/wctype.in.h
Normal file
@ -0,0 +1,487 @@
|
||||
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
|
||||
|
||||
Copyright (C) 2006-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Bruno Haible and Paul Eggert. */
|
||||
|
||||
/*
|
||||
* ISO C 99 <wctype.h> for platforms that lack it.
|
||||
* <http://www.opengroup.org/susv3xbd/wctype.h.html>
|
||||
*
|
||||
* iswctype, towctrans, towlower, towupper, wctrans, wctype,
|
||||
* wctrans_t, and wctype_t are not yet implemented.
|
||||
*/
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_WCTYPE_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
#if @HAVE_WINT_T@
|
||||
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
|
||||
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>
|
||||
#endif
|
||||
|
||||
/* Include the original <wctype.h> if it exists.
|
||||
BeOS 5 has the functions but no <wctype.h>. */
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#if @HAVE_WCTYPE_H@
|
||||
# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_WCTYPE_H
|
||||
#define _@GUARD_PREFIX@_WCTYPE_H
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
|
||||
#defines a number of identifiers in the application namespace. Revert
|
||||
these #defines. */
|
||||
#ifdef __sun
|
||||
# undef multibyte
|
||||
# undef eucw1
|
||||
# undef eucw2
|
||||
# undef eucw3
|
||||
# undef scrw1
|
||||
# undef scrw2
|
||||
# undef scrw3
|
||||
#endif
|
||||
|
||||
/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
|
||||
#if !@HAVE_WINT_T@ && !defined wint_t
|
||||
# define wint_t int
|
||||
# ifndef WEOF
|
||||
# define WEOF -1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WEOF
|
||||
# define WEOF ((wint_t) -1)
|
||||
# endif
|
||||
#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@
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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
|
||||
# endif
|
||||
# endif
|
||||
# if @REPLACE_TOWLOWER@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define towlower rpl_towlower
|
||||
# define towupper rpl_towupper
|
||||
# endif
|
||||
# endif
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswalnum
|
||||
# else
|
||||
iswalnum
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return ((wc >= '0' && wc <= '9')
|
||||
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswalpha
|
||||
# else
|
||||
iswalpha
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswblank
|
||||
# else
|
||||
iswblank
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc == ' ' || wc == '\t';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswcntrl
|
||||
# else
|
||||
iswcntrl
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc & ~0x1f) == 0 || wc == 0x7f;
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswdigit
|
||||
# else
|
||||
iswdigit
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc >= '0' && wc <= '9';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswgraph
|
||||
# else
|
||||
iswgraph
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc >= '!' && wc <= '~';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswlower
|
||||
# else
|
||||
iswlower
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc >= 'a' && wc <= 'z';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswprint
|
||||
# else
|
||||
iswprint
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc >= ' ' && wc <= '~';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswpunct
|
||||
# else
|
||||
iswpunct
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc >= '!' && wc <= '~'
|
||||
&& !((wc >= '0' && wc <= '9')
|
||||
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswspace
|
||||
# else
|
||||
iswspace
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc == ' ' || wc == '\t'
|
||||
|| wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswupper
|
||||
# else
|
||||
iswupper
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return wc >= 'A' && wc <= 'Z';
|
||||
}
|
||||
|
||||
static inline int
|
||||
# if @REPLACE_ISWCNTRL@
|
||||
rpl_iswxdigit
|
||||
# else
|
||||
iswxdigit
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return ((wc >= '0' && wc <= '9')
|
||||
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
|
||||
}
|
||||
|
||||
static inline wint_t
|
||||
# if @REPLACE_TOWLOWER@
|
||||
rpl_towlower
|
||||
# else
|
||||
towlower
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
|
||||
}
|
||||
|
||||
static inline wint_t
|
||||
# if @REPLACE_TOWLOWER@
|
||||
rpl_towupper
|
||||
# else
|
||||
towupper
|
||||
# endif
|
||||
(wint_t wc)
|
||||
{
|
||||
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
|
||||
}
|
||||
|
||||
# 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
|
||||
_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
|
||||
# else
|
||||
_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# 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
|
||||
to take a wchar_t argument and return a wchar_t result. mingw declares
|
||||
these functions to take a wint_t argument and return a wint_t result.
|
||||
This means that:
|
||||
1. When the user passes an argument outside the range 0x0000..0xFFFF, the
|
||||
function will look only at the lower 16 bits. This is allowed according
|
||||
to POSIX.
|
||||
2. The return value is returned in the lower 16 bits of the result register.
|
||||
The upper 16 bits are random: whatever happened to be in that part of the
|
||||
result register. We need to fix this by adding a zero-extend from
|
||||
wchar_t to wint_t after the call. */
|
||||
|
||||
static inline wint_t
|
||||
rpl_towlower (wint_t wc)
|
||||
{
|
||||
return (wint_t) (wchar_t) towlower (wc);
|
||||
}
|
||||
# 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
|
||||
|
||||
# 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 (iswcntrl, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
|
||||
#else
|
||||
_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
|
||||
#endif
|
||||
_GL_CXXALIASWARN (iswalnum);
|
||||
_GL_CXXALIASWARN (iswalpha);
|
||||
_GL_CXXALIASWARN (iswcntrl);
|
||||
_GL_CXXALIASWARN (iswdigit);
|
||||
_GL_CXXALIASWARN (iswgraph);
|
||||
_GL_CXXALIASWARN (iswlower);
|
||||
_GL_CXXALIASWARN (iswprint);
|
||||
_GL_CXXALIASWARN (iswpunct);
|
||||
_GL_CXXALIASWARN (iswspace);
|
||||
_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_TOWLOWER@ || defined __MINGW32__
|
||||
_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
|
||||
_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
|
||||
#else
|
||||
_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
|
||||
_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
|
||||
#endif
|
||||
_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 /* _@GUARD_PREFIX@_WCTYPE_H */
|
||||
#endif /* _@GUARD_PREFIX@_WCTYPE_H */
|
26
lib/wmemcpy-impl.h
Normal file
26
lib/wmemcpy-impl.h
Normal file
@ -0,0 +1,26 @@
|
||||
/* 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;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* 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
|
||||
@ -14,7 +15,9 @@
|
||||
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>
|
||||
|
||||
#define USE_LONG_DOUBLE
|
||||
#include "isnan.c"
|
||||
/* Specification. */
|
||||
#include <wchar.h>
|
||||
|
||||
#include "wmemcpy-impl.h"
|
108
lib/xsize.h
108
lib/xsize.h
@ -1,108 +0,0 @@
|
||||
/* xsize.h -- Checked size_t computations.
|
||||
|
||||
Copyright (C) 2003, 2008-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, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _XSIZE_H
|
||||
#define _XSIZE_H
|
||||
|
||||
/* Get size_t. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get SIZE_MAX. */
|
||||
#include <limits.h>
|
||||
#if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* The size of memory objects is often computed through expressions of
|
||||
type size_t. Example:
|
||||
void* p = malloc (header_size + n * element_size).
|
||||
These computations can lead to overflow. When this happens, malloc()
|
||||
returns a piece of memory that is way too small, and the program then
|
||||
crashes while attempting to fill the memory.
|
||||
To avoid this, the functions and macros in this file check for overflow.
|
||||
The convention is that SIZE_MAX represents overflow.
|
||||
malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
|
||||
implementation that uses mmap --, it's recommended to use size_overflow_p()
|
||||
or size_in_bounds_p() before invoking malloc().
|
||||
The example thus becomes:
|
||||
size_t size = xsum (header_size, xtimes (n, element_size));
|
||||
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
|
||||
*/
|
||||
|
||||
/* Convert an arbitrary value >= 0 to type size_t. */
|
||||
#define xcast_size_t(N) \
|
||||
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
|
||||
|
||||
/* Sum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum (size_t size1, size_t size2)
|
||||
{
|
||||
size_t sum = size1 + size2;
|
||||
return (sum >= size1 ? sum : SIZE_MAX);
|
||||
}
|
||||
|
||||
/* Sum of three sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum3 (size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
return xsum (xsum (size1, size2), size3);
|
||||
}
|
||||
|
||||
/* Sum of four sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
return xsum (xsum (xsum (size1, size2), size3), size4);
|
||||
}
|
||||
|
||||
/* Maximum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
xmax (size_t size1, size_t size2)
|
||||
{
|
||||
/* No explicit check is needed here, because for any n:
|
||||
max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
|
||||
return (size1 >= size2 ? size1 : size2);
|
||||
}
|
||||
|
||||
/* Multiplication of a count with an element size, with overflow check.
|
||||
The count must be >= 0 and the element size must be > 0.
|
||||
This is a macro, not an inline function, so that it works correctly even
|
||||
when N is of a wider type and N > SIZE_MAX. */
|
||||
#define xtimes(N, ELSIZE) \
|
||||
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
|
||||
|
||||
/* Check for overflow. */
|
||||
#define size_overflow_p(SIZE) \
|
||||
((SIZE) == SIZE_MAX)
|
||||
/* Check against overflow. */
|
||||
#define size_in_bounds_p(SIZE) \
|
||||
((SIZE) != SIZE_MAX)
|
||||
|
||||
#endif /* _XSIZE_H */
|
226
m4/Makefile.in
226
m4/Makefile.in
@ -46,7 +46,6 @@ VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@ -65,48 +64,41 @@ subdir = m4
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
|
||||
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
|
||||
$(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/ax_append_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 \
|
||||
$(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/ctype.m4 \
|
||||
$(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/exponentd.m4 \
|
||||
$(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
|
||||
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/float_h.m4 \
|
||||
$(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
|
||||
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnand.m4 \
|
||||
$(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
|
||||
$(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/locale_h.m4 \
|
||||
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/malloc.m4 \
|
||||
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/ax_with_curses.m4 $(top_srcdir)/m4/btowc.m4 \
|
||||
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
|
||||
$(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/extensions.m4 \
|
||||
$(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/getopt.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
|
||||
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/libunistring-base.m4 \
|
||||
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
|
||||
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
|
||||
$(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
|
||||
$(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \
|
||||
$(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
|
||||
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/multiarch.m4 \
|
||||
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/printf-frexp.m4 \
|
||||
$(top_srcdir)/m4/printf-frexpl.m4 \
|
||||
$(top_srcdir)/m4/printf-posix-rpl.m4 \
|
||||
$(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/signbit.m4 \
|
||||
$(top_srcdir)/m4/size_max.m4 \
|
||||
$(top_srcdir)/m4/snprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/stat.m4 \
|
||||
$(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \
|
||||
$(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
|
||||
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strdup.m4 \
|
||||
$(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strncat.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \
|
||||
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
|
||||
$(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/string_h.m4 \
|
||||
$(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
|
||||
$(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/m4/vfprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf-posix.m4 \
|
||||
$(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wcsdup.m4 \
|
||||
$(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
|
||||
$(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
|
||||
$(top_srcdir)/m4/wmemcpy.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
@ -116,12 +108,12 @@ CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
AMTAR = @AMTAR@
|
||||
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
|
||||
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@ -144,36 +136,24 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
|
||||
EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
|
||||
ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
|
||||
ENOLINK_VALUE = @ENOLINK_VALUE@
|
||||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
EXEEXT = @EXEEXT@
|
||||
FLOAT_H = @FLOAT_H@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GNULIB_ACOSL = @GNULIB_ACOSL@
|
||||
GNULIB_ASINL = @GNULIB_ASINL@
|
||||
GNULIB_ATANL = @GNULIB_ATANL@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GNULIB_ATOLL = @GNULIB_ATOLL@
|
||||
GNULIB_BTOWC = @GNULIB_BTOWC@
|
||||
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
|
||||
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
|
||||
GNULIB_CEIL = @GNULIB_CEIL@
|
||||
GNULIB_CEILF = @GNULIB_CEILF@
|
||||
GNULIB_CEILL = @GNULIB_CEILL@
|
||||
GNULIB_CHOWN = @GNULIB_CHOWN@
|
||||
GNULIB_CLOSE = @GNULIB_CLOSE@
|
||||
GNULIB_COSL = @GNULIB_COSL@
|
||||
GNULIB_DPRINTF = @GNULIB_DPRINTF@
|
||||
GNULIB_DUP2 = @GNULIB_DUP2@
|
||||
GNULIB_DUP3 = @GNULIB_DUP3@
|
||||
GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
|
||||
GNULIB_ENVIRON = @GNULIB_ENVIRON@
|
||||
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
|
||||
GNULIB_EXPL = @GNULIB_EXPL@
|
||||
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
|
||||
GNULIB_FCHDIR = @GNULIB_FCHDIR@
|
||||
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
|
||||
@ -184,9 +164,6 @@ GNULIB_FFSL = @GNULIB_FFSL@
|
||||
GNULIB_FFSLL = @GNULIB_FFSLL@
|
||||
GNULIB_FGETC = @GNULIB_FGETC@
|
||||
GNULIB_FGETS = @GNULIB_FGETS@
|
||||
GNULIB_FLOOR = @GNULIB_FLOOR@
|
||||
GNULIB_FLOORF = @GNULIB_FLOORF@
|
||||
GNULIB_FLOORL = @GNULIB_FLOORL@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF = @GNULIB_FPRINTF@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
@ -195,8 +172,6 @@ GNULIB_FPUTC = @GNULIB_FPUTC@
|
||||
GNULIB_FPUTS = @GNULIB_FPUTS@
|
||||
GNULIB_FREAD = @GNULIB_FREAD@
|
||||
GNULIB_FREOPEN = @GNULIB_FREOPEN@
|
||||
GNULIB_FREXP = @GNULIB_FREXP@
|
||||
GNULIB_FREXPL = @GNULIB_FREXPL@
|
||||
GNULIB_FSCANF = @GNULIB_FSCANF@
|
||||
GNULIB_FSEEK = @GNULIB_FSEEK@
|
||||
GNULIB_FSEEKO = @GNULIB_FSEEKO@
|
||||
@ -226,20 +201,13 @@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
|
||||
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
|
||||
GNULIB_GRANTPT = @GNULIB_GRANTPT@
|
||||
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
|
||||
GNULIB_ISBLANK = @GNULIB_ISBLANK@
|
||||
GNULIB_ISFINITE = @GNULIB_ISFINITE@
|
||||
GNULIB_ISINF = @GNULIB_ISINF@
|
||||
GNULIB_ISNAN = @GNULIB_ISNAN@
|
||||
GNULIB_ISNAND = @GNULIB_ISNAND@
|
||||
GNULIB_ISNANF = @GNULIB_ISNANF@
|
||||
GNULIB_ISNANL = @GNULIB_ISNANL@
|
||||
GNULIB_ICONV = @GNULIB_ICONV@
|
||||
GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
|
||||
GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
|
||||
GNULIB_LCHMOD = @GNULIB_LCHMOD@
|
||||
GNULIB_LCHOWN = @GNULIB_LCHOWN@
|
||||
GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LINK = @GNULIB_LINK@
|
||||
GNULIB_LINKAT = @GNULIB_LINKAT@
|
||||
GNULIB_LOGB = @GNULIB_LOGB@
|
||||
GNULIB_LOGL = @GNULIB_LOGL@
|
||||
GNULIB_LSEEK = @GNULIB_LSEEK@
|
||||
GNULIB_LSTAT = @GNULIB_LSTAT@
|
||||
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
|
||||
@ -305,19 +273,13 @@ GNULIB_REMOVE = @GNULIB_REMOVE@
|
||||
GNULIB_RENAME = @GNULIB_RENAME@
|
||||
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
|
||||
GNULIB_RMDIR = @GNULIB_RMDIR@
|
||||
GNULIB_ROUND = @GNULIB_ROUND@
|
||||
GNULIB_ROUNDF = @GNULIB_ROUNDF@
|
||||
GNULIB_ROUNDL = @GNULIB_ROUNDL@
|
||||
GNULIB_RPMATCH = @GNULIB_RPMATCH@
|
||||
GNULIB_SCANF = @GNULIB_SCANF@
|
||||
GNULIB_SETENV = @GNULIB_SETENV@
|
||||
GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
|
||||
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
|
||||
GNULIB_SINL = @GNULIB_SINL@
|
||||
GNULIB_SLEEP = @GNULIB_SLEEP@
|
||||
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
|
||||
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
|
||||
GNULIB_SQRTL = @GNULIB_SQRTL@
|
||||
GNULIB_STAT = @GNULIB_STAT@
|
||||
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
|
||||
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
|
||||
@ -344,13 +306,10 @@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
|
||||
GNULIB_SYMLINK = @GNULIB_SYMLINK@
|
||||
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
|
||||
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
|
||||
GNULIB_TANL = @GNULIB_TANL@
|
||||
GNULIB_TIMEGM = @GNULIB_TIMEGM@
|
||||
GNULIB_TIME_R = @GNULIB_TIME_R@
|
||||
GNULIB_TMPFILE = @GNULIB_TMPFILE@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
|
||||
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
|
||||
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
|
||||
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
|
||||
@ -399,6 +358,8 @@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
|
||||
GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
|
||||
GNULIB_WCTOB = @GNULIB_WCTOB@
|
||||
GNULIB_WCTOMB = @GNULIB_WCTOMB@
|
||||
GNULIB_WCTRANS = @GNULIB_WCTRANS@
|
||||
GNULIB_WCTYPE = @GNULIB_WCTYPE@
|
||||
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
|
||||
GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
|
||||
GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
|
||||
@ -408,27 +369,13 @@ GNULIB_WMEMSET = @GNULIB_WMEMSET@
|
||||
GNULIB_WRITE = @GNULIB_WRITE@
|
||||
GNULIB__EXIT = @GNULIB__EXIT@
|
||||
GREP = @GREP@
|
||||
HAVE_ACOSL = @HAVE_ACOSL@
|
||||
HAVE_ASINL = @HAVE_ASINL@
|
||||
HAVE_ATANL = @HAVE_ATANL@
|
||||
HAVE_ATOLL = @HAVE_ATOLL@
|
||||
HAVE_BTOWC = @HAVE_BTOWC@
|
||||
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
|
||||
HAVE_CHOWN = @HAVE_CHOWN@
|
||||
HAVE_COSL = @HAVE_COSL@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
|
||||
HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
|
||||
HAVE_DECL_COSL = @HAVE_DECL_COSL@
|
||||
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
|
||||
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
|
||||
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
|
||||
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
|
||||
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
|
||||
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
|
||||
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
|
||||
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
|
||||
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
|
||||
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
|
||||
@ -438,30 +385,18 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
|
||||
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
|
||||
HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
|
||||
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
|
||||
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
|
||||
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
|
||||
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
|
||||
HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
|
||||
HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
|
||||
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
|
||||
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
|
||||
HAVE_DECL_SINL = @HAVE_DECL_SINL@
|
||||
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
|
||||
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
|
||||
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
|
||||
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
|
||||
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
|
||||
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
|
||||
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
|
||||
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
||||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
|
||||
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
|
||||
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
|
||||
@ -472,7 +407,6 @@ HAVE_DUP2 = @HAVE_DUP2@
|
||||
HAVE_DUP3 = @HAVE_DUP3@
|
||||
HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
|
||||
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
|
||||
HAVE_EXPL = @HAVE_EXPL@
|
||||
HAVE_FACCESSAT = @HAVE_FACCESSAT@
|
||||
HAVE_FCHDIR = @HAVE_FCHDIR@
|
||||
HAVE_FCHMODAT = @HAVE_FCHMODAT@
|
||||
@ -497,15 +431,12 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
|
||||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISBLANK = @HAVE_ISBLANK@
|
||||
HAVE_ISNAND = @HAVE_ISNAND@
|
||||
HAVE_ISNANF = @HAVE_ISNANF@
|
||||
HAVE_ISNANL = @HAVE_ISNANL@
|
||||
HAVE_ISWBLANK = @HAVE_ISWBLANK@
|
||||
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
|
||||
HAVE_LCHMOD = @HAVE_LCHMOD@
|
||||
HAVE_LCHOWN = @HAVE_LCHOWN@
|
||||
HAVE_LINK = @HAVE_LINK@
|
||||
HAVE_LINKAT = @HAVE_LINKAT@
|
||||
HAVE_LOGL = @HAVE_LOGL@
|
||||
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
|
||||
HAVE_LSTAT = @HAVE_LSTAT@
|
||||
HAVE_MBRLEN = @HAVE_MBRLEN@
|
||||
@ -545,9 +476,7 @@ HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
|
||||
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
|
||||
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
|
||||
HAVE_SINL = @HAVE_SINL@
|
||||
HAVE_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_SQRTL = @HAVE_SQRTL@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
@ -570,7 +499,6 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
|
||||
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
|
||||
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
|
||||
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
|
||||
HAVE_TANL = @HAVE_TANL@
|
||||
HAVE_TIMEGM = @HAVE_TIMEGM@
|
||||
HAVE_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNLINKAT = @HAVE_UNLINKAT@
|
||||
@ -608,6 +536,9 @@ HAVE_WCSSTR = @HAVE_WCSSTR@
|
||||
HAVE_WCSTOK = @HAVE_WCSTOK@
|
||||
HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
|
||||
HAVE_WCSXFRM = @HAVE_WCSXFRM@
|
||||
HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
|
||||
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
|
||||
HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
|
||||
HAVE_WINT_T = @HAVE_WINT_T@
|
||||
HAVE_WMEMCHR = @HAVE_WMEMCHR@
|
||||
HAVE_WMEMCMP = @HAVE_WMEMCMP@
|
||||
@ -617,6 +548,8 @@ HAVE_WMEMSET = @HAVE_WMEMSET@
|
||||
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HAVE__EXIT = @HAVE__EXIT@
|
||||
ICONV_CONST = @ICONV_CONST@
|
||||
ICONV_H = @ICONV_H@
|
||||
INCLUDE_NEXT = @INCLUDE_NEXT@
|
||||
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
|
||||
INSTALL = @INSTALL@
|
||||
@ -624,23 +557,33 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
|
||||
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
|
||||
LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
LOCALE_FR = @LOCALE_FR@
|
||||
LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
|
||||
LOCALE_JA = @LOCALE_JA@
|
||||
LOCALE_ZH_CN = @LOCALE_ZH_CN@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
|
||||
@ -651,13 +594,10 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
|
||||
NEXT_CTYPE_H = @NEXT_CTYPE_H@
|
||||
NEXT_ERRNO_H = @NEXT_ERRNO_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
|
||||
NEXT_GETOPT_H = @NEXT_GETOPT_H@
|
||||
NEXT_ICONV_H = @NEXT_ICONV_H@
|
||||
NEXT_LOCALE_H = @NEXT_LOCALE_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
NEXT_STDARG_H = @NEXT_STDARG_H@
|
||||
NEXT_STDDEF_H = @NEXT_STDDEF_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
@ -668,6 +608,7 @@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
|
||||
NEXT_TIME_H = @NEXT_TIME_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NEXT_WCHAR_H = @NEXT_WCHAR_H@
|
||||
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -677,6 +618,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
|
||||
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
|
||||
@ -685,9 +627,6 @@ RANLIB = @RANLIB@
|
||||
REPLACE_BTOWC = @REPLACE_BTOWC@
|
||||
REPLACE_CALLOC = @REPLACE_CALLOC@
|
||||
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
|
||||
REPLACE_CEIL = @REPLACE_CEIL@
|
||||
REPLACE_CEILF = @REPLACE_CEILF@
|
||||
REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_CLOSE = @REPLACE_CLOSE@
|
||||
REPLACE_DPRINTF = @REPLACE_DPRINTF@
|
||||
@ -697,15 +636,10 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
|
||||
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
|
||||
REPLACE_FCLOSE = @REPLACE_FCLOSE@
|
||||
REPLACE_FFLUSH = @REPLACE_FFLUSH@
|
||||
REPLACE_FLOOR = @REPLACE_FLOOR@
|
||||
REPLACE_FLOORF = @REPLACE_FLOORF@
|
||||
REPLACE_FLOORL = @REPLACE_FLOORL@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FPURGE = @REPLACE_FPURGE@
|
||||
REPLACE_FREOPEN = @REPLACE_FREOPEN@
|
||||
REPLACE_FREXP = @REPLACE_FREXP@
|
||||
REPLACE_FREXPL = @REPLACE_FREXPL@
|
||||
REPLACE_FSEEK = @REPLACE_FSEEK@
|
||||
REPLACE_FSEEKO = @REPLACE_FSEEKO@
|
||||
REPLACE_FSTAT = @REPLACE_FSTAT@
|
||||
@ -721,12 +655,12 @@ REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
REPLACE_ISFINITE = @REPLACE_ISFINITE@
|
||||
REPLACE_ISINF = @REPLACE_ISINF@
|
||||
REPLACE_ISNAN = @REPLACE_ISNAN@
|
||||
REPLACE_ICONV = @REPLACE_ICONV@
|
||||
REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
|
||||
REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
|
||||
REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
|
||||
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
|
||||
REPLACE_LCHOWN = @REPLACE_LCHOWN@
|
||||
REPLACE_LDEXPL = @REPLACE_LDEXPL@
|
||||
REPLACE_LINK = @REPLACE_LINK@
|
||||
REPLACE_LINKAT = @REPLACE_LINKAT@
|
||||
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
|
||||
@ -747,7 +681,6 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
|
||||
REPLACE_MKNOD = @REPLACE_MKNOD@
|
||||
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
|
||||
REPLACE_MKTIME = @REPLACE_MKTIME@
|
||||
REPLACE_NAN = @REPLACE_NAN@
|
||||
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
|
||||
REPLACE_NULL = @REPLACE_NULL@
|
||||
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
|
||||
@ -765,13 +698,8 @@ REPLACE_REMOVE = @REPLACE_REMOVE@
|
||||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SLEEP = @REPLACE_SLEEP@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
@ -794,9 +722,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
|
||||
REPLACE_SYMLINK = @REPLACE_SYMLINK@
|
||||
REPLACE_TIMEGM = @REPLACE_TIMEGM@
|
||||
REPLACE_TMPFILE = @REPLACE_TMPFILE@
|
||||
REPLACE_TRUNC = @REPLACE_TRUNC@
|
||||
REPLACE_TRUNCF = @REPLACE_TRUNCF@
|
||||
REPLACE_TRUNCL = @REPLACE_TRUNCL@
|
||||
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
|
||||
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
|
||||
REPLACE_UNLINK = @REPLACE_UNLINK@
|
||||
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
|
||||
@ -821,7 +747,6 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
|
||||
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
|
||||
STDARG_H = @STDARG_H@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STDDEF_H = @STDDEF_H@
|
||||
STDINT_H = @STDINT_H@
|
||||
@ -831,9 +756,13 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
|
||||
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
|
||||
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
|
||||
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
@ -872,6 +801,7 @@ infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
lispdir = @lispdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
|
121
m4/alloca.m4
121
m4/alloca.m4
@ -1,121 +0,0 @@
|
||||
# alloca.m4 serial 13
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
|
||||
dnl 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_ALLOCA],
|
||||
[
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])
|
||||
if test $ac_cv_func_alloca_works = no; then
|
||||
gl_PREREQ_ALLOCA
|
||||
fi
|
||||
|
||||
# Define an additional variable used in the Makefile substitution.
|
||||
if test $ac_cv_working_alloca_h = yes; then
|
||||
AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
|
||||
AC_EGREP_CPP([Need own alloca], [
|
||||
#if defined __GNUC__ || defined _AIX || defined _MSC_VER
|
||||
Need own alloca
|
||||
#endif
|
||||
], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
|
||||
])
|
||||
if test $gl_cv_rpl_alloca = yes; then
|
||||
dnl OK, alloca can be implemented through a compiler built-in.
|
||||
AC_DEFINE([HAVE_ALLOCA], [1],
|
||||
[Define to 1 if you have 'alloca' after including <alloca.h>,
|
||||
a header that may be supplied by this distribution.])
|
||||
ALLOCA_H=alloca.h
|
||||
else
|
||||
dnl alloca exists as a library function, i.e. it is slow and probably
|
||||
dnl a memory leak. Don't define HAVE_ALLOCA in this case.
|
||||
ALLOCA_H=
|
||||
fi
|
||||
else
|
||||
ALLOCA_H=alloca.h
|
||||
fi
|
||||
AC_SUBST([ALLOCA_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/alloca.c.
|
||||
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
|
||||
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
|
||||
|
||||
# This works around a bug in autoconf <= 2.68.
|
||||
# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
|
||||
|
||||
m4_version_prereq([2.69], [] ,[
|
||||
|
||||
# This is taken from the following Autoconf patch:
|
||||
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
|
||||
|
||||
# _AC_LIBOBJ_ALLOCA
|
||||
# -----------------
|
||||
# Set up the LIBOBJ replacement of `alloca'. Well, not exactly
|
||||
# AC_LIBOBJ since we actually set the output variable `ALLOCA'.
|
||||
# Nevertheless, for Automake, AC_LIBSOURCES it.
|
||||
m4_define([_AC_LIBOBJ_ALLOCA],
|
||||
[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
|
||||
# that cause trouble. Some versions do not even contain alloca or
|
||||
# contain a buggy version. If you still want to use their alloca,
|
||||
# use ar to extract alloca.o from them instead of compiling alloca.c.
|
||||
AC_LIBSOURCES(alloca.c)
|
||||
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
|
||||
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using `alloca.c'.])
|
||||
|
||||
AC_CACHE_CHECK(whether `alloca.c' needs Cray hooks, ac_cv_os_cray,
|
||||
[AC_EGREP_CPP(webecray,
|
||||
[#if defined CRAY && ! defined CRAY2
|
||||
webecray
|
||||
#else
|
||||
wenotbecray
|
||||
#endif
|
||||
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
|
||||
if test $ac_cv_os_cray = yes; then
|
||||
for ac_func in _getb67 GETB67 getb67; do
|
||||
AC_CHECK_FUNC($ac_func,
|
||||
[AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
|
||||
[Define to one of `_getb67', `GETB67',
|
||||
`getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for
|
||||
`alloca.c' support on those systems.])
|
||||
break])
|
||||
done
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([stack direction for C alloca],
|
||||
[ac_cv_c_stack_direction],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
if (! addr)
|
||||
addr = &dummy;
|
||||
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
|
||||
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
|
||||
return dir + dummy;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return find_stack_direction (0, argc + !argv + 20) < 0;
|
||||
}])],
|
||||
[ac_cv_c_stack_direction=1],
|
||||
[ac_cv_c_stack_direction=-1],
|
||||
[ac_cv_c_stack_direction=0])])
|
||||
AH_VERBATIM([STACK_DIRECTION],
|
||||
[/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
@%:@undef STACK_DIRECTION])dnl
|
||||
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
|
||||
])# _AC_LIBOBJ_ALLOCA
|
||||
])
|
@ -1,48 +0,0 @@
|
||||
# asm-underscore.m4 serial 1
|
||||
dnl Copyright (C) 2010-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.
|
||||
|
||||
dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
|
||||
|
||||
# gl_ASM_SYMBOL_PREFIX
|
||||
# Tests for the prefix of C symbols at the assembly language level and the
|
||||
# linker level. This prefix is either an underscore or empty. Defines the
|
||||
# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
|
||||
# a stringified variant of this prefix.
|
||||
|
||||
AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
|
||||
[
|
||||
dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
|
||||
dnl 1. It works only for GCC.
|
||||
dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
|
||||
AC_CACHE_CHECK(
|
||||
[whether C symbols are prefixed with underscore at the linker level],
|
||||
[gl_cv_prog_as_underscore],
|
||||
[cat > conftest.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" int foo (void);
|
||||
#endif
|
||||
int foo(void) { return 0; }
|
||||
EOF
|
||||
# Look for the assembly language name in the .s file.
|
||||
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
|
||||
if grep _foo conftest.s >/dev/null ; then
|
||||
gl_cv_prog_as_underscore=yes
|
||||
else
|
||||
gl_cv_prog_as_underscore=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
if test $gl_cv_prog_as_underscore = yes; then
|
||||
USER_LABEL_PREFIX=_
|
||||
else
|
||||
USER_LABEL_PREFIX=
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
|
||||
[Define to the prefix of C symbols at the assembler and linker level,
|
||||
either an underscore or empty.])
|
||||
ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
|
||||
AC_SUBST([ASM_SYMBOL_PREFIX])
|
||||
])
|
116
m4/btowc.m4
Normal file
116
m4/btowc.m4
Normal file
@ -0,0 +1,116 @@
|
||||
# btowc.m4 serial 10
|
||||
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,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_BTOWC],
|
||||
[
|
||||
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
|
||||
|
||||
dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
|
||||
dnl program below may lead to an endless loop. See
|
||||
dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
|
||||
AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
|
||||
|
||||
AC_CHECK_FUNCS_ONCE([btowc])
|
||||
if test $ac_cv_func_btowc = no; then
|
||||
HAVE_BTOWC=0
|
||||
else
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([gt_LOCALE_FR])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0.
|
||||
AC_CACHE_CHECK([whether btowc(0) is correct],
|
||||
[gl_cv_func_btowc_nul],
|
||||
[
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
/* 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>
|
||||
int main ()
|
||||
{
|
||||
if (btowc ('\0') != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_btowc_nul=yes],
|
||||
[gl_cv_func_btowc_nul=no],
|
||||
[
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on Cygwin.
|
||||
cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_btowc_nul="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
])
|
||||
|
||||
dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
|
||||
AC_CACHE_CHECK([whether btowc(EOF) is correct],
|
||||
[gl_cv_func_btowc_eof],
|
||||
[
|
||||
dnl Initial guess, used when cross-compiling or when no suitable locale
|
||||
dnl is present.
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on IRIX.
|
||||
irix*) gl_cv_func_btowc_eof="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_btowc_eof="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_FR != none; then
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
/* 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>
|
||||
int main ()
|
||||
{
|
||||
if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
|
||||
{
|
||||
if (btowc (EOF) != WEOF)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_btowc_eof=yes],
|
||||
[gl_cv_func_btowc_eof=no],
|
||||
[:])
|
||||
fi
|
||||
])
|
||||
|
||||
case "$gl_cv_func_btowc_nul" in
|
||||
*yes) ;;
|
||||
*) REPLACE_BTOWC=1 ;;
|
||||
esac
|
||||
case "$gl_cv_func_btowc_eof" in
|
||||
*yes) ;;
|
||||
*) REPLACE_BTOWC=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/btowc.c.
|
||||
AC_DEFUN([gl_PREREQ_BTOWC], [
|
||||
:
|
||||
])
|
23
m4/codeset.m4
Normal file
23
m4/codeset.m4
Normal file
@ -0,0 +1,23 @@
|
||||
# codeset.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2006, 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,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_LANGINFO_CODESET],
|
||||
[
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <langinfo.h>]],
|
||||
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
|
||||
[am_cv_langinfo_codeset=yes],
|
||||
[am_cv_langinfo_codeset=no])
|
||||
])
|
||||
if test $am_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
|
||||
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
|
||||
fi
|
||||
])
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user