glibc/iconv/iconv_prog.c

791 lines
20 KiB
C
Raw Normal View History

/* Convert text in given files from the specified from-set to the to-set.
2006-01-01 20:15:56 +01:00
Copyright (C) 1998-2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
* catgets/gencat.c: Use GPL, not LGPL. * elf/cache.c: Likewise. * elf/chroot_canon.c: Likewise. * elf/ldconfig.c: Likewise. * elf/readlib.c: Likewise. * iconv/dummy-repertoire.c: Likewise. * iconv/iconv_charmap.c: Likewise. * iconv/iconv_prog.c: Likewise. * iconv/iconvconfig.c: Likewise. * locale/programs/3level.h: Likewise. * locale/programs/charmap-dir.c: Likewise. * locale/programs/charmap-dir.h: Likewise. * locale/programs/charmap-kw.gperf: Likewise. * locale/programs/charmap.c: Likewise. * locale/programs/charmap.h: Likewise. * locale/programs/config.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/locale-spec.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/localedef.h: Likewise. * locale/programs/locarchive.c: Likewise. * locale/programs/locfile-kw.gperf: Likewise. * locale/programs/locfile-token.h: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/repertoire.h: Likewise. * locale/programs/simple-hash.c: Likewise. * locale/programs/simple-hash.h: Likewise. * locale/programs/xmalloc.c: Likewise. * locale/programs/xstrdup.c: Likewise. * malloc/memusagestat.c: Likewise. * nscd/aicache.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/dbg_log.c: Likewise. * nscd/gai.c: Likewise. * nscd/getgrgid_r.c: Likewise. * nscd/getgrnam_r.c: Likewise. * nscd/gethstbyad_r.c: Likewise. * nscd/gethstbynm2_r.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/mem.c: Likewise. * nscd/nscd.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/getconf.c: Likewise. * sysdeps/generic/nscd_setup_thread.c: Likewise. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Likewise.
2005-12-07 06:49:17 +01:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
* catgets/gencat.c: Use GPL, not LGPL. * elf/cache.c: Likewise. * elf/chroot_canon.c: Likewise. * elf/ldconfig.c: Likewise. * elf/readlib.c: Likewise. * iconv/dummy-repertoire.c: Likewise. * iconv/iconv_charmap.c: Likewise. * iconv/iconv_prog.c: Likewise. * iconv/iconvconfig.c: Likewise. * locale/programs/3level.h: Likewise. * locale/programs/charmap-dir.c: Likewise. * locale/programs/charmap-dir.h: Likewise. * locale/programs/charmap-kw.gperf: Likewise. * locale/programs/charmap.c: Likewise. * locale/programs/charmap.h: Likewise. * locale/programs/config.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/locale-spec.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/localedef.h: Likewise. * locale/programs/locarchive.c: Likewise. * locale/programs/locfile-kw.gperf: Likewise. * locale/programs/locfile-token.h: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/repertoire.h: Likewise. * locale/programs/simple-hash.c: Likewise. * locale/programs/simple-hash.h: Likewise. * locale/programs/xmalloc.c: Likewise. * locale/programs/xstrdup.c: Likewise. * malloc/memusagestat.c: Likewise. * nscd/aicache.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/dbg_log.c: Likewise. * nscd/gai.c: Likewise. * nscd/getgrgid_r.c: Likewise. * nscd/getgrnam_r.c: Likewise. * nscd/gethstbyad_r.c: Likewise. * nscd/gethstbynm2_r.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/mem.c: Likewise. * nscd/nscd.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/getconf.c: Likewise. * sysdeps/generic/nscd_setup_thread.c: Likewise. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Likewise.
2005-12-07 06:49:17 +01:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
* catgets/gencat.c: Use GPL, not LGPL. * elf/cache.c: Likewise. * elf/chroot_canon.c: Likewise. * elf/ldconfig.c: Likewise. * elf/readlib.c: Likewise. * iconv/dummy-repertoire.c: Likewise. * iconv/iconv_charmap.c: Likewise. * iconv/iconv_prog.c: Likewise. * iconv/iconvconfig.c: Likewise. * locale/programs/3level.h: Likewise. * locale/programs/charmap-dir.c: Likewise. * locale/programs/charmap-dir.h: Likewise. * locale/programs/charmap-kw.gperf: Likewise. * locale/programs/charmap.c: Likewise. * locale/programs/charmap.h: Likewise. * locale/programs/config.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/locale-spec.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/localedef.h: Likewise. * locale/programs/locarchive.c: Likewise. * locale/programs/locfile-kw.gperf: Likewise. * locale/programs/locfile-token.h: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/repertoire.h: Likewise. * locale/programs/simple-hash.c: Likewise. * locale/programs/simple-hash.h: Likewise. * locale/programs/xmalloc.c: Likewise. * locale/programs/xstrdup.c: Likewise. * malloc/memusagestat.c: Likewise. * nscd/aicache.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/dbg_log.c: Likewise. * nscd/gai.c: Likewise. * nscd/getgrgid_r.c: Likewise. * nscd/getgrnam_r.c: Likewise. * nscd/gethstbyad_r.c: Likewise. * nscd/gethstbynm2_r.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/mem.c: Likewise. * nscd/nscd.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/getconf.c: Likewise. * sysdeps/generic/nscd_setup_thread.c: Likewise. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Likewise.
2005-12-07 06:49:17 +01:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
* catgets/gencat.c: Use GPL, not LGPL. * elf/cache.c: Likewise. * elf/chroot_canon.c: Likewise. * elf/ldconfig.c: Likewise. * elf/readlib.c: Likewise. * iconv/dummy-repertoire.c: Likewise. * iconv/iconv_charmap.c: Likewise. * iconv/iconv_prog.c: Likewise. * iconv/iconvconfig.c: Likewise. * locale/programs/3level.h: Likewise. * locale/programs/charmap-dir.c: Likewise. * locale/programs/charmap-dir.h: Likewise. * locale/programs/charmap-kw.gperf: Likewise. * locale/programs/charmap.c: Likewise. * locale/programs/charmap.h: Likewise. * locale/programs/config.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/locale-spec.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/localedef.h: Likewise. * locale/programs/locarchive.c: Likewise. * locale/programs/locfile-kw.gperf: Likewise. * locale/programs/locfile-token.h: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/repertoire.h: Likewise. * locale/programs/simple-hash.c: Likewise. * locale/programs/simple-hash.h: Likewise. * locale/programs/xmalloc.c: Likewise. * locale/programs/xstrdup.c: Likewise. * malloc/memusagestat.c: Likewise. * nscd/aicache.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/dbg_log.c: Likewise. * nscd/gai.c: Likewise. * nscd/getgrgid_r.c: Likewise. * nscd/getgrnam_r.c: Likewise. * nscd/gethstbyad_r.c: Likewise. * nscd/gethstbynm2_r.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/mem.c: Likewise. * nscd/nscd.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/getconf.c: Likewise. * sysdeps/generic/nscd_setup_thread.c: Likewise. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Likewise.
2005-12-07 06:49:17 +01:00
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <argp.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <iconv.h>
#include <langinfo.h>
#include <locale.h>
#include <search.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Update. 1999-06-18 Zack Weinberg <zack@rabi.columbia.edu> * include/features.h: Define new macros __GNUC_PREREQ and __GLIBC_PREREQ which can be used to test the version of gcc and glibc respectively. * assert/assert.h: Use __GNUC_PREREQ. * intl/libintl.h: Likewise. * math/complex.h: Likewise. * math/tgmath.h: Likewise. * misc/sys/cdefs.h: Likewise. * posix/sys/types.h: Likewise. * socket/sys/socket.h: Likewise. * string/bits/string2.h: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Likewise. 1999-06-18 Zack Weinberg <zack@rabi.columbia.edu> * include/libintl.h: Declare _libc_intl_domainname here. Define _ and N_ here. * include/libc-symbols.h: Don't include <libintl.h>. Don't define _ and N_. Don't declare _libc_intl_domainname. * Makeconfig (CPPFLAGS): Use -imacros to read libc-symbols.h. * db2/config.h: Don't include sys/stat.h or define HAVE_ST_BLKSIZE here... * db2/compat.h: ...do it here. * linuxthreads/internals.h: Include bits/libc-tsd.h after all other headers. * linuxthreads/no-tsd.c: Include sys/cdefs.h for __P. * iconv/iconv.c: Include stddef.h for NULL. * malloc/malloc.h: Include features.h. * sysdeps/generic/morecore.c: Use __malloc_ptr_t not __ptr_t. * sysdeps/unix/make_errlist.c: Write an "#include <libintl.h>" into the generated file. * sysdeps/gnu/errlist.awk: Likewise. * sysdeps/gnu/errlist.c: Rebuilt. * assert/assert-perr.c: Include libintl.h. * assert/assert.c: Likewise. * elf/dl-open.c: Likewise. * elf/dlsym.c: Likewise. * elf/dlvsym.c: Likewise. * iconv/iconv_prog.c: Likewise. * inet/rcmd.c: Likewise. * inet/ruserpass.c: Likewise. * locale/programs/charset.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/repertoire.c: Likewise. * login/programs/database.c: Likewise. * login/programs/request.c: Likewise. * malloc/mcheck.c: Likewise. * misc/error.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nis_error.c: Likewise. * nis/nis_local_names.c: Likewise. * nis/nis_print.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * nis/ypclnt.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/nscd_stat.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/id.c: Likewise. * resolv/herror.c: Likewise. * stdio-common/psignal.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/clnt_unix.c: Likewise. * sunrpc/get_myaddr.c: Likewise. * sunrpc/pm_getmaps.c: Likewise. * sunrpc/pmap_clnt.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/rpc_main.c: Likewise. * sunrpc/rpc_scan.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/svc_unix.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * sysdeps/mach/hurd/mips/dl-machine.c: Likewise. * sysdeps/posix/gai_strerror.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c: Likewise. * timezone/zic.c: Likewise.
1999-06-19 11:58:37 +02:00
#include <libintl.h>
Update. 1998-08-03 16:36 Ulrich Drepper <drepper@cygnus.com> * catgets/catgets.c: Use mmap/munmap only is _POSIX_MAPPED_FILES is defined. * catgets/open_catalog.c: Likewise. * iconv/iconv_prog.c: Likewise. * intl/loadmsgcat.c: Likewise. * locale/findlocale.c: Likewise. * locale/loadlocale.c: Likewise. * locale/programs/localedef.c: Likewise. * malloc/malloc.c: Likewise. * elf/elf.h: Fix typo. * math/Makefile: Use $(LN_S) instead of ln. * sysdeps/generic/getpgid.c: Fix return type. 1998-08-01 02:49 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * sysdeps/posix/tempname.c (__stdio_gen_tempname): Rename to __gen_tempname and simplify the interface. Strip out the code to do path search and create FILE objects. This function now takes a mktemp() style template and returns either a name or a file descriptor. (__path_search): New function; searches for directories for temp files. * sysdeps/generic/tempname.c: Stub out __gen_tempname and __path_search, not __stdio_gen_tempname. * libio/stdio.h: Prototype __gen_tempname and __path_search, not __stdio_gen_tempname. * stdio/stdio.h: Likewise. * stdio-common/tempnam.c: Use __path_search and __gen_tempname. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. * misc/mkstemp.c: New file. Use __gen_tempname. * misc/mktemp.c: Likewise. * sysdeps/posix/mkstemp.c: Removed. * sysdeps/posix/mktemp.c: Removed. * sysdeps/generic/mkstemp.c: Removed. * sysdeps/generic/mktemp.c: Removed. 1998-08-02 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * configure.in: Check, if door add-on is installed. * config.make.in: Add have_doors. * sunrpc/Makefile: Add HAVE_DOOR define. * sunrpc/key_call.c: Add keyserv/door interface. * sunrpc/svc_unix.c: Call setsockopt only if SO_PASSCRED is defined. * sunrpc/clnt_unix.c: Likewise. 1998-08-02 Andreas Jaeger <aj@arthur.rhein-neckar.de> * inet/netinet/in.h (IN_CLASSC): Correct mask. Reported by Ian Staniforth <I.Staniforth@sheffield.ac.uk> [fixes PR libc/727]. 1998-08-03 10:23 Ulrich Drepper <drepper@cygnus.com> * misc/Makefile: Fix installation problem with --disable-shared. * posix/Makefile: Likewise. 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/regex.c (re_search_2): Optimize searching for anchored pattern if '^' cannot match at embedded newlines. (regerror): Renamed from __regerror, which it should only be called if _LIBC. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sunrpc/svc_unix.c (__msgread): Check setsockopt return value. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/glob.c: Remove obsolete cast. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Rules (tests): Fix last change.
1998-08-03 18:47:01 +02:00
#ifdef _POSIX_MAPPED_FILES
# include <sys/mman.h>
#endif
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
#include <charmap.h>
#include <gconv_int.h>
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
#include "iconv_prog.h"
#include "iconvconfig.h"
/* Get libc version number. */
#include "../version.h"
#define PACKAGE _libc_intl_domainname
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
#define OPT_VERBOSE 1000
#define OPT_LIST 'l'
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
{ NULL, 0, NULL, 0, N_("Input/Output format specification:") },
{ "from-code", 'f', "NAME", 0, N_("encoding of original text") },
{ "to-code", 't', "NAME", 0, N_("encoding for output") },
{ NULL, 0, NULL, 0, N_("Information:") },
{ "list", 'l', NULL, 0, N_("list all known coded character sets") },
{ NULL, 0, NULL, 0, N_("Output control:") },
{ NULL, 'c', NULL, 0, N_("omit invalid characters from output") },
{ "output", 'o', "FILE", 0, N_("output file") },
{ "silent", 's', NULL, 0, N_("suppress warnings") },
{ "verbose", OPT_VERBOSE, NULL, 0, N_("print progress information") },
{ NULL, 0, NULL, 0, NULL }
};
/* Short description of program. */
static const char doc[] = N_("\
Convert encoding of given files from one encoding to another.");
/* Strings for arguments in help texts. */
static const char args_doc[] = N_("[FILE...]");
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
options, parse_opt, args_doc, doc, NULL, more_help
};
/* Code sets to convert from and to respectively. An empty string as the
default causes the 'iconv_open' function to look up the charset of the
currently selected locale and use it. */
static const char *from_code = "";
static const char *to_code = "";
/* File to write output to. If NULL write to stdout. */
static const char *output_file;
/* Nonzero if verbose ouput is wanted. */
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
int verbose;
/* Nonzero if list of all coded character sets is wanted. */
static int list;
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
/* If nonzero omit invalid character from output. */
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
int omit_invalid;
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
/* Prototypes for the functions doing the actual work. */
static int process_block (iconv_t cd, char *addr, size_t len, FILE *output);
static int process_fd (iconv_t cd, int fd, FILE *output);
static int process_file (iconv_t cd, FILE *input, FILE *output);
static void print_known_names (void) internal_function;
int
main (int argc, char *argv[])
{
int status = EXIT_SUCCESS;
int remaining;
FILE *output;
iconv_t cd;
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
const char *orig_to_code;
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
struct charmap_t *from_charmap = NULL;
struct charmap_t *to_charmap = NULL;
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
/* Set the text message domain. */
textdomain (_libc_intl_domainname);
/* Parse and process arguments. */
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
/* List all coded character sets if wanted. */
if (list)
{
print_known_names ();
exit (EXIT_SUCCESS);
}
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
/* If we have to ignore errors make sure we use the appropriate name for
the to-character-set. */
orig_to_code = to_code;
if (omit_invalid)
{
const char *errhand = strchrnul (to_code, '/');
int nslash = 2;
char *newp;
char *cp;
if (*errhand == '/')
{
--nslash;
errhand = strchrnul (errhand, '/');
if (*errhand == '/')
{
--nslash;
errhand = strchr (errhand, '\0');
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
}
}
newp = (char *) alloca (errhand - to_code + nslash + 7 + 1);
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
cp = mempcpy (newp, to_code, errhand - to_code);
while (nslash-- > 0)
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
*cp++ = '/';
if (cp[-1] != '/')
*cp++ = ',';
memcpy (cp, "IGNORE", sizeof ("IGNORE"));
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
to_code = newp;
}
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* POSIX 1003.2b introduces a silly thing: the arguments to -t anf -f
can be file names of charmaps. In this case iconv will have to read
those charmaps and use them to do the conversion. But there are
holes in the specification. There is nothing said that if -f is a
charmap filename that -t must be, too. And vice versa. There is
also no word about the symbolic names used. What if they don't
match? */
if (strchr (from_code, '/') != NULL)
/* The from-name might be a charmap file name. Try reading the
file. */
from_charmap = charmap_read (from_code, /*0, 1*/1, 0, 0);
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
if (strchr (orig_to_code, '/') != NULL)
/* The to-name might be a charmap file name. Try reading the
file. */
to_charmap = charmap_read (orig_to_code, /*0, 1,*/1,0, 0);
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* Determine output file. */
if (output_file != NULL && strcmp (output_file, "-") != 0)
{
output = fopen (output_file, "w");
if (output == NULL)
error (EXIT_FAILURE, errno, _("cannot open output file"));
}
else
output = stdout;
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* At this point we have to handle two cases. The first one is
where a charmap is used for the from- or to-charset, or both. We
handle this special since it is very different from the sane way of
doing things. The other case allows converting using the iconv()
function. */
if (from_charmap != NULL || to_charmap != NULL)
/* Construct the conversion table and do the conversion. */
status = charmap_conversion (from_code, from_charmap, to_code, to_charmap,
argc, remaining, argv, output);
else
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
{
/* Let's see whether we have these coded character sets. */
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t) -1)
{
if (errno == EINVAL)
{
/* Try to be nice with the user and tell her which of the
two encoding names is wrong. This is possible because
all supported encodings can be converted from/to Unicode,
in other words, because the graph of encodings is
connected. */
bool from_wrong =
(iconv_open ("UTF-8", from_code) == (iconv_t) -1
&& errno == EINVAL);
bool to_wrong =
(iconv_open (to_code, "UTF-8") == (iconv_t) -1
&& errno == EINVAL);
const char *from_pretty =
(from_code[0] ? from_code : nl_langinfo (CODESET));
const char *to_pretty =
(orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET));
if (from_wrong)
{
if (to_wrong)
error (0, 0,
_("\
conversion from `%s' and to `%s' are not supported"),
from_pretty, to_pretty);
else
error (0, 0,
_("conversion from `%s' is not supported"),
from_pretty);
}
else
{
if (to_wrong)
error (0, 0,
_("conversion to `%s' is not supported"),
to_pretty);
else
error (0, 0,
_("conversion from `%s' to `%s' is not supported"),
from_pretty, to_pretty);
}
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
exit (1);
}
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
else
error (EXIT_FAILURE, errno,
_("failed to start conversion processing"));
}
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* Now process the remaining files. Write them to stdout or the file
specified with the `-o' parameter. If we have no file given as
the parameter process all from stdin. */
if (remaining == argc)
{
if (process_file (cd, stdin, output) != 0)
status = EXIT_FAILURE;
}
else
do
{
#ifdef _POSIX_MAPPED_FILES
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
struct stat st;
char *addr;
#endif
int fd, ret;
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
if (verbose)
fprintf (stderr, "%s:\n", argv[remaining]);
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
if (strcmp (argv[remaining], "-") == 0)
fd = 0;
else
{
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
fd = open (argv[remaining], O_RDONLY);
if (fd == -1)
{
error (0, errno, _("cannot open input file `%s'"),
argv[remaining]);
status = EXIT_FAILURE;
continue;
}
}
Update. 1998-08-03 16:36 Ulrich Drepper <drepper@cygnus.com> * catgets/catgets.c: Use mmap/munmap only is _POSIX_MAPPED_FILES is defined. * catgets/open_catalog.c: Likewise. * iconv/iconv_prog.c: Likewise. * intl/loadmsgcat.c: Likewise. * locale/findlocale.c: Likewise. * locale/loadlocale.c: Likewise. * locale/programs/localedef.c: Likewise. * malloc/malloc.c: Likewise. * elf/elf.h: Fix typo. * math/Makefile: Use $(LN_S) instead of ln. * sysdeps/generic/getpgid.c: Fix return type. 1998-08-01 02:49 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * sysdeps/posix/tempname.c (__stdio_gen_tempname): Rename to __gen_tempname and simplify the interface. Strip out the code to do path search and create FILE objects. This function now takes a mktemp() style template and returns either a name or a file descriptor. (__path_search): New function; searches for directories for temp files. * sysdeps/generic/tempname.c: Stub out __gen_tempname and __path_search, not __stdio_gen_tempname. * libio/stdio.h: Prototype __gen_tempname and __path_search, not __stdio_gen_tempname. * stdio/stdio.h: Likewise. * stdio-common/tempnam.c: Use __path_search and __gen_tempname. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. * misc/mkstemp.c: New file. Use __gen_tempname. * misc/mktemp.c: Likewise. * sysdeps/posix/mkstemp.c: Removed. * sysdeps/posix/mktemp.c: Removed. * sysdeps/generic/mkstemp.c: Removed. * sysdeps/generic/mktemp.c: Removed. 1998-08-02 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * configure.in: Check, if door add-on is installed. * config.make.in: Add have_doors. * sunrpc/Makefile: Add HAVE_DOOR define. * sunrpc/key_call.c: Add keyserv/door interface. * sunrpc/svc_unix.c: Call setsockopt only if SO_PASSCRED is defined. * sunrpc/clnt_unix.c: Likewise. 1998-08-02 Andreas Jaeger <aj@arthur.rhein-neckar.de> * inet/netinet/in.h (IN_CLASSC): Correct mask. Reported by Ian Staniforth <I.Staniforth@sheffield.ac.uk> [fixes PR libc/727]. 1998-08-03 10:23 Ulrich Drepper <drepper@cygnus.com> * misc/Makefile: Fix installation problem with --disable-shared. * posix/Makefile: Likewise. 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/regex.c (re_search_2): Optimize searching for anchored pattern if '^' cannot match at embedded newlines. (regerror): Renamed from __regerror, which it should only be called if _LIBC. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sunrpc/svc_unix.c (__msgread): Check setsockopt return value. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/glob.c: Remove obsolete cast. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Rules (tests): Fix last change.
1998-08-03 18:47:01 +02:00
#ifdef _POSIX_MAPPED_FILES
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* We have possibilities for reading the input file. First try
to mmap() it since this will provide the fastest solution. */
if (fstat (fd, &st) == 0
&& ((addr = mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE,
fd, 0)) != MAP_FAILED))
{
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* Yes, we can use mmap(). The descriptor is not needed
anymore. */
if (close (fd) != 0)
error (EXIT_FAILURE, errno,
_("error while closing input `%s'"),
argv[remaining]);
ret = process_block (cd, addr, st.st_size, output);
/* We don't need the input data anymore. */
munmap ((void *) addr, st.st_size);
if (ret != 0)
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
{
status = EXIT_FAILURE;
if (ret < 0)
/* We cannot go on with producing output since it might
lead to problem because the last output might leave
the output stream in an undefined state. */
break;
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
}
}
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
else
Update. 1998-08-03 16:36 Ulrich Drepper <drepper@cygnus.com> * catgets/catgets.c: Use mmap/munmap only is _POSIX_MAPPED_FILES is defined. * catgets/open_catalog.c: Likewise. * iconv/iconv_prog.c: Likewise. * intl/loadmsgcat.c: Likewise. * locale/findlocale.c: Likewise. * locale/loadlocale.c: Likewise. * locale/programs/localedef.c: Likewise. * malloc/malloc.c: Likewise. * elf/elf.h: Fix typo. * math/Makefile: Use $(LN_S) instead of ln. * sysdeps/generic/getpgid.c: Fix return type. 1998-08-01 02:49 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * sysdeps/posix/tempname.c (__stdio_gen_tempname): Rename to __gen_tempname and simplify the interface. Strip out the code to do path search and create FILE objects. This function now takes a mktemp() style template and returns either a name or a file descriptor. (__path_search): New function; searches for directories for temp files. * sysdeps/generic/tempname.c: Stub out __gen_tempname and __path_search, not __stdio_gen_tempname. * libio/stdio.h: Prototype __gen_tempname and __path_search, not __stdio_gen_tempname. * stdio/stdio.h: Likewise. * stdio-common/tempnam.c: Use __path_search and __gen_tempname. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. * misc/mkstemp.c: New file. Use __gen_tempname. * misc/mktemp.c: Likewise. * sysdeps/posix/mkstemp.c: Removed. * sysdeps/posix/mktemp.c: Removed. * sysdeps/generic/mkstemp.c: Removed. * sysdeps/generic/mktemp.c: Removed. 1998-08-02 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * configure.in: Check, if door add-on is installed. * config.make.in: Add have_doors. * sunrpc/Makefile: Add HAVE_DOOR define. * sunrpc/key_call.c: Add keyserv/door interface. * sunrpc/svc_unix.c: Call setsockopt only if SO_PASSCRED is defined. * sunrpc/clnt_unix.c: Likewise. 1998-08-02 Andreas Jaeger <aj@arthur.rhein-neckar.de> * inet/netinet/in.h (IN_CLASSC): Correct mask. Reported by Ian Staniforth <I.Staniforth@sheffield.ac.uk> [fixes PR libc/727]. 1998-08-03 10:23 Ulrich Drepper <drepper@cygnus.com> * misc/Makefile: Fix installation problem with --disable-shared. * posix/Makefile: Likewise. 1998-08-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/regex.c (re_search_2): Optimize searching for anchored pattern if '^' cannot match at embedded newlines. (regerror): Renamed from __regerror, which it should only be called if _LIBC. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sunrpc/svc_unix.c (__msgread): Check setsockopt return value. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/glob.c: Remove obsolete cast. 1998-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Rules (tests): Fix last change.
1998-08-03 18:47:01 +02:00
#endif /* _POSIX_MAPPED_FILES */
{
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
/* Read the file in pieces. */
ret = process_fd (cd, fd, output);
/* Now close the file. */
close (fd);
if (ret != 0)
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
{
/* Something went wrong. */
status = EXIT_FAILURE;
if (ret < 0)
/* We cannot go on with producing output since it might
lead to problem because the last output might leave
the output stream in an undefined state. */
break;
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
}
}
}
Update. 2001-02-04 Ulrich Drepper <drepper@redhat.com> * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise.
2001-02-05 06:57:24 +01:00
while (++remaining < argc);
}
/* Close the output file now. */
if (fclose (output))
error (EXIT_FAILURE, errno, _("error while closing output file"));
return status;
}
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
switch (key)
{
case 'f':
from_code = arg;
break;
case 't':
to_code = arg;
break;
case 'o':
output_file = arg;
break;
case 's':
/* Nothing, for now at least. We are not giving out any information
about missing character or so. */
break;
case 'c':
Update. * iconv/gconv.h (__GCONV_IS_LAST, __GCONV_IGNORE_ERRORS): Define. (struct __gconv_step_data): Rename __is_last to __flags. * iconv/gconv_close.c: Change all uses of __is_last. * iconv/skeleton.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconv/gconv_open.c: Likewise. Avoid unneeded initializations. Recognize IGNORE error handling, set flag, and remove from name. * iconv/loop.c (ignore_errors_p): Define. Add flags parameter to both functions. * iconv/skeleton.c: Pass flags to all conversion functions. * iconv/gconv_simple.c: Add flags parameter to all functions. Don't return error for invald error if ignore flag is set. (ucs4_internal_loop_single): Add missing pointer increment. (internal_ucs4le_loop_single): Likewise. * iconv/iconv_prog.c: Implement handling of -c parameter. * iconvdata/8bit-gap.c: Don't return error for invald error if ignore flag is set. * iconvdata/8bit-generic.c: Likewise. * iconvdata/ansi_x3.110.c: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/big5hkscs.c: Likewise. * iconvdata/euc-cn.c: Likewise. * iconvdata/euc-jp.c: Likewise. * iconvdata/euc-kr.c: Likewise. * iconvdata/gbgbk.c: Likewise. * iconvdata/gbk.c: Likewise. * iconvdata/iso-2022-cn.c: Likewise. * iconvdata/iso-2022-jp.c: Likewise. * iconvdata/iso-2022-kr.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso_6937-2.c: Likewise. * iconvdata/iso_6937.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t.61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/unicode.c: Likewise. * iconvdata/utf-16.c: Likewise. * libio/fileops.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Undo *s change in all cases of
2000-06-06 05:16:30 +02:00
/* Omit invalid characters from output. */
omit_invalid = 1;
break;
case OPT_VERBOSE:
verbose = 1;
break;
case OPT_LIST:
list = 1;
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
static char *
more_help (int key, const char *text, void *input)
{
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
default:
break;
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)
{
fprintf (stream, "iconv (GNU %s) %s\n", PACKAGE, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
2006-01-01 20:15:56 +01:00
"), "2006");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
static int
process_block (iconv_t cd, char *addr, size_t len, FILE *output)
{
#define OUTBUF_SIZE 32768
Update. <<<<<<< ChangeLog 1998-04-23 22:43 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (fillin_rpath): Handle empty element returned by strsep as current directory. * iconv/gconv_builtin.h: Add aliases unicode and unicodebig for Java. Add definitions for unicodelittle implementation. * iconv/gconv_int.h: Add declaration for unicodelittle functions. * iconv/gconv_simple.c: Define unicodelittle functions. * iconv/iconv_prog.c: Make program print information about position of illegal character in input. * iconv/skeleton.c: Use __strcasecmp instead of __strcasestr for comparison of charset name. * iconvdata/big5.c (CHARSET_NAME): Adapt for this. * iconvdata/ebcdic-at-de-a.c: Likewise. * iconvdata/ebcdic-at-de.c: Likewise. * iconvdata/ebcdic-ca-fr.c: Likewise. * iconvdata/euccn.c: Likewise. * iconvdata/eucjp.c: Likewise. * iconvdata/euckr.c: Likewise. * iconvdata/euctw.c: Likewise. * iconvdata/hp-roman8.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/koi-8.c: Likewise. * iconvdata/koi8-r.c: Likewise. * iconvdata/latin-greek-1.c: Likewise. * iconvdata/latin-greek.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/iso646.c: Add support for more ISO 646 variants. * iconvdata/TESTS: Add tests for ISO646 module. * iconvdata/gconv-modules: Add new modules. * iconvdata/testdate/CSA_Z243.4-1985-1: New tests for ISO646 module. * iconvdata/testdate/CSA_Z243.4-1985-1..UCS2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2..UCS4: Likewise. * iconvdata/testdate/DIN_66003: Likewise. * iconvdata/testdate/DIN_66003..UTF8: Likewise. * iconvdata/testdate/DS_2089: Likewise. * iconvdata/testdate/DS_2089..UTF8: Likewise. * iconvdata/testdate/ES: Likewise. * iconvdata/testdate/ES..UTF8: Likewise. * iconvdata/testdate/ES2: Likewise. * iconvdata/testdate/ES2..UTF8: Likewise. * iconvdata/testdate/GB_1988-80: Likewise. * iconvdata/testdate/GB_1988-80..UTF8: Likewise. * iconvdata/testdate/IT: Likewise. * iconvdata/testdate/IT..UTF8: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO..UTF8: Likewise. * iconvdata/testdate/JIS_C6229-1984-B: Likewise. * iconvdata/testdate/JIS_C6229-1984-B..UTF8: Likewise. * iconvdata/testdate/JUS_I.B1.002: Likewise. * iconvdata/testdate/JUS_I.B1.002..UTF8: Likewise. * iconvdata/testdate/KSC5636: Likewise. * iconvdata/testdate/KSC5636..UTF8: Likewise. * iconvdata/testdate/MSZ_7795.3: Likewise. * iconvdata/testdate/MSZ_7795.3..UTF8: Likewise. * iconvdata/testdate/NC_NC00-10: Likewise. * iconvdata/testdate/NC_NC00-10..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010: Likewise. * iconvdata/testdate/NF_Z_62-010..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010_1973: Likewise. * iconvdata/testdate/NF_Z_62-010_1973..UTF8: Likewise. * iconvdata/testdate/NS_4551-1: Likewise. * iconvdata/testdate/NS_4551-1..UTF8: Likewise. * iconvdata/testdate/NS_4551-2: Likewise. * iconvdata/testdate/NS_4551-2..UTF8: Likewise. * iconvdata/testdate/PT: Likewise. * iconvdata/testdate/PT..UTF8: Likewise. * iconvdata/testdate/PT2: Likewise. * iconvdata/testdate/PT2..UTF8: Likewise. * iconvdata/testdate/SEN_850200_B: Likewise. * iconvdata/testdate/SEN_850200_B..UTF8: Likewise. * iconvdata/testdate/SEN_850200_C: Likewise. * iconvdata/testdate/SEN_850200_C..UTF8: Likewise. * iconvdata/cns11643.h: Use uint32_t instead of wchar_t. * iconvdata/cns11643l1.h: Likewise. * iconvdata/latin-greek-1.h: Likewise. * iconvdata/latin-greek.h: Likewise. * iconvdata/koi8-r.h: Likewise. * iconvdata/jis0212.h: Likewise. * iconvdata/gb2312.h: Likewise. * iconvdata/ksc5601.h: Likewise. * iconvdata/8bit-gap.c: Use 32 bit type for idx element of struct gap. * iconvdata/Makefile: Add rules for lots of more modules. * iconvdata/cp1250.c: New file. * iconvdata/cp1251.c: New file. * iconvdata/cp1252.c: New file. * iconvdata/cp1253.c: New file. * iconvdata/cp1254.c: New file. * iconvdata/cp1255.c: New file. * iconvdata/cp1256.c: New file. * iconvdata/cp1257.c: New file. * iconvdata/ebcdic-dk-no-a.c: New file. * iconvdata/ebcdic-dk-no.c: New file. * iconvdata/ebcdic-es-a.c: New file. * iconvdata/ebcdic-es-s.c: New file. * iconvdata/ebcdic-es.c: New file. * iconvdata/ebcdic-fi-se-a.c: New file. * iconvdata/ebcdic-fi-se.c: New file. * iconvdata/ebcdic-fr.c: New file. * iconvdata/ebcdic-is-friss.c: New file. * iconvdata/ebcdic-it.c: New file. * iconvdata/ebcdic-pt.c: New file. * iconvdata/ebcdic-uk.c: New file. * iconvdata/ebcdic-us.c: New file. * iconvdata/ibm037.c: New file. * iconvdata/ibm038.c: New file. * iconvdata/ibm1004.c: New file. * iconvdata/ibm1026.c: New file. * iconvdata/ibm1047.c: New file. * iconvdata/ibm256.c: New file. * iconvdata/ibm273.c: New file. * iconvdata/ibm274.c: New file. * iconvdata/ibm275.c: New file. * iconvdata/ibm277.c: New file. * iconvdata/ibm278.c: New file. * iconvdata/ibm280.c: New file. * iconvdata/ibm281.c: New file. * iconvdata/ibm284.c: New file. * iconvdata/ibm285.c: New file. * iconvdata/ibm290.c: New file. * iconvdata/ibm297.c: New file. * iconvdata/ibm420.c: New file. * iconvdata/ibm423.c: New file. * iconvdata/ibm424.c: New file. * iconvdata/ibm437.c: New file. * iconvdata/ibm500.c: New file. * iconvdata/ibm850.c: New file. * iconvdata/ibm851.c: New file. * iconvdata/ibm852.c: New file. * iconvdata/ibm855.c: New file. * iconvdata/ibm857.c: New file. * iconvdata/ibm860.c: New file. * iconvdata/ibm861.c: New file. * iconvdata/ibm862.c: New file. * iconvdata/ibm863.c: New file. * iconvdata/ibm864.c: New file. * iconvdata/ibm865.c: New file. * iconvdata/ibm868.c: New file. * iconvdata/ibm869.c: New file. * iconvdata/ibm870.c: New file. * iconvdata/ibm871.c: New file. * iconvdata/ibm875.c: New file. * iconvdata/ibm880.c: New file. * iconvdata/ibm891.c: New file. * iconvdata/ibm903.c: New file. * iconvdata/ibm904.c: New file. * iconvdata/ibm905.c: New file. * iconvdata/ibm918.c: New file. * locale/iso-4217.def: Update. * localedata/locales/pt_BR: Correct. Patches by Andreas Jaeger. * stdio-common/vfscanf.h: Recognize nan and inf in floating-point formats. 1998-04-22 Andreas Jaeger <aj@arthur.rhein-neckar.de> * elf/dl-load.c (_dl_init_paths): ';' is also a terminal for LD_LIBRARY_PATH. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * Makerules: Change occurances of `cd dir; cmd' to `cd dir && cmd'. * Makefile: Likewise. * posix/Makefile: Likewise. * sysdeps/mach/hurd/Makefile: Likewise. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/bits/dirent.h: New file. * sysdeps/mach/hurd/readdir64.c: New file. * sysdeps/mach/hurd/readdir64_r.c: New file. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * stdio/stdio.h (vasprintf, __asprintf, asprintf, vdprintf, dprintf): Synchronize declarations with libio/stdio.h. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * elf/dlerror.c (dlerror): Don't assume that __libc_internal_tsd_get is defined. __libc_getspecific is already well-protected, so just use it directly. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * io/ftw.h (ftw): Fix typo. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/gnu/utmp_file.c: Fix typo. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconvdata/run-iconv-test.sh: Fix more portability bugs. When one part of a test fails move on to the next test. 1998-04-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Compare addresses as pointers, not signed integers. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1998-04-24 09:07:59 +02:00
const char *start = addr;
char outbuf[OUTBUF_SIZE];
Update. 1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com> * libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and __libc_siglongjmp to GLIBC_2.1. * elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use __strerror_r. * iconv/Makefile: Don't run tests now. * iconv/iconv_prog.c (process_block): If loop is repeated, call iconv with correct output buffer. Major rewrite of the low-level gconv functionality. * iconv/gconv.c: Rewritten. * iconv/gconv.h: Likewise. * iconv/gconv_builtin.c: Likewise. * iconv/gconv_builtin.h: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_open.c: Likewise. * iconv/gconv_simple.c: Likewise. * iconv/iconv.c: Likewise. * iconvdata/8bit-gap.c: Likewise. * iconvdata/8bit-generic.c: Likewise. * iconvdata/Makefile: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/cns11643.c: Likewise. * iconvdata/cns11643.h: Likewise. * iconvdata/cns11643l1.c: Likewise. * iconvdata/cns11643l1.h: Likewise. * iconvdata/ebcdic-at-de-a.c: Likewise. * iconvdata/ebcdic-at-de.c: Likewise. * iconvdata/ebcdic-ca-fr.c: Likewise. * iconvdata/euccn.c: Likewise. * iconvdata/eucjp.c: Likewise. * iconvdata/euckr.c: Likewise. * iconvdata/euctw.c: Likewise. * iconvdata/gb2312.c: Likewise. * iconvdata/gb2312.h: Likewise. * iconvdata/hp-roman8.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/jis0201.c: Likewise. * iconvdata/jis0201.h: Likewise. * iconvdata/jis0208.c: Likewise. * iconvdata/jis0208.h: Likewise. * iconvdata/jis0212.c: Likewise. * iconvdata/jis0212.h: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/koi-8.c: Likewise. * iconvdata/koi8-r.c: Likewise. * iconvdata/ksc5601.c: Likewise. * iconvdata/ksc5601.h: Likewise. * iconvdata/latin-greek-1.c: Likewise. * iconvdata/latin-greek.c: Likewise. * iconvdata/run-iconv-test.sh: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/uhc.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsmbsload.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconv/loop.c: New file. * iconv/skeleton.c: New file. * stdlib/mblen.c: Handle empty input string correctly. * stdlib/mbtowc.c: Likewise. * posix/getopt.c: Various cleanups. * sysdeps/arm/bits/setjmp.h: Add copyright text. * sysdeps/i386/bits/setjmp.h: Likewise. * sysdeps/m68k/bits/setjmp.h: Likewise. * sysdeps/powerpc/bits/setjmp.h: Likewise. * sysdeps/sparc/sparc32/bits/setjmp.h: Likewise. * sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp and make longjmp weak alias. 1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com> * iconv/Makefile (routines): Only include gconv_dl if building for an ELF system - dynamic linking is not available on a.out. (CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl due to above check. * iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call routines from gconv_dl. 1998-04-17 Gordon Matzigkeit <gord@profitpress.com> * csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that we can compile without libio. 1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/hurd/Subdirs: Remove login. 1998-04-11 Gordon Matzigkeit <gord@profitpress.com> * db2/compat.h: Include <errno.h>, to make sure we get the definition of EFTYPE before we define it ourselves. 1998-04-10 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/generic/bits/socket.h: Protect against multiple inclusion. * sysdeps/mach/hurd/bits/ioctls.h: Likewise. Fix typo to allow inclusion from sys/ioctl.h again. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconvdata/*.[ch]: Clean up namespace. Optimize character lookup. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libc.map: Export __strerror_r. Remove _strerror_internal. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr. Also undefine __strcasestr. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/regex.c: Rename __re_max_failures back to re_max_failures, aliases do not work with global variables due to copy relocations. 1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com> * manual/creature.texi: Fix type. Patch by Andreas Schwab. 1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com> * signal/sighold.c: Include stddef.h for NULL definition. * signal/sigrelse.c: Likewise. * sysdeps/posix/sigignore.c: Likewise. * sysdeps/posix/sigset.c: Likewise. * sysdeps/posix/waitid.c: Likewise. * sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. * wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX. Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>. 1998-04-13 Mark Kettenis <kettenis@phys.uva.nl> * login/Makefile (headers): Remove utmpx.h and bits/utmpx.h. * login/getutent.c (getutxent): Remove alias. * login/getutent_r.c (setutxent, pututxline, endutxent): Remove aliases. * login/getutid.c (getutxid): Remove alias. * login/getutline.c (getutxline): Remove alias. * login/utmp.h: Add prototypes for __updwtmp, __getutent, __getutid, __getutline and __pututline. * login/utmpx.h: Moved to ... * sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE, UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname and updwtmpx. * login/updwtmp.c: Moved to ... * sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by allowing file name transformation. * sysdeps/gnu/updwtmp.c: New file. Use generic implementation with additional file name transformation. * sysdeps/unix/sysv/linux/updwtmp.c: Likewise. * login/utmp_file.c: Moved to ... * sysdeps/generic/utmp_file.c: ... here. (setutent_file): Generalized by allowing file name transformation. Do not print error message. Library functions should not print them. Reported by Jim Meyering. * sysdeps/gnu/utmp_file.c: New file. Use generic implementation with additional file name transformation. * sysdeps/unix/sysv/linux/utmp_file.c: Likewise. * sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add setutxent, getutxent, endutxent, getutxid, getutxid, getutxline, pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h and bits/utmpx.h. * sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h. (_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to _PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING): Define if __USE_GNU. * sysdeps/gnu/setutxent.c: New file. * sysdeps/gnu/getutxent.c: New file. * sysdeps/gnu/endutxent.c: New file. * sysdeps/gnu/getutxid.c: New file. * sysdeps/gnu/getutxline.c: New file. * sysdeps/gnu/pututxline.c: New file. * sysdeps/gnu/utmpxname.c: New file. * sysdeps/gnu/updwtmpx.c: New file. * sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove. * sysdeps/generic/bits/utmpx.h: Remove. 1998-04-20 Ulrich Drepper <drepper@cygnus.com> * posix/wordexp-test.c (main): Initialize ifs element of ts for ~root test. 1998-04-17 07:53 H.J. Lu <hjl@gnu.org> * sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo. 1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com> * libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st variable using _G_stat64. * libio/fileops.c: Remove macro definition of fstat, it is in the global header. Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>. 1998-04-17 Philip Blundell <pb@nexus.co.uk> * sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox <willy@odie.barnet.ac.uk>. 1998-04-16 Philip Blundell <Philip.Blundell@pobox.com> * inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro, required by IPv6 Basic API. (IN6_IS_ADDR_MC_LINKLOCAL): Likewise. (IN6_IS_ADDR_MC_SITELOCAL): Likewise. (IN6_IS_ADDR_MC_ORGLOCAL): Likewise. (IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
char *outptr;
size_t outlen;
size_t n;
int ret = 0;
while (len > 0)
{
Update. 1998-04-20 18:00 Ulrich Drepper <drepper@cygnus.com> * libc.map: Add __dgettext to GLIBC_2.0 and __libc_longjmp, and __libc_siglongjmp to GLIBC_2.1. * elf/dl-minimal.c (__assert_perror_fail): Don't use strerror, use __strerror_r. * iconv/Makefile: Don't run tests now. * iconv/iconv_prog.c (process_block): If loop is repeated, call iconv with correct output buffer. Major rewrite of the low-level gconv functionality. * iconv/gconv.c: Rewritten. * iconv/gconv.h: Likewise. * iconv/gconv_builtin.c: Likewise. * iconv/gconv_builtin.h: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_open.c: Likewise. * iconv/gconv_simple.c: Likewise. * iconv/iconv.c: Likewise. * iconvdata/8bit-gap.c: Likewise. * iconvdata/8bit-generic.c: Likewise. * iconvdata/Makefile: Likewise. * iconvdata/big5.c: Likewise. * iconvdata/cns11643.c: Likewise. * iconvdata/cns11643.h: Likewise. * iconvdata/cns11643l1.c: Likewise. * iconvdata/cns11643l1.h: Likewise. * iconvdata/ebcdic-at-de-a.c: Likewise. * iconvdata/ebcdic-at-de.c: Likewise. * iconvdata/ebcdic-ca-fr.c: Likewise. * iconvdata/euccn.c: Likewise. * iconvdata/eucjp.c: Likewise. * iconvdata/euckr.c: Likewise. * iconvdata/euctw.c: Likewise. * iconvdata/gb2312.c: Likewise. * iconvdata/gb2312.h: Likewise. * iconvdata/hp-roman8.c: Likewise. * iconvdata/iso646.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/jis0201.c: Likewise. * iconvdata/jis0201.h: Likewise. * iconvdata/jis0208.c: Likewise. * iconvdata/jis0208.h: Likewise. * iconvdata/jis0212.c: Likewise. * iconvdata/jis0212.h: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/koi-8.c: Likewise. * iconvdata/koi8-r.c: Likewise. * iconvdata/ksc5601.c: Likewise. * iconvdata/ksc5601.h: Likewise. * iconvdata/latin-greek-1.c: Likewise. * iconvdata/latin-greek.c: Likewise. * iconvdata/run-iconv-test.sh: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/uhc.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsmbsload.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconv/loop.c: New file. * iconv/skeleton.c: New file. * stdlib/mblen.c: Handle empty input string correctly. * stdlib/mbtowc.c: Likewise. * posix/getopt.c: Various cleanups. * sysdeps/arm/bits/setjmp.h: Add copyright text. * sysdeps/i386/bits/setjmp.h: Likewise. * sysdeps/m68k/bits/setjmp.h: Likewise. * sysdeps/powerpc/bits/setjmp.h: Likewise. * sysdeps/sparc/sparc32/bits/setjmp.h: Likewise. * sysdeps/generic/longjmp.c: Rename function to __libc_siglongjmp and make longjmp weak alias. 1998-04-18 20:29 Philip Blundell <Philip.Blundell@pobox.com> * iconv/Makefile (routines): Only include gconv_dl if building for an ELF system - dynamic linking is not available on a.out. (CFLAGS-gconv_conf.c): Define STATIC_GCONV if omitting gconv_dl due to above check. * iconv/gconv_db.c: If STATIC_GCONV defined, don't try to call routines from gconv_dl. 1998-04-17 Gordon Matzigkeit <gord@profitpress.com> * csu/init.c (_IO_stdin_used): Protect with USE_IN_LIBIO so that we can compile without libio. 1998-04-20 16:28 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/hurd/Subdirs: Remove login. 1998-04-11 Gordon Matzigkeit <gord@profitpress.com> * db2/compat.h: Include <errno.h>, to make sure we get the definition of EFTYPE before we define it ourselves. 1998-04-10 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/generic/bits/socket.h: Protect against multiple inclusion. * sysdeps/mach/hurd/bits/ioctls.h: Likewise. Fix typo to allow inclusion from sys/ioctl.h again. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconvdata/*.[ch]: Clean up namespace. Optimize character lookup. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libc.map: Export __strerror_r. Remove _strerror_internal. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/strcasestr.c: Undefine strcasestr, not strstr. Also undefine __strcasestr. 1998-04-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/regex.c: Rename __re_max_failures back to re_max_failures, aliases do not work with global variables due to copy relocations. 1998-04-20 15:12 Ulrich Drepper <drepper@cygnus.com> * manual/creature.texi: Fix type. Patch by Andreas Schwab. 1998-04-20 13:47 Ulrich Drepper <drepper@cygnus.com> * signal/sighold.c: Include stddef.h for NULL definition. * signal/sigrelse.c: Likewise. * sysdeps/posix/sigignore.c: Likewise. * sysdeps/posix/sigset.c: Likewise. * sysdeps/posix/waitid.c: Likewise. * sysdeps/unix/sysv/linux/rt_sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. * wcsmbs/mbsrtowcs.c: Include stdlib.h for MB_CUR_MAX. Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>. 1998-04-13 Mark Kettenis <kettenis@phys.uva.nl> * login/Makefile (headers): Remove utmpx.h and bits/utmpx.h. * login/getutent.c (getutxent): Remove alias. * login/getutent_r.c (setutxent, pututxline, endutxent): Remove aliases. * login/getutid.c (getutxid): Remove alias. * login/getutline.c (getutxline): Remove alias. * login/utmp.h: Add prototypes for __updwtmp, __getutent, __getutid, __getutline and __pututline. * login/utmpx.h: Moved to ... * sysdeps/gnu/utmpx.h: ... here. [__USE_GNU]: Define UTMPX_FILE, UTMPX_FILENAME, WTMPX_FILE and WTMPX_FILENAME, declare utmpxname and updwtmpx. * login/updwtmp.c: Moved to ... * sysdeps/generic/updwtmp.c: ... here. (updwtmp): Generalized by allowing file name transformation. * sysdeps/gnu/updwtmp.c: New file. Use generic implementation with additional file name transformation. * sysdeps/unix/sysv/linux/updwtmp.c: Likewise. * login/utmp_file.c: Moved to ... * sysdeps/generic/utmp_file.c: ... here. (setutent_file): Generalized by allowing file name transformation. Do not print error message. Library functions should not print them. Reported by Jim Meyering. * sysdeps/gnu/utmp_file.c: New file. Use generic implementation with additional file name transformation. * sysdeps/unix/sysv/linux/utmp_file.c: Likewise. * sysdeps/gnu/Makefile [$(subdir)=login] (sysdep_routines): Add setutxent, getutxent, endutxent, getutxid, getutxid, getutxline, pututxline, utmpxname and updwtmpx. (sysdep_headers): Add utmpx.h and bits/utmpx.h. * sysdeps/gnu/bits/utmpx.h [__USE_GNU] Include paths.h. (_PATH_UTMPX): Define to _PATH_UTMP. (_PATH_WTMPX): Define to _PATH_WTMPX. (RUN_LVL): Define only if __USE_GNU. (ACCOUNTING): Define if __USE_GNU. * sysdeps/gnu/setutxent.c: New file. * sysdeps/gnu/getutxent.c: New file. * sysdeps/gnu/endutxent.c: New file. * sysdeps/gnu/getutxid.c: New file. * sysdeps/gnu/getutxline.c: New file. * sysdeps/gnu/pututxline.c: New file. * sysdeps/gnu/utmpxname.c: New file. * sysdeps/gnu/updwtmpx.c: New file. * sysdeps/unix/sysv/linux/paths.h (_PATH_UTMP_DB): Remove. * sysdeps/generic/bits/utmpx.h: Remove. 1998-04-20 Ulrich Drepper <drepper@cygnus.com> * posix/wordexp-test.c (main): Initialize ifs element of ts for ~root test. 1998-04-17 07:53 H.J. Lu <hjl@gnu.org> * sysdeps/unix/sysv/linux/i386/s_pread64.S: Fix a typo. 1998-04-17 11:32 Ulrich Drepper <drepper@cygnus.com> * libio/oldfileops.c (_IO_old_file_seekoff): Define temporary st variable using _G_stat64. * libio/fileops.c: Remove macro definition of fstat, it is in the global header. Reported by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>. 1998-04-17 Philip Blundell <pb@nexus.co.uk> * sysdeps/arm/strlen.S: New file, based on code by Matthew Wilcox <willy@odie.barnet.ac.uk>. 1998-04-16 Philip Blundell <Philip.Blundell@pobox.com> * inet/netinet/in.h (IN6_IS_ADDR_MC_NODELOCAL): New macro, required by IPv6 Basic API. (IN6_IS_ADDR_MC_LINKLOCAL): Likewise. (IN6_IS_ADDR_MC_SITELOCAL): Likewise. (IN6_IS_ADDR_MC_ORGLOCAL): Likewise. (IN6_IS_ADDR_MC_GLOBAL): Likewise.
1998-04-20 20:41:05 +02:00
outptr = outbuf;
outlen = OUTBUF_SIZE;
n = iconv (cd, &addr, &len, &outptr, &outlen);
if (n == (size_t) -1 && omit_invalid && errno == EILSEQ)
{
ret = 1;
if (len == 0)
n = 0;
else
errno = E2BIG;
}
if (outptr != outbuf)
{
/* We have something to write out. */
Update. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * scripts/config.sub: Update from latest autoconf version. * scripts/config.guess: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * inet/arpa/inet.h: Remove K&R compatibility. * math/fenv.h: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/kernel_sigaction.h (struct kernel_sigaction): Remove K&R compatibility. * sysdeps/unix/sysv/linux/net/if.h: Likewise. * sysdeps/unix/sysv/linux/sys/acct.h: Likewise. * sysdeps/unix/sysv/linux/sys/fsuid.h: Likewise. * sysdeps/unix/sysv/linux/sys/io.h: Likewise. * sysdeps/unix/sysv/linux/sys/kdaemon.h: Likewise. * sysdeps/unix/sysv/linux/sys/klog.h: Likewise. * sysdeps/unix/sysv/linux/sys/mount.h: Likewise. * sysdeps/unix/sysv/linux/sys/prctl.h: Likewise. * sysdeps/unix/sysv/linux/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sys/quota.h: Likewise. * sysdeps/unix/sysv/linux/sys/sendfile.h: Likewise. * sysdeps/unix/sysv/linux/sys/swap.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysctl.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysinfo.h: Likewise. * sysdeps/unix/sysv/linux/sys/timex.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/vm86.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/perm.h: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * iconv/iconv_prog.c (process_block): Save errno value from iconv call. Patch by Bruno Haible <haible@ilog.fr> [libc/1402]. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * po/gl.po: New file. 1999-10-18 Andreas Schwab <schwab@suse.de> * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Correct namespace selection. 1999-10-18 Andreas Schwab <schwab@suse.de> * debug/xtrace.sh: Use TERMINAL_PROG instead of TERM to avoid clash with the TERM environment variable. 1999-10-18 Andreas Jaeger <aj@suse.de> * sysdeps/generic/s_cproj.c (__cproj): Fix bug: NaN + i NaN returns now NaN + i NaN. * sysdeps/generic/s_cprojf.c (__cprojf): Likewise * sysdeps/generic/s_cprojl.c (__cprojl): Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * include/aio.h: Remove K&R compatiblity. * include/alloca.h: Likewise. * include/db.h: Likewise. * include/dirent.h: Likewise. * include/fcntl.h: Likewise. * include/fpu_control.h: Likewise. * include/glob.h: Likewise. * include/grp.h: Likewise. * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/bits/siginfo.h: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h: Likewise. * include/execinfo.h: Add __THROW. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mips/Implies: Remove wordsize-32 reference. * sysdeps/mips/mips3/Implies: Add it here.
1999-10-19 05:14:36 +02:00
int errno_save = errno;
Update. 2002-08-24 Ulrich Drepper <drepper@redhat.com> * locale/programs/charmap.c (charmap_new_char): Don't use ULONG_MAX as maximum UCS4 value. * sysdeps/unix/sysv/linux/ia64/sys/user.h: New file. * sysdeps/generic/strtol.c: We don't need the isascii test in glibc. * malloc/hooks.c (public_sET_STATe): use size_t as type for i. * malloc/malloc.c (mALLINFo): Likewise. * libio/wstrops.c (_IO_wstr_pbackfail): Use WEOF in comparison. * libio/wfileops.c (_IO_wfile_overflow): Use EOF not WEOF when examining result of _IO_do_flush call. * stdio-common/vfprintf.c (vfprintf): Use correct type in va_arg. Use prec not spec when sizing buffers. * catgets/open_catalog.c (__open_catalog): Add casts to avoid warnings. * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. * locale/loadlocale.c (_nl_intern_locale_data): Likewise. * stdio-common/vfscanf.c (inchar): Likewise. * misc/efgcvt_r.c (fcvt_r): Likewise. * elf/dl-misc.c (_dl_debug_vdprintf): Likewise. * elf/readlib.c (process_file): Likewise. * elf/sprof.c (load_profdata): Likewise. * sysdeps/ia64/hp-timing.h (HP_TIMING_PRINT): Likewise. * locale/programs/linereader.c (get_toplvl_escape): Likewise. * locale/programs/charmap.c (charmap_read): Likewise. * libio/fileops.c: Likewise. * libio/fmemopen.c: Likewise. * stdlib/strtod.c: Likewise. * elf/dl-load.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c (process_block): Likewise. * sysdeps/unix/sysv/linux/ia64/Makefile: Define _ASM_IA64_CURRENT_H macro to calm down the compiler. * iconv/gconv_cache.c (__gconv_load_cache): Add cast to avoid warning. * sysdeps/ia64/elf/initfini.c: Don't use newlines embedded in string. * sysdeps/unix/sysv/linux/i386/sysdep.S: Update comment regarding placement of errno definition. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. * resolv/nss_dns/dns-host.c (MAXPACKET): Increase minimum value from 1024 to 65536, to avoid buffer overrun. 2002-08-16 Paul Eggert <eggert@twinsun.com> * resolv/gethnamaddr.c (MAXPACKET): Increase minimum value from 1024 to 65536, to avoid buffer overrun. * resolv/res_query.c (MAXPACKET): Likewise. architectures.
2002-08-25 06:51:08 +02:00
if (fwrite (outbuf, 1, outptr - outbuf, output)
< (size_t) (outptr - outbuf)
|| ferror (output))
{
/* Error occurred while printing the result. */
error (0, 0, _("\
conversion stopped due to problem in writing the output"));
return -1;
}
Update. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * scripts/config.sub: Update from latest autoconf version. * scripts/config.guess: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * inet/arpa/inet.h: Remove K&R compatibility. * math/fenv.h: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/kernel_sigaction.h (struct kernel_sigaction): Remove K&R compatibility. * sysdeps/unix/sysv/linux/net/if.h: Likewise. * sysdeps/unix/sysv/linux/sys/acct.h: Likewise. * sysdeps/unix/sysv/linux/sys/fsuid.h: Likewise. * sysdeps/unix/sysv/linux/sys/io.h: Likewise. * sysdeps/unix/sysv/linux/sys/kdaemon.h: Likewise. * sysdeps/unix/sysv/linux/sys/klog.h: Likewise. * sysdeps/unix/sysv/linux/sys/mount.h: Likewise. * sysdeps/unix/sysv/linux/sys/prctl.h: Likewise. * sysdeps/unix/sysv/linux/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sys/quota.h: Likewise. * sysdeps/unix/sysv/linux/sys/sendfile.h: Likewise. * sysdeps/unix/sysv/linux/sys/swap.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysctl.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysinfo.h: Likewise. * sysdeps/unix/sysv/linux/sys/timex.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/vm86.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/perm.h: Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * iconv/iconv_prog.c (process_block): Save errno value from iconv call. Patch by Bruno Haible <haible@ilog.fr> [libc/1402]. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * po/gl.po: New file. 1999-10-18 Andreas Schwab <schwab@suse.de> * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Correct namespace selection. 1999-10-18 Andreas Schwab <schwab@suse.de> * debug/xtrace.sh: Use TERMINAL_PROG instead of TERM to avoid clash with the TERM environment variable. 1999-10-18 Andreas Jaeger <aj@suse.de> * sysdeps/generic/s_cproj.c (__cproj): Fix bug: NaN + i NaN returns now NaN + i NaN. * sysdeps/generic/s_cprojf.c (__cprojf): Likewise * sysdeps/generic/s_cprojl.c (__cprojl): Likewise. 1999-10-18 Andreas Jaeger <aj@suse.de> * include/aio.h: Remove K&R compatiblity. * include/alloca.h: Likewise. * include/db.h: Likewise. * include/dirent.h: Likewise. * include/fcntl.h: Likewise. * include/fpu_control.h: Likewise. * include/glob.h: Likewise. * include/grp.h: Likewise. * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/bits/siginfo.h: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h: Likewise. * include/execinfo.h: Add __THROW. 1999-10-18 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mips/Implies: Remove wordsize-32 reference. * sysdeps/mips/mips3/Implies: Add it here.
1999-10-19 05:14:36 +02:00
errno = errno_save;
}
if (n != (size_t) -1)
{
/* All the input test is processed. For state-dependent
character sets we have to flush the state now. */
outptr = outbuf;
outlen = OUTBUF_SIZE;
n = iconv (cd, NULL, NULL, &outptr, &outlen);
if (outptr != outbuf)
{
/* We have something to write out. */
int errno_save = errno;
Update. 2002-08-24 Ulrich Drepper <drepper@redhat.com> * locale/programs/charmap.c (charmap_new_char): Don't use ULONG_MAX as maximum UCS4 value. * sysdeps/unix/sysv/linux/ia64/sys/user.h: New file. * sysdeps/generic/strtol.c: We don't need the isascii test in glibc. * malloc/hooks.c (public_sET_STATe): use size_t as type for i. * malloc/malloc.c (mALLINFo): Likewise. * libio/wstrops.c (_IO_wstr_pbackfail): Use WEOF in comparison. * libio/wfileops.c (_IO_wfile_overflow): Use EOF not WEOF when examining result of _IO_do_flush call. * stdio-common/vfprintf.c (vfprintf): Use correct type in va_arg. Use prec not spec when sizing buffers. * catgets/open_catalog.c (__open_catalog): Add casts to avoid warnings. * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. * locale/loadlocale.c (_nl_intern_locale_data): Likewise. * stdio-common/vfscanf.c (inchar): Likewise. * misc/efgcvt_r.c (fcvt_r): Likewise. * elf/dl-misc.c (_dl_debug_vdprintf): Likewise. * elf/readlib.c (process_file): Likewise. * elf/sprof.c (load_profdata): Likewise. * sysdeps/ia64/hp-timing.h (HP_TIMING_PRINT): Likewise. * locale/programs/linereader.c (get_toplvl_escape): Likewise. * locale/programs/charmap.c (charmap_read): Likewise. * libio/fileops.c: Likewise. * libio/fmemopen.c: Likewise. * stdlib/strtod.c: Likewise. * elf/dl-load.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c (process_block): Likewise. * sysdeps/unix/sysv/linux/ia64/Makefile: Define _ASM_IA64_CURRENT_H macro to calm down the compiler. * iconv/gconv_cache.c (__gconv_load_cache): Add cast to avoid warning. * sysdeps/ia64/elf/initfini.c: Don't use newlines embedded in string. * sysdeps/unix/sysv/linux/i386/sysdep.S: Update comment regarding placement of errno definition. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. * resolv/nss_dns/dns-host.c (MAXPACKET): Increase minimum value from 1024 to 65536, to avoid buffer overrun. 2002-08-16 Paul Eggert <eggert@twinsun.com> * resolv/gethnamaddr.c (MAXPACKET): Increase minimum value from 1024 to 65536, to avoid buffer overrun. * resolv/res_query.c (MAXPACKET): Likewise. architectures.
2002-08-25 06:51:08 +02:00
if (fwrite (outbuf, 1, outptr - outbuf, output)
< (size_t) (outptr - outbuf)
|| ferror (output))
{
/* Error occurred while printing the result. */
error (0, 0, _("\
conversion stopped due to problem in writing the output"));
return -1;
}
errno = errno_save;
}
if (n != (size_t) -1)
break;
if (omit_invalid && errno == EILSEQ)
{
ret = 1;
break;
}
}
if (errno != E2BIG)
{
/* iconv() ran into a problem. */
switch (errno)
{
case EILSEQ:
if (! omit_invalid)
error (0, 0, _("illegal input sequence at position %ld"),
(long int) (addr - start));
break;
case EINVAL:
error (0, 0, _("\
incomplete character or shift sequence at end of buffer"));
break;
case EBADF:
error (0, 0, _("internal error (illegal descriptor)"));
break;
default:
error (0, 0, _("unknown iconv() error %d"), errno);
break;
}
return -1;
}
}
return ret;
}
static int
process_fd (iconv_t cd, int fd, FILE *output)
{
/* we have a problem with reading from a desriptor since we must not
provide the iconv() function an incomplete character or shift
sequence at the end of the buffer. Since we have to deal with
arbitrary encodings we must read the whole text in a buffer and
process it in one step. */
static char *inbuf = NULL;
static size_t maxlen = 0;
char *inptr = NULL;
size_t actlen = 0;
while (actlen < maxlen)
{
ssize_t n = read (fd, inptr, maxlen - actlen);
if (n == 0)
/* No more text to read. */
break;
if (n == -1)
{
/* Error while reading. */
error (0, errno, _("error while reading the input"));
return -1;
}
inptr += n;
actlen += n;
}
if (actlen == maxlen)
while (1)
{
ssize_t n;
char *new_inbuf;
/* Increase the buffer. */
new_inbuf = (char *) realloc (inbuf, maxlen + 32768);
if (new_inbuf == NULL)
{
error (0, errno, _("unable to allocate buffer for input"));
return -1;
}
inbuf = new_inbuf;
maxlen += 32768;
inptr = inbuf + actlen;
do
{
n = read (fd, inptr, maxlen - actlen);
if (n == 0)
/* No more text to read. */
break;
if (n == -1)
{
/* Error while reading. */
error (0, errno, _("error while reading the input"));
return -1;
}
inptr += n;
actlen += n;
}
while (actlen < maxlen);
if (n == 0)
/* Break again so we leave both loops. */
break;
}
/* Now we have all the input in the buffer. Process it in one run. */
return process_block (cd, inbuf, actlen, output);
}
static int
process_file (iconv_t cd, FILE *input, FILE *output)
{
/* This should be safe since we use this function only for `stdin' and
we haven't read anything so far. */
return process_fd (cd, fileno (input), output);
}
/* Print all known character sets/encodings. */
static void *printlist;
static size_t column;
static int not_first;
static void
insert_print_list (const void *nodep, VISIT value, int level)
{
if (value == leaf || value == postorder)
{
const struct gconv_alias *s = *(const struct gconv_alias **) nodep;
Update. <<<<<<< ChangeLog 1998-04-23 22:43 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (fillin_rpath): Handle empty element returned by strsep as current directory. * iconv/gconv_builtin.h: Add aliases unicode and unicodebig for Java. Add definitions for unicodelittle implementation. * iconv/gconv_int.h: Add declaration for unicodelittle functions. * iconv/gconv_simple.c: Define unicodelittle functions. * iconv/iconv_prog.c: Make program print information about position of illegal character in input. * iconv/skeleton.c: Use __strcasecmp instead of __strcasestr for comparison of charset name. * iconvdata/big5.c (CHARSET_NAME): Adapt for this. * iconvdata/ebcdic-at-de-a.c: Likewise. * iconvdata/ebcdic-at-de.c: Likewise. * iconvdata/ebcdic-ca-fr.c: Likewise. * iconvdata/euccn.c: Likewise. * iconvdata/eucjp.c: Likewise. * iconvdata/euckr.c: Likewise. * iconvdata/euctw.c: Likewise. * iconvdata/hp-roman8.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/koi-8.c: Likewise. * iconvdata/koi8-r.c: Likewise. * iconvdata/latin-greek-1.c: Likewise. * iconvdata/latin-greek.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/iso646.c: Add support for more ISO 646 variants. * iconvdata/TESTS: Add tests for ISO646 module. * iconvdata/gconv-modules: Add new modules. * iconvdata/testdate/CSA_Z243.4-1985-1: New tests for ISO646 module. * iconvdata/testdate/CSA_Z243.4-1985-1..UCS2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2..UCS4: Likewise. * iconvdata/testdate/DIN_66003: Likewise. * iconvdata/testdate/DIN_66003..UTF8: Likewise. * iconvdata/testdate/DS_2089: Likewise. * iconvdata/testdate/DS_2089..UTF8: Likewise. * iconvdata/testdate/ES: Likewise. * iconvdata/testdate/ES..UTF8: Likewise. * iconvdata/testdate/ES2: Likewise. * iconvdata/testdate/ES2..UTF8: Likewise. * iconvdata/testdate/GB_1988-80: Likewise. * iconvdata/testdate/GB_1988-80..UTF8: Likewise. * iconvdata/testdate/IT: Likewise. * iconvdata/testdate/IT..UTF8: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO..UTF8: Likewise. * iconvdata/testdate/JIS_C6229-1984-B: Likewise. * iconvdata/testdate/JIS_C6229-1984-B..UTF8: Likewise. * iconvdata/testdate/JUS_I.B1.002: Likewise. * iconvdata/testdate/JUS_I.B1.002..UTF8: Likewise. * iconvdata/testdate/KSC5636: Likewise. * iconvdata/testdate/KSC5636..UTF8: Likewise. * iconvdata/testdate/MSZ_7795.3: Likewise. * iconvdata/testdate/MSZ_7795.3..UTF8: Likewise. * iconvdata/testdate/NC_NC00-10: Likewise. * iconvdata/testdate/NC_NC00-10..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010: Likewise. * iconvdata/testdate/NF_Z_62-010..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010_1973: Likewise. * iconvdata/testdate/NF_Z_62-010_1973..UTF8: Likewise. * iconvdata/testdate/NS_4551-1: Likewise. * iconvdata/testdate/NS_4551-1..UTF8: Likewise. * iconvdata/testdate/NS_4551-2: Likewise. * iconvdata/testdate/NS_4551-2..UTF8: Likewise. * iconvdata/testdate/PT: Likewise. * iconvdata/testdate/PT..UTF8: Likewise. * iconvdata/testdate/PT2: Likewise. * iconvdata/testdate/PT2..UTF8: Likewise. * iconvdata/testdate/SEN_850200_B: Likewise. * iconvdata/testdate/SEN_850200_B..UTF8: Likewise. * iconvdata/testdate/SEN_850200_C: Likewise. * iconvdata/testdate/SEN_850200_C..UTF8: Likewise. * iconvdata/cns11643.h: Use uint32_t instead of wchar_t. * iconvdata/cns11643l1.h: Likewise. * iconvdata/latin-greek-1.h: Likewise. * iconvdata/latin-greek.h: Likewise. * iconvdata/koi8-r.h: Likewise. * iconvdata/jis0212.h: Likewise. * iconvdata/gb2312.h: Likewise. * iconvdata/ksc5601.h: Likewise. * iconvdata/8bit-gap.c: Use 32 bit type for idx element of struct gap. * iconvdata/Makefile: Add rules for lots of more modules. * iconvdata/cp1250.c: New file. * iconvdata/cp1251.c: New file. * iconvdata/cp1252.c: New file. * iconvdata/cp1253.c: New file. * iconvdata/cp1254.c: New file. * iconvdata/cp1255.c: New file. * iconvdata/cp1256.c: New file. * iconvdata/cp1257.c: New file. * iconvdata/ebcdic-dk-no-a.c: New file. * iconvdata/ebcdic-dk-no.c: New file. * iconvdata/ebcdic-es-a.c: New file. * iconvdata/ebcdic-es-s.c: New file. * iconvdata/ebcdic-es.c: New file. * iconvdata/ebcdic-fi-se-a.c: New file. * iconvdata/ebcdic-fi-se.c: New file. * iconvdata/ebcdic-fr.c: New file. * iconvdata/ebcdic-is-friss.c: New file. * iconvdata/ebcdic-it.c: New file. * iconvdata/ebcdic-pt.c: New file. * iconvdata/ebcdic-uk.c: New file. * iconvdata/ebcdic-us.c: New file. * iconvdata/ibm037.c: New file. * iconvdata/ibm038.c: New file. * iconvdata/ibm1004.c: New file. * iconvdata/ibm1026.c: New file. * iconvdata/ibm1047.c: New file. * iconvdata/ibm256.c: New file. * iconvdata/ibm273.c: New file. * iconvdata/ibm274.c: New file. * iconvdata/ibm275.c: New file. * iconvdata/ibm277.c: New file. * iconvdata/ibm278.c: New file. * iconvdata/ibm280.c: New file. * iconvdata/ibm281.c: New file. * iconvdata/ibm284.c: New file. * iconvdata/ibm285.c: New file. * iconvdata/ibm290.c: New file. * iconvdata/ibm297.c: New file. * iconvdata/ibm420.c: New file. * iconvdata/ibm423.c: New file. * iconvdata/ibm424.c: New file. * iconvdata/ibm437.c: New file. * iconvdata/ibm500.c: New file. * iconvdata/ibm850.c: New file. * iconvdata/ibm851.c: New file. * iconvdata/ibm852.c: New file. * iconvdata/ibm855.c: New file. * iconvdata/ibm857.c: New file. * iconvdata/ibm860.c: New file. * iconvdata/ibm861.c: New file. * iconvdata/ibm862.c: New file. * iconvdata/ibm863.c: New file. * iconvdata/ibm864.c: New file. * iconvdata/ibm865.c: New file. * iconvdata/ibm868.c: New file. * iconvdata/ibm869.c: New file. * iconvdata/ibm870.c: New file. * iconvdata/ibm871.c: New file. * iconvdata/ibm875.c: New file. * iconvdata/ibm880.c: New file. * iconvdata/ibm891.c: New file. * iconvdata/ibm903.c: New file. * iconvdata/ibm904.c: New file. * iconvdata/ibm905.c: New file. * iconvdata/ibm918.c: New file. * locale/iso-4217.def: Update. * localedata/locales/pt_BR: Correct. Patches by Andreas Jaeger. * stdio-common/vfscanf.h: Recognize nan and inf in floating-point formats. 1998-04-22 Andreas Jaeger <aj@arthur.rhein-neckar.de> * elf/dl-load.c (_dl_init_paths): ';' is also a terminal for LD_LIBRARY_PATH. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * Makerules: Change occurances of `cd dir; cmd' to `cd dir && cmd'. * Makefile: Likewise. * posix/Makefile: Likewise. * sysdeps/mach/hurd/Makefile: Likewise. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/bits/dirent.h: New file. * sysdeps/mach/hurd/readdir64.c: New file. * sysdeps/mach/hurd/readdir64_r.c: New file. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * stdio/stdio.h (vasprintf, __asprintf, asprintf, vdprintf, dprintf): Synchronize declarations with libio/stdio.h. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * elf/dlerror.c (dlerror): Don't assume that __libc_internal_tsd_get is defined. __libc_getspecific is already well-protected, so just use it directly. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * io/ftw.h (ftw): Fix typo. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/gnu/utmp_file.c: Fix typo. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconvdata/run-iconv-test.sh: Fix more portability bugs. When one part of a test fails move on to the next test. 1998-04-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Compare addresses as pointers, not signed integers. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1998-04-24 09:07:59 +02:00
tsearch (s->fromname, &printlist, (__compar_fn_t) strverscmp);
}
}
static void
do_print_human (const void *nodep, VISIT value, int level)
{
if (value == leaf || value == postorder)
{
const char *s = *(const char **) nodep;
size_t len = strlen (s);
size_t cnt;
while (len > 0 && s[len - 1] == '/')
--len;
for (cnt = 0; cnt < len; ++cnt)
if (isalnum (s[cnt]))
break;
if (cnt == len)
return;
if (not_first)
{
putchar (',');
++column;
if (column > 2 && column + len > 77)
{
fputs ("\n ", stdout);
column = 2;
}
else
{
putchar (' ');
++column;
}
}
else
Update. <<<<<<< ChangeLog 1998-04-23 22:43 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (fillin_rpath): Handle empty element returned by strsep as current directory. * iconv/gconv_builtin.h: Add aliases unicode and unicodebig for Java. Add definitions for unicodelittle implementation. * iconv/gconv_int.h: Add declaration for unicodelittle functions. * iconv/gconv_simple.c: Define unicodelittle functions. * iconv/iconv_prog.c: Make program print information about position of illegal character in input. * iconv/skeleton.c: Use __strcasecmp instead of __strcasestr for comparison of charset name. * iconvdata/big5.c (CHARSET_NAME): Adapt for this. * iconvdata/ebcdic-at-de-a.c: Likewise. * iconvdata/ebcdic-at-de.c: Likewise. * iconvdata/ebcdic-ca-fr.c: Likewise. * iconvdata/euccn.c: Likewise. * iconvdata/eucjp.c: Likewise. * iconvdata/euckr.c: Likewise. * iconvdata/euctw.c: Likewise. * iconvdata/hp-roman8.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/johab.c: Likewise. * iconvdata/koi-8.c: Likewise. * iconvdata/koi8-r.c: Likewise. * iconvdata/latin-greek-1.c: Likewise. * iconvdata/latin-greek.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. * iconvdata/uhc.c: Likewise. * iconvdata/iso646.c: Add support for more ISO 646 variants. * iconvdata/TESTS: Add tests for ISO646 module. * iconvdata/gconv-modules: Add new modules. * iconvdata/testdate/CSA_Z243.4-1985-1: New tests for ISO646 module. * iconvdata/testdate/CSA_Z243.4-1985-1..UCS2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2: Likewise. * iconvdata/testdate/CSA_Z243.4-1985-2..UCS4: Likewise. * iconvdata/testdate/DIN_66003: Likewise. * iconvdata/testdate/DIN_66003..UTF8: Likewise. * iconvdata/testdate/DS_2089: Likewise. * iconvdata/testdate/DS_2089..UTF8: Likewise. * iconvdata/testdate/ES: Likewise. * iconvdata/testdate/ES..UTF8: Likewise. * iconvdata/testdate/ES2: Likewise. * iconvdata/testdate/ES2..UTF8: Likewise. * iconvdata/testdate/GB_1988-80: Likewise. * iconvdata/testdate/GB_1988-80..UTF8: Likewise. * iconvdata/testdate/IT: Likewise. * iconvdata/testdate/IT..UTF8: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO: Likewise. * iconvdata/testdate/JIS_C6220-1969-RO..UTF8: Likewise. * iconvdata/testdate/JIS_C6229-1984-B: Likewise. * iconvdata/testdate/JIS_C6229-1984-B..UTF8: Likewise. * iconvdata/testdate/JUS_I.B1.002: Likewise. * iconvdata/testdate/JUS_I.B1.002..UTF8: Likewise. * iconvdata/testdate/KSC5636: Likewise. * iconvdata/testdate/KSC5636..UTF8: Likewise. * iconvdata/testdate/MSZ_7795.3: Likewise. * iconvdata/testdate/MSZ_7795.3..UTF8: Likewise. * iconvdata/testdate/NC_NC00-10: Likewise. * iconvdata/testdate/NC_NC00-10..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010: Likewise. * iconvdata/testdate/NF_Z_62-010..UTF8: Likewise. * iconvdata/testdate/NF_Z_62-010_1973: Likewise. * iconvdata/testdate/NF_Z_62-010_1973..UTF8: Likewise. * iconvdata/testdate/NS_4551-1: Likewise. * iconvdata/testdate/NS_4551-1..UTF8: Likewise. * iconvdata/testdate/NS_4551-2: Likewise. * iconvdata/testdate/NS_4551-2..UTF8: Likewise. * iconvdata/testdate/PT: Likewise. * iconvdata/testdate/PT..UTF8: Likewise. * iconvdata/testdate/PT2: Likewise. * iconvdata/testdate/PT2..UTF8: Likewise. * iconvdata/testdate/SEN_850200_B: Likewise. * iconvdata/testdate/SEN_850200_B..UTF8: Likewise. * iconvdata/testdate/SEN_850200_C: Likewise. * iconvdata/testdate/SEN_850200_C..UTF8: Likewise. * iconvdata/cns11643.h: Use uint32_t instead of wchar_t. * iconvdata/cns11643l1.h: Likewise. * iconvdata/latin-greek-1.h: Likewise. * iconvdata/latin-greek.h: Likewise. * iconvdata/koi8-r.h: Likewise. * iconvdata/jis0212.h: Likewise. * iconvdata/gb2312.h: Likewise. * iconvdata/ksc5601.h: Likewise. * iconvdata/8bit-gap.c: Use 32 bit type for idx element of struct gap. * iconvdata/Makefile: Add rules for lots of more modules. * iconvdata/cp1250.c: New file. * iconvdata/cp1251.c: New file. * iconvdata/cp1252.c: New file. * iconvdata/cp1253.c: New file. * iconvdata/cp1254.c: New file. * iconvdata/cp1255.c: New file. * iconvdata/cp1256.c: New file. * iconvdata/cp1257.c: New file. * iconvdata/ebcdic-dk-no-a.c: New file. * iconvdata/ebcdic-dk-no.c: New file. * iconvdata/ebcdic-es-a.c: New file. * iconvdata/ebcdic-es-s.c: New file. * iconvdata/ebcdic-es.c: New file. * iconvdata/ebcdic-fi-se-a.c: New file. * iconvdata/ebcdic-fi-se.c: New file. * iconvdata/ebcdic-fr.c: New file. * iconvdata/ebcdic-is-friss.c: New file. * iconvdata/ebcdic-it.c: New file. * iconvdata/ebcdic-pt.c: New file. * iconvdata/ebcdic-uk.c: New file. * iconvdata/ebcdic-us.c: New file. * iconvdata/ibm037.c: New file. * iconvdata/ibm038.c: New file. * iconvdata/ibm1004.c: New file. * iconvdata/ibm1026.c: New file. * iconvdata/ibm1047.c: New file. * iconvdata/ibm256.c: New file. * iconvdata/ibm273.c: New file. * iconvdata/ibm274.c: New file. * iconvdata/ibm275.c: New file. * iconvdata/ibm277.c: New file. * iconvdata/ibm278.c: New file. * iconvdata/ibm280.c: New file. * iconvdata/ibm281.c: New file. * iconvdata/ibm284.c: New file. * iconvdata/ibm285.c: New file. * iconvdata/ibm290.c: New file. * iconvdata/ibm297.c: New file. * iconvdata/ibm420.c: New file. * iconvdata/ibm423.c: New file. * iconvdata/ibm424.c: New file. * iconvdata/ibm437.c: New file. * iconvdata/ibm500.c: New file. * iconvdata/ibm850.c: New file. * iconvdata/ibm851.c: New file. * iconvdata/ibm852.c: New file. * iconvdata/ibm855.c: New file. * iconvdata/ibm857.c: New file. * iconvdata/ibm860.c: New file. * iconvdata/ibm861.c: New file. * iconvdata/ibm862.c: New file. * iconvdata/ibm863.c: New file. * iconvdata/ibm864.c: New file. * iconvdata/ibm865.c: New file. * iconvdata/ibm868.c: New file. * iconvdata/ibm869.c: New file. * iconvdata/ibm870.c: New file. * iconvdata/ibm871.c: New file. * iconvdata/ibm875.c: New file. * iconvdata/ibm880.c: New file. * iconvdata/ibm891.c: New file. * iconvdata/ibm903.c: New file. * iconvdata/ibm904.c: New file. * iconvdata/ibm905.c: New file. * iconvdata/ibm918.c: New file. * locale/iso-4217.def: Update. * localedata/locales/pt_BR: Correct. Patches by Andreas Jaeger. * stdio-common/vfscanf.h: Recognize nan and inf in floating-point formats. 1998-04-22 Andreas Jaeger <aj@arthur.rhein-neckar.de> * elf/dl-load.c (_dl_init_paths): ';' is also a terminal for LD_LIBRARY_PATH. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * Makerules: Change occurances of `cd dir; cmd' to `cd dir && cmd'. * Makefile: Likewise. * posix/Makefile: Likewise. * sysdeps/mach/hurd/Makefile: Likewise. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/bits/dirent.h: New file. * sysdeps/mach/hurd/readdir64.c: New file. * sysdeps/mach/hurd/readdir64_r.c: New file. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * stdio/stdio.h (vasprintf, __asprintf, asprintf, vdprintf, dprintf): Synchronize declarations with libio/stdio.h. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * elf/dlerror.c (dlerror): Don't assume that __libc_internal_tsd_get is defined. __libc_getspecific is already well-protected, so just use it directly. 1998-04-22 Gordon Matzigkeit <gord@profitpress.com> * io/ftw.h (ftw): Fix typo. 1998-04-21 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/gnu/utmp_file.c: Fix typo. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconvdata/run-iconv-test.sh: Fix more portability bugs. When one part of a test fails move on to the next test. 1998-04-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Compare addresses as pointers, not signed integers. 1998-04-22 11:06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1998-04-24 09:07:59 +02:00
not_first = 1;
fwrite (s, len, 1, stdout);
column += len;
}
}
static void
do_print (const void *nodep, VISIT value, int level)
{
if (value == leaf || value == postorder)
{
const char *s = *(const char **) nodep;
puts (s);
}
}
static void
internal_function
add_known_names (struct gconv_module *node)
{
if (node->left != NULL)
add_known_names (node->left);
if (node->right != NULL)
add_known_names (node->right);
do
{
if (strcmp (node->from_string, "INTERNAL"))
tsearch (node->from_string, &printlist,
(__compar_fn_t) strverscmp);
if (strcmp (node->to_string, "INTERNAL") != 0)
tsearch (node->to_string, &printlist, (__compar_fn_t) strverscmp);
node = node->same;
}
while (node != NULL);
}
static void
insert_cache (void)
{
const struct gconvcache_header *header;
const char *strtab;
const struct hash_entry *hashtab;
size_t cnt;
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
header = (const struct gconvcache_header *) __gconv_get_cache ();
strtab = (char *) header + header->string_offset;
hashtab = (struct hash_entry *) ((char *) header + header->hash_offset);
for (cnt = 0; cnt < header->hash_size; ++cnt)
if (hashtab[cnt].string_offset != 0)
{
const char *str = strtab + hashtab[cnt].string_offset;
if (strcmp (str, "INTERNAL") != 0)
tsearch (str, &printlist, (__compar_fn_t) strverscmp);
}
}
static void
internal_function
print_known_names (void)
{
iconv_t h;
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
void *cache;
/* We must initialize the internal databases first. */
h = iconv_open ("L1", "L1");
iconv_close (h);
/* See whether we have a cache. */
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
cache = __gconv_get_cache ();
if (cache != NULL)
/* Yep, use only this information. */
insert_cache ();
else
{
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
struct gconv_module *modules;
/* No, then use the information read from the gconv-modules file.
First add the aliases. */
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
twalk (__gconv_get_alias_db (), insert_print_list);
/* Add the from- and to-names from the known modules. */
Update. 2002-08-04 Ulrich Drepper <drepper@redhat.com> * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT to access _sys_siglist. * string/strsignal.c: Likewise. * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias. * sysdeps/gnu/siglist.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps. * libio/wfileops.c: Add missing INTUSE for _IO_file_close. * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden alias and use it. * intl/bindtextdom.c: Use _nl_default_dirname_internal. * include/netinet/in.h: Add declaration of in6addr_loopback_internal. * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback. * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access. * include/time.h: Add libc_hidden_proto for __gmtime_r. * time/gmtime.c (__gmtime_r): Add libc_hidden_def. * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db, and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db, and __gconv_get_cache respectively. * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and defined static. Change all users. (__gconv_get_cache): New function. * iconv/gconv_db.c (__gconv_get_modules_db): New function. (__gconv_get_alias_db): New function. * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden. (__conv_modules_db): Likewise. Add prototypes for __gconv_get_cache, __gconv_get_modules_db, and __gconv_get_alias_db. * iconv/iconv_prog.c: Use the new functions instead of accessing the variables. * include/stdlib.h: Add prototype and libc_hidden_proto for __default_morecore. * sysdeps/generic/morecore.c: Include <stdlib.h>. * malloc/obstack.c: Remove fputs macro. * malloc/mtrace.c: Remove fopen macro.
2002-08-05 01:32:14 +02:00
modules = __gconv_get_modules_db ();
if (modules != NULL)
add_known_names (modules);
}
bool human_readable = isatty (fileno (stdout));
if (human_readable)
fputs (_("\
The following list contain all the coded character sets known. This does\n\
not necessarily mean that all combinations of these names can be used for\n\
the FROM and TO command line parameters. One coded character set can be\n\
listed with several different names (aliases).\n\n "), stdout);
/* Now print the collected names. */
column = 2;
twalk (printlist, human_readable ? do_print_human : do_print);
if (human_readable && column != 0)
puts ("");
}