Compare commits

...
Author SHA1 Message Date
Roland McGrath b1794a285f Thu Apr 25 15:49:57 1996 Miles Bader <miles@gnu.ai.mit.edu>
* sysdeps/mach/hurd/getcwd.c (__getcwd): When we find a match in
	the scan for a name, avoid doing another readdir (which overwrites
	NENTRIES, and was resulting in a bogus ENOENT).

	* sysdeps/mach/hurd/fcntl.c (__fcntl): Add missing break after F_SETFL.
1996-04-26 06:03:18 +00:00
Roland McGrath b2c8be1fdf Fri Apr 26 01:55:07 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* malloc/mcheck.c (mabort): Use __libc_fatal only #ifdef _LIBC.

Wed Apr 24 00:22:42 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* stdio/internals.c (seek_to_target): Set errno if seek function
	returns the wrong offset.

	* wcsmbs/wcsrtombs.c [! EILSEQ] (EILSEQ): Define to EINVAL.
	* wcsmbs/wcrtomb.c: Likewise.

	* stdio-common/vfprintf.c: Include errno.h.
1996-04-26 05:57:35 +00:00
Roland McGrath 8555e89e37 Added trailing blank line. 1996-04-26 05:55:41 +00:00
Miles Bader 072d114510 (__getcwd): When we find a match in the scan for a name, avoid doing another readdir (which overwrites NENTRIES, and was resulting in a bogus ENOENT). 1996-04-25 21:37:46 +00:00
Miles Bader 8ec2f30995 (__fcntl): Add missing break after F_SETFL. 1996-04-25 20:21:20 +00:00
Roland McGrath 7f77e07b00 Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/internals.c (seek_to_target): Set errno if seek function
	returns the wrong offset.
1996-04-25 18:13:38 +00:00
Roland McGrath 66aeca9cfb Tue Apr 23 21:09:14 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (signal_allowed): For SIGIO/SIGURG, add a new
 	variable, LUCKY, to use instead of setting D to -1 (which fucks
 	things up).
1996-04-24 09:03:11 +00:00
Roland McGrath 80bcb41041 Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* wcsmbs/wcsrtombs.c [! EILSEQ] (EILSEQ): Define to EINVAL.
	* wcsmbs/wcrtomb.c: Likewise.
1996-04-24 05:28:34 +00:00
Miles Bader e0637da1c7 (signal_allowed): For SIGIO/SIGURG, add a new variable, LUCKY, to use instead of setting D to -1 (which fucks things up). 1996-04-24 03:28:51 +00:00
Roland McGrath 9a8c0d4f41 Tue Apr 23 15:56:56 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* config.h.in (HAVE_REGEX): New macro.

	* sysdeps/unix/syscalls.list: Add statfs, fstatfs.
	* io/Makefile (headers): Add sys/statfs.h, statfsbuf.h.
	(routines): Add statfs, fstatfs.
	* sysdeps/mach/hurd/statfs.c: New file.
	* sysdeps/mach/hurd/fstatfs.c: New file.
	* sysdeps/stub/fstatfs.c: New file.
	* sysdeps/stub/statfs.c: New file.
	* io/sys/statfs.h: New file.
	* sysdeps/generic/statfsbuf.h: New file.
	* sysdeps/unix/sysv/linux/statfsbuf.h: New file.

Tue Apr 23 00:06:47 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* malloc/Makefile (gmalloc-routines): Add valloc back here.
	(dist-routines): Remove it here.
	* malloc/valloc.c [_MALLOC_INTERNAL && GMALLOC_INHIBIT_VALLOC]
	(ELIDE_VALLOC): Define it.
	[! ELIDE_VALLOC]: Make whole file conditional on this.
	* malloc/malloc.h (valloc): Make decl conditional on
	[!GMALLOC_INHIBIT_VALLOC] instead of [!emacs].

Mon Apr 22 00:02:19 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* MakeTAGS: Include version.mk.
	(po/SYS_libc.pot): Add missing / in sed s cmd.
1996-04-24 00:58:47 +00:00
Roland McGrath b0d20a87b5 Sat Apr 20 18:13:00 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): Test $(have-no-whole-archive), not
	$(libc_cv_ld_no_whole_archive).

Sat Apr 20 17:07:17 1996  Ulrich Drepper  <drepper@cygnus.com>

	* assert/assert.h, ctype/ctype.h, dirent/dirent.h, errno.h,
	grp/grp.h, io/fcntl.h, io/sys/stat.h, io/utime.h, locale/locale.h,
	math/math.h, misc/nlist.h, misc/sgtty.h, misc/sys/file.h,
	misc/sys/ioctl.h, misc/sys/uio.h, posix/sys/times.h,
	posix/sys/types.h, posix/sys/utsname.h, posix/sys/wait.h,
	posix/tar.h, posix/wordexp.h, pwd/pwd.h, resource/sys/vlimit.h,
	resource/sys/vtimes.h, setjmp/setjmp.h, signal/signal.h,
	stdio-common/printf.h, stdlib/alloca.h, stdlib/stdlib.h,
	string/string.h, sysdeps/generic/sigaction.h,
	sysdeps/generic/sigset.h, sysdeps/generic/sys/ptrace.h,
	sysdeps/generic/sys/ptrace.h, sysdeps/unix/bsd/osf/sigaction.h,
	sysdeps/unix/sysv/linux/sys/ptrace.h,
	sysdeps/unix/sysv/minix/sigaction.h,
	sysdeps/unix/sysv/sco3.2.4/sigaction.h,
	sysdeps/unix/sysv/sysv4/sigaction.h,
	sysdeps/unix/sysv/sysv4/sigset.h, termios/termios.h,
	time/sys/time.h, time/time.h: Fix copyright comment.

	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): If uids and gids are
	not given in stack aux vector, fetch them with syscalls.
1996-04-21 00:27:19 +00:00
Roland McGrath a641835acd Fri Apr 19 00:49:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdlib/rpmatch.c (rpmatch: try): Take new arg NOMATCH, return value
 	for nonmatching nonerror (instead of !MATCH).
	(rpmatch): Use it, so we return -1 when NOEXPR doesn't match either.

	* resolv/getnetnamadr.c (getnetbyaddr): Use u_int32_t instead of
	unsigned long for variable NET2.

	* time/etcetera, time/europe, time/solar89: Updated from ADO's 96e.

Tue Apr  9 14:37:31 1996  Ulrich Drepper  <drepper@cygnus.com>

	* catgets/Makefile, catgets/catgets.c, catgets/catgetsinfo.h,
	catgets/config.h, catgets/gencat.c, catgets/nl_types.h,
	catgets/open_catalog.c: New files.  Implementation of XPG4
	compliant catgets() function and needed tools.
	* Makefile (subdirs): Add catgets.

Thu Apr 18 23:36:11 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* math/Makefile (CPPFLAGS): Append -D__NO_MATH_INLINES.

Wed Apr 10 20:48:43 1996  Ulrich Drepper  <drepper@cygnus.com>

	* stdio-common/vfprintf.c: Correct some typos.

	* sysdeps/libm-ieee754/w_gammaf.c, sysdeps/libm-ieee754/w_lgamma.c,
	sysdeps/libm-ieee754/w_lgammaf.c: Reference signgam instead of
	__signgam.

Thu Apr 18 21:07:27 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* Makerules (no-whole-archive): New variable.
	(build-shlib): Use it.
	* elf/Makefile (libdl.so): Use it.
	* configure.in (libc_cv_ld_no_whole_archive): New check for
	--no-whole-archive.
	* config.make.in (have-no-whole-archive): New variable.

	* stdio-common/printf_fp.c: Increase fudge factor for BIGNUM_SIZE calc
	from 3 to 4.

	* Make-dist: Include version.mk.
	(version, release): Variables removed.
	* Makeconfig (version.mk): New target.

Fri Apr 19 01:42:18 1996  Ulrich Drepper  <drepper@cygnus.com>

	* locale/Makefile (headers): Add langinfo.h.
	(CPPFLAGS): Remove -Iliblib.
1996-04-20 00:05:25 +00:00
Roland McGrath f24f4dc82d Mon Apr 15 16:49:04 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* malloc/memalign.c, malloc/malloc.h [__DJGPP__ == 1]: Elide memalign
	function and its declaration.
1996-04-16 01:18:23 +00:00
Per Bothner 147e600987 * config.guess: Combine two OSF1 rules. Also recognize field test versions. From mjr@zk3.dec.com. * config.guess (dgux): Use /usr/bin/uname rather than uname, because GNU uname does not support -p. From pmr@pajato.com. 1996-04-13 00:06:54 +00:00
Miles Bader e2a501ab7c *** empty log message ***
Wed Apr 10 14:13:45 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Store
 	MACH_PORT_DEAD in the thread reply-port variable before destroying
 	the signal handler's reply port, to avoid infinite recursion.
1996-04-10 18:36:39 +00:00
Miles Bader 574ce5e4e4 (_hurdsig_longjmp_from_handler): Store MACH_PORT_DEAD in the thread reply-port variable before destroying the signal handler's reply port, to avoid infinite recursion. 1996-04-10 18:36:02 +00:00
Roland McGrath b84095feb4 Mon Apr 8 18:27:17 1996 Miles Bader <miles@gnu.ai.mit.edu>
* sysdeps/mach/gettimeofday.c (__gettimeofday): Don't fail if the
	user passes in TZ, just zero it (emacs passes in a dummy variable,
	and rms says the hurd should be the one to change).
1996-04-09 09:02:55 +00:00
Miles Bader a1a5fa67c6 (__gettimeofday): Don't fail if the user passes in TZ, just zero it (emacs passes in a dummy variable, and rms says the hurd should be the one to change). 1996-04-08 23:35:57 +00:00
Michael Meissner 2e6878f7b1 Add Solaris on PowerPC support 1996-04-08 20:19:10 +00:00
Roland McGrath 3125073e10 Sun Apr 7 10:37:30 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* sysdeps/mach/hurd/fork.c: Don't leak send rights to the child's proc
 	port in the parent.
Fri Apr  5 17:43:41 1996  Miles Bader  <miles@gnu.ai.mit.edu>
1996-04-07 17:44:31 +00:00
Roland McGrath d70576891e * sysdeps/mach/hurd/fork.c (__fork): Don't leak send-rights to the
child's proc port in the parent.
1996-04-06 10:03:22 +00:00
Miles Bader 786db2208e *** empty log message ***
Fri Apr  5 17:43:41 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Store
	MACH_PORT_DEAD in the thread reply-port variable before destroying
	the signal handler's reply port to avoid infinite recursion.
	* sysdeps/mach/hurd/mig-reply.c (__mig_dealloc_reply_port): Only
	attempt to destroy PORT if it's a valid port name.
1996-04-06 01:51:07 +00:00
Miles Bader aa0e1b599c (__mig_dealloc_reply_port): Only attempt to destroy PORT if it's a valid port name. 1996-04-06 01:49:21 +00:00
Roland McGrath 2e516341fa Wed Apr 3 17:10:44 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* extra-lib.mk: Put libs in $(common-objpfx) instead of $(objpfx).
	* Makerules ($(install-lib) rules): Find libs with $(common-objpfx)
	instead of $(objpfx).
1996-04-04 01:18:10 +00:00
Roland McGrath 299a95b9f0 Tue Apr 2 21:27:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/glob.c (glob_pattern_p): Avoid scanning past eos if
	the pattern ends with a backslash and quoting is enabled.
	* posix/fnmatch.c (fnmatch): Likewise; return FNM_NOMATCH for such
 	patterns.
1996-04-03 16:31:49 +00:00
Roland McGrath 30de3b18a5 Mon Apr 1 13:34:55 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* stdio-common/tst-printf.c (main): Add new test case.

	* sysdeps/generic/setenv.c (unsetenv): Use old-style definition.

Mon Apr  1 11:39:10  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

	* stdlib/strtod.c (STRTOD): Fix handling of American style FP
	numbers.

	* stdio-common/vfprintf.c (vfprintf): Don't increment format
	string pointer twice after seeing `*'.

Sun Mar 31 17:31:54 1996  Roland McGrath  <roland@whiz-bang.gnu.ai.mit.edu>

	* MakeTAGS (po/SYS_libc.pot): Prepend header processed from
 	po/header.pot.

Sun Mar 31 18:07:32 1996  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

	* locale/Makefile (others, install-bin): Compiling locale works
        again.
	(locale-modules): locale has no --dump option anymore.  Remove
	ctypedump.

	* locale/programs/config.h: Don't declare euidaccess.
	Use #include_next to get libc's config.h.

	* locale/programs/ctypedump.c: Not needed anymore.  Dump option
	of locale is removed.

	* locale/programs/locale.c: Adapt for new locale implementation.

	* stdio-common/_itoa.h (_itoa_word): Define as inline function.
	* stdio-common/_itoa.c (_itoa_lower_digits, _itoa_upper_digits):
	Don't declare static because used in _itoa_word inline function.

	* stdio-common/printf-parse.h: Prepare for use in wide-char
	stdio implementation.
	(find_spec): Take additional argument to work with mbrlen instead
	of mblen.
	(parse_one_spec): Ditto.

	* stdio-common/printf-prs.c: Prepare for use in wide-char
	stdio implementation.

	* stdio-common/printf.h: Mark change for wide-char handling.
	Changing it now would result in incompatibilities.

	* stdio-common/vfprintf.c: New and fast implementation.

	* wcsmbs/Makefile (routines): Remove pre-ISO C multibyte functions
	mbsadvance, mbscat, mbschr, mbscmp, mbscpy, mbsdup, mbslen,
	mbsncat, mbsncmp, mbsncpy, mbsrchr, mbstomb.
	Change wcswcs to wcsstr.
	Add wmemchr, wmemcmp, wmemcpy, wmemmove, wmemset, btowc, wctob,
	mbsinit, mbrlen, mbrtowc, wcrtomb, mbsrtowcs, wcsrtombs.

	* wcsmbs/btowc.c, wcsmbs/mbrlen.c, wcsmbs/mbrtowc.c,
        wcsmbs/mbsinit.c, wcsmbs/mbsrtowcs.c, wcsmbs/wchar.h,
        wcsmbs/wcrtomb.c, wcsmbs/wcsrtombs.c, wcsmbs/wcsstr.c,
        wcsmbs/wctob.c, wcsmbs/wmemchr.c, wcsmbs/wmemcmp.c,
        wcsmbs/wmemcpy.c, wcsmbs/wmemmove.c, wcsmbs/wmemset.c: New
        function according to ISO C amendment 1.
	* wchar.h: Wrapper around "wcsmbs/wchar.h".

	* wcsmbs/wcscat.c, wcsmbs/wcschr.c, wcsmbs/wcscmp.c,
        wcsmbs/wcscpy.c, wcsmbs/wcscspn.c, wcsmbs/wcsdup.c,
        wcsmbs/wcslen.c, wcsmbs/wcsncat.c, wcsmbs/wcsncmp.c,
        wcsmbs/wcsncpy.c, wcsmbs/wcspbrk.c, wcsmbs/wcsrchr.c,
        wcsmbs/wcsspn.c, wcsmbs/wcstok.c: Changed to conform with ISO C
        amendment 1.

	* wcsmbs/mbsadvance.c, wcsmbs/mbscat.c, wcsmbs/mbschr.c,
        wcsmbs/mbscmp.c, wcsmbs/mbscpy.c, wcsmbs/mbsdup.c,
        wcsmbs/mbslen.c, wcsmbs/mbsncat.c, wcsmbs/mbsncmp.c,
        wcsmbs/mbsncpy.c, wcsmbs/mbsrchr.c, wcsmbs/mbstomb.c,
        wcsmbs/mbstr.h, wcsmbs/wcstr.h, wcsmbs/wcswcs.c: Removed.
        Implement functions from early drafts, not part of final standard.

Sun Mar 31 16:50:41 1996  Roland McGrath  <roland@whiz-bang.gnu.ai.mit.edu>

	* setjmp/setjmp.h (jmp_buf): Change gratuitous struct tag name to
	__jmp_bug_tag so its C++ implicit typedef does not conflict with the
	__jmp_buf typedef.

	* Makerules (BUILD_CFLAGS) [! objdir]: Use $(..)config.h when
	compiling in the source directories.

Fri Mar 29 16:26:35 1996  Roland McGrath  <roland@whiz-bang.gnu.ai.mit.edu>

	* sysdeps/libm-ieee754/w_gamma.c: Use signgam instead of __signgam.
	* sysdeps/libm-ieee754/s_signgam.c: Undo last change.
1996-04-02 13:27:17 +00:00
Roland McGrath b80510574c Fri Mar 29 11:29:46 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/libm-ieee754/s_signgam.c (signgam): Renamed to __signgam,
	with weak alias signgam.
1996-03-29 21:23:58 +00:00
Roland McGrath 27e00f3f17 Thu Mar 28 18:32:34 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* Makeconfig (+cflags, +gcc-nowarn): Use gcc flags unconditionally.
1996-03-29 21:19:15 +00:00
Roland McGrath ac157523bd Thu Mar 28 18:32:34 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* Makeconfig (+cflags, +gcc-nowarn): Use gcc flags unconditionally.
1996-03-29 21:13:27 +00:00
Doug Evans 46a7c97679 (aux): Delete another duplicate entry. 1996-03-29 01:49:55 +00:00
Doug Evans 0daf278545 (aux): Delete duplicate entry. 1996-03-29 01:46:52 +00:00
Roland McGrath b7407d6362 wctype.h mention 1996-03-29 01:04:20 +00:00
Roland McGrath c475b8f594 * sunrpc/rpc_main.c (main): Call textdomain. 1996-03-28 21:00:28 +00:00
Roland McGrath 7a1c652d58 * MakeTAGS (XGETTEXTFLAGS-siglist.pot, XGETTEXTFLAGS-errlist.pot): Add
--no-location.
	(all-pot): Replace $(subdirs) files with $P/subdirs.pot.
	($P/subdirs.pot): New target.
	($P/SYS_libc.pot): Add -n switch.
1996-03-28 20:55:37 +00:00
Roland McGrath a141dd342d * locale/locale.h (LC_*): Values reordered to match Linux libc. 1996-03-28 19:34:47 +00:00
Roland McGrath 8c1442d02f Thu Mar 28 14:22:51 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/mach/hurd/kill.c: If proc_pid2task gives us MACH_PORT_NULL
	the process is a zombie; send no messages and return success.
1996-03-28 19:30:33 +00:00
Roland McGrath 43efc10333 Thu Mar 28 11:53:26 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* wctype/cname-lookup.h: Find localeinfo.h in ../locale.
	* wctype/wctype.c: Likewise.
	* wctype/wctrans.c: Likewise.
1996-03-28 17:19:40 +00:00
Roland McGrath ffcf96345f Thu Mar 28 03:00:43 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* locale/nl_langinfo.c (nl_langinfo): Use DATA->values instead of
	DATA->strings.

	* Makerules (BUILD_CFLAGS): Remove $(common-objpfx) from config.h.

	* configure.in (.weakext check): Fix asm code to use .weakext instead
	of .weak!  Fix bogus test calls.
	* configure: Regenerated.
1996-03-28 09:48:58 +00:00
Roland McGrath 0393dfd6c2 * locale/programs/xmalloc.c: Test _LIBC as well as STDC_HEADERS.
* locale/programs/ld-collate.c (collate_finish): Use error_at_line
	instead of error_with_loc.

	* locale/weight.h: Use u_int32_t instead of u32_t.
	* string/strxfrm.c: Likewise.

	* string/strxfrm.c: Find weight.h in ../locale; don't #include
	"localeinfo.h".
	* string/strcoll.c: Likewise.

	* locale/programs/simple-hash.c, locale/programs/simple-hash.h,
 	locale/programs/xmalloc.c, locale/programs/xstrdup.c: Helper functions
 	for locale related programs.
 	locale/programs/charmap.c, locale/programs/charset.c,
 	locale/programs/charset.h, locale/programs/config.h,
 	locale/programs/ctypedump.c, locale/programs/ld-collate.c,
 	locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
 	locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
 	locale/programs/ld-time.c, locale/programs/linereader.c,
 	locale/programs/linereader.h, locale/programs/locale.c,
 	locale/programs/localedef.c, locale/programs/locales.h,
 	locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
 	locale/programs/locfile-token.h, locale/programs/locfile.c,
 	locale/programs/locfile.h, locale/programs/stringtrans.c,
 	locale/programs/stringtrans.h: Implementation of locale related
 	programs.
1996-03-28 09:16:15 +00:00
Roland McGrath 19bc17a905 Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.

Sat Mar 23 17:52:49 1996  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

	* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
	change value to $(datadir)/i18n.  `nls' is not an appropriate
	name.

	* Makefile (subdirs): Add new subdir wctype.

	* ctype/ctype-info.c: Add new global variable __ctype_names
	and initialize from _nl_C_LC_CTYPE.

	* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
        class.  Use bit 11.
	[_ISbit]: Protect definition of bitmasks because they are also
	used in wctype.h.

	* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
	after successfully pushing back a character.

	Fundamental changes in locale implementation.  Almost nothing
	from the old code is used anymore.
	* locale/charmap.c, locale/collate.c, locale/config.h,
 	locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
 	locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
 	locale/locale.c locale/localeconv.c, locale/localedef.c,
 	locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
 	locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
 	locale/numeric.c, locale/setlocale.c, locale/token.h,
 	locale/xmalloc.c: Removed.

	* locale/Makefile: Update for new locale implementation with
	program source code distributed in subdir.

	* locale/categories.def, locale/iso-4217.def: Updated file
        for new locale implementation.

	* locale/langinfo.h: Updated for new locale implementation.
	(ERA_D_T_FMT, ERA_T_FMT): New official values according to
	P1003.2b/D11.
	(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
	_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
	_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
	_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
	_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
	_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
	extended LC_CTYPE and LC_COLLATE implementation.

	* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
 	locale/xstrdup.c: Helper functions for locale related programs.

	* locale/C-collate.c, locale/C-ctype.c,
        locale/C-messages.c, locale/C-monetary.c,
        locale/C-numeric.c, locale/C-time.c,
        locale/lc-collate.c, locale/lc-ctype.c,
        locale/lc-messages.c, locale/lc-monetary.c,
        locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
        functions, and new generated "C" locale data.

	* locale/loadlocale.c: Now handles word fields in locale binary
        automatically by changing the endianess if necessary.

	* locale/localeinfo.h (LIMAGIC): Changed magic number because
	of incompatible changes.
	(locale_data): Changed definition to allow word as a value type.
	(coll_sort_rule): Values for collation sorting mode.
	(_NL_CURRENT_WORD): New macro to access word value of locale entry.
	(__collate_table, __collate_extra): Declare new global variables
	for collation tables.

	* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
        locale/programs/charmap.c, locale/programs/charset.c,
        locale/programs/charset.h, locale/programs/config.h,
        locale/programs/ctypedump.c, locale/programs/ld-collate.c,
        locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
        locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
        locale/programs/ld-time.c, locale/programs/linereader.c,
        locale/programs/linereader.h, locale/programs/locale.c,
        locale/programs/localedef.c, locale/programs/locales.h,
        locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
        locale/programs/locfile-token.h, locale/programs/locfile.c,
        locale/programs/locfile.h, locale/programs/stringtrans.c,
        locale/programs/stringtrans.h: Implementation of locale related
        programs.

	* locale/weight.h: Functions to access collation tables.

	* posix/unistd.h: Define _POSIX2_LOCALEDEF.

	* stdio-common/printf_fp.c: Fix bug with printing certain numbers
	< 10^-1.  Reported by Bill Metzenthen.

	* stdio-common/tfformat.c: Add new test for above bug.

	* string/strcoll.c, string/strxfrm.c: Real implementation of
        string collation according to ISO C.

	* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
        wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
        wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
        Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
Roland McGrath 53f770e0f9 Wed Mar 27 14:52:11 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* elf/rtld.c (dl_main): Call _dl_sysdep_start_cleanup after
	_dl_relocate_object loop.  Avoid relocating RTLD_MAP in that loop, and
	do it individually if necessary after _dl_sysdep_start_cleanup call.

	* stdlib/Makefile (mpn-routines): Add divrem.

Tue Mar 26 22:54:14  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

	* stdio-common/printf_fp.c (__printf_fp): Use mpn_divmod
	instead of __mpn_divmod.

Wed Mar 27 10:26:21 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/alpha/setjmp.S: Must establish global pointer before
 	address of __sigsetjmp_aux can be loaded.

Wed Mar 27 02:23:19 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>

	* sysdeps/i386/i586/memset.S: New file.  Highly optimized
	version for i586 contributed by Torbjorn Granlund.
	Adapted for use as bzero.
	* sysdeps/i386/i586/bzero.S: Use sysdeps/i386/i586/memset.S
	code to implement bzero().

Tue Mar 26 20:01:17 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* stdlib/Makefile (mpn-routines): Remove divmod.
1996-03-27 23:23:59 +00:00
Roland McGrath 3ef987a23c Updated from /src/gmp-1.937 1996-03-27 20:18:04 +00:00
Brendan Kehoe c0621444ed * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h (NO_UNDERSCORES): Use
wrapped with #ifndef, to avoid config.h defining it.
Tue Mar 26 15:40:14 1996  Brendan Kehoe  <brendan@zen.org>

	* sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h (NO_UNDERSCORES): Use
	wrapped with #ifndef, to avoid config.h defining it.
1996-03-27 00:46:37 +00:00
Roland McGrath 81e4d60c7b * malloc/realloc.c (_realloc_internal): In case of growing large
block, leave _heaplimit zero across _malloc_internal call.
1996-03-25 21:23:16 +00:00
Roland McGrath 5775972dec Mon Mar 25 13:10:04 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile [gettext-srcdir]: Use gpl2lgpl.sed on copied sources.
1996-03-25 18:10:46 +00:00
Roland McGrath 857fa1b81d Mon Mar 25 03:35:16 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* malloc/malloc.c (morecore): Don't attempt recursive realloc of info
	table when _heaplimit==0 during realloc growing large block.

	* MakeTAGS (extract): Remove /dev/null from xgettext command line.
	(text-srcs): New variable: extract only C sources from $(tags_sources).
	(po/$(domain).pot): Depend on that.
	If it's empty, cp /dev/null $@ instead of $(extract).

	* misc/Makefile (headers): Add iovec.h.
	* sysdeps/unix/sysv/linux/iovec.h: New file.
	* sysdeps/generic/iovec.h: New file.
	* misc/sys/uio.h (struct iovec): Type replaced with #include <iovec.h>.

	* configure.in (NO_UNDERSCORES check): Use AC_TRY_LINK instead of
	AC_TRY_COMPILE.

	* misc/sys/cdefs.h [__USE_BSD] (const, signed, volatile): Move these
	macros inside [! __STDC__].

	* stdlib/rpmatch.c: New file.
	* stdlib/Makefile (routines): Add rpmatch.
	* stdlib/stdlib.h [__USE_SVID]: Declare rpmatch.

	* MakeTAGS (MSGJOIN): Variable removed.
	(po/SYS_libc.pot): Use $(XGETTEXT) instead of $(MSGJOIN).

Wed Mar 20 20:08:46 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysdep.h: Don't define C_SYMBOL_NAME.

	* sysdeps/unix/sysv/linux/m68k/sysdep.h: Don't define
	NO_UNDERSCORES.
1996-03-25 17:48:26 +00:00
Roland McGrath 25c931a18c Contents were duplicated by botched patching. 1996-03-25 06:26:06 +00:00
Doug Evans edc1601c51 (os): sunos[3456] -> sunos[34], sunos[56] have their own entries 1996-03-21 23:26:26 +00:00
Roland McGrath 036a272548 Thu Mar 21 11:19:15 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* mach/devstream.c (input): Translate \r to \n on input.
1996-03-21 16:23:21 +00:00
Roland McGrath ce563359af Wed Mar 20 11:28:49 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/printf.h, stdio-common/printf_fp.c,
	stdio-common/vfprintf.c: Place const in parameter list at
	correct place.

Wed Mar 20 23:58.12 1996  Ulrich Drepper <drepper@gnu.ai.mit.edu>

	* sysdeps/i386/ldbl2mpn.c: Copy of former version of
	sysdeps/ieee754/ldbl2mpn.c.
	* sysdeps/ieee754/ldbl2mpn.c: Remove i386 specific unification.
	Reported by Andreas Schwab.

Wed Mar 20 19:58:43 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* version.c: Include version.h to define RELEASE and VERSION macros.
	(__libc_release, __libc_version): Use them.
	* locale/SYS_libc.c (_libc_intl_domainname): Include ../version.h and
	use VERSION to define domainname as `SYS_GNU_libc-VERSION'.
	* Make-dist (rel+vers): Snarf the macro values from version.h.

	* MakeTAGS (extract): Pass $(XGETTEXTFLAGS-$(@F)).
	(XGETTEXTFLAGS-siglist.pot, XGETTEXTFLAGS-errlist.pot): New variables;
	pass -a for these files.

	* Makerules (po/%.pot): Depend on FORCE target so recursive make is
	always run.
1996-03-21 15:20:37 +00:00
Roland McGrath 38bb44bc19 Mon Mar 18 22:54:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/wait3.c: New file.
	* sysdeps/unix/sysv/linux/wait.c: Use the bsd4.4 wait, not the
	one from sysdeps/posix.
1996-03-21 00:37:31 +00:00
Roland McGrath d7193325fc * sysdeps/unix/bsd/waitflags.h (WNOREAP): New macro. 1996-03-20 17:01:27 +00:00
Roland McGrath 948c3e72ec Wed Mar 20 09:42:11 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* elf/dl-load.c (_dl_map_object_from_fd): Always set L->l_type; if not
	lt_executable, then lt_library.
	* elf/rtld.c (dl_main): Don't set NEW->l_type after _dl_map_object.

Wed Mar 20 00:08:23 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/syscalls.list: Remove gtty and stty.

Tue Mar 19 16:31:06 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/termbits.h (CRTSCTS, CBAUDEX, VEOL,
	VEOL2, VMIN, VTIME): Corrected.
	(PAGEOUT, WRAP, VDSUSP): Deleted.

	* sysdeps/unix/readdir.c: Test [! _DIRENT_HAVE_D_RECLEN] instead of
	(sizeof (DP->d_name) > 1) to detect fixed-size dir entries.
1996-03-20 14:50:57 +00:00
Roland McGrath 213afb94b6 Regenerated
Thu Mar 14 06:01:07 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* posix/glob.c (glob): In GLOB_BRACE brace expansion, fix buffer size
	calculation to include trailing invariant portion.  Don't use alloca;
	instead use a dynamic auto array for GCC, malloc for non-GCC.
	Handle nested braces properly.
1996-03-20 03:12:40 +00:00
Roland McGrath 4d58533340 * sysdeps/i386/fpu/__math.h (asinh): Call log1p instead of __log1p.
* math/math.h: Move M_* constants before __math.h include.
	[__NO_MATH_INLINES || __OPTIMIZE__]: Include __math.h only #if this.

	* misc/efgcvt_r.c (ecvt_r): Declare floor, log10, fabs as weak extern.
	If log10 is not defined (i.e. no -lm), use stupid loop instead.
1996-03-20 00:18:44 +00:00
Roland McGrath d3669add24 * features.h (__FAVOR_BSD): Define only if _BSD_SOURCE is defined
and no other _*_SOURCE macro is.
	(_GNU_SOURCE): Don't define by default.
	* libc-symbols.h (_GNU_SOURCE): Define it.
1996-03-19 21:59:41 +00:00
Roland McGrath c8cf0b14ed * configure.in (alpha*-*-linux*): Unset $gnu_ld and $elf. 1996-03-19 21:23:40 +00:00
Roland McGrath c224a18a90 * config.make.in (weak-symbols): Variable removed.
* configure.in (--with-weak-symbols): Option removed.
	(NO_UNDERSCORES, HAVE_ASM_WEAK_DIRECTIVE, HAVE_ASM_WEAKEXT_DIRECTIVE):
	New tests.
	* config.h.in (HAVE_WEAK_SYMBOLS): #undef removed.
	(NO_UNDERSCORES, HAVE_ASM_WEAK_DIRECTIVE, HAVE_ASM_WEAKEXT_DIRECTIVE):
	New #undefs.
	* libc-symbols.h: Use them instead of HAVE_WEAK_SYMBOLS.

	* inet/inet_lnaof.c: Use u_int32_t instead of u_long.
	* inet/inet_mkadr.c: Likewise.
	* inet/inet_net.c: Likewise.
	* inet/inet_netof.c: Likewise.
	* inet/rcmd.c: Likewise.
	* inet/arpa/inet.h: Likewise.
	* inet/netinet/in.h: Likewise.
	* inet/netinet/tcp.h: Likewise.
	* inet/protocols/rwhod.h: Likewise.
	* inet/protocols/talkd.h: Likewise.
	* resolv/inet_addr.c: Likewise.

	* sunrpc/rpc/xdr.h (IXDR_GET_LONG, IXDR_PUT_LONG): change casts to
 	u_int32_t (instead of u_long).
1996-03-19 21:10:11 +00:00
Roland McGrath b20e47cb14 Tue Mar 19 14:18:42 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/unix/bsd/pause.c: Moved to sysdeps/unix/common/pause.c.

Mon Mar  4 20:17:28 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/unix/sysv/linux/adjtime.c: Use INT_MAX instead of LONG_MAX.

	* sysdeps/unix/sysv/Makefile (sysdep_routines): Don't add s_getdents.

	* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Don't add mount,
	umount.

	* sysdeps/alpha/__math.h (atan, cabs): New functions.

	* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: new file (syscall
 	expects set-value, not pointer to it).

Sun Feb 25 22:36:10 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/unix/sysv/linux/alpha/profil-counter.h: New file.

	* gmon/gmon.c (__bb_head): new variable.
	(write_hist, write_call_graph, write_bb_counts): new functions.
	(_mcleanup): modified to call above functions instead of directly
 	writing out gmon.out.
	* gmon/sys/gmon.h (struct __bb): New type.
	(struct gmonhdr): Type removed.
	(struct gmonparam): New member `log_hashfraction'.
	(GMONVERSION): Macro removed.

	* gmon/sys/gmon_out.h, gmon/bb_exit_func.c,
 	sysdeps/generic/bb_init_func.c, sysdeps/alpha/bb_init_func.S: new
 	files.
	* gmon/Makefile (headers): Add sys/gmon_out.h.
	(routines): Add bb_init_func, bb_exit_func.

	* gmon/mcount.c: Avoid integer division.

Wed Feb 21 23:56:41 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/alpha/setjmp.S: switched order in which sp and fp are
 	passed to match what __sigsetjmp_aux() expects.

Tue Feb 20 11:33:46 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (select, bind,
 	connect, getpeername, getsockname, listen, recv, recvfrom,
 	recvmsg, send, sendmsg, sendto, setsockopt, shutdown, socketpair):
 	added to override same-name assembly file in the parent directory.

	* stdlib/stdlib.h: add include of sys/types.h in front of random
 	etc declarations to ensure int32_t is declared.

	* stdlib/random.c, stdlib/random_r.c: replaced "long int" by int32_t
	where 32 bit integers are required.  Also change LONG_MAX into
	0x7fffffff since the intent is to turn off the sign bit in a
	32 bit integer.

	* time/offtime.c (__offtime): Use Paul Eggert's code to deal
	with very large values for "days" (e.g., 64 bit values).

Mon Feb 19 22:22:12 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* stdlib/stdlib.h (__random, __random_r, random_r, struct
 	random_data): use int32_t instead of `long int'.

Sat Feb 17 11:29:29 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/unix/sysv/linux/alpha/ioperm.c: new file.

	* sysdeps/alpha/ffs.S: new file.

	* sysdeps/alpha/fabs.c: File removed.

	* time/tzfile.c (__tzfile_read): counter variable is i, *not*
	num_transitions!

	* time/offtime.c: make capable of dealing with very large (64 bit)
 	time_t values.  Use old algorithm until a year is reached that
	is an integer multiple of 400, then use DAYS_PER_400_YEARS to
	do the remainder in a single division.

	* sysdeps/generic/ffs.c (ffs): fix variable declarations to
	be unsigned int, not unsigned long.

	* string/test-ffs.c (main): add test case with all upper bits
	set.

	* stdlib/tst-strtol.c: add tests cases for machines where
	sizeof(long)==8.

	* stdlib/testrand.c (main): disallow rand() to return negative
 	integers.

	* stdlib/testmb.c (main): fix format to use %lx instead of %x.

	* stdlib/stdlib.h: on 64 bit machines, declare
	struct random_data, __random(),  __random_r, and random_r to
	return "int" instead of "long int".

	* stdlib/random_r.c: 64 bit machines use "int" instead of "long
 	int".  Similarly, use INT_MAX instead of LONG_MAX.

	* stdlib/random.c: on 64 bit machines, randtbl[] and __random[]
 	need to operate on "int" instead of "long int".

	* locale/locfile-hash.c (compute_hashval): make shifted constant
	a long to avoid loosing bits on 64 bit machines.

	* dirent/tst-seekdir.c (main): fix confusing comment; print
	a line to mark point where directory is rewound.

Fri Feb 16 15:01:49 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* time/strftime.c (strftime): any hour > 11 is PM (not > 12!).

Wed Feb 14 00:21:17 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/unix/sysv/linux/alpha/Makefile,
	sysdeps/unix/sysv/linux/alpha/brk.S,
	sysdeps/unix/sysv/linux/alpha/fpu_control.c,
	sysdeps/unix/sysv/linux/alpha/fpu_control.h,
	sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
	sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
	sysdeps/unix/sysv/linux/alpha/pipe.S,
	sysdeps/unix/sysv/linux/alpha/setfpucw.c,
	sysdeps/unix/sysv/linux/alpha/sigprocmask.c,
	sysdeps/unix/sysv/linux/alpha/speed.c,
	sysdeps/unix/sysv/linux/alpha/start.S,
	sysdeps/unix/sysv/linux/alpha/syscall.S,
	sysdeps/unix/sysv/linux/alpha/syscalls.list,
	sysdeps/unix/sysv/linux/alpha/alpha/regdef.h,
	sysdeps/unix/sysv/linux/alpha/sysdep.S,
	sysdeps/unix/sysv/linux/alpha/sysdep.h: New files.

	* sysdeps/alpha/setjmp_aux.c (__sigsetjmp_aux): restore return
 	address register before returning (gcc 2.7.1 doesn't do it,
 	presumably because $26 is declared as a global variable).

	* sysdeps/unix/sysv/linux/sys/mman.h: msync was missing "flags"
	argument.

	* sysdeps/unix/alarm.c (alarm): do roundup using test & increment
	instead of multiplication.

	* sysdeps/posix/sleep.c (sleep): initialize sa_mask to mask of
	currently blocked signals instead of the empty mask to ensure
	that execution of alarm handler occurs with none of the currently
	blocked signals enabled.

	* sysdeps/unix/alpha/sysdep.h: new file (adapted from OSF/1 version).

	* sysdeps/unix/bsd/osf/alpha/sysdep.h: include
 	sysdeps/unix/alpha/sysdep.h and removed definitions now in that file.

	* sysdeps/alpha/divrem.S, sysdeps/alpha/htonl.S,
	sysdeps/alpha/htons.S, sysdeps/alpha/machine-gmon.h,
	sysdeps/alpha/_mcount.S, sysdeps/alpha/ntohl.s, sysdeps/alpha/ntohs.s,
	sysdeps/alpha/strlen.S: New files.

	* sysdeps/alpha/divl.S, sysdeps/alpha/divlu.S, sysdeps/alpha/divq.S,
	sysdeps/alpha/divqu.S, sysdeps/alpha/divrem.m4,
	sysdeps/alpha/macros.m4, sysdeps/alpha/reml.S, sysdeps/alpha/remlu.S,
	sysdeps/alpha/remq.S, sysdeps/alpha/remqu.S, sysdeps/alpha/strlen.c:
 	Removed.

	* sysdeps/generic/sbrk.c (__sbrk): argument is of type ptrdiff_t, not
	int.

	* sysdeps/alpha/__longjmp.c (__longjmp): moved dummy while loop
	to end of function to avoid a jump across NOPs.

	* sysdeps/alpha/Makefile (sysdep_routines): Removed all rules
 	pertaining to integer division/remainder routines since new code
 	doesn't require them.

	* sunrpc/xdr_mem.c, sunrpc/xdr_stdio.c: Use 4 instead of sizeof(long)
	where 32 bit quantities are consumed/stored.  Various other minor
	64-bit cleanups (casting).

	* sunrpc/xdr.c (xdr_int): test for sizeof(int)==4 to determine
 	whether xdr_long or xdr_short should be used to encode an int.
  	Notice that an xdr_long is 4 bytes independent of the architecture
	(otherwise no Alpha could interoperate with existing NFS servers,
 	for example).  Ditto for enums.

	* sunrpc/svc_udp.c (svcudp_recv): changed test from 4*sizeof(u_long)
	to 16 since it really wants 16 bytes.

	* sunrpc/svc.c (maskp): changed from u_long* to u_int32*.

	* sunrpc/rpc_cmsg.c (xdr_callmsg), sunrpc/svc_authux.c: increment
	"buf" pointer by casting it to a char* first since a long* may be 8
 	bytes or more and oa->oa_length may be any multiple of 4.

	* sunrpc/rpc/xdr.h (IXDR_GET_LONG, IXDR_PUT_LONG): change casts to
 	u_int32_t (instead of u_long).

	* sunrpc/clnt_udp.c (clntudp_call): replaced sizeof(u_long) by 4
	since it really is testing for 32 bits.  Fixed casts to use
	u_int32 instead of u_long.
	* sunrpc/xdr_rec.c: Likewise.

	* sunrpc/clnt_tcp.c (clnttcp_call): replaced u_long by u_int32.
	* sunrpc/rpc/auth.h: Likewise.

	* limits.h (LONG_MAX, LONG_MIN, ULONG_MAX): use 64 bit values
	for Alpha.

Tue Mar 19 13:27:49 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* sysdeps/i386/fpu/__math.h: New file.
	Contributed by John C. Bowman <bowman@hagar.ph.utexas.edu>.

Sun Mar 17 00:28:16 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/posix/clock.c: Don't multiply the return value by
	CLOCKS_PER_SEC or CLK_TCK.

	* sysdeps/mach/hurd/getcwd.c: Fail with ENOENT if a parent directory
	scan finds no match.

	* posix/unistd.h (setpgrp): Declare no-arg version unless __FAVOR_BSD.
	* misc/bsd-compat.c (setpgrp): New function, two arg version.
	* sysdeps/stub/setpgid.c: Remove setpgrp alias.
	* sysdeps/mach/hurd/setpgid.c: Likewise.
	* sysdeps/unix/sysv/sysv4/setpgid.c: Likewise.
	* sysdeps/unix/common/syscalls.list (setpgid): Remove setpgrp alias.
	* sysdeps/unix/sysv/irix4/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/setpgrp.c: Obsolete file removed.
	* posix/setpgrp.c (setpgrp): New file.
	* posix/Makefile (routines): Add setpgrp.

Tue Feb  6 12:46:29 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* libc-symbols.h (weak_alias, weak_symbol): added definitions
	for ECOFF (HAVE_ECOFF).
1996-03-19 20:21:54 +00:00
Roland McGrath e384537164 Mon Mar 18 13:20:46 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* elf/Makefile (rtld-link): New canned sequence.
	(ld.so, ld-linux.so.1): Use it.  Pass -soname option.

	* sysdeps/i386/setjmp.S (__setjmp): Define compatibility entry point.

Sun Mar 17 23:15:32 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/tcgetpgrp.c,
	sysdeps/unix/sysv/linux/tcsetpgrp.c: New files.
1996-03-18 18:32:47 +00:00
Roland McGrath 9b431e31e1 Sun Mar 17 07:19:33 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* db/Makefile (CFLAGS-hash_func.c): New variable; pass -Wno-unused.
	(CFLAGS): Append -Wno-unitialized.

	* sysdeps/alpha/memchr.S: New file.
	* sysdeps/alpha/memchr.c: Obsolete file removed.
	* string/tester.c: Soup up memchr tests.
1996-03-17 12:36:52 +00:00
Roland McGrath 5aab07eb56 Sat Mar 16 20:58:43 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* stdlib/erand48_r.c: Use FP division by powers of two to distribute
	short bits into double.
1996-03-17 02:00:05 +00:00
Roland McGrath 6025c399e9 Sat Mar 16 20:08:22 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/memchr.S: new file.
	* sysdeps/alpha/memchr.c: obsolete file removed.

Sat Mar 16 16:26:09 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* misc/Makefile (headers): Add sysexits.h.
	* misc/sysexits.h: New file.

Thu Mar 14 15:20:45 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/libm-ieee754/e_atan2.c (__ieee754_atan2): Change atan
	call to __atan.
	* sysdeps/libm-ieee754/e_atan2f.c (__ieee754_atan2f): Change atanf
 	call to __atanf.

	* sysdeps/m68k/fpu/e_acos.c, sysdeps/m68k/fpu/e_acosf.c,
	sysdeps/m68k/fpu/e_asin.c, sysdeps/m68k/fpu/e_asinf.c,
	sysdeps/m68k/fpu/e_atanh.c, sysdeps/m68k/fpu/e_atanhf.c,
	sysdeps/m68k/fpu/e_cosh.c, sysdeps/m68k/fpu/e_coshf.c,
	sysdeps/m68k/fpu/e_exp.c, sysdeps/m68k/fpu/e_expf.c,
	sysdeps/m68k/fpu/e_fmod.c, sysdeps/m68k/fpu/e_fmodf.c,
	sysdeps/m68k/fpu/e_log.c, sysdeps/m68k/fpu/e_log10.c,
	sysdeps/m68k/fpu/e_log10f.c, sysdeps/m68k/fpu/e_logf.c,
	sysdeps/m68k/fpu/e_pow.c, sysdeps/m68k/fpu/e_powf.c,
	sysdeps/m68k/fpu/e_remainder.c, sysdeps/m68k/fpu/e_remainderf.c,
	sysdeps/m68k/fpu/e_scalb.c, sysdeps/m68k/fpu/e_scalbf.c,
	sysdeps/m68k/fpu/e_sinh.c, sysdeps/m68k/fpu/e_sinhf.c,
	sysdeps/m68k/fpu/e_sqrt.c, sysdeps/m68k/fpu/e_sqrtf.c,
	sysdeps/m68k/fpu/k_cos.c, sysdeps/m68k/fpu/k_cosf.c,
	sysdeps/m68k/fpu/k_sin.c, sysdeps/m68k/fpu/k_sinf.c,
	sysdeps/m68k/fpu/k_tan.c, sysdeps/m68k/fpu/k_tanf.c,
	sysdeps/m68k/fpu/s_atan.c, sysdeps/m68k/fpu/s_atanf.c,
	sysdeps/m68k/fpu/s_ceil.c, sysdeps/m68k/fpu/s_ceilf.c,
	sysdeps/m68k/fpu/s_cos.c, sysdeps/m68k/fpu/s_cosf.c,
	sysdeps/m68k/fpu/s_expm1.c, sysdeps/m68k/fpu/s_expm1f.c,
	sysdeps/m68k/fpu/s_fabs.c, sysdeps/m68k/fpu/s_fabsf.c,
	sysdeps/m68k/fpu/s_finite.c, sysdeps/m68k/fpu/s_finitef.c,
	sysdeps/m68k/fpu/s_floor.c, sysdeps/m68k/fpu/s_floorf.c,
	sysdeps/m68k/fpu/s_frexp.c, sysdeps/m68k/fpu/s_frexpf.c,
	sysdeps/m68k/fpu/s_ilogb.c, sysdeps/m68k/fpu/s_ilogbf.c,
	sysdeps/m68k/fpu/s_isinf.c, sysdeps/m68k/fpu/s_isinff.c,
	sysdeps/m68k/fpu/s_isnan.c, sysdeps/m68k/fpu/s_isnanf.c,
	sysdeps/m68k/fpu/s_ldexp.c, sysdeps/m68k/fpu/s_ldexpf.c,
	sysdeps/m68k/fpu/s_log1p.c, sysdeps/m68k/fpu/s_log1pf.c,
	sysdeps/m68k/fpu/s_logb.c, sysdeps/m68k/fpu/s_logbf.c,
	sysdeps/m68k/fpu/s_modf.c, sysdeps/m68k/fpu/s_modff.c,
	sysdeps/m68k/fpu/s_rint.c, sysdeps/m68k/fpu/s_rintf.c,
	sysdeps/m68k/fpu/s_scalbn.c, sysdeps/m68k/fpu/s_scalbnf.c,
	sysdeps/m68k/fpu/s_significand.c,
	sysdeps/m68k/fpu/s_significandf.c, sysdeps/m68k/fpu/s_sin.c,
	sysdeps/m68k/fpu/s_sinf.c, sysdeps/m68k/fpu/s_tan.c,
	sysdeps/m68k/fpu/s_tanf.c, sysdeps/m68k/fpu/s_tanh.c,
	sysdeps/m68k/fpu/s_tanhf.c: New files, for m68881 port of fdlibm.

	* sysdeps/m68k/fpu/__math.h: Rewritten for fdlibm.

	* sysdeps/m68k/fpu/isinfl.c: Rewritten to get argument type right.
	* sysdeps/m68k/fpu/isnanl.c: Likewise.

Thu Mar 14 06:01:07 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* posix/glob.c (glob): In GLOB_BRACE brace expansion, fix buffer size
	calculation to include trailing invariant portion.  Don't use alloca;
	instead use a dynamic auto array for GCC, malloc for non-GCC.
	Handle nested braces properly.

	* elf/elf.h (Elf32_auxv_t): Specify prototype (void) for `a_un.a_fcn'.

	* libc-symbols.h (lint): New macro.

Fri Mar 15 01:18:00 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* libio/iosetvbuf.c: Add weak alias setvbuf.
1996-03-17 01:58:17 +00:00
Roland McGrath d3b7d2ac93 Fri Mar 15 01:18:00 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libio/iosetvbuf.c: Add weak alias setvbuf.
1996-03-16 21:08:20 +00:00
Ian e5ba41ce24 Recognize mips-*-sysv* 1996-03-15 00:14:04 +00:00
Roland McGrath 8d71c7b0e4 Thu Mar 14 06:01:07 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* string/strnlen.c: New file.
	* string/Makefile (routines): Add strnlen.
	* string/string.h [__USE_GNU] (strnlen): Declare new function.
	[__OPTIMIZE__]: Define extern inline implementation of it.
1996-03-14 11:20:23 +00:00
Roland McGrath 52e9a9d118 Thu Mar 14 06:01:07 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* string/strnlen.c: New file.
	* string/Makefile (routines): Add strnlen.
	* string/string.h [__USE_GNU] (strnlen): Declare new function.
	[__OPTIMIZE__]: Define extern inline implementation of it.

	* stdlib/erand48_r.c: Use __mpn_construct_double instead of ldexp and
	addition, to avoid using anything from -lm.

Mon Mar  4 21:57:14 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/m68k/Makefile: New file.

	* sysdeps/unix/sysv/linux/m68k/sysdep.h (SYS_ify): Redefine.
	(CALL_MCOUNT): New macro, empty unless [PROF].
	(ENTRY): Do CALL_MCOUNT just after the label.
	(JUMPTARGET): New macro.
	(SYSCALL_ERROR_HANDLER): Fix syntax.

Thu Mar 14 04:20:48 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* sysdeps/unix/sysv/linux/init-first.c (init): Call `__personality'
	function instead of using inline asm i386 syscall.
	* sysdeps/unix/sysv/linux/syscalls.list: Add personality syscall.

	* posix/unistd.h [__USE_BSD]: Declare usleep.

	* misc/efgcvt.c (MAXDIG): New macro computed from <floats.h> constants.
	(fcvt, ecvt): Use it for buffer size.

	* stdlib/drand48-iter.c (__drand48_iterate): Use u_int64_t instead of
	conditionalizing long vs long long.

	* stdlib/drand48-iter.c (__drand48_iterate): Don't check for null
	pointers; never return EFAULT.
	* stdlib/drand48_r.c (drand48_r): Likewise.
	* stdlib/erand48_r.c (erand48_r): Likewise.
1996-03-14 11:20:03 +00:00
Roland McGrath 6c46dada59 Tue Mar 12 04:57:57 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* setjmp/Makefile (tests): Add jmpbug.
	* setjmp/jmpbug.c: New file.
1996-03-12 10:01:41 +00:00
Roland McGrath 1177c8babf Tue Mar 12 04:42:01 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/sparc/jmp_buf.h: Rewritten; use array of ints, not struct.
	* sysdeps/sparc/setjmp.S: Rewritten; store %fp value as well.
	* sysdeps/sparc/__longjmp.S: Rewritten; unwind frames one by one with
	`restore' until the target frame is hit.

Sun Mar 10 20:29:40 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/sigsuspend.c: New file.
	* sysdeps/unix/sysv/linux/syscalls.list: Remove sigsuspend, add
	s_sigsuspend.

Thu Mar  7 21:30:58 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makerules (+make-deps, sed-remove-objpfx): Quote periods on the
	left side of sed substitutions.

Sun Mar 10 16:58:10 1996  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

	* stdio-common/printf_fp.c (hack_digit): __mpn_normal_size
	is not available anymore.  Do it ourselves.

	* sysdeps/unix/sysv/linux/i386/fpu_control.h (_FPU_SETCW):
	Correct GCC `asm' syntax.

	* stdio-common/Makefile (tests): Add tst-ungetc.
	* stdio-common/tst-ungetc.c: New test from drepper.
	* stdio-common/tstscanf.c (main): New %[ test case from drepper.

	* sysdeps/libm-ieee754/s_scalbn.c (scalbn): Rename to __scalbn;
	somehow this was missed, though the weak alias is already there.
1996-03-12 09:50:46 +00:00
Roland McGrath dd0e4e0c8b Tue Mar 12 03:15:02 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/fpu_control.h (_FPU_DEFAULT): Change
	default to double precision, all interrupts masked; fdlibm requires.
1996-03-12 08:19:58 +00:00
Roland McGrath d25d5f6a50 Sat Mar 9 18:44:27 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/setfpucw.c: Obsolete file removed.

Fri Mar  8 22:16:48 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* stdio-common/printf_fp.c (HAVE_ALLOCA): New macro.
1996-03-09 23:50:19 +00:00
Roland McGrath 3f92886a4c Fri Mar 8 22:16:48 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* stdio-common/printf_fp.c (HAVE_ALLOCA): New macro.
1996-03-09 03:16:59 +00:00
Miles Bader 45667a533a *** empty log message ***
Tue Mar  5 18:45:14 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/select.c (__select): Include LASTFD in the
	final loop.
1996-03-05 23:48:15 +00:00
Miles Bader 5ac0712ca5 (__select): Include LASTFD in the final loop. 1996-03-05 23:46:23 +00:00
Richard Kenner b49d86bd21 Add -apple and -aux. 1996-03-05 23:34:58 +00:00
Roland McGrath f7eac6eb50 Mon Mar 4 20:54:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makeconfig ($(common-objpfx)config.make): Depend on config.h.in.


Mon Mar  4 17:35:09 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	* hurd/catch-signal.c (hurd_safe_memmove): New function.
	(hurd_safe_copyin, hurd_safe_copyout): New functions.
	* hurd/hurd/sigpreempt.h: Declare them.

Sun Mar  3 08:43:44 1996  Roland McGrath  <roland@charlie-brown.gnu.ai.mit.edu>

	Replace math code with fdlibm from Sun as modified for netbsd by
	JT Conklin and Ian Taylor, including x86 FPU support.
	* sysdeps/libm-ieee754, sysdeps/libm-i387: New directories.
	* math/math_private.h: New file.
	* sysdeps/i386/fpu/Implies: New file.
	* sysdeps/ieee754/Implies: New file.
	* math/machine/asm.h, math/machine/endian.h: New files.
	* math/Makefile, math/math.h: Rewritten.
	* mathcalls.h, math/mathcalls.h: New file, broken out of math.h.
	* math/finite.c: File removed.
	* sysdeps/generic/Makefile [$(subdir)=math]: Frobnication removed.

	* math/test-math.c: Include errno.h and string.h.

	* sysdeps/unix/bsd/dirstream.h: File removed.
	* sysdeps/unix/bsd/readdir.c: File removed.
1996-03-05 21:41:30 +00:00
Roland McGrath 1521668f2a Sun Mar 3 08:43:44 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* math/test-math.c: Include errno.h and string.h.
1996-03-05 19:06:19 +00:00
Miles Bader 5d8a006d2c A bug fix for the previous select bug fix.
Tue Mar  5 12:14:57 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/select.c (__select): Also don't fault just
	because some fdmask is 0.
1996-03-05 17:35:49 +00:00
Miles Bader 3cf11a4b33 (__select): Don't fault when some fdmask is 0. 1996-03-05 17:15:44 +00:00
Roland McGrath d43e047895 Mon Mar 4 20:54:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makeconfig ($(common-objpfx)config.make): Depend on config.h.in.
1996-03-05 16:23:22 +00:00
Erik Sandberg 9a0d30bdb1 (moss): Fix previous change. 1996-03-05 03:02:45 +00:00
Miles Bader e9ef1cf37a (__select): Don't increment GOT only because READ/WRITE/EXCEPTFDS is 0! Don't return without frobbing the bitmasks after a timeout. When clearing the bitmasks, only loop from FIRSTFD to LASTFD. 1996-03-05 00:07:01 +00:00
Richard Kenner bba51ac77a Accept -moss* as op sys. 1996-03-04 23:03:15 +00:00
Miles Bader e49639955f Hurd select fixes.
Mon Mar  4 17:35:35 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/select.c (__select):
	Don't increment GOT only because READ/WRITE/EXCEPTFDS is 0!
	Don't return without frobbing the bitmasks after a timeout.
	When clearing the bitmasks, only loop from FIRSTFD to LASTFD.
1996-03-04 22:56:09 +00:00
Roland McGrath c3d3967cd2 Mon Mar 4 17:35:09 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* hurd/catch-signal.c (hurd_safe_memmove): New function.
	(hurd_safe_copyin, hurd_safe_copyout): New functions.
	* hurd/hurd/sigpreempt.h: Declare them.
1996-03-04 22:45:04 +00:00
Roland McGrath 661fa17673 Sat Mar 2 16:35:40 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/m68k/profil-counter.h: File removed.
	* sysdeps/unix/sysv/sysv4/solaris2/sparc/profil-counter.h: File
	removed.
	* sysdeps/generic/profil-counter.h: New file.
1996-03-02 21:38:05 +00:00
Roland McGrath 36ff88f69e Sat Mar 2 16:35:40 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/m68k/profil-counter.h: File removed.
	* sysdeps/unix/sysv/sysv4/solaris2/sparc/profil-counter.h: File
	removed.
	* sysdeps/generic/profil-counter.h: New file.
1996-03-02 21:37:50 +00:00
695 changed files with 40212 additions and 9648 deletions
+1089 -1
View File
File diff suppressed because it is too large Load Diff
+1 -5
View File
@@ -105,11 +105,7 @@ foo:=$(shell echo '+tsrcs=$(+tsrcs)'>&2)
foo:=$(shell echo foobie, dammit! >&2)
ifndef tardir
rel+vers := $(shell sed -n -e 's/^.*libc_release.*\"\([^"]*\)";$$/\1/p' \
-e 's/^.*libc_version.*\"\([^"]*\)";$$/\1/p' \
< $(..)version.c)
release := $(word 1,$(rel+vers))
version := $(word 2,$(rel+vers))
-include $(common-objpfx)version.mk
export tardir := glibc-$(version)
endif
+30 -8
View File
@@ -118,9 +118,6 @@ endif # subdir
ifndef XGETTEXT
XGETTEXT = xgettext
endif
ifndef MSGJOIN
MSGJOIN = msgjoin
endif
P = $(..)po
@@ -133,22 +130,47 @@ endif
define extract
@rm -f $@.new
$(XGETTEXT) --keyword=_ --keyword=N_ --sort-output -d - \
> $@.new /dev/null $^
$(XGETTEXTFLAGS-$(@F)) > $@.new $^
mv -f $@.new $@
endef
$P/$(domain).pot: $(tags_sources); $(extract)
text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
$P/$(domain).pot: $(text-srcs)
ifeq (,$(text-srcs))
cp /dev/null $@
else
$(extract)
endif
$P/siglist.pot: $(..)sysdeps/generic/signame.c; $(extract)
$P/siglist.pot: $(common-objpfx)siglist.c; $(extract)
$P/errlist.pot: $(..)sysdeps/mach/hurd/errlist.c; $(extract)
all-pot = $P/libc-top.pot $(subdirs:%=$P/%.pot) \
# Extract all strings from these files; their strings are not marked.
# Their surroundings are also not interesting.
XGETTEXTFLAGS-siglist.pot = -a --no-location
XGETTEXTFLAGS-errlist.pot = -a --no-location
all-pot = $P/libc-top.pot $P/subdirs.pot \
$P/siglist.pot $P/errlist.pot
ifndef subdir
# Collect all the subdir messages, massaging the file names in comments
# to include the subdir name.
$P/subdirs.pot: $(subdirs:%=$P/%.pot)
@rm -f $@.new
(for d in $(subdirs); \
do sed "s%^#: %&$$d/%" $P/$$d.pot; done) > $@.new
mv -f $@.new $@
# Get $(version) defined.
include $(common-objpfx)version.mk
# Combine all the messages into the final sorted template translation file.
$P/SYS_libc.pot: $(all-pot)
@rm -f $@.new
$(MSGJOIN) $^ > $@.new
sed -e 's/VERSION/$(version)/' -e "s/DATE/`date +'%Y-%m-%d %k:%M'`/" \
po/header.pot > $@.new
$(XGETTEXT) -d - -n -s --omit-header $^ >> $@.new
mv -f $@.new $@
test ! -d CVS || cvs ci -m'Regenerated from source files' $@
+10 -8
View File
@@ -83,7 +83,7 @@ include $(common-objpfx)config.make
# changes and so config.status would be run every time; the dependence of
# config.make should suffice to force regeneration and re-exec, and the new
# image will notice if config.h changed.
$(common-objpfx)config.make: $(common-objpfx)config.status
$(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in
cd $(<D); $(SHELL) $(<F)
# Force the user to configure before making.
@@ -171,8 +171,8 @@ localedir = $(datadir)/locale
endif
# Where to install the locale charmap source files.
ifndef nlsdir
nlsdir = $(datadir)/nls
ifndef i18ndir
i18ndir = $(datadir)/i18n
endif
@@ -395,13 +395,8 @@ ifeq "$(strip $(+cflags))" ""
+cflags := $(default_cflags)
endif # $(+cflags) == ""
# If using gcc, add flags that only it will grok.
ifneq "$(findstring gcc,$(CC))" ""
+cflags := $(+cflags) $(+gccwarn)
+gcc-nowarn := -w
else
+gcc-nowarn :=
endif # gcc
# Don't duplicate options if we inherited variables from the parent.
+cflags := $(sort $(+cflags))
@@ -473,6 +468,13 @@ cross-compiling := yes
else
cross-compiling := no
endif
# Figure out the version numbers from version.h.
$(common-objpfx)version.mk: $(..)version.h
sed -n -e 's/^.*RELEASE.*\"\([^"]*\)";$$/release=\1/p' \
-e 's/^.*VERSION.*\"\([^"]*\)";$$/version=\1/p' \
< $< > $@-new
mv -f $@-new $@
endif # Makeconfig not yet included
+2 -2
View File
@@ -51,10 +51,10 @@ sysdep-subdirs := $(subst $(\n), ,$(sysdep-subdirs))
endif
# These are the subdirectories containing the library source.
subdirs = csu assert ctype db locale intl math setjmp signal stdlib \
subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\
posix io termios resource misc socket sysvipc gmon gnulib \
$(wildcard crypt) manual $(sysdep-subdirs) elf
wctype $(wildcard crypt) manual $(sysdep-subdirs) elf
export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63.
# The mach and hurd subdirectories have many generated header files which
+23 -9
View File
@@ -276,13 +276,14 @@ S-CPPFLAGS = $(asm-CPPFLAGS)
define +make-deps
-@rm -f $@
$(+mkdep) $< $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) | \
sed -e 's,$*\.o,$(foreach o,$(object-suffixes),$(@:.d=$o)) $@,' \
sed -e 's,$(subst .,\.,$*)\.o,$(foreach o,$(object-suffixes),$(@:.d=$o)) $@,' \
$(sed-remove-objpfx) > $(@:.d=.T)
mv -f $(@:.d=.T) $@
endef
ifneq (,$(objpfx))
sed-remove-objpfx = -e 's@ $(subst @,\@,$(objpfx))@ $$(objpfx)@g' \
-e 's@^$(subst @,\@,$(objpfx))@$$(objpfx)@g'
sed-remove-objpfx = -e 's@ $(subst .,\., \
$(subst @,\@,$(objpfx)))@ $$(objpfx)@g' \
-e 's@^$(subst .,\.,$(subst @,\@,$(objpfx)))@$$(objpfx)@g'
endif
# Figure out the source filenames in this directory.
@@ -518,12 +519,12 @@ install-lib.a := $(filter lib%.a,$(install-lib))
install-lib-non.a := $(filter-out lib%.a,$(install-lib))
ifdef install-lib-non.a
$(addprefix $(libdir)/$(libprefix),$(install-lib-non.a)): \
$(libdir)/$(libprefix)%: $(objpfx)%
$(libdir)/$(libprefix)%: $(common-objpfx)%
$(do-install)
endif
ifdef install-lib.a
$(install-lib.a:lib%.a=$(libdir)/lib$(libprefix)%.a): \
$(libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
$(libdir)/lib$(libprefix)%.a: $(common-objpfx)lib%.a
$(do-install)
$(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
endif
@@ -568,12 +569,19 @@ ifeq (yes,$(build-shared))
# on other shared objects.
lib%.so: lib%_pic.a; $(build-shlib)
ifeq ($(have-no-whole-archive),yes)
no-whole-archive = -Wl,--no-whole-archive
else
no-whole-archive =
endif
define build-shlib
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
-Wl,-rpath-link=$(common-objdir) \
-Wl,--whole-archive $^ $(LDLIBS-$(@F:lib%.so=%).so)
-Wl,--whole-archive $^ $(no-whole-archive) \
$(LDLIBS-$(@F:lib%.so=%).so)
endef
# Don't try to use -lc when making libc.so itself.
@@ -609,7 +617,12 @@ cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=%) -o $(@F)
endef
# We always want to use configuration definitions.
BUILD_CFLAGS = -include $(common-objpfx)config.h
ifdef objdir
# This is always used in $(common-objdir), so we use no directory name.
BUILD_CFLAGS = -include config.h
else
BUILD_CFLAGS = -include $(..)config.h
endif
# Support the GNU standard name for this target.
.PHONY: check
@@ -619,8 +632,9 @@ check: tests
TAGS: distinfo $(..)MakeTAGS
$(MAKE) $(addprefix -f ,$^) $@
$(..)po/%.pot: distinfo $(..)MakeTAGS
$(MAKE) $(addprefix -f ,$^) $@
$(..)po/%.pot: distinfo $(..)MakeTAGS FORCE
$(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
FORCE:
.PHONY: echo-headers
+32 -7
View File
@@ -1,4 +1,4 @@
GNU C Library NEWS -- history of user-visible changes. 2 January 1996
GNU C Library NEWS -- history of user-visible changes. 28 March 1996
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -7,6 +7,10 @@ Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu.
Version 1.10
* GNU extensions are no longer declared by default. To enable them you
must define the macro `_GNU_SOURCE' in your program or compile with
`-D_GNU_SOURCE'.
* The library has changed from using GNU ld symbol aliases to using weak
symbols where available. The ELF object file format supports weak
symbols; GNU ld also supports weak symbols in the a.out format. (There
@@ -34,8 +38,14 @@ Version 1.10
* The C library now provides the run-time support code for profiling
executables compiled with `-pg'. Programs can control the profiling code
through the interface in <sys/gmon.h>. The profiling code was adapted
from 4.4 BSD-Lite.
through the interface in <sys/gmon.h>. The `gmon.out' files written by
the GNU C library can be read only by GNU `gprof' (from GNU binutils);
the support for this file format was contributed by David Mosberger-Tang.
* The math code has been replaced with a math library based on fdlibm from
Sun, and modified by JT Conklin with i387 support and by Ian Taylor with
`float' functions. The math functions now reside in a separate library,
so programs using them will need to use `-lm' their linking commands.
* The new functions `strtoq' and `strtouq' parse integer values from
strings, like `strtol' and `strtoul', but they return `long long int' and
@@ -53,6 +63,11 @@ Version 1.10
* The new header <langinfo.h> defines an interface for accessing
various locale-dependent data (using the locale chosen with `setlocale').
* Ulrich Drepper has contributed a new suite of functions for operation on
wide-character and multibyte-character strings, in <wcstr.h> and <mbstr.h>;
and classification and case conversion of wide characters, in <wctype.h>.
These new functions are intended to conform to the ISO C specification.
* You can now use positional parameter specifications in format strings
for the `printf' and `scanf' families of functions. For example,
`printf ("Number %2$d, Mr %1$s\n", "Jones", 6);'' prints
@@ -133,6 +148,10 @@ Version 1.10
The GNU library now supports Linux versions 1.3.29 and later,
using the ELF object file format (i[345]86-*-linux).
* Andreas Schwab has ported the C library to Linux/m68k (m68k-*-linux).
* David Mosberger-Tang has ported the C library to Linux/Alpha (alpha-*-linux).
* Ulrich Drepper has contributed a new set of message catalog functions to
support multiple languages, for use with his new package GNU gettext.
@@ -163,10 +182,16 @@ Version 1.10
* New function `getsid' returns session ID number on systems that support it.
* The 4.4 BSD `db' library has been incorporated into the GNU C library.
New header files <db.h> and <mpool.h> provide a rich set of functions for
several types of simple databases stored in memory and in files, and
<ndbm.h> is an old `ndbm'-compatbile interface using the `db' functions.
* We have incorporated the 4.4 BSD `db' library (version 1.85). New header
files <db.h> and <mpool.h> provide a rich set of functions for several
types of simple databases stored in memory and in files, and <ndbm.h> is
an old `ndbm'-compatbile interface using the `db' functions.
* New macro `strdupa' copies a string like `strdup', but uses local stack
space from `alloca' instead of dynamic heap space from `malloc'.
* New function `strnlen' is like `strlen' but searches only a given maximum
number of characters for the null terminator.
Version 1.09
+2 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -95,4 +95,3 @@ __END_DECLS
#endif /* NDEBUG. */
+41
View File
@@ -0,0 +1,41 @@
# Copyright (C) 1996 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
# You should have received a copy of the GNU Library General Public
# License along with the GNU C Library; see the file COPYING.LIB. If
# not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Makefile for catgets.
#
subdir := catgets
headers = nl_types.h
distribute = catgetsinfo.h config.h
routines = catgets open_catalog
others = gencat
install-bin = gencat
gencat-modules = xmalloc
# To find xmalloc.c
vpath %.c ../locale/programs
include ../Rules
$(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:"' \
-DHAVE_CONFIG_H $(CPPFLAGS)
+163
View File
@@ -0,0 +1,163 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <alloca.h>
#include <nl_types.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include "catgetsinfo.h"
/* Open the catalog and return a descriptor for the catalog. */
nl_catd
catopen (const char *cat_name, int flag)
{
__nl_catd result;
const char *env_var;
result = (__nl_catd) malloc (sizeof (__nl_catd));
if (result == NULL)
/* We cannot get enough memory. */
return (nl_catd) -1;
result->status = closed;
result->cat_name = strdup (cat_name);
if (result->cat_name == NULL)
{
free (result);
return (nl_catd) -1;
}
if (strchr (cat_name, '/') == NULL)
{
if (flag == NL_CAT_LOCALE)
{
env_var = getenv ("LC_ALL");
if (env_var == NULL)
{
env_var = getenv ("LC_MESSAGES");
if (env_var == NULL)
{
env_var = getenv ("LANG");
if (env_var == NULL)
env_var = "C";
}
}
}
else
{
env_var = getenv ("LANG");
if (env_var == NULL)
env_var = "C";
}
result->env_var = strdup (env_var);
if (result->env_var == NULL)
{
free ((void *) result->cat_name);
free ((void *) result);
return (nl_catd) -1;
}
if (getenv ("NLSPATH") != NULL)
result->nlspath = strdup (getenv ("NLSPATH"));
else
result->nlspath = strdup (NLSPATH);
if (result->nlspath == NULL)
{
free ((void *) result->cat_name);
free ((void *) result->env_var);
free ((void *) result);
return (nl_catd) -1;
}
}
else
{
result->env_var = NULL;
result->nlspath = NULL;
}
return (nl_catd) result;
}
/* Return message from message catalog. */
char *
catgets (nl_catd catalog_desc, int set, int message, const char *string)
{
__nl_catd catalog;
size_t idx;
size_t cnt;
/* Be generous if catalog which failed to be open is used. */
if (catalog_desc == (nl_catd) -1 || ++set <= 0 || message < 0)
return (char *) string;
catalog = (__nl_catd) catalog_desc;
if (catalog->status == closed)
__open_catalog (catalog, 1);
if (catalog->status == nonexisting)
return (char *) string;
idx = ((set * message) % catalog->plane_size) * 3;
cnt = 0;
do
{
if (catalog->name_ptr[idx + 0] == (u_int32_t) set
&& catalog->name_ptr[idx + 1] == (u_int32_t) message)
return (char *) &catalog->strings[catalog->name_ptr[idx + 2]];
idx += catalog->plane_size * 3;
}
while (++cnt < catalog->plane_depth);
return (char *) string;
}
/* Return resources used for loaded message catalog. */
int
catclose (nl_catd catalog_desc)
{
__nl_catd catalog;
catalog = (__nl_catd) catalog_desc;
if (catalog->status == mmaped)
munmap ((void *) catalog->file_ptr, catalog->file_size);
else if (catalog->status == malloced)
free ((void *) catalog->file_ptr);
else if (catalog->status != closed && catalog->status != nonexisting)
return -1;
if (catalog->nlspath)
free ((void *) catalog->nlspath);
if (catalog->env_var)
free ((void *) catalog->env_var);
free ((void *) catalog);
return 0;
}
+59
View File
@@ -0,0 +1,59 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/types.h>
struct catalog_obj
{
u_int32_t magic;
u_int32_t plane_size;
u_int32_t plane_depth;
/* This is in fact two arrays in one: always a pair of name and
pointer into the data area. */
u_int32_t name_ptr[0];
};
/* This structure will be filled after loading the catalog. */
typedef struct catalog_info
{
enum { closed, nonexisting, mmaped, malloced } status;
const char *cat_name;
const char *env_var;
const char *nlspath;
size_t plane_size;
size_t plane_depth;
u_int32_t *name_ptr;
const char *strings;
struct catalog_obj *file_ptr;
size_t file_size;
} *__nl_catd;
/* The magic number to signal we really have a catalog file. */
#define CATGETS_MAGIC 0x960408de
/* Prototypes for helper functions. */
void __open_catalog (__nl_catd __catalog, int __with_path);
+14
View File
@@ -0,0 +1,14 @@
#ifndef _CG_CONFIG_H
#define _CG_CONFIG_H
/* Use the internal textdomain used for libc messages. */
#define PACKAGE _libc_intl_domainname
#ifndef VERSION
/* Get libc version number. */
#include "../version.h"
#endif
#include_next <config.h>
#endif
+1030
View File
File diff suppressed because it is too large Load Diff
+48
View File
@@ -0,0 +1,48 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _NL_TYPES_H
#define _NL_TYPES_H 1
#include <features.h>
/* The default message set used by the gencat program. */
#define NL_SETD 1
/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
#define NL_CAT_LOCALE 1
/* Message catalog descriptor type. */
typedef void *nl_catd;
__BEGIN_DECLS
/* Open message catalog for later use, returning descriptor. */
extern nl_catd catopen __P ((__const char *__cat_name, int __flag));
/* Return translation with NUMBER in SET of CATALOG; if not found
return STRING. */
extern char *catgets __P ((nl_catd __catalog, int __set, int __number,
__const char *__string));
/* Close message CATALOG. */
extern int catclose __P ((nl_catd __catalog));
__END_DECLS
#endif /* nl_types.h */
+263
View File
@@ -0,0 +1,263 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <endian.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include "catgetsinfo.h"
#define SWAPU32(w) \
(((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
void
__open_catalog (__nl_catd catalog, int with_path)
{
int fd;
struct stat st;
int swapping;
if (strchr (catalog->cat_name, '/') != NULL || !with_path)
fd = open (catalog->cat_name, O_RDONLY);
else
{
const char *run_nlspath = catalog->nlspath;
#define ENOUGH(n) \
if (bufact + (n) >=bufmax) \
{ \
char *old_buf = buf; \
bufmax += 256 + (n); \
buf = (char *) alloca (bufmax); \
memcpy (buf, old_buf, bufact); \
}
/* The RUN_NLSPATH variable contains a colon separated list of
descriptions where we expect to find catalogs. We have to
recognize certain % substitutions and stop when we found the
first existing file. */
char *buf;
size_t bufact;
size_t bufmax;
buf = NULL;
bufmax = 0;
fd = -1;
while (*run_nlspath != '\0')
{
bufact = 0;
while (*run_nlspath != ':' && *run_nlspath != '\0')
if (*run_nlspath == '%')
{
const char *tmp;
++run_nlspath; /* We have seen the `%'. */
switch (*run_nlspath++)
{
case 'N':
/* Use the catalog name. */
ENOUGH (strlen (catalog->cat_name));
bufact = stpcpy (&buf[bufact], catalog->cat_name) - buf;
break;
case 'L':
/* Use the current locale category value. */
ENOUGH (strlen (catalog->env_var));
bufact = stpcpy (&buf[bufact], catalog->env_var) - buf;
break;
case 'l':
/* Use language element of locale category value. */
tmp = catalog->env_var;
do
{
ENOUGH (1);
buf[bufact++] = *tmp++;
}
while (*tmp != '\0' && *tmp != '_' && *tmp != '.');
break;
case 't':
/* Use territory element of locale category value. */
tmp = catalog->env_var;
do
++tmp;
while (*tmp != '\0' && *tmp != '_' && *tmp != '.');
if (*tmp == '_')
{
++tmp;
do
{
ENOUGH (1);
buf[bufact++] = *tmp;
}
while (*tmp != '\0' && *tmp != '.');
}
break;
case 'c':
/* Use code set element of locale category value. */
tmp = catalog->env_var;
do
++tmp;
while (*tmp != '\0' && *tmp != '.');
if (*tmp == '.')
{
++tmp;
do
{
ENOUGH (1);
buf[bufact++] = *tmp;
}
while (*tmp != '\0');
}
break;
case '%':
ENOUGH (1);
buf[bufact++] = '%';
break;
default:
/* Unknown variable: ignore this path element. */
bufact = 0;
while (*run_nlspath != '\0' && *run_nlspath != ':')
++run_nlspath;
break;
}
}
else
{
ENOUGH (1);
buf[bufact++] = *run_nlspath++;
}
ENOUGH (1);
buf[bufact] = '\0';
if (bufact != 0)
{
fd = open (buf, O_RDONLY);
if (fd >= 0)
break;
}
++run_nlspath;
}
}
if (fd < 0 || fstat (fd, &st) < 0)
{
catalog->status = nonexisting;
return;
}
#ifndef MAP_COPY
/* Linux seems to lack read-only copy-on-write. */
#define MAP_COPY MAP_PRIVATE
#endif
#ifndef MAP_FILE
/* Some systems do not have this flag; it is superfluous. */
#define MAP_FILE 0
#endif
#ifndef MAP_INHERIT
/* Some systems might lack this; they lose. */
#define MAP_INHERIT 0
#endif
catalog->file_size = st.st_size;
catalog->file_ptr =
(struct catalog_obj *) mmap (NULL, st.st_size, PROT_READ,
MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0);
if (catalog->file_ptr != (struct catalog_obj *) -1)
/* Tell the world we managed to mmap the file. */
catalog->status = mmaped;
else
{
/* mmap failed perhaps because the system call is not
implemented. Try to load the file. */
size_t todo;
catalog->file_ptr = malloc (st.st_size);
if (catalog->file_ptr == NULL)
{
catalog->status = nonexisting;
return;
}
todo = st.st_size;
/* Save read, handle partial reads. */
do
{
size_t now = read (fd, (((char *) &catalog->file_ptr)
+ (st.st_size - todo)), todo);
if (now == 0)
{
free ((void *) catalog->file_ptr);
catalog->status = nonexisting;
return;
}
todo -= now;
}
while (todo > 0);
catalog->status = malloced;
}
/* We don't need the file anymore. */
close (fd);
/* Determine whether the file is a catalog file and if yes whether
it is written using the correct byte order. Else we have to swap
the values. */
if (catalog->file_ptr->magic == CATGETS_MAGIC)
swapping = 0;
else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC))
swapping = 1;
else
{
/* Illegal file. Free he resources and mark catalog as not
usable. */
if (catalog->status == mmaped)
munmap ((void *) catalog->file_ptr, catalog->file_size);
else
free (catalog->file_ptr);
catalog->status = nonexisting;
return;
}
#define SWAP(x) (swapping ? SWAPU32 (x) : (x))
/* Get dimensions of the used hashing table. */
catalog->plane_size = SWAP (catalog->file_ptr->plane_size);
catalog->plane_depth = SWAP (catalog->file_ptr->plane_depth);
/* The file contains two versions of the pointer tables. Pick the
right one for the local byte order. */
#if __BYTE_ORDER == __LITTLE_ENDIAN
catalog->name_ptr = &catalog->file_ptr->name_ptr[0];
#elif __BYTE_ORDER == __BIG_ENDIAN
catalog->name_ptr = &catalog->file_ptr->name_ptr[catalog->plane_size
* catalog->plane_depth
* 3];
#else
# error Cannot handle __BYTE_ORDER byte order
#endif
/* The rest of the file contains all the strings. They are
addressed relative to the position of the first string. */
catalog->strings =
(const char *) &catalog->file_ptr->name_ptr[catalog->plane_size
* catalog->plane_depth * 3 * 2];
}
+16 -8
View File
@@ -51,15 +51,13 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:[VX]*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
# After 4.x, OSF1 uses "X4.x" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'`
exit 0 ;;
alpha:OSF1:*:*)
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
@@ -138,7 +136,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`uname -p`
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
@@ -330,6 +328,9 @@ EOF
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
@@ -451,6 +452,13 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
R3000:*System_V*:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
+15 -11
View File
@@ -4,12 +4,19 @@
#undef HAVE_GNU_LD
/* Define if using ELF, which supports weak symbols.
This implies HAVE_WEAK_SYMBOLS; set by --with-elf. */
This implies HAVE_ASM_WEAK_DIRECTIVE and NO_UNDERSCORES; set by
--with-elf. */
#undef HAVE_ELF
/* Define if weak symbols are available in the assembler and
linker being used. Set by --with-weak-symbols. */
#undef HAVE_WEAK_SYMBOLS
/* Define if C symbols are asm symbols. Don't define if C symbols
have a `_' prepended to make the asm symbol. */
#undef NO_UNDERSCORES
/* Define if weak symbols are available via the `.weak' directive. */
#undef HAVE_ASM_WEAK_DIRECTIVE
/* Define if weak symbols are available via the `.weakext' directive. */
#undef HAVE_ASM_WEAKEXT_DIRECTIVE
/* Define if not using ELF, but `.init' and `.fini' sections are available. */
#undef HAVE_INITFINI
@@ -24,13 +31,6 @@
declaring a symbol global (default `.globl'). */
#undef ASM_GLOBAL_DIRECTIVE
/* ELF has weak symbols, and with GNU ld a.out does too. */
#ifndef HAVE_WEAK_SYMBOLS
#if defined (HAVE_ELF) || defined (HAVE_GNU_LD)
#define HAVE_WEAK_SYMBOLS
#endif
#endif
/* Define to use GNU libio instead of GNU stdio.
This is defined by configure under --enable-libio. */
#undef USE_IN_LIBIO
@@ -71,4 +71,8 @@
#define HAVE_STRERROR 1
/* The locale code needs these definitions. */
#define HAVE_REGEX 1
#endif
+2 -1
View File
@@ -15,9 +15,10 @@ config-sysdirs = @sysnames@
config-defines = @DEFS@
elf = @elf@
weak-symbols = @weak@
have-initfini = @libc_cv_have_initfini@
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
# Configuration options.
gnu-as = @gnu_as@
gnu-ld = @gnu_ld@
Vendored
+5 -3
View File
@@ -81,7 +81,8 @@ case $os in
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
os=
basic_machine=$1
;;
@@ -652,7 +653,7 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \
| -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]* \
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
@@ -661,7 +662,7 @@ case $os in
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos*)
| -cygwin32* | -pe* | -psos* | -moss* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
@@ -887,6 +888,7 @@ case $basic_machine in
;;
-aux*)
vendor=apple
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
Vendored
+124 -33
View File
@@ -2,8 +2,8 @@
# From configure.in CVSid
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.7
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
# Generated automatically using autoconf version 2.9
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -26,8 +26,6 @@ ac_help="$ac_help
--with-gnu-as if using GNU as (in the binutils package)"
ac_help="$ac_help
--with-elf if using the ELF object format"
ac_help="$ac_help
--with-weak-symbols if weak symbols are available in as and ld"
ac_help="$ac_help
--enable-libio build in GNU libio instead of GNU stdio"
ac_help="$ac_help
@@ -355,7 +353,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.7"
echo "configure generated by autoconf version 2.9"
exit 0 ;;
-with-* | --with-*)
@@ -620,14 +618,6 @@ else
elf=no
fi
# Check whether --with-weak-symbols or --without-weak-symbols was given.
if test "${with_weak_symbols+set}" = set; then
withval="$with_weak_symbols"
weak=$withval
else
weak=no
fi
# Check whether --enable-libio or --disable-libio was given.
if test "${enable_libio+set}" = set; then
@@ -721,12 +711,18 @@ config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
case "$host_os" in
gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
# These systems always use GNU tools.
gnu_ld=yes gnu_as=yes
gnu_ld=yes gnu_as=yes ;;
esac
case "$host_os" in
gnu* | linux* | sysv4* | solaris2*)
# These systems always use the ELF format.
elf=yes
elf=yes ;;
esac
# Linux/Alpha does not use ELF yet.
case "$host_cpu-$host_os" in
alpha*-linux*)
gnu_ld=no elf=no ;;
esac
# Compute the list of sysdep directories for this configuration.
@@ -1147,13 +1143,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1151 "configure"
#line 1147 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1162,13 +1158,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1166 "configure"
#line 1162 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1217,7 +1213,7 @@ if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1221 "configure"
#line 1217 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
@@ -1233,7 +1229,7 @@ size_t size; wchar_t wchar;
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
if { (eval echo configure:1237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
@@ -1340,7 +1336,7 @@ if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1344 "configure"
#line 1340 "configure"
#include "confdefs.h"
int main() { return 0; }
@@ -1349,7 +1345,7 @@ asm (".section .init");
asm (".section .fini");
; return 0; }
EOF
if { (eval echo configure:1353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -1369,6 +1365,108 @@ EOF
fi
fi
if test $elf = yes; then
libc_cv_asm_underscores=no
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1377 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() { return 0; }
int t() {
glibc_foobar ();
; return 0; }
EOF
if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
rm -rf conftest*
libc_cv_asm_underscores=no
fi
rm -f conftest*
fi
echo "$ac_t""$libc_cv_asm_underscores" 1>&4
fi
if test $libc_cv_asm_underscores = no; then
cat >> confdefs.h <<\EOF
#define NO_UNDERSCORES 1
EOF
fi
if test $elf = yes; then
libc_cv_weak_symbols=yes
libc_cv_asm_weak_directive=yes
libc_cv_asm_weakext_directive=no
else
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.s <<EOF
.text
${libc_cv_asm_global_directive} foo
foo: .long 0
.weak foo
.weak bar; bar = foo
EOF
if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
libc_cv_asm_weak_directive=yes
else
libc_cv_asm_weak_directive=no
fi
rm -f conftest*
fi
echo "$ac_t""$libc_cv_asm_weak_directive" 1>&4
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.s <<EOF
.text
${libc_cv_asm_global_directive} foo
foo: .long 0
.weakext foo
.weakext bar, foo
EOF
if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
libc_cv_asm_weakext_directive=yes
else
libc_cv_asm_weakext_directive=no
fi
rm -f conftest*
fi
echo "$ac_t""$libc_cv_asm_weakext_directive" 1>&4
fi # no .weak
fi # not ELF
if test $libc_cv_asm_weak_directive = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ASM_WEAK_DIRECTIVE 1
EOF
elif test $libc_cv_asm_weakext_directive = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ASM_WEAKEXT_DIRECTIVE 1
EOF
fi
### End of automated tests.
### Now run sysdeps configure fragments.
# sysdeps configure fragments may set these with files to be linked below.
libc_link_dests=
libc_link_sources=
@@ -1456,7 +1554,7 @@ default) stdio=stdio ;;
esac
echo "$ac_t""$stdio" 1>&4
if test $gnu_ld = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_GNU_LD 1
@@ -1474,12 +1572,6 @@ if test $elf = yes; then
#define HAVE_ELF 1
EOF
fi
if test $weak = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_WEAK_SYMBOLS 1
EOF
fi
@@ -1573,7 +1665,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.7"
echo "$CONFIG_STATUS generated by autoconf version 2.9"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1639,7 +1731,6 @@ s%@stdio@%$stdio%g
s%@gnu_ld@%$gnu_ld%g
s%@gnu_as@%$gnu_as%g
s%@elf@%$elf%g
s%@weak@%$weak%g
s%@shared@%$shared%g
s%@profile@%$profile%g
s%@omitfp@%$omitfp%g
@@ -1747,7 +1838,7 @@ rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
+86 -10
View File
@@ -1,6 +1,6 @@
Dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$CVSid$])
AC_PREREQ(2.4.2)dnl dnl Minimum Autoconf version required.
AC_PREREQ(2.9)dnl dnl Minimum Autoconf version required.
AC_INIT(features.h)
AC_CONFIG_HEADER(config.h)
@@ -49,9 +49,6 @@ test $gnu_binutils = yes && gnu_as=yes gnu_ld=yes
AC_ARG_WITH(elf, dnl
--with-elf if using the ELF object format,
elf=$withval, elf=no)
AC_ARG_WITH(weak-symbols, dnl
--with-weak-symbols if weak symbols are available in as and ld,
weak=$withval, weak=no)
AC_ARG_ENABLE(libio, dnl
[ --enable-libio build in GNU libio instead of GNU stdio],
@@ -84,12 +81,18 @@ config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
case "$host_os" in
gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
# These systems always use GNU tools.
gnu_ld=yes gnu_as=yes
gnu_ld=yes gnu_as=yes ;;
esac
case "$host_os" in
gnu* | linux* | sysv4* | solaris2*)
# These systems always use the ELF format.
elf=yes
elf=yes ;;
esac
# Linux/Alpha does not use ELF yet.
case "$host_cpu-$host_os" in
alpha*-linux*)
gnu_ld=no elf=no ;;
esac
# Compute the list of sysdep directories for this configuration.
@@ -406,6 +409,82 @@ if test $elf != yes; then
fi
fi
if test $elf = yes; then
libc_cv_asm_underscores=no
else
AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
[AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
libc_cv_asm_underscores=yes,
libc_cv_asm_underscores=no)])
fi
if test $libc_cv_asm_underscores = no; then
AC_DEFINE(NO_UNDERSCORES)
fi
if test $elf = yes; then
libc_cv_weak_symbols=yes
libc_cv_asm_weak_directive=yes
libc_cv_asm_weakext_directive=no
else
AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
[dnl
cat > conftest.s <<EOF
.text
${libc_cv_asm_global_directive} foo
foo: .long 0
.weak foo
.weak bar; bar = foo
EOF
if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
libc_cv_asm_weak_directive=yes
else
libc_cv_asm_weak_directive=no
fi
rm -f conftest*])
if test $libc_cv_asm_weak_directive = no; then
AC_CACHE_CHECK(for assembler .weakext directive,
libc_cv_asm_weakext_directive,
[dnl
cat > conftest.s <<EOF
.text
${libc_cv_asm_global_directive} foo
foo: .long 0
.weakext foo
.weakext bar, foo
EOF
if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
libc_cv_asm_weakext_directive=yes
else
libc_cv_asm_weakext_directive=no
fi
rm -f conftest*])
fi # no .weak
fi # not ELF
if test $libc_cv_asm_weak_directive = yes; then
AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
elif test $libc_cv_asm_weakext_directive = yes; then
AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
fi
AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
cat > conftest.c <<\EOF
main () { exit (0); }
EOF
if ${CC-cc} $CFLAGS -Wl,--no-whole-archive \
-o conftest conftest.c 2>/dev/null; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
fi
rm -f conftest*])
AC_SUBST(libc_cv_ld_no_whole_archive)dnl
### End of automated tests.
### Now run sysdeps configure fragments.
# sysdeps configure fragments may set these with files to be linked below.
libc_link_dests=
libc_link_sources=
@@ -498,7 +577,7 @@ default) stdio=stdio ;;
esac
AC_MSG_RESULT($stdio)
AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) AC_SUBST(weak)
AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf)
if test $gnu_ld = yes; then
AC_DEFINE(HAVE_GNU_LD)
fi
@@ -508,9 +587,6 @@ fi
if test $elf = yes; then
AC_DEFINE(HAVE_ELF)
fi
if test $weak = yes; then
AC_DEFINE(HAVE_WEAK_SYMBOLS)
fi
AC_SUBST(shared)
if test $shared = default; then
+9 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,11 +21,15 @@ Cambridge, MA 02139, USA. */
/* Defined in locale/C-ctype.c. */
extern const char _nl_C_LC_CTYPE_class[];
extern const char _nl_C_LC_CTYPE_class32[];
extern const char _nl_C_LC_CTYPE_toupper[];
extern const char _nl_C_LC_CTYPE_tolower[];
extern const char _nl_C_LC_CTYPE_names[];
#define b(u,x) (((u int *) _nl_C_LC_CTYPE_##x) + 128);
#define b(u,x,o) (((const u int *) _nl_C_LC_CTYPE_##x) + o);
const unsigned short int *__ctype_b = b(unsigned short, class);
const int *__ctype_tolower = b(, tolower);
const int *__ctype_toupper = b(, toupper);
const unsigned short int *__ctype_b = b (unsigned short, class, 128);
const unsigned int *__ctype32_b = b (unsigned, class32, 0);
const int *__ctype_tolower = b (, tolower, 128);
const int *__ctype_toupper = b (, toupper, 128);
const unsigned int *__ctype_names = b (unsigned, names, 0);
+7 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -27,6 +27,7 @@ Cambridge, MA 02139, USA. */
__BEGIN_DECLS
#ifndef _ISbit
/* These are all the characteristics of characters.
If there get to be more than 16 distinct characteristics,
many things must be changed that use `unsigned short int's.
@@ -55,11 +56,9 @@ enum
_ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */
_IScntrl = _ISbit (9), /* Control character. */
_ISpunct = _ISbit (10), /* Punctuation. */
/* The following are defined in POSIX.2 as being combinations of the
classes above. */
_ISalnum = _ISalpha | _ISdigit /* Alphanumeric. */
_ISalnum = _ISbit (11) /* Alphanumeric. */
};
#endif /* ! _ISbit */
/* These are defined in ctype-info.c.
The declarations here must match those in localeinfo.h.
@@ -70,7 +69,8 @@ enum
char' values and for EOF; we also support negative `signed char' values
for broken old programs. The case conversion arrays are of `int's
rather than `unsigned char's because tolower (EOF) must be EOF, which
doesn't fit into an `unsigned char'. */
doesn't fit into an `unsigned char'. But today more important is that
the arrays are also used for multi-byte character sets. */
extern __const unsigned short int *__ctype_b; /* Characteristics. */
extern __const int *__ctype_tolower; /* Case conversions. */
extern __const int *__ctype_toupper; /* Case conversions. */
+7
View File
@@ -26,3 +26,10 @@ distribute := compat.h \
include ../Rules
CPPFLAGS += -D__DBINTERFACE_PRIVATE
# This file defines some static functions for alternative hash algorithms
# that are not actually used.
CFLAGS-hash_func.c := -Wno-unused
# The db code outsmarts the compiler frequently.
override CFLAGS += -Wno-uninitialized
+1 -1
View File
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+3 -1
View File
@@ -14,7 +14,7 @@ main ()
dirp = opendir(".");
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
{
/* save position 3 (fourth entry) */
/* save position 3 (after fourth entry) */
if (i++ == 3)
save3 = telldir(dirp);
@@ -26,6 +26,8 @@ main ()
break;
}
printf("going back past 4-th entry...\n");
/* go back to saved entry */
seekdir (dirp, save3);
+11 -5
View File
@@ -1,6 +1,6 @@
# Makefile for elf subdirectory of GNU C Library.
# Copyright (C) 1995 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -61,9 +61,15 @@ $(objpfx)librtld.so: $(rtld-routines:%=$(objpfx)%.so) \
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
'-Wl,-(' $^ -lgcc '-Wl,-)'
$(objpfx)ld.so $(objpfx)ld-linux.so.1: $(objpfx)librtld.so
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
-Wl,-rpath=$(default-rpath) $^
$(objpfx)ld.so: $(objpfx)librtld.so
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
$(objpfx)ld-linux.so.1: $(objpfx)librtld.so
$(rtld-link) -Wl,-soname=ld-linux.so.1
define rtld-link
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
-Wl,-rpath=$(default-rpath) $^
endef
# The Linux-compatible dynamic linker shared object is just the same
# with one object file of compatibility initialization code added.
@@ -74,7 +80,7 @@ $(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
$(patsubst %/,cd %;,$(objpfx)) \
$(LINK.o) -shared -o $(@:$(objpfx)%=%) \
$(LDFLAGS.so) $(LDFLAGS-dl.so) \
-Wl,--whole-archive $(^:$(objpfx)%=%)
-Wl,--whole-archive $(^:$(objpfx)%=%) $(no-whole-archive)
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
$(slibdir)/ld-linux.so.1: $(objpfx)ld-linux.so.1; $(do-install-program)
+1 -2
View File
@@ -430,8 +430,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname)
}
}
if (type == ET_EXEC)
l->l_type = lt_executable;
l->l_type = type == ET_EXEC ? lt_executable : lt_library;
if (l->l_ld == 0)
{
+4 -4
View File
@@ -412,12 +412,12 @@ typedef struct
typedef struct
{
int a_type; /* Entry type */
int a_type; /* Entry type */
union
{
long a_val; /* Integer value */
void *a_ptr; /* Pointer value */
void (*a_fcn) (); /* Function pointer value */
long int a_val; /* Integer value */
void *a_ptr; /* Pointer value */
void (*a_fcn) (void); /* Function pointer value */
} a_un;
} Elf32_auxv_t;
+23 -11
View File
@@ -1,5 +1,5 @@
/* Run time dynamic linker.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -269,7 +269,6 @@ of this helper program; chances are you did not intend to run this program.\n",
{
struct link_map *new;
new = _dl_map_object (l, strtab + d->d_un.d_val);
new->l_type = lt_library;
if (!before_rtld && new == &rtld_map)
before_rtld = last;
last = new;
@@ -340,23 +339,36 @@ of this helper program; chances are you did not intend to run this program.\n",
lazy = !_dl_secure && *(getenv ("LD_BIND_NOW") ?: "") == '\0';
/* Do any necessary cleanups for the startup OS interface code.
We do these now so that no calls are made after real relocation
which might be resolved to different functions than we expect. */
_dl_sysdep_start_cleanup ();
/* Now we have all the objects loaded. Relocate them all.
We do this in reverse order so that copy relocs of earlier
objects overwrite the data written by later objects. */
/* Now we have all the objects loaded. Relocate them all except for
the dynamic linker itself. We do this in reverse order so that
copy relocs of earlier objects overwrite the data written by later
objects. We do not re-relocate the dynamic linker itself in this
loop because that could result in the GOT entries for functions we
call being changed, and that would break us. It is safe to
relocate the dynamic linker out of order because it has no copy
relocs (we know that because it is self-contained). */
l = _dl_loaded;
while (l->l_next)
l = l->l_next;
do
{
_dl_relocate_object (l, lazy);
if (l != &rtld_map)
_dl_relocate_object (l, lazy);
l = l->l_prev;
} while (l);
/* Do any necessary cleanups for the startup OS interface code.
We do these now so that no calls are made after rtld re-relocation
which might be resolved to different functions than we expect.
We cannot do this before relocating the other objects because
_dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */
_dl_sysdep_start_cleanup ();
if (rtld_map.l_opencount > 0)
/* There was an explicit ref to the dynamic linker as a shared lib.
Re-relocate ourselves with user-controlled symbol definitions. */
_dl_relocate_object (&rtld_map, lazy);
/* Tell the debugger where to find the map of loaded objects. */
dl_r_debug.r_version = 1 /* R_DEBUG_VERSION XXX */;
dl_r_debug.r_ldbase = rtld_map.l_addr; /* Record our load address. */
+1 -1
View File
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+3 -3
View File
@@ -19,10 +19,10 @@ extra-objs := $(extra-objs)
install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
$(objpfx)$(patsubst %,$(libtype$o),\
$(common-objpfx)$(patsubst %,$(libtype$o),\
$(lib:lib%=%)))
ifneq (,$(filter .so,$(object-suffixes-$(lib))))
alltypes-$(lib) += $(objpfx)$(lib).so
alltypes-$(lib) += $(common-objpfx)$(lib).so
endif
ifeq (,$($(lib)-no-lib-dep))
@@ -33,7 +33,7 @@ endif
# Use o-iterator.mk to generate a rule for each flavor of library.
define o-iterator-doit
$(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
$(common-objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
$($(lib)-routines:%=$(objpfx)%$o); $$(build-extra-lib)
endef
object-suffixes-left = $(object-suffixes-$(lib))
+5 -11
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ Cambridge, MA 02139, USA. */
_GNU_SOURCE All of the above, plus GNU extensions.
The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
If none of these are defined, the default is _GNU_SOURCE.
If none of these are defined, the default is all but _GNU_SOURCE.
If more than one of these are defined, they accumulate.
For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
together give you ANSI C, 1003.1, and 1003.2, but nothing else.
@@ -69,20 +69,14 @@ Cambridge, MA 02139, USA. */
#undef __FAVOR_BSD
/* If nothing is defined, define _GNU_SOURCE. */
#if (!defined(_GNU_SOURCE) && !defined(__STRICT_ANSI__) && \
!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
!defined(_BSD_SOURCE) && !defined(_SVID_SOURCE))
#define _GNU_SOURCE 1
#endif
/* Always use ANSI things. */
#define __USE_ANSI 1
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
#ifdef _BSD_SOURCE
#if defined (_BSD_SOURCE) && \
!(defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) || \
defined (_GNU_SOURCE) || defined (_SVID_SOURCE))
#define __FAVOR_BSD 1
#endif
+2 -2
View File
@@ -21,9 +21,9 @@
#
subdir := gmon
headers := sys/gmon.h
headers := sys/gmon.h sys/gmon_out.h
distribute := machine-gmon.h
routines := gmon mcount profil
routines := gmon mcount profil bb_init_func bb_exit_func
include ../Rules
+78
View File
@@ -0,0 +1,78 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* __bb_exit_func() dumps all the basic-block statistics linked into
the bb_head chain to .d files. */
#include <sys/gmon_out.h>
#include <sys/types.h>
#include <ansidecl.h>
#include <stdio.h>
#include <strings.h>
/* structure emitted by -a */
struct bb {
long zero_word;
const char *filename;
long *counts;
long ncounts;
struct bb *next;
const unsigned long *addresses;
};
extern struct bb *__bb_head; /* from gmon.c */
#define OUT_NAME "gmon.out"
void
DEFUN_VOID(__bb_exit_func)
{
const int version = GMON_VERSION;
struct gmon_hdr ghdr;
struct bb *ptr;
FILE *fp;
fp = fopen(OUT_NAME, "wb");
if (!fp)
{
perror(OUT_NAME);
return;
}
bcopy(GMON_MAGIC, &ghdr.cookie[0], 4);
bcopy(&version, &ghdr.version, sizeof(version));
fwrite(&ghdr, sizeof(ghdr), 1, fp);
for (ptr = __bb_head; ptr != 0; ptr = ptr->next) {
u_int ncounts = ptr->ncounts;
u_char tag;
u_int i;
tag = GMON_TAG_BB_COUNT;
fwrite(&tag, sizeof(tag), 1, fp);
fwrite(&ncounts, sizeof(ncounts), 1, fp);
for (i = 0; i < ncounts; ++i) {
fwrite(&ptr->addresses[i], sizeof(ptr->addresses[0]), 1, fp);
fwrite(&ptr->counts[i], sizeof(ptr->counts[0]), 1, fp);
}
}
fclose (fp);
}
+223 -165
View File
@@ -30,161 +30,53 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if !defined(lint) && defined(LIBC_SCCS)
static char sccsid[] = "@(#)gmon.c 8.1 (Berkeley) 6/4/93";
#endif
#include <sys/param.h>
#include <sys/time.h>
#include <sys/gmon.h>
#include <sys/gmon_out.h>
#include <ansidecl.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
struct __bb *__bb_head; /* Head of basic-block list or NULL. */
struct gmonparam _gmonparam = { GMON_PROF_OFF };
/*
* See profil(2) where this is described:
*/
static int s_scale;
/* see profil(2) where this is describe (incorrectly) */
#define SCALE_1_TO_1 0x10000L
#define ERR(s) write(2, s, sizeof(s) - 1)
#define ERR(s) write(2, s, sizeof(s))
void moncontrol __P((int));
static int hertz __P((void));
void
monstartup(lowpc, highpc)
u_long lowpc;
u_long highpc;
/*
* Discover the tick frequency of the machine if something goes wrong,
* we return 0, an impossible hertz.
*/
static int
DEFUN_VOID(hertz)
{
register int o;
char *cp;
struct gmonparam *p = &_gmonparam;
/*
* round lowpc and highpc to multiples of the density we're using
* so the rest of the scaling (here and in gprof) stays in ints.
*/
p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER));
p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER));
p->textsize = p->highpc - p->lowpc;
p->kcountsize = p->textsize / HISTFRACTION;
p->hashfraction = HASHFRACTION;
p->fromssize = p->textsize / HASHFRACTION;
p->tolimit = p->textsize * ARCDENSITY / 100;
if (p->tolimit < MINARCS)
p->tolimit = MINARCS;
else if (p->tolimit > MAXARCS)
p->tolimit = MAXARCS;
p->tossize = p->tolimit * sizeof(struct tostruct);
cp = malloc (p->kcountsize + p->fromssize + p->tossize);
if (! cp) {
ERR("monstartup: out of memory\n");
return;
}
bzero(cp, p->kcountsize + p->fromssize + p->tossize);
p->tos = (struct tostruct *)cp;
cp += p->tossize;
p->kcount = (u_short *)cp;
cp += p->kcountsize;
p->froms = (u_short *)cp;
p->tos[0].link = 0;
o = p->highpc - p->lowpc;
if (p->kcountsize < o) {
#ifndef hp300
s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
#else /* avoid floating point */
int quot = o / p->kcountsize;
if (quot >= 0x10000)
s_scale = 1;
else if (quot >= 0x100)
s_scale = 0x10000 / quot;
else if (o >= 0x800000)
s_scale = 0x1000000 / (o / (p->kcountsize >> 8));
else
s_scale = 0x1000000 / ((o << 8) / p->kcountsize);
#endif
} else
s_scale = SCALE_1_TO_1;
moncontrol(1);
struct itimerval tim;
tim.it_interval.tv_sec = 0;
tim.it_interval.tv_usec = 1;
tim.it_value.tv_sec = 0;
tim.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &tim, 0);
setitimer(ITIMER_REAL, 0, &tim);
if (tim.it_interval.tv_usec < 2)
return 0;
return (1000000 / tim.it_interval.tv_usec);
}
void
_mcleanup()
{
int fd;
int fromindex;
int endfrom;
u_long frompc;
int toindex;
struct rawarc rawarc;
struct gmonparam *p = &_gmonparam;
struct gmonhdr gmonhdr, *hdr;
#ifdef DEBUG
int log, len;
char buf[200];
#endif
if (p->state == GMON_PROF_ERROR)
ERR("_mcleanup: tos overflow\n");
moncontrol(0);
fd = open("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666);
if (fd < 0) {
perror("mcount: gmon.out");
return;
}
#ifdef DEBUG
log = open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664);
if (log < 0) {
perror("mcount: gmon.log");
return;
}
len = sprintf(buf, "[mcleanup1] kcount 0x%x ssiz %d\n",
p->kcount, p->kcountsize);
write(log, buf, len);
#endif
hdr = (struct gmonhdr *)&gmonhdr;
hdr->lpc = p->lowpc;
hdr->hpc = p->highpc;
hdr->ncnt = p->kcountsize + sizeof(gmonhdr);
hdr->version = GMONVERSION;
hdr->profrate = hertz();
write(fd, (char *)hdr, sizeof *hdr);
write(fd, p->kcount, p->kcountsize);
endfrom = p->fromssize / sizeof(*p->froms);
for (fromindex = 0; fromindex < endfrom; fromindex++) {
if (p->froms[fromindex] == 0)
continue;
frompc = p->lowpc;
frompc += fromindex * p->hashfraction * sizeof(*p->froms);
for (toindex = p->froms[fromindex]; toindex != 0;
toindex = p->tos[toindex].link) {
#ifdef DEBUG
len = sprintf(buf,
"[mcleanup2] frompc 0x%x selfpc 0x%x count %d\n" ,
frompc, p->tos[toindex].selfpc,
p->tos[toindex].count);
write(log, buf, len);
#endif
rawarc.raw_frompc = frompc;
rawarc.raw_selfpc = p->tos[toindex].selfpc;
rawarc.raw_count = p->tos[toindex].count;
write(fd, &rawarc, sizeof rawarc);
}
}
close(fd);
}
/*
* Control profiling
@@ -192,41 +84,207 @@ _mcleanup()
* all the data structures are ready.
*/
void
moncontrol(mode)
int mode;
DEFUN(moncontrol, (mode), int mode)
{
struct gmonparam *p = &_gmonparam;
struct gmonparam *p = &_gmonparam;
if (mode) {
/* start */
profil(p->kcount, p->kcountsize, (int)p->lowpc,
s_scale);
p->state = GMON_PROF_ON;
} else {
/* stop */
profil(0, 0, 0, 0);
p->state = GMON_PROF_OFF;
if (mode)
{
/* start */
profil((void *) p->kcount, p->kcountsize, p->lowpc, s_scale);
p->state = GMON_PROF_ON;
}
else
{
/* stop */
profil((void *) 0, 0, 0, 0);
p->state = GMON_PROF_OFF;
}
}
void
DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc)
{
register int o;
char *cp;
struct gmonparam *p = &_gmonparam;
/*
* round lowpc and highpc to multiples of the density we're using
* so the rest of the scaling (here and in gprof) stays in ints.
*/
p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER));
p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER));
p->textsize = p->highpc - p->lowpc;
p->kcountsize = p->textsize / HISTFRACTION;
p->hashfraction = HASHFRACTION;
p->log_hashfraction = -1;
if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) {
/* if HASHFRACTION is a power of two, mcount can use shifting
instead of integer division. Precompute shift amount. */
p->log_hashfraction = ffs(p->hashfraction * sizeof(*p->froms)) - 1;
}
p->fromssize = p->textsize / HASHFRACTION;
p->tolimit = p->textsize * ARCDENSITY / 100;
if (p->tolimit < MINARCS)
p->tolimit = MINARCS;
else if (p->tolimit > MAXARCS)
p->tolimit = MAXARCS;
p->tossize = p->tolimit * sizeof(struct tostruct);
cp = malloc (p->kcountsize + p->fromssize + p->tossize);
if (! cp)
{
ERR("monstartup: out of memory\n");
return;
}
bzero(cp, p->kcountsize + p->fromssize + p->tossize);
p->tos = (struct tostruct *)cp;
cp += p->tossize;
p->kcount = (u_short *)cp;
cp += p->kcountsize;
p->froms = (u_short *)cp;
p->tos[0].link = 0;
o = p->highpc - p->lowpc;
if (p->kcountsize < o)
{
#ifndef hp300
s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
#else
/* avoid floating point operations */
int quot = o / p->kcountsize;
if (quot >= 0x10000)
s_scale = 1;
else if (quot >= 0x100)
s_scale = 0x10000 / quot;
else if (o >= 0x800000)
s_scale = 0x1000000 / (o / (p->kcountsize >> 8));
else
s_scale = 0x1000000 / ((o << 8) / p->kcountsize);
#endif
} else
s_scale = SCALE_1_TO_1;
moncontrol(1);
}
static void
DEFUN(write_hist, (fd), int fd)
{
const u_char tag = GMON_TAG_TIME_HIST;
struct gmon_hist_hdr thdr;
int size, rate;
if (_gmonparam.kcountsize > 0)
{
size = _gmonparam.kcountsize / sizeof(HISTCOUNTER);
rate = hertz();
bcopy(&_gmonparam.lowpc, &thdr.low_pc, sizeof(thdr.low_pc));
bcopy(&_gmonparam.highpc, &thdr.high_pc, sizeof(thdr.high_pc));
bcopy(&size, &thdr.hist_size, sizeof(thdr.hist_size));
bcopy(&rate, &thdr.prof_rate, sizeof(thdr.prof_rate));
strcpy(thdr.dimen, "seconds");
thdr.dimen_abbrev = 's';
write(fd, &tag, sizeof(tag));
write(fd, &thdr, sizeof(thdr));
write(fd, _gmonparam.kcount, _gmonparam.kcountsize);
}
}
static void
DEFUN(write_call_graph, (fd), int fd)
{
const u_char tag = GMON_TAG_CG_ARC;
struct gmon_cg_arc_record raw_arc;
int from_index, to_index, from_len;
u_long frompc;
from_len = _gmonparam.fromssize / sizeof(*_gmonparam.froms);
for (from_index = 0; from_index < from_len; ++from_index)
{
if (_gmonparam.froms[from_index] == 0)
continue;
frompc = _gmonparam.lowpc;
frompc += (from_index * _gmonparam.hashfraction
* sizeof(*_gmonparam.froms));
for (to_index = _gmonparam.froms[from_index];
to_index != 0;
to_index = _gmonparam.tos[to_index].link)
{
bcopy(&frompc, &raw_arc.from_pc, sizeof(raw_arc.from_pc));
bcopy(&_gmonparam.tos[to_index].selfpc, &raw_arc.self_pc,
sizeof(raw_arc.self_pc));
bcopy(&_gmonparam.tos[to_index].count, &raw_arc.count,
sizeof(raw_arc.count));
write(fd, &tag, sizeof(tag));
write(fd, &raw_arc, sizeof(raw_arc));
}
}
}
/*
* discover the tick frequency of the machine
* if something goes wrong, we return 0, an impossible hertz.
*/
static int
hertz()
static void
DEFUN(write_bb_counts, (fd), int fd)
{
struct itimerval tim;
tim.it_interval.tv_sec = 0;
tim.it_interval.tv_usec = 1;
tim.it_value.tv_sec = 0;
tim.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &tim, 0);
setitimer(ITIMER_REAL, 0, &tim);
if (tim.it_interval.tv_usec < 2)
return(0);
return (1000000 / tim.it_interval.tv_usec);
struct __bb *grp;
const u_char tag = GMON_TAG_BB_COUNT;
int ncounts;
int i;
/* Write each group of basic-block info (all basic-blocks in a
compilation unit form a single group). */
for (grp = __bb_head; grp; grp = grp->next)
{
ncounts = grp->ncounts;
write(fd, &tag, sizeof(tag));
write(fd, &ncounts, sizeof(ncounts));
for (i = 0; i < ncounts; ++i)
{
write(fd, &grp->addresses[i], sizeof(grp->addresses[0]));
write(fd, &grp->counts[i], sizeof(grp->counts[0]));
}
}
}
void
DEFUN_VOID(_mcleanup)
{
const int version = GMON_VERSION;
struct gmon_hdr ghdr;
int fd;
moncontrol(0);
fd = open("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666);
if (fd < 0)
{
perror("_mcleanup: gmon.out");
return;
}
/* write gmon.out header: */
bcopy(GMON_MAGIC, &ghdr.cookie[0], 4);
bcopy(&version, &ghdr.version, sizeof(version));
write(fd, &ghdr, sizeof(ghdr));
/* write PC histogram: */
write_hist(fd);
/* write call-graph: */
write_call_graph(fd);
/* write basic-block execution counts: */
write_bb_counts(fd);
close(fd);
}
+8 -1
View File
@@ -67,6 +67,7 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
#ifdef KERNEL
register int s;
#endif
int i;
p = &_gmonparam;
/*
@@ -89,7 +90,13 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
if (frompc > p->textsize)
goto done;
frompcindex = &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))];
/* avoid integer divide if possible: */
if (p->log_hashfraction >= 0) {
i = frompc >> p->log_hashfraction;
} else {
i = frompc / (p->hashfraction * sizeof(*p->froms));
}
frompcindex = &p->froms[i];
toindex = *frompcindex;
if (toindex == 0) {
/*
+16 -9
View File
@@ -39,17 +39,23 @@
#include <sys/cdefs.h>
/*
* Structure prepended to gmon.out profiling data file.
* See gmon_out.h for gmon.out format.
*/
struct gmonhdr {
u_long lpc; /* base pc address of sample buffer */
u_long hpc; /* max pc address of sampled buffer */
int ncnt; /* size of sample buffer (plus this header) */
int version; /* version number */
int profrate; /* profiling clock rate */
int spare[3]; /* reserved */
/* structure emitted by "gcc -a". This must match struct bb in
gcc/libgcc2.c. It is OK for gcc to declare a longer structure as
long as the members below are present. */
struct __bb
{
long zero_word;
const char *filename;
long *counts;
long ncounts;
struct __bb *next;
const unsigned long *addresses;
};
#define GMONVERSION 0x00051879
extern struct __bb *__bb_head;
/*
* histogram counters are unsigned shorts (according to the kernel).
@@ -137,6 +143,7 @@ struct gmonparam {
u_long highpc;
u_long textsize;
u_long hashfraction;
long log_hashfraction;
};
extern struct gmonparam _gmonparam;
+66
View File
@@ -0,0 +1,66 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* This file specifies the format of gmon.out files. It should have
as few external dependencies as possible as it is going to be included
in many different programs. That is, minimize the number of #include's.
A gmon.out file consists of a header (defined by gmon_hdr) followed by
a sequence of records. Each record starts with a one-byte tag
identifying the type of records, followed by records specific data. */
#ifndef _SYS_GMON_OUT_H_
#define _SYS_GMON_OUT_H_
#define GMON_MAGIC "gmon" /* magic cookie */
#define GMON_VERSION 1 /* version number */
/*
* Raw header as it appears on file (without padding). This header
* always comes first in gmon.out and is then followed by a series
* records defined below.
*/
struct gmon_hdr {
char cookie[4];
char version[4];
char spare[3 * 4];
};
/* types of records in this file: */
typedef enum {
GMON_TAG_TIME_HIST = 0, GMON_TAG_CG_ARC = 1, GMON_TAG_BB_COUNT = 2
} GMON_Record_Tag;
struct gmon_hist_hdr {
char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
char hist_size[4]; /* size of sample buffer */
char prof_rate[4]; /* profiling clock rate */
char dimen[15]; /* phys. dim., usually "seconds" */
char dimen_abbrev; /* usually 's' for "seconds" */
};
struct gmon_cg_arc_record {
char from_pc[sizeof (char *)]; /* address within caller's body */
char self_pc[sizeof (char *)]; /* address within callee's body */
char count[4]; /* number of arc traversals */
};
#endif /* !_SYS_GMON_OUT_H_ */
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+79
View File
@@ -85,3 +85,82 @@ hurd_safe_memset (void *dest, int byte, size_t nbytes)
(vm_address_t) dest, (vm_address_t) dest + nbytes,
&operate, SIG_ERR);
}
error_t
hurd_safe_copyout (void *dest, const void *src, size_t nbytes)
{
error_t operate (struct hurd_signal_preempter *preempter)
{
memcpy (dest, src, nbytes);
return 0;
}
return hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
(vm_address_t) dest, (vm_address_t) dest + nbytes,
&operate, SIG_ERR);
}
error_t
hurd_safe_copyin (void *dest, const void *src, size_t nbytes)
{
error_t operate (struct hurd_signal_preempter *preempter)
{
memcpy (dest, src, nbytes);
return 0;
}
return hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
(vm_address_t) src, (vm_address_t) src + nbytes,
&operate, SIG_ERR);
}
error_t
hurd_safe_memmove (void *dest, const void *src, size_t nbytes)
{
jmp_buf buf;
void throw (int signo, long int sigcode, struct sigcontext *scp)
{ longjmp (buf, scp->sc_error ?: EGRATUITOUS); }
struct hurd_signal_preempter src_preempter =
{
sigmask (SIGBUS) | sigmask (SIGSEGV),
(vm_address_t) src, (vm_address_t) src + nbytes,
NULL, (sighandler_t) &throw,
};
struct hurd_signal_preempter dest_preempter =
{
sigmask (SIGBUS) | sigmask (SIGSEGV),
(vm_address_t) dest, (vm_address_t) dest + nbytes,
NULL, (sighandler_t) &throw,
&src_preempter
};
struct hurd_sigstate *const ss = _hurd_self_sigstate ();
error_t error;
/* This returns again with nonzero value when we preempt a signal. */
error = setjmp (buf);
if (error == 0)
{
/* Install a signal preempter for the thread. */
__spin_lock (&ss->lock);
src_preempter.next = ss->preempters;
ss->preempters = &dest_preempter;
__spin_unlock (&ss->lock);
/* Do the copy; it might fault. */
memmove (dest, src, nbytes);
}
/* Either memmove completed happily and ERROR is still zero, or it hit
an expected signal and `throw' made setjmp return the signal error
code in ERROR. Now we can remove the preempter and return. */
__spin_lock (&ss->lock);
assert (ss->preempters == &dest_preempter);
ss->preempters = src_preempter.next;
__spin_unlock (&ss->lock);
return error;
}
+13 -1
View File
@@ -83,8 +83,20 @@ error_t hurd_catch_signal (sigset_t sigset,
/* Convenience functions using `hurd_catch_signal'. */
error_t hurd_safe_memmove (void *dest, const void *src, size_t nbytes);
/* Like `memset', but catch faults in DEST. */
error_t hurd_safe_memset (void *dest, int byte, size_t nbytes);
/* Like `memcpy', but catch faults in SRC. */
error_t hurd_safe_copyin (void *dest, const void *src, size_t nbytes);
/* Like `memcpy', but catch faults in DEST. */
error_t hurd_safe_copyout (void *dest, const void *src, size_t nbytes);
/* Like `memmove', but catch faults in SRC or DEST.
If only one region is expected to fault, it is more efficient
to use `hurd_safe_copyin' or `hurd_safe_copyout' as appropriate. */
error_t hurd_safe_memmove (void *dest, const void *src, size_t nbytes);
#endif /* hurd/sigpreempt.h */
+4 -3
View File
@@ -1013,8 +1013,9 @@ signal_allowed (int signo, mach_port_t refport)
authorizing SIGIO and SIGURG signals properly. */
int d;
int lucky = 0; /* True if we find a match for REFPORT. */
__mutex_lock (&_hurd_dtable_lock);
for (d = 0; (unsigned int) d < (unsigned int) _hurd_dtablesize; ++d)
for (d = 0; !lucky && (unsigned) d < (unsigned) _hurd_dtablesize; ++d)
{
struct hurd_userlink ulink;
io_t port;
@@ -1026,13 +1027,13 @@ signal_allowed (int signo, mach_port_t refport)
{
if (refport == asyncid)
/* Break out of the loop on the next iteration. */
d = -1;
lucky = 1;
__mach_port_deallocate (__mach_task_self (), asyncid);
}
_hurd_port_free (&_hurd_dtable[d]->port, &ulink, port);
}
/* If we found a lucky winner, we've set D to -1 in the loop. */
if (d < 0)
if (lucky)
goto win;
}
}
+10 -2
View File
@@ -1,5 +1,5 @@
/* longjmp cleanup function for unwinding past signal handlers.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,15 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val)
mach_port_t *reply_port =
(mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY);
if (*reply_port)
__mach_port_destroy (__mach_task_self (), *reply_port);
{
mach_port_t port = *reply_port;
/* Assigning MACH_PORT_DEAD here tells libc's mig_get_reply_port
not to get another reply port, but avoids mig_dealloc_reply_port
trying to deallocate it after the receive fails (which it will,
because the reply port will be bogus, regardless). */
*reply_port = MACH_PORT_DEAD;
__mach_port_destroy (__mach_task_self (), port);
}
*reply_port = scp->sc_reply_port;
}
+6 -5
View File
@@ -39,14 +39,15 @@
/* External definitions for functions in inet(3) */
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
unsigned long inet_addr __P((const char *));
u_int32_t inet_addr __P((const char *));
int inet_aton __P((const char *, struct in_addr *));
unsigned long inet_lnaof __P((struct in_addr));
struct in_addr inet_makeaddr __P((u_long , u_long));
unsigned long inet_netof __P((struct in_addr));
unsigned long inet_network __P((const char *));
u_int32_t inet_lnaof __P((struct in_addr));
struct in_addr inet_makeaddr __P((u_int32_t , u_int32_t));
u_int32_t inet_netof __P((struct in_addr));
u_int32_t inet_network __P((const char *));
char *inet_ntoa __P((struct in_addr));
__END_DECLS
+2 -2
View File
@@ -44,11 +44,11 @@ static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
* internet address; handles class a/b/c network
* number formats.
*/
u_long
u_int32_t
inet_lnaof(in)
struct in_addr in;
{
register u_long i = ntohl(in.s_addr);
register u_int32_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
return ((i)&IN_CLASSA_HOST);
+2 -2
View File
@@ -45,9 +45,9 @@ static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
*/
struct in_addr
inet_makeaddr(net, host)
u_long net, host;
u_int32_t net, host;
{
u_long addr;
u_int32_t addr;
if (net < 128)
addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+3 -3
View File
@@ -45,13 +45,13 @@ static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
* The library routines call this routine to interpret
* network numbers.
*/
u_long
u_int32_t
inet_network(cp)
register const char *cp;
{
register u_long val, base, n;
register u_int32_t val, base, n;
register char c;
u_long parts[4], *pp = parts;
u_int32_t parts[4], *pp = parts;
register int i;
again:
+2 -2
View File
@@ -43,11 +43,11 @@ static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
* Return the network number from an internet
* address; handles class a/b/c network #'s.
*/
u_long
u_int32_t
inet_netof(in)
struct in_addr in;
{
register u_long i = ntohl(in.s_addr);
register u_int32_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
+9 -9
View File
@@ -89,7 +89,7 @@ enum
/* Internet address. */
struct in_addr
{
unsigned long int s_addr;
unsigned int s_addr;
};
@@ -98,33 +98,33 @@ struct in_addr
On subnets, host and network parts are found according to
the subnet mask, not these masks. */
#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
#define IN_CLASSA(a) ((((unsigned) (a)) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
#define IN_CLASSA_MAX 128
#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB(a) ((((unsigned) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(a) ((((long int) (a)) & 0xc0000000) == 0xc0000000)
#define IN_CLASSC(a) ((((unsigned) (a)) & 0xc0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
#define IN_CLASSD(a) ((((unsigned) (a)) & 0xf0000000) == 0xe0000000)
#define IN_MULTICAST(a) IN_CLASSD(a)
#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xe0000000) == 0xe0000000)
#define IN_BADCLASS(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
#define IN_EXPERIMENTAL(a) ((((unsigned) (a)) & 0xe0000000) == 0xe0000000)
#define IN_BADCLASS(a) ((((unsigned) (a)) & 0xf0000000) == 0xf0000000)
/* Address to accept any incoming messages. */
#define INADDR_ANY ((unsigned long int) 0x00000000)
#define INADDR_ANY ((unsigned) 0x00000000)
/* Address to send to all hosts. */
#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
#define INADDR_BROADCAST ((unsigned) 0xffffffff)
/* Address indicating an error return. */
#define INADDR_NONE 0xffffffff
+1 -1
View File
@@ -33,7 +33,7 @@
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
*/
typedef u_long tcp_seq;
typedef unsigned int tcp_seq;
/*
* TCP header.
* Per RFC 793, September, 1981.
+3 -1
View File
@@ -36,13 +36,15 @@
#ifndef _RWHOD_H_
#define _RWHOD_H_
#include <sys/types.h>
/*
* rwho protocol packet format.
*/
struct outmp {
char out_line[8]; /* tty name */
char out_name[8]; /* user id */
long out_time; /* time on */
int32_t out_time; /* time on */
};
struct whod {
+5 -3
View File
@@ -54,6 +54,8 @@
* stream connection through which the conversation takes place.
*/
#include <sys/types.h>
/*
* Client->server request message format.
*/
@@ -62,10 +64,10 @@ typedef struct {
u_char type; /* request type, see below */
u_char answer; /* not used */
u_char pad;
u_long id_num; /* message id */
u_int32_t id_num; /* message id */
struct osockaddr addr; /* old (4.3) style */
struct osockaddr ctl_addr; /* old (4.3) style */
long pid; /* caller's process id */
int32_t pid; /* caller's process id */
#define NAME_SIZE 12
char l_name[NAME_SIZE];/* caller's name */
char r_name[NAME_SIZE];/* callee's name */
@@ -81,7 +83,7 @@ typedef struct {
u_char type; /* type of request message, see below */
u_char answer; /* respose to request message, see below */
u_char pad;
u_long id_num; /* message id */
u_int32_t id_num; /* message id */
struct osockaddr addr; /* address for establishing conversation */
} CTL_RESPONSE;
+10 -10
View File
@@ -52,8 +52,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <ctype.h>
#include <string.h>
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
static int __icheckhost __P((u_long, char *));
int __ivaliduser __P((FILE *, u_int32_t, const char *, const char *));
static int __icheckhost __P((u_int32_t, char *));
int
rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
@@ -65,7 +65,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
struct hostent *hp;
struct sockaddr_in sin, from;
fd_set reads;
long oldmask;
int32_t oldmask;
pid_t pid;
int s, lport, timo;
char c;
@@ -242,7 +242,7 @@ ruserok(rhost, superuser, ruser, luser)
int superuser;
{
struct hostent *hp;
u_long addr;
u_int32_t addr;
char **ap;
if ((hp = gethostbyname(rhost)) == NULL)
@@ -266,7 +266,7 @@ ruserok(rhost, superuser, ruser, luser)
*/
int
iruserok(raddr, superuser, ruser, luser)
u_long raddr;
u_int32_t raddr;
int superuser;
const char *ruser, *luser;
{
@@ -347,7 +347,7 @@ again:
int
__ivaliduser(hostf, raddr, luser, ruser)
FILE *hostf;
u_long raddr;
u_int32_t raddr;
const char *luser, *ruser;
{
register char *user, *p;
@@ -389,15 +389,15 @@ __ivaliduser(hostf, raddr, luser, ruser)
*/
static int
__icheckhost(raddr, lhost)
u_long raddr;
u_int32_t raddr;
register char *lhost;
{
register struct hostent *hp;
register u_long laddr;
register u_int32_t laddr;
register char **pp;
/* Try for raw ip address first. */
if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
if (isdigit(*lhost) && (int32_t)(laddr = inet_addr(lhost)) != -1)
return (raddr == laddr);
/* Better be a hostname. */
@@ -406,7 +406,7 @@ __icheckhost(raddr, lhost)
/* Spin through ip addresses. */
for (pp = hp->h_addr_list; *pp; ++pp)
if (!bcmp(&raddr, *pp, sizeof(u_long)))
if (!bcmp(&raddr, *pp, sizeof(u_int32_t)))
return (1);
/* No match. */
+5 -5
View File
@@ -1,6 +1,6 @@
# Makefile for intl subdirectory: message handling code from GNU gettext.
# Copyright (C) 1995 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -31,12 +31,12 @@ CPPFLAGS += -D'GNULOCALEDIR="$(localedir)"' \
ifdef gettext-srcdir
%.h:: $(gettext-srcdir)/intl/%.glibc; $(copysrc)
%.c:: $(gettext-srcdir)/intl/%.c; $(copysrc)
%.h:: $(gettext-srcdir)/intl/%.h; $(copysrc)
%.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.glibc; $(copysrc)
%.c:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.c; $(copysrc)
%.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.h; $(copysrc)
define copysrc
cp -f $< $@.new
sed -f $^ > $@.new
chmod a-w $@.new
mv -f $@.new $@
test ! -d CVS || cvs commit -m'Updated from $<' $@
+14 -10
View File
@@ -1,19 +1,23 @@
/* bindtextdom.c -- implementation of the bindtextdomain(3) function
Copyright (C) 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+14 -10
View File
@@ -1,19 +1,23 @@
/* dcgettext.c -- implementation of the dcgettext(3) function
Copyright (C) 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+14 -10
View File
@@ -1,19 +1,23 @@
/* dgettext.c -- implementation of the dgettext(3) function
Copyright (C) 1995 Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+118 -42
View File
@@ -1,25 +1,30 @@
/* finddomain.c -- handle list of needed message catalogs
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
@@ -63,20 +68,21 @@ void free ();
/* Rename the non ANSI C functions. This is required by the standard
because some ANSI C functions will require linking with this object
file and the name space must not be polluted. */
# define stpcpy __stpcpy
# define stpcpy(dest, src) __stpcpy(dest, src)
#endif
/* Encoding of locale name parts. */
#define CEN_REVISION 1
#define CEN_SPONSOR 2
#define CEN_SPECIAL 4
#define XPG_CODESET 8
#define TERRITORY 16
#define CEN_AUDIENCE 32
#define XPG_MODIFIER 64
#define CEN_REVISION 1
#define CEN_SPONSOR 2
#define CEN_SPECIAL 4
#define XPG_NORM_CODESET 8
#define XPG_CODESET 16
#define TERRITORY 32
#define CEN_AUDIENCE 64
#define XPG_MODIFIER 128
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
#define XPG_SPECIFIC (XPG_CODESET|XPG_MODIFIER)
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
/* List of already loaded domains. */
@@ -88,6 +94,7 @@ static struct loaded_domain *make_entry_rec PARAMS ((const char *dirname,
const char *language,
const char *territory,
const char *codeset,
const char *normalized_codeset,
const char *modifier,
const char *special,
const char *sponsor,
@@ -95,9 +102,13 @@ static struct loaded_domain *make_entry_rec PARAMS ((const char *dirname,
const char *domainname,
int do_allocate));
/* Normalize name of selected codeset. */
static const char *normalize_codeset PARAMS ((const char *codeset));
/* Substitution for systems lacking this function in their C library. */
#if !_LIBC && !HAVE_STPCPY
static char *stpcpy PARAMS ((char *dest, const char *src));
static char *stpcpy__ PARAMS ((char *dest, const char *src));
# define stpcpy(dest, src) stpcpy__ (dest, src)
#endif
@@ -116,6 +127,7 @@ _nl_find_domain (dirname, locale, domainname)
const char *modifier = NULL;
const char *territory = NULL;
const char *codeset = NULL;
const char *normalized_codeset = NULL;
const char *special = NULL;
const char *sponsor = NULL;
const char *revision = NULL;
@@ -141,13 +153,14 @@ _nl_find_domain (dirname, locale, domainname)
(2) sponsor
(3) special
(4) codeset
(5) territory
(6) audience/modifier
(5) normalized codeset
(6) territory
(7) audience/modifier
*/
/* If we have already tested for this locale entry there has to
be one data set in the list of loaded domains. */
retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL,
retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, domainname, 0);
if (retval != NULL)
{
@@ -225,6 +238,15 @@ _nl_find_domain (dirname, locale, domainname)
++cp;
mask |= XPG_CODESET;
if (codeset != cp && codeset[0] != '\0')
{
normalized_codeset = normalize_codeset (codeset);
if (strcmp (codeset, normalized_codeset) == 0)
free ((char *) normalized_codeset);
else
mask |= XPG_NORM_CODESET;
}
}
}
@@ -297,8 +319,8 @@ _nl_find_domain (dirname, locale, domainname)
/* Create all possible locale entries which might be interested in
generalzation. */
retval = make_entry_rec (dirname, mask, language, territory, codeset,
modifier, special, sponsor, revision,
domainname, 1);
normalized_codeset, modifier, special, sponsor,
revision, domainname, 1);
if (retval == NULL)
/* This means we are out of core. */
return NULL;
@@ -331,13 +353,15 @@ _nl_find_domain (dirname, locale, domainname)
static struct loaded_domain *
make_entry_rec (dirname, mask, language, territory, codeset, modifier,
special, sponsor, revision, domain, do_allocate)
make_entry_rec (dirname, mask, language, territory, codeset,
normalized_codeset, modifier, special, sponsor, revision,
domain, do_allocate)
const char *dirname;
int mask;
const char *language;
const char *territory;
const char *codeset;
const char *normalized_codeset;
const char *modifier;
const char *special;
const char *sponsor;
@@ -358,23 +382,26 @@ make_entry_rec (dirname, mask, language, territory, codeset, modifier,
both syntaces set this is necessary to prevent constructing
illegal local names. */
/* FIXME: Rewrite because test is necessary only in first round. */
if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0)
if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0
|| ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0))
{
/* Allocate room for the full file name. */
filename = (char *) malloc (strlen (dirname) + 1
+ strlen (language)
+ ((mask & TERRITORY) != 0
? strlen (territory) : 0)
? strlen (territory) + 1 : 0)
+ ((mask & XPG_CODESET) != 0
? strlen (codeset) : 0)
? strlen (codeset) + 1 : 0)
+ ((mask & XPG_NORM_CODESET) != 0
? strlen (normalized_codeset) + 1 : 0)
+ ((mask & XPG_MODIFIER) != 0 ?
strlen (modifier) : 0)
strlen (modifier) + 1 : 0)
+ ((mask & CEN_SPECIAL) != 0
? strlen (special) : 0)
? strlen (special) + 1 : 0)
+ ((mask & CEN_SPONSOR) != 0
? strlen (sponsor) : 0)
? strlen (sponsor) + 1 : 0)
+ ((mask & CEN_REVISION) != 0
? strlen (revision) : 0) + 1
? strlen (revision) + 1 : 0) + 1
+ strlen (domain) + 1);
if (filename == NULL)
@@ -396,7 +423,12 @@ make_entry_rec (dirname, mask, language, territory, codeset, modifier,
if ((mask & XPG_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, codeset);
cp = stpcpy (cp, codeset);
}
if ((mask & XPG_NORM_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, normalized_codeset);
}
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{
@@ -470,20 +502,64 @@ make_entry_rec (dirname, mask, language, territory, codeset, modifier,
}
entries = 0;
for (cnt = 126; cnt >= 0; --cnt)
for (cnt = 254; cnt >= 0; --cnt)
if (cnt < mask && (cnt & ~mask) == 0
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0))
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
retval->successor[entries++] = make_entry_rec (dirname, cnt,
language, territory,
codeset, modifier,
special, sponsor,
revision, domain, 1);
codeset,
normalized_codeset,
modifier, special,
sponsor, revision,
domain, 1);
retval->successor[entries] = NULL;
return retval;
}
static const char *
normalize_codeset (codeset)
const char *codeset;
{
int len = 0;
int only_digit = 1;
const char *cp;
char *retval;
char *wp;
for (cp = codeset; cp[0] != '\0'; ++cp)
if (isalnum (cp[0]))
{
++len;
if (isalpha (cp[0]))
only_digit = 0;
}
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
if (retval != NULL)
{
if (only_digit)
wp = stpcpy (retval, "ISO");
else
wp = retval;
for (cp = codeset; cp[0] != '\0'; ++cp)
if (isalpha (cp[0]))
*wp++ = toupper (cp[0]);
else if (isdigit (cp[0]))
*wp++ = cp[0];
*wp = '\0';
}
return (const char *) retval;
}
/* @@ begin of epilog @@ */
/* We don't want libintl.a to depend on any other library. So we
@@ -492,7 +568,7 @@ make_entry_rec (dirname, mask, language, territory, codeset, modifier,
to be defined. */
#if !_LIBC && !HAVE_STPCPY
static char *
stpcpy (dest, src)
stpcpy__ (dest, src)
char *dest;
const char *src;
{
+14 -10
View File
@@ -1,19 +1,23 @@
/* gettext.c -- implementation of gettext(3) function
Copyright (C) 1995 Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+12 -9
View File
@@ -1,20 +1,23 @@
/* gettext.h - internal header for GNU gettext internationalization functions
Copyright (C) 1995 Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _GETTEXT_H
#define _GETTEXT_H 1
+16 -12
View File
@@ -1,19 +1,23 @@
/* gettextP.h -- header describing internals of gettext library
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _GETTEXTP_H
#define _GETTEXTP_H
@@ -46,7 +50,7 @@ SWAP (i)
struct loaded_domain
{
struct loaded_domain *next;
struct loaded_domain *successor[31];
struct loaded_domain *successor[63];
const char *filename;
int decided;
+14 -10
View File
@@ -1,19 +1,23 @@
/* hash-string - Implements a string hashing function.
Copyright (C) 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_VALUES_H
# include <values.h>
+5 -3
View File
@@ -1,9 +1,11 @@
/* libgettext.h -- Message catalogs for internationalization.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper.
This file is derived from the file libgettext.h in the GNU gettext package.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
@@ -16,8 +18,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1
+14 -10
View File
@@ -1,19 +1,23 @@
/* loadmsgcat.c -- load needed message catalogs
Copyright (C) 1995 Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+14 -10
View File
@@ -1,19 +1,23 @@
/* localealias.c -- handle aliases for locale names
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+14 -10
View File
@@ -1,19 +1,23 @@
/* textdomain.c -- implementation of the textdomain(3) function
Copyright (C) 1995 Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
+2 -1
View File
@@ -21,7 +21,7 @@
#
subdir := io
headers := sys/stat.h statbuf.h \
headers := sys/stat.h statbuf.h sys/statfs.h statfsbuf.h \
fcntl.h sys/fcntl.h fcntlbits.h \
poll.h sys/poll.h \
utime.h ftw.h fts.h
@@ -31,6 +31,7 @@ routines := \
mkfifo \
stat fstat lstat mknod \
xstat fxstat lxstat xmknod \
statfs fstatfs \
umask chmod fchmod mkdir \
open close read write lseek access euidaccess \
fcntl flock lockf \
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -70,7 +70,7 @@ extern int creat __P ((__const char *__file, __mode_t __mode));
The CMD argument is one of the following. */
#define F_ULOCK 0 /* Unlock a previously locked region. */
#define F_LOCK 1 /* Lock a region for exclusive use. */
#define F_LOCK 1 /* Lock a region for exclusive use. */
#define F_TLOCK 2 /* Test and lock a region for exclusive use. */
#define F_TEST 3 /* Test a region for other processes locks. */
+1 -1
View File
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -1,4 +1,5 @@
/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
/* Definitions for getting information about a filesystem.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,28 +17,25 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _DIRSTREAM_H
#ifndef _SYS_STATFS_H
#define _DIRSTREAM_H 1
#define _SYS_STATFS_H 1
#include <features.h>
#define __need_size_t
#include <stddef.h>
#include <gnu/types.h> /* For __off_t. */
/* Get the system-specific definition of `struct statfs'. */
#include <statfsbuf.h>
/* Directory stream type.
__BEGIN_DECLS
The BSD directory format is the same as `struct dirent', so `readdir'
returns a pointer into the buffer we read directory data into. */
/* Return information about the filesystem on which FILE resides. */
extern int __statfs __P ((__const char *__file, struct statfs *__buf));
extern int statfs __P ((__const char *__file, struct statfs *__buf));
struct __dirstream
{
int __fd; /* File descriptor. */
/* Return information about the filesystem containing the file FILDES
refers to. */
extern int __fstatfs __P ((int __fildes, struct statfs *__buf));
extern int fstatfs __P ((int __fildes, struct statfs *__buf));
char *__data; /* Directory block. */
size_t __allocation; /* Space allocated for the block. */
size_t __offset; /* Current offset into the block. */
size_t __size; /* Total valid data in the block. */
__off_t __pos; /* Position in directory of this block. */
};
__END_DECLS
#endif /* dirstream.h */
#endif /* sys/statfs.h */
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+38 -20
View File
@@ -27,14 +27,13 @@ Cambridge, MA 02139, USA. */
We include config.h which is generated by configure.
It should define for us the following symbols:
* HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
* ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
* HAVE_GNU_LD if using GNU ld, with support for weak symbols in a.out,
and for symbol set and warning messages extensions in a.out and ELF.
This implies HAVE_WEAK_SYMBOLS; set by --with-gnu-ld.
* HAVE_ELF if using ELF, which supports weak symbols.
This implies HAVE_WEAK_SYMBOLS; set by --with-elf.
* HAVE_WEAK_SYMBOLS if weak symbols are available in the assembler and
linker being used. Set by --with-weak-symbols.
* HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
* HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
* HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
*/
@@ -47,7 +46,13 @@ Cambridge, MA 02139, USA. */
itself is being compiled, or just some generator program. */
#define _LIBC 1
/* Enable declarations of GNU extensions, since we are compiling them. */
#define _GNU_SOURCE 1
#include <config.h>
/* This disables sccsid/rcsid strings in lots of code of non-GNU origin. */
#define lint 1
/*
*/
@@ -76,23 +81,14 @@ extern const char _libc_intl_domainname[];
/*
*/
/* The symbols in all the user (non-_) macros are C symbols. Predefined
should be HAVE_WEAK_SYMBOLS and/or HAVE_ELF and/or HAVE_GNU_LD.
HAVE_WEAK_SYMBOLS is implied by the other two. HAVE_GNU_LD without
HAVE_ELF implies a.out. */
/* The symbols in all the user (non-_) macros are C symbols.
HAVE_GNU_LD without HAVE_ELF implies a.out. */
#ifndef HAVE_WEAK_SYMBOLS
#if defined (HAVE_ELF) || defined (HAVE_GNU_LD)
#if defined (HAVE_ASM_WEAK_DIRECTIVE) || defined (HAVE_ASM_WEAKEXT_DIRECTIVE)
#define HAVE_WEAK_SYMBOLS
#endif
#endif
#ifndef __SYMBOL_PREFIX
#ifdef HAVE_ELF
#define NO_UNDERSCORES
#else
#include <sysdep.h> /* Should define NO_UNDERSCORES. */
#endif
#ifdef NO_UNDERSCORES
#define __SYMBOL_PREFIX
#else
@@ -140,8 +136,21 @@ extern const char _libc_intl_domainname[];
#ifdef HAVE_WEAK_SYMBOLS
#ifdef ASSEMBLER
#ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
/* Define ALIAS as a weak alias for ORIGINAL.
If weak aliases are not available, this defines a strong alias. */
#define weak_alias(original, alias) \
.weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
/* Declare SYMBOL to be weak. */
#define weak_symbol(symbol) .weakext C_SYMBOL_NAME (symbol)
#else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
/* Define ALIAS as a weak alias for ORIGINAL.
If weak aliases are not available, this defines a strong alias. */
#define weak_alias(original, alias) \
@@ -151,12 +160,21 @@ extern const char _libc_intl_domainname[];
/* Declare SYMBOL to be weak. */
#define weak_symbol(symbol) .weak C_SYMBOL_NAME (symbol)
#else
#endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
#else /* ! ASSEMBLER */
#ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
#define weak_symbol(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
#define weak_alias(original, alias) \
asm (".weakext " __SYMBOL_PREFIX #alias ", " __SYMBOL_PREFIX #original);
#else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
#define weak_symbol(symbol) asm (".weak " __SYMBOL_PREFIX #symbol);
#define weak_alias(original, alias) \
asm (".weak " __SYMBOL_PREFIX #alias "\n" \
__SYMBOL_PREFIX #alias " = " __SYMBOL_PREFIX #original);
#endif
#endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
#endif /* ! ASSEMBLER */
#else
#define weak_alias(original, alias) strong_alias(original, alias)
#define weak_symbol(symbol) /* Do nothing. */
+19 -4
View File
@@ -511,26 +511,41 @@ int
DEFUN(_IO_sputbackc, (fp, c),
register _IO_FILE *fp AND int c)
{
int result;
if (fp->_IO_read_ptr > fp->_IO_read_base
&& (unsigned char)fp->_IO_read_ptr[-1] == (unsigned char)c)
{
fp->_IO_read_ptr--;
return (unsigned char)c;
result = (unsigned char)c;
}
return _IO_PBACKFAIL (fp, c);
else
result = _IO_PBACKFAIL (fp, c);
if (result != EOF)
fp->_flags &= ~_IO_EOF_SEEN;
return result;
}
int
DEFUN(_IO_sungetc, (fp),
register _IO_FILE *fp)
{
int result;
if (fp->_IO_read_ptr > fp->_IO_read_base)
{
fp->_IO_read_ptr--;
return (unsigned char)*fp->_IO_read_ptr;
result = (unsigned char)*fp->_IO_read_ptr;
}
else
return _IO_PBACKFAIL (fp, EOF);
result = _IO_PBACKFAIL (fp, EOF);
if (result != EOF)
fp->_flags &= ~_IO_EOF_SEEN;
return result;
}
#if 0 /* Work in progress */
+2
View File
@@ -78,3 +78,5 @@ _IO_setvbuf (fp, buf, mode, size)
}
return _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
}
weak_alias (_IO_setvbuf, setvbuf)
+15 -1
View File
@@ -101,12 +101,26 @@ Cambridge, MA 02139, USA. */
#define UINT_MAX 4294967295
#endif
#ifdef __alpha__
/* Minimum and maximum values a `signed long int' can hold. */
#define LONG_MAX 9223372036854775807L
#define LONG_MIN (- LONG_MAX - 1L)
/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
#define ULONG_MAX 18446744073709551615L
#else
/* Minimum and maximum values a `signed long int' can hold. */
#define LONG_MIN INT_MIN
#define LONG_MAX INT_MAX
#define LONG_MIN INT_MIN
/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
#define ULONG_MAX UINT_MAX
#endif
#endif /* limits.h */
#endif /* GCC 2. */
+321 -23
View File
@@ -3,7 +3,7 @@
#include "localeinfo.h"
#include <endian.h>
const char _nl_C_LC_CTYPE_class[] =
const char _nl_C_LC_CTYPE_class[768] =
/* 0x80 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
/* 0x86 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
/* 0x8c */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
@@ -33,19 +33,19 @@ const char _nl_C_LC_CTYPE_class[] =
/* 0x1c */ "\002\000" "\002\000" "\002\000" "\002\000" "\001\140" "\004\300"
/* 0x22 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
/* 0x28 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
/* 0x2e */ "\004\300" "\004\300" "\000\330" "\000\330" "\000\330" "\000\330"
/* 0x34 */ "\000\330" "\000\330" "\000\330" "\000\330" "\000\330" "\000\330"
/* 0x2e */ "\004\300" "\004\300" "\010\330" "\010\330" "\010\330" "\010\330"
/* 0x34 */ "\010\330" "\010\330" "\010\330" "\010\330" "\010\330" "\010\330"
/* 0x3a */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
/* 0x40 */ "\004\300" "\000\325" "\000\325" "\000\325" "\000\325" "\000\325"
/* 0x46 */ "\000\325" "\000\305" "\000\305" "\000\305" "\000\305" "\000\305"
/* 0x4c */ "\000\305" "\000\305" "\000\305" "\000\305" "\000\305" "\000\305"
/* 0x52 */ "\000\305" "\000\305" "\000\305" "\000\305" "\000\305" "\000\305"
/* 0x58 */ "\000\305" "\000\305" "\000\305" "\004\300" "\004\300" "\004\300"
/* 0x5e */ "\004\300" "\004\300" "\004\300" "\000\326" "\000\326" "\000\326"
/* 0x64 */ "\000\326" "\000\326" "\000\326" "\000\306" "\000\306" "\000\306"
/* 0x6a */ "\000\306" "\000\306" "\000\306" "\000\306" "\000\306" "\000\306"
/* 0x70 */ "\000\306" "\000\306" "\000\306" "\000\306" "\000\306" "\000\306"
/* 0x76 */ "\000\306" "\000\306" "\000\306" "\000\306" "\000\306" "\004\300"
/* 0x40 */ "\004\300" "\010\325" "\010\325" "\010\325" "\010\325" "\010\325"
/* 0x46 */ "\010\325" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
/* 0x4c */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
/* 0x52 */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
/* 0x58 */ "\010\305" "\010\305" "\010\305" "\004\300" "\004\300" "\004\300"
/* 0x5e */ "\004\300" "\004\300" "\004\300" "\010\326" "\010\326" "\010\326"
/* 0x64 */ "\010\326" "\010\326" "\010\326" "\010\306" "\010\306" "\010\306"
/* 0x6a */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306"
/* 0x70 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306"
/* 0x76 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\004\300"
/* 0x7c */ "\004\300" "\004\300" "\004\300" "\002\000" "\002\000" "\002\000"
/* 0x82 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
/* 0x88 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
@@ -69,8 +69,96 @@ const char _nl_C_LC_CTYPE_class[] =
/* 0xf4 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
/* 0xfa */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
;
const char _nl_C_LC_CTYPE_class32[1024] =
/* 0x00 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x03 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x06 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x09 */ "\003\040\000\000" "\002\040\000\000" "\002\040\000\000"
/* 0x0c */ "\002\040\000\000" "\002\040\000\000" "\002\000\000\000"
/* 0x0f */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x12 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x15 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x18 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x1b */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x1e */ "\002\000\000\000" "\002\000\000\000" "\001\140\000\000"
/* 0x21 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x24 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x27 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x2a */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x2d */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x30 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
/* 0x33 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
/* 0x36 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
/* 0x39 */ "\010\330\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x3c */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x3f */ "\004\300\000\000" "\004\300\000\000" "\010\325\000\000"
/* 0x42 */ "\010\325\000\000" "\010\325\000\000" "\010\325\000\000"
/* 0x45 */ "\010\325\000\000" "\010\325\000\000" "\010\305\000\000"
/* 0x48 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x4b */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x4e */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x51 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x54 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x57 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
/* 0x5a */ "\010\305\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x5d */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x60 */ "\004\300\000\000" "\010\326\000\000" "\010\326\000\000"
/* 0x63 */ "\010\326\000\000" "\010\326\000\000" "\010\326\000\000"
/* 0x66 */ "\010\326\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x69 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x6c */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x6f */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x72 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x75 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x78 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
/* 0x7b */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
/* 0x7e */ "\004\300\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x81 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x84 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x87 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x8a */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x8d */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x90 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x93 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x96 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x99 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x9c */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0x9f */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xa2 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xa5 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xa8 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xab */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xae */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xb1 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xb4 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xb7 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xba */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xbd */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xc0 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xc3 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xc6 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xc9 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xcc */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xcf */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xd2 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xd5 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xd8 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xdb */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xde */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xe1 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xe4 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xe7 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xea */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xed */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xf0 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xf3 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xf6 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xf9 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xfc */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
/* 0xff */ "\002\000\000\000"
;
#if BYTE_ORDER == LITTLE_ENDIAN
const char _nl_C_LC_CTYPE_toupper[] =
const char _nl_C_LC_CTYPE_toupper[1536] =
/* 0x80 */ "\200\000\000\000" "\201\000\000\000" "\202\000\000\000"
/* 0x83 */ "\203\000\000\000" "\204\000\000\000" "\205\000\000\000"
/* 0x86 */ "\206\000\000\000" "\207\000\000\000" "\210\000\000\000"
@@ -200,7 +288,7 @@ const char _nl_C_LC_CTYPE_toupper[] =
/* 0xfa */ "\372\000\000\000" "\373\000\000\000" "\374\000\000\000"
/* 0xfd */ "\375\000\000\000" "\376\000\000\000" "\377\000\000\000"
;
const char _nl_C_LC_CTYPE_tolower[] =
const char _nl_C_LC_CTYPE_tolower[1536] =
/* 0x80 */ "\200\000\000\000" "\201\000\000\000" "\202\000\000\000"
/* 0x83 */ "\203\000\000\000" "\204\000\000\000" "\205\000\000\000"
/* 0x86 */ "\206\000\000\000" "\207\000\000\000" "\210\000\000\000"
@@ -330,8 +418,96 @@ const char _nl_C_LC_CTYPE_tolower[] =
/* 0xfa */ "\372\000\000\000" "\373\000\000\000" "\374\000\000\000"
/* 0xfd */ "\375\000\000\000" "\376\000\000\000" "\377\000\000\000"
;
const char _nl_C_LC_CTYPE_names[1024] =
/* 0x00 */ "\000\000\000\000" "\001\000\000\000" "\002\000\000\000"
/* 0x03 */ "\003\000\000\000" "\004\000\000\000" "\005\000\000\000"
/* 0x06 */ "\006\000\000\000" "\007\000\000\000" "\010\000\000\000"
/* 0x09 */ "\011\000\000\000" "\012\000\000\000" "\013\000\000\000"
/* 0x0c */ "\014\000\000\000" "\015\000\000\000" "\016\000\000\000"
/* 0x0f */ "\017\000\000\000" "\020\000\000\000" "\021\000\000\000"
/* 0x12 */ "\022\000\000\000" "\023\000\000\000" "\024\000\000\000"
/* 0x15 */ "\025\000\000\000" "\026\000\000\000" "\027\000\000\000"
/* 0x18 */ "\030\000\000\000" "\031\000\000\000" "\032\000\000\000"
/* 0x1b */ "\033\000\000\000" "\034\000\000\000" "\035\000\000\000"
/* 0x1e */ "\036\000\000\000" "\037\000\000\000" "\040\000\000\000"
/* 0x21 */ "\041\000\000\000" "\042\000\000\000" "\043\000\000\000"
/* 0x24 */ "\044\000\000\000" "\045\000\000\000" "\046\000\000\000"
/* 0x27 */ "\047\000\000\000" "\050\000\000\000" "\051\000\000\000"
/* 0x2a */ "\052\000\000\000" "\053\000\000\000" "\054\000\000\000"
/* 0x2d */ "\055\000\000\000" "\056\000\000\000" "\057\000\000\000"
/* 0x30 */ "\060\000\000\000" "\061\000\000\000" "\062\000\000\000"
/* 0x33 */ "\063\000\000\000" "\064\000\000\000" "\065\000\000\000"
/* 0x36 */ "\066\000\000\000" "\067\000\000\000" "\070\000\000\000"
/* 0x39 */ "\071\000\000\000" "\072\000\000\000" "\073\000\000\000"
/* 0x3c */ "\074\000\000\000" "\075\000\000\000" "\076\000\000\000"
/* 0x3f */ "\077\000\000\000" "\100\000\000\000" "\101\000\000\000"
/* 0x42 */ "\102\000\000\000" "\103\000\000\000" "\104\000\000\000"
/* 0x45 */ "\105\000\000\000" "\106\000\000\000" "\107\000\000\000"
/* 0x48 */ "\110\000\000\000" "\111\000\000\000" "\112\000\000\000"
/* 0x4b */ "\113\000\000\000" "\114\000\000\000" "\115\000\000\000"
/* 0x4e */ "\116\000\000\000" "\117\000\000\000" "\120\000\000\000"
/* 0x51 */ "\121\000\000\000" "\122\000\000\000" "\123\000\000\000"
/* 0x54 */ "\124\000\000\000" "\125\000\000\000" "\126\000\000\000"
/* 0x57 */ "\127\000\000\000" "\130\000\000\000" "\131\000\000\000"
/* 0x5a */ "\132\000\000\000" "\133\000\000\000" "\134\000\000\000"
/* 0x5d */ "\135\000\000\000" "\136\000\000\000" "\137\000\000\000"
/* 0x60 */ "\140\000\000\000" "\141\000\000\000" "\142\000\000\000"
/* 0x63 */ "\143\000\000\000" "\144\000\000\000" "\145\000\000\000"
/* 0x66 */ "\146\000\000\000" "\147\000\000\000" "\150\000\000\000"
/* 0x69 */ "\151\000\000\000" "\152\000\000\000" "\153\000\000\000"
/* 0x6c */ "\154\000\000\000" "\155\000\000\000" "\156\000\000\000"
/* 0x6f */ "\157\000\000\000" "\160\000\000\000" "\161\000\000\000"
/* 0x72 */ "\162\000\000\000" "\163\000\000\000" "\164\000\000\000"
/* 0x75 */ "\165\000\000\000" "\166\000\000\000" "\167\000\000\000"
/* 0x78 */ "\170\000\000\000" "\171\000\000\000" "\172\000\000\000"
/* 0x7b */ "\173\000\000\000" "\174\000\000\000" "\175\000\000\000"
/* 0x7e */ "\176\000\000\000" "\177\000\000\000" "\200\000\000\000"
/* 0x81 */ "\201\000\000\000" "\202\000\000\000" "\203\000\000\000"
/* 0x84 */ "\204\000\000\000" "\205\000\000\000" "\206\000\000\000"
/* 0x87 */ "\207\000\000\000" "\210\000\000\000" "\211\000\000\000"
/* 0x8a */ "\212\000\000\000" "\213\000\000\000" "\214\000\000\000"
/* 0x8d */ "\215\000\000\000" "\216\000\000\000" "\217\000\000\000"
/* 0x90 */ "\220\000\000\000" "\221\000\000\000" "\222\000\000\000"
/* 0x93 */ "\223\000\000\000" "\224\000\000\000" "\225\000\000\000"
/* 0x96 */ "\226\000\000\000" "\227\000\000\000" "\230\000\000\000"
/* 0x99 */ "\231\000\000\000" "\232\000\000\000" "\233\000\000\000"
/* 0x9c */ "\234\000\000\000" "\235\000\000\000" "\236\000\000\000"
/* 0x9f */ "\237\000\000\000" "\240\000\000\000" "\241\000\000\000"
/* 0xa2 */ "\242\000\000\000" "\243\000\000\000" "\244\000\000\000"
/* 0xa5 */ "\245\000\000\000" "\246\000\000\000" "\247\000\000\000"
/* 0xa8 */ "\250\000\000\000" "\251\000\000\000" "\252\000\000\000"
/* 0xab */ "\253\000\000\000" "\254\000\000\000" "\255\000\000\000"
/* 0xae */ "\256\000\000\000" "\257\000\000\000" "\260\000\000\000"
/* 0xb1 */ "\261\000\000\000" "\262\000\000\000" "\263\000\000\000"
/* 0xb4 */ "\264\000\000\000" "\265\000\000\000" "\266\000\000\000"
/* 0xb7 */ "\267\000\000\000" "\270\000\000\000" "\271\000\000\000"
/* 0xba */ "\272\000\000\000" "\273\000\000\000" "\274\000\000\000"
/* 0xbd */ "\275\000\000\000" "\276\000\000\000" "\277\000\000\000"
/* 0xc0 */ "\300\000\000\000" "\301\000\000\000" "\302\000\000\000"
/* 0xc3 */ "\303\000\000\000" "\304\000\000\000" "\305\000\000\000"
/* 0xc6 */ "\306\000\000\000" "\307\000\000\000" "\310\000\000\000"
/* 0xc9 */ "\311\000\000\000" "\312\000\000\000" "\313\000\000\000"
/* 0xcc */ "\314\000\000\000" "\315\000\000\000" "\316\000\000\000"
/* 0xcf */ "\317\000\000\000" "\320\000\000\000" "\321\000\000\000"
/* 0xd2 */ "\322\000\000\000" "\323\000\000\000" "\324\000\000\000"
/* 0xd5 */ "\325\000\000\000" "\326\000\000\000" "\327\000\000\000"
/* 0xd8 */ "\330\000\000\000" "\331\000\000\000" "\332\000\000\000"
/* 0xdb */ "\333\000\000\000" "\334\000\000\000" "\335\000\000\000"
/* 0xde */ "\336\000\000\000" "\337\000\000\000" "\340\000\000\000"
/* 0xe1 */ "\341\000\000\000" "\342\000\000\000" "\343\000\000\000"
/* 0xe4 */ "\344\000\000\000" "\345\000\000\000" "\346\000\000\000"
/* 0xe7 */ "\347\000\000\000" "\350\000\000\000" "\351\000\000\000"
/* 0xea */ "\352\000\000\000" "\353\000\000\000" "\354\000\000\000"
/* 0xed */ "\355\000\000\000" "\356\000\000\000" "\357\000\000\000"
/* 0xf0 */ "\360\000\000\000" "\361\000\000\000" "\362\000\000\000"
/* 0xf3 */ "\363\000\000\000" "\364\000\000\000" "\365\000\000\000"
/* 0xf6 */ "\366\000\000\000" "\367\000\000\000" "\370\000\000\000"
/* 0xf9 */ "\371\000\000\000" "\372\000\000\000" "\373\000\000\000"
/* 0xfc */ "\374\000\000\000" "\375\000\000\000" "\376\000\000\000"
/* 0xff */ "\377\000\000\000"
;
#elif BYTE_ORDER == BIG_ENDIAN
const char _nl_C_LC_CTYPE_toupper[] =
const char _nl_C_LC_CTYPE_toupper[1536] =
/* 0x80 */ "\000\000\000\200" "\000\000\000\201" "\000\000\000\202"
/* 0x83 */ "\000\000\000\203" "\000\000\000\204" "\000\000\000\205"
/* 0x86 */ "\000\000\000\206" "\000\000\000\207" "\000\000\000\210"
@@ -461,7 +637,7 @@ const char _nl_C_LC_CTYPE_toupper[] =
/* 0xfa */ "\000\000\000\372" "\000\000\000\373" "\000\000\000\374"
/* 0xfd */ "\000\000\000\375" "\000\000\000\376" "\000\000\000\377"
;
const char _nl_C_LC_CTYPE_tolower[] =
const char _nl_C_LC_CTYPE_tolower[1536] =
/* 0x80 */ "\000\000\000\200" "\000\000\000\201" "\000\000\000\202"
/* 0x83 */ "\000\000\000\203" "\000\000\000\204" "\000\000\000\205"
/* 0x86 */ "\000\000\000\206" "\000\000\000\207" "\000\000\000\210"
@@ -591,18 +767,140 @@ const char _nl_C_LC_CTYPE_tolower[] =
/* 0xfa */ "\000\000\000\372" "\000\000\000\373" "\000\000\000\374"
/* 0xfd */ "\000\000\000\375" "\000\000\000\376" "\000\000\000\377"
;
const char _nl_C_LC_CTYPE_names[1024] =
/* 0x00 */ "\000\000\000\000" "\000\000\000\001" "\000\000\000\002"
/* 0x03 */ "\000\000\000\003" "\000\000\000\004" "\000\000\000\005"
/* 0x06 */ "\000\000\000\006" "\000\000\000\007" "\000\000\000\010"
/* 0x09 */ "\000\000\000\011" "\000\000\000\012" "\000\000\000\013"
/* 0x0c */ "\000\000\000\014" "\000\000\000\015" "\000\000\000\016"
/* 0x0f */ "\000\000\000\017" "\000\000\000\020" "\000\000\000\021"
/* 0x12 */ "\000\000\000\022" "\000\000\000\023" "\000\000\000\024"
/* 0x15 */ "\000\000\000\025" "\000\000\000\026" "\000\000\000\027"
/* 0x18 */ "\000\000\000\030" "\000\000\000\031" "\000\000\000\032"
/* 0x1b */ "\000\000\000\033" "\000\000\000\034" "\000\000\000\035"
/* 0x1e */ "\000\000\000\036" "\000\000\000\037" "\000\000\000\040"
/* 0x21 */ "\000\000\000\041" "\000\000\000\042" "\000\000\000\043"
/* 0x24 */ "\000\000\000\044" "\000\000\000\045" "\000\000\000\046"
/* 0x27 */ "\000\000\000\047" "\000\000\000\050" "\000\000\000\051"
/* 0x2a */ "\000\000\000\052" "\000\000\000\053" "\000\000\000\054"
/* 0x2d */ "\000\000\000\055" "\000\000\000\056" "\000\000\000\057"
/* 0x30 */ "\000\000\000\060" "\000\000\000\061" "\000\000\000\062"
/* 0x33 */ "\000\000\000\063" "\000\000\000\064" "\000\000\000\065"
/* 0x36 */ "\000\000\000\066" "\000\000\000\067" "\000\000\000\070"
/* 0x39 */ "\000\000\000\071" "\000\000\000\072" "\000\000\000\073"
/* 0x3c */ "\000\000\000\074" "\000\000\000\075" "\000\000\000\076"
/* 0x3f */ "\000\000\000\077" "\000\000\000\100" "\000\000\000\101"
/* 0x42 */ "\000\000\000\102" "\000\000\000\103" "\000\000\000\104"
/* 0x45 */ "\000\000\000\105" "\000\000\000\106" "\000\000\000\107"
/* 0x48 */ "\000\000\000\110" "\000\000\000\111" "\000\000\000\112"
/* 0x4b */ "\000\000\000\113" "\000\000\000\114" "\000\000\000\115"
/* 0x4e */ "\000\000\000\116" "\000\000\000\117" "\000\000\000\120"
/* 0x51 */ "\000\000\000\121" "\000\000\000\122" "\000\000\000\123"
/* 0x54 */ "\000\000\000\124" "\000\000\000\125" "\000\000\000\126"
/* 0x57 */ "\000\000\000\127" "\000\000\000\130" "\000\000\000\131"
/* 0x5a */ "\000\000\000\132" "\000\000\000\133" "\000\000\000\134"
/* 0x5d */ "\000\000\000\135" "\000\000\000\136" "\000\000\000\137"
/* 0x60 */ "\000\000\000\140" "\000\000\000\141" "\000\000\000\142"
/* 0x63 */ "\000\000\000\143" "\000\000\000\144" "\000\000\000\145"
/* 0x66 */ "\000\000\000\146" "\000\000\000\147" "\000\000\000\150"
/* 0x69 */ "\000\000\000\151" "\000\000\000\152" "\000\000\000\153"
/* 0x6c */ "\000\000\000\154" "\000\000\000\155" "\000\000\000\156"
/* 0x6f */ "\000\000\000\157" "\000\000\000\160" "\000\000\000\161"
/* 0x72 */ "\000\000\000\162" "\000\000\000\163" "\000\000\000\164"
/* 0x75 */ "\000\000\000\165" "\000\000\000\166" "\000\000\000\167"
/* 0x78 */ "\000\000\000\170" "\000\000\000\171" "\000\000\000\172"
/* 0x7b */ "\000\000\000\173" "\000\000\000\174" "\000\000\000\175"
/* 0x7e */ "\000\000\000\176" "\000\000\000\177" "\000\000\000\200"
/* 0x81 */ "\000\000\000\201" "\000\000\000\202" "\000\000\000\203"
/* 0x84 */ "\000\000\000\204" "\000\000\000\205" "\000\000\000\206"
/* 0x87 */ "\000\000\000\207" "\000\000\000\210" "\000\000\000\211"
/* 0x8a */ "\000\000\000\212" "\000\000\000\213" "\000\000\000\214"
/* 0x8d */ "\000\000\000\215" "\000\000\000\216" "\000\000\000\217"
/* 0x90 */ "\000\000\000\220" "\000\000\000\221" "\000\000\000\222"
/* 0x93 */ "\000\000\000\223" "\000\000\000\224" "\000\000\000\225"
/* 0x96 */ "\000\000\000\226" "\000\000\000\227" "\000\000\000\230"
/* 0x99 */ "\000\000\000\231" "\000\000\000\232" "\000\000\000\233"
/* 0x9c */ "\000\000\000\234" "\000\000\000\235" "\000\000\000\236"
/* 0x9f */ "\000\000\000\237" "\000\000\000\240" "\000\000\000\241"
/* 0xa2 */ "\000\000\000\242" "\000\000\000\243" "\000\000\000\244"
/* 0xa5 */ "\000\000\000\245" "\000\000\000\246" "\000\000\000\247"
/* 0xa8 */ "\000\000\000\250" "\000\000\000\251" "\000\000\000\252"
/* 0xab */ "\000\000\000\253" "\000\000\000\254" "\000\000\000\255"
/* 0xae */ "\000\000\000\256" "\000\000\000\257" "\000\000\000\260"
/* 0xb1 */ "\000\000\000\261" "\000\000\000\262" "\000\000\000\263"
/* 0xb4 */ "\000\000\000\264" "\000\000\000\265" "\000\000\000\266"
/* 0xb7 */ "\000\000\000\267" "\000\000\000\270" "\000\000\000\271"
/* 0xba */ "\000\000\000\272" "\000\000\000\273" "\000\000\000\274"
/* 0xbd */ "\000\000\000\275" "\000\000\000\276" "\000\000\000\277"
/* 0xc0 */ "\000\000\000\300" "\000\000\000\301" "\000\000\000\302"
/* 0xc3 */ "\000\000\000\303" "\000\000\000\304" "\000\000\000\305"
/* 0xc6 */ "\000\000\000\306" "\000\000\000\307" "\000\000\000\310"
/* 0xc9 */ "\000\000\000\311" "\000\000\000\312" "\000\000\000\313"
/* 0xcc */ "\000\000\000\314" "\000\000\000\315" "\000\000\000\316"
/* 0xcf */ "\000\000\000\317" "\000\000\000\320" "\000\000\000\321"
/* 0xd2 */ "\000\000\000\322" "\000\000\000\323" "\000\000\000\324"
/* 0xd5 */ "\000\000\000\325" "\000\000\000\326" "\000\000\000\327"
/* 0xd8 */ "\000\000\000\330" "\000\000\000\331" "\000\000\000\332"
/* 0xdb */ "\000\000\000\333" "\000\000\000\334" "\000\000\000\335"
/* 0xde */ "\000\000\000\336" "\000\000\000\337" "\000\000\000\340"
/* 0xe1 */ "\000\000\000\341" "\000\000\000\342" "\000\000\000\343"
/* 0xe4 */ "\000\000\000\344" "\000\000\000\345" "\000\000\000\346"
/* 0xe7 */ "\000\000\000\347" "\000\000\000\350" "\000\000\000\351"
/* 0xea */ "\000\000\000\352" "\000\000\000\353" "\000\000\000\354"
/* 0xed */ "\000\000\000\355" "\000\000\000\356" "\000\000\000\357"
/* 0xf0 */ "\000\000\000\360" "\000\000\000\361" "\000\000\000\362"
/* 0xf3 */ "\000\000\000\363" "\000\000\000\364" "\000\000\000\365"
/* 0xf6 */ "\000\000\000\366" "\000\000\000\367" "\000\000\000\370"
/* 0xf9 */ "\000\000\000\371" "\000\000\000\372" "\000\000\000\373"
/* 0xfc */ "\000\000\000\374" "\000\000\000\375" "\000\000\000\376"
/* 0xff */ "\000\000\000\377"
;
#else
#error "BYTE_ORDER" BYTE_ORDER " not handled."
#endif
const char _nl_C_LC_CTYPE_width[256] =
/* 0x00 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x10 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x20 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x30 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x40 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x50 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x60 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x70 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x80 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0x90 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xa0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xb0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xc0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xd0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xe0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
/* 0xf0 */ "\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
;
const struct locale_data _nl_C_LC_CTYPE =
const struct locale_data _nl_C_LC_CTYPE =
{
NULL, 0, /* no file mapped */
5,
13,
{
_nl_C_LC_CTYPE_class,
NULL, NULL,
_nl_C_LC_CTYPE_toupper,
_nl_C_LC_CTYPE_tolower
{ string: _nl_C_LC_CTYPE_class },
#if BYTE_ORDER == LITTLE_ENDIAN
{ string: NULL }, { string: NULL },
#endif
{ string: _nl_C_LC_CTYPE_toupper },
{ string: _nl_C_LC_CTYPE_tolower },
{ string: NULL },
#if BYTE_ORDER == BIG_ENDIAN
{ string: NULL },
#endif
{ string: _nl_C_LC_CTYPE_class32 },
{ string: _nl_C_LC_CTYPE_names },
#if BYTE_ORDER == BIG_ENDIAN
{ string: NULL },
#endif
{ word: 256 }, { word: 1 },
{ string: "upper\0" "lower\0" "alpha\0" "digit\0" "xdigit\0" "space\0"
"print\0" "graph\0" "blank\0" "cntrl\0" "punct\0" "alnum\0" },
{ string: "tolower\0" "toupper\0" },
{ string: _nl_C_LC_CTYPE_width }
}
};
+5 -5
View File
@@ -1,5 +1,5 @@
/* Generated by GNU locale 0.1.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. */
@@ -11,9 +11,9 @@ const struct locale_data _nl_C_LC_MESSAGES =
NULL, 0, /* no file mapped */
4,
{
"[yY][[:alpha:]]",
"[nN][[:alpha:]]",
"",
""
{ string: "[yY][[:alpha:]]" },
{ string: "[nN][[:alpha:]]" },
{ string: "" },
{ string: "" }
}
};
+16 -16
View File
@@ -1,5 +1,5 @@
/* Generated by GNU locale 0.1.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. */
@@ -11,20 +11,20 @@ const struct locale_data _nl_C_LC_MONETARY =
NULL, 0, /* no file mapped */
15,
{
"",
"",
"",
"",
"\177",
"",
"",
"\177",
"\177",
"\177",
"\177",
"\177",
"\177",
"\177",
"\177"
{ string: "" },
{ string: "" },
{ string: "" },
{ string: "" },
{ string: "\177" },
{ string: "" },
{ string: "" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" },
{ string: "\177" }
}
};
+4 -4
View File
@@ -1,5 +1,5 @@
/* Generated by GNU locale 0.1.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. */
@@ -11,8 +11,8 @@ const struct locale_data _nl_C_LC_NUMERIC =
NULL, 0, /* no file mapped */
3,
{
".",
"",
"\177"
{ string: "." },
{ string: "" },
{ string: "\177" }
}
};
+47 -46
View File
@@ -1,5 +1,5 @@
/* Generated by GNU locale 0.1.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. */
@@ -9,51 +9,52 @@ PARTICULAR PURPOSE. */
const struct locale_data _nl_C_LC_TIME =
{
NULL, 0, /* no file mapped */
44,
45,
{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"AM",
"PM",
"%a %b %d %H:%M:%S %Y",
"%m/%d/%y",
"%H:%M:%S",
NULL
{ string: "Sun" },
{ string: "Mon" },
{ string: "Tue" },
{ string: "Wed" },
{ string: "Thu" },
{ string: "Fri" },
{ string: "Sat" },
{ string: "Sunday" },
{ string: "Monday" },
{ string: "Tuesday" },
{ string: "Wednesday" },
{ string: "Thursday" },
{ string: "Friday" },
{ string: "Saturday" },
{ string: "Jan" },
{ string: "Feb" },
{ string: "Mar" },
{ string: "Apr" },
{ string: "May" },
{ string: "Jun" },
{ string: "Jul" },
{ string: "Aug" },
{ string: "Sep" },
{ string: "Oct" },
{ string: "Nov" },
{ string: "Dec" },
{ string: "January" },
{ string: "February" },
{ string: "March" },
{ string: "April" },
{ string: "May" },
{ string: "June" },
{ string: "July" },
{ string: "August" },
{ string: "September" },
{ string: "October" },
{ string: "November" },
{ string: "December" },
{ string: "AM" },
{ string: "PM" },
{ string: "%a %b %d %H:%M:%S %Y" },
{ string: "%m/%d/%y" },
{ string: "%H:%M:%S" },
{ string: "%I:%M:%S %p" },
{ string: NULL }
}
};
+21 -13
View File
@@ -13,19 +13,21 @@
# You should have received a copy of the GNU Library General Public
# License along with the GNU C Library; see the file COPYING.LIB. If
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.
# not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Makefile for locales.
#
subdir := locale
headers = locale.h
headers = locale.h langinfo.h
distribute = localeinfo.h categories.def \
$(localedef-modules:=.c) $(locale-modules:=.c) \
$(lib-modules:=.c) config.h hash.h iso-4217.def \
keyword.gperf keyword.h localedef.h token.h
$(lib-modules:=.c) config.h simple-hash.h iso-4217.def \
charmap-kw.gperf charmap-kw.h locfile-token.h \
locfile-kw.gperf locfile-kw.h linereader.h \
locales.h locfile.h stringtrans.h
routines = setlocale loadlocale localeconv nl_langinfo
categories = ctype messages monetary numeric time collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc
@@ -34,10 +36,12 @@ install-bin = localedef locale
extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \
$(lib-modules:=.o)
localedef-modules := charmap locfile-lex locfile-parse locale-ctype \
monetary messages collate numeric
locale-modules := ctypedump
lib-modules := locfile-hash xmalloc
vpath %.c programs
vpath %.h programs
localedef-modules := $(categories:%=ld-%) charmap charset linereader \
locfile stringtrans
lib-modules := simple-hash xmalloc xstrdup
GPERF = gperf
@@ -45,14 +49,18 @@ GPERFFLAGS = -acCgopt -k1,2,5,$$
include ../Rules
keyword.h: keyword.gperf
$(GPERF) $(GPERFFLAGS) $< > $@.new
programs/%-kw.h: programs/%-kw.gperf
$(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $< > $@.new
mv -f $@.new $@
$(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
CPPFLAGS += -DLOCALE_PATH='"$(localedir)"' -DCHARMAP_PATH='"$(nlsdir)/charmap"'
CPPFLAGS := -DLOCALE_PATH='"$(localedir)"' \
-DCHARMAP_PATH='"$(i18ndir)/charmap"' \
-DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \
-Iprograms $(CPPFLAGS)
CFLAGS-locfile-lex.c = -Wno-write-strings
CFLAGS-charmap.c = -Wno-write-strings
CFLAGS-locfile.c = -Wno-write-strings
+3 -1
View File
@@ -1,4 +1,6 @@
/* Define a constant for the dgettext domainname for libc internal messages,
so the string constant is not repeated in dozens of object files. */
const char _libc_intl_domainname[] = "SYS_libc";
#include "../version.h"
const char _libc_intl_domainname[] = "SYS_GNU_libc-" VERSION;
+92 -69
View File
@@ -1,5 +1,5 @@
/* Definition of all available locale categories and their items. -*- C -*-
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -32,88 +32,111 @@ Cambridge, MA 02139, USA. */
program code which loads this file.
The various value types for the items are `string', `stringarray', `byte'
and `bytearray'. These cover all possible values in the current locale
definitions. `min' and `max' can be individually used again. */
`bytearray', and `word'. These cover all possible values in the current
locale definitions. `min' and `max' can be individually used again. */
#ifndef NO_POSTLOAD
#define NO_POSTLOAD NULL
#endif
DEFINE_CATEGORY (LC_COLLATE, "LC_COLLATE",
(
{ 0 } /* No data encoding yet. */
), NO_POSTLOAD, collate_input, NULL, NULL )
DEFINE_CATEGORY
(
LC_COLLATE, "LC_COLLATE",
(
DEFINE_ELEMENT (_NL_COLLATE_NRULES, "collate-nrules", std, word)
DEFINE_ELEMENT (_NL_COLLATE_RULES, "collate-rules", std, string)
DEFINE_ELEMENT (_NL_COLLATE_HASH_SIZE, "collate-hash-size", std, word)
DEFINE_ELEMENT (_NL_COLLATE_HASH_LAYERS, "collate-hash-layers", std, word)
DEFINE_ELEMENT (_NL_COLLATE_TABLE_EB, "collate-table-eb", std, string)
DEFINE_ELEMENT (_NL_COLLATE_TABLE_EL, "collate-table-el", std, string)
DEFINE_ELEMENT (_NL_COLLATE_UNDEFINED, "collate-undefined", std, word)
DEFINE_ELEMENT (_NL_COLLATE_EXTRA_EB, "collate-extra-eb", std, string)
DEFINE_ELEMENT (_NL_COLLATE_EXTRA_EL, "collate-extra-el", std, string)
), _nl_postload_collate, collate_input, NULL, NULL)
/* The actual definition of ctype is meaningless here. It is hard coded in
the code because it has to be handled very specially. Only the names of
the functions are important. */
DEFINE_CATEGORY (LC_CTYPE, "LC_CTYPE",
(
{ _NL_CTYPE_CLASS, "ctype-class", std, string },
{ _NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string },
{ _NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string },
{ _NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string },
{ _NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string },
{ 0 }
), _nl_postload_ctype,
ctype_input, ctype_check, ctype_output )
the functions and the value types are important. */
DEFINE_CATEGORY
(
LC_CTYPE, "LC_CTYPE",
(
DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, string)
DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string)
DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string)
DEFINE_ELEMENT (_NL_CTYPE_NAMES_EB, "ctype-names-eb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_NAMES_EL, "ctype-names-eb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE, "ctype-hash-size", std, word)
DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS, "ctype-hash-layers", std, word)
DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES, "ctype-class-names", std, string)
DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES, "ctype-map-names", std, string)
DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray)
), _nl_postload_ctype, ctype_input, ctype_check, ctype_output)
DEFINE_CATEGORY (LC_MONETARY, "LC_MONETARY",
(
{ INT_CURR_SYMBOL, "int_curr_symbol", std, string },
{ CURRENCY_SYMBOL, "currency_symbol", std, string },
{ MON_DECIMAL_POINT, "mon_decimal_point", std, string },
{ MON_THOUSANDS_SEP, "mon_thousands_sep", std, string },
{ MON_GROUPING, "mon_grouping", std, bytearray },
{ POSITIVE_SIGN, "positive_sign", std, string },
{ NEGATIVE_SIGN, "negative_sign", std, string },
{ INT_FRAC_DIGITS, "int_frac_digits", std, byte },
{ FRAC_DIGITS, "frac_digits", std, byte },
{ P_CS_PRECEDES, "p_cs_precedes", std, byte, 0, 1 },
{ P_SEP_BY_SPACE, "p_sep_by_space", std, byte, 0, 2 },
{ N_CS_PRECEDES, "n_cs_precedes", std, byte, 0, 1 },
{ N_SEP_BY_SPACE, "n_sep_by_space", std, byte, 0, 2 },
{ P_SIGN_POSN, "p_sign_posn", std, byte, 0, 4 },
{ N_SIGN_POSN, "n_sign_posn", std, byte, 0, 4 },
{ 0 }
), NO_POSTLOAD, NULL, monetary_check, NULL )
DEFINE_CATEGORY
(
LC_MONETARY, "LC_MONETARY",
(
DEFINE_ELEMENT (INT_CURR_SYMBOL, "int_curr_symbol", std, string)
DEFINE_ELEMENT (CURRENCY_SYMBOL, "currency_symbol", std, string)
DEFINE_ELEMENT (MON_DECIMAL_POINT, "mon_decimal_point", std, string)
DEFINE_ELEMENT (MON_THOUSANDS_SEP, "mon_thousands_sep", std, string)
DEFINE_ELEMENT (MON_GROUPING, "mon_grouping", std, bytearray)
DEFINE_ELEMENT (POSITIVE_SIGN, "positive_sign", std, string)
DEFINE_ELEMENT (NEGATIVE_SIGN, "negative_sign", std, string)
DEFINE_ELEMENT (INT_FRAC_DIGITS, "int_frac_digits", std, byte)
DEFINE_ELEMENT (FRAC_DIGITS, "frac_digits", std, byte)
DEFINE_ELEMENT (P_CS_PRECEDES, "p_cs_precedes", std, byte, 0, 1)
DEFINE_ELEMENT (P_SEP_BY_SPACE, "p_sep_by_space", std, byte, 0, 2)
DEFINE_ELEMENT (N_CS_PRECEDES, "n_cs_precedes", std, byte, 0, 1)
DEFINE_ELEMENT (N_SEP_BY_SPACE, "n_sep_by_space", std, byte, 0, 2)
DEFINE_ELEMENT (P_SIGN_POSN, "p_sign_posn", std, byte, 0, 4)
DEFINE_ELEMENT (N_SIGN_POSN, "n_sign_posn", std, byte, 0, 4)
), NO_POSTLOAD, NULL, monetary_check, NULL)
DEFINE_CATEGORY (LC_NUMERIC, "LC_NUMERIC",
(
{ DECIMAL_POINT, "decimal_point", std, string },
{ THOUSANDS_SEP, "thousands_sep", std, string },
{ GROUPING, "grouping", std, bytearray },
{ 0 }
), NO_POSTLOAD, NULL, numeric_check, NULL)
DEFINE_CATEGORY
(
LC_NUMERIC, "LC_NUMERIC",
(
DEFINE_ELEMENT (DECIMAL_POINT, "decimal_point", std, string)
DEFINE_ELEMENT (THOUSANDS_SEP, "thousands_sep", std, string)
DEFINE_ELEMENT (GROUPING, "grouping", std, bytearray)
), NO_POSTLOAD, NULL, numeric_check, NULL)
DEFINE_CATEGORY (LC_TIME, "LC_TIME",
(
{ ABDAY_1, "abday", std, stringarray, 7, 7 },
{ DAY_1, "day", std, stringarray, 7, 7 },
{ ABMON_1, "abmon", std, stringarray, 12, 12 },
{ MON_1, "mon", std, stringarray, 12, 12 },
{ AM_STR, "am_pm", std, stringarray, 2, 2 },
{ D_T_FMT, "d_t_fmt", std, string },
{ D_FMT, "d_fmt", std, string },
{ T_FMT, "t_fmt", std, string },
{ T_FMT_AMPM, "t_fmt_ampm", std, string },
{ ERA, "era", opt, string },
{ ERA_YEAR, "era_year", opt, string },
{ ERA_D_FMT, "era_d_fmt", opt, string },
{ ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100 },
{ 0 }
), NO_POSTLOAD, NULL, NULL, NULL )
DEFINE_CATEGORY
(
LC_TIME, "LC_TIME",
(
DEFINE_ELEMENT (ABDAY_1, "abday", std, stringarray, 7, 7)
DEFINE_ELEMENT (DAY_1, "day", std, stringarray, 7, 7)
DEFINE_ELEMENT (ABMON_1, "abmon", std, stringarray, 12, 12)
DEFINE_ELEMENT (MON_1, "mon", std, stringarray, 12, 12)
DEFINE_ELEMENT (AM_STR, "am_pm", std, stringarray, 2, 2)
DEFINE_ELEMENT (D_T_FMT, "d_t_fmt", std, string)
DEFINE_ELEMENT (D_FMT, "d_fmt", std, string)
DEFINE_ELEMENT (T_FMT, "t_fmt", std, string)
DEFINE_ELEMENT (T_FMT_AMPM, "t_fmt_ampm", std, string)
DEFINE_ELEMENT (ERA, "era", opt, string)
DEFINE_ELEMENT (ERA_YEAR, "era_year", opt, string)
DEFINE_ELEMENT (ERA_D_FMT, "era_d_fmt", opt, string)
DEFINE_ELEMENT (ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100)
DEFINE_ELEMENT (ERA_D_T_FMT, "era_d_t_fmt", opt, string)
DEFINE_ELEMENT (ERA_T_FMT, "era_t_fmt", opt, string)
), NO_POSTLOAD, NULL, NULL, NULL)
DEFINE_CATEGORY (LC_MESSAGES, "LC_MESSAGES",
(
{ YESEXPR, "yesexpr", std, string },
{ NOEXPR, "noexpr", std, string },
{ YESSTR, "yesstr", opt, string },
{ NOSTR, "nostr", opt, string },
{ 0 }
), NO_POSTLOAD, NULL, messages_check, NULL )
DEFINE_CATEGORY
(
LC_MESSAGES, "LC_MESSAGES",
(
DEFINE_ELEMENT (YESEXPR, "yesexpr", std, string)
DEFINE_ELEMENT (NOEXPR, "noexpr", std, string)
DEFINE_ELEMENT (YESSTR, "yesstr", opt, string)
DEFINE_ELEMENT (NOSTR, "nostr", opt, string)
), NO_POSTLOAD, NULL, messages_check, NULL)
-524
View File
@@ -1,524 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <ctype.h>
#include <errno.h>
#include <libintl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "localedef.h"
#include "hash.h"
/* Data structure for representing charmap database. */
struct charmap charmap_data;
/* Line number in charmap file. */
static unsigned int line_no;
/* Prototypes for local functions. */
static void read_prolog (FILE *infile);
static unsigned long read_body (FILE *infile);
/* Read complete table of symbolic names for character set from file. If
this file does not exist or is not readable a default file is tried.
If this also is not readable no character map is defined. */
void
charmap_read (const char *filename)
{
unsigned long max_char;
long path_max = pathconf (".", _PC_PATH_MAX);
char buf[path_max];
FILE *infile = NULL;
/* Initialize charmap data. */
charmap_data.codeset_name = NULL;
charmap_data.mb_cur_max = -1;
charmap_data.mb_cur_min = -1;
charmap_data.escape_char = '\\';
charmap_data.comment_char = '#';
if (filename != NULL)
{
strcpy (buf, filename);
infile = fopen (filename, "r");
if (infile == NULL && filename[0] != '/')
{
snprintf (buf, path_max, "%s/%s", CHARMAP_PATH, filename);
infile = fopen (buf, "r");
}
}
if (infile == NULL)
{
if (filename != NULL)
error (0, errno, gettext ("input file `%s' not found"), filename);
snprintf (buf, path_max, "%s/%s", CHARMAP_PATH, DEFAULT_CHARMAP);
infile = fopen (buf, "r");
if (infile == NULL)
error (4, errno, gettext ("input file `%s' not found"), filename);
}
charmap_data.filename = buf;
init_hash (&charmap_data.table, 500);
line_no = 0;
/* Read the prolog of the charmap file. */
read_prolog (infile);
/* Last works on the charmap tables global data. */
if (charmap_data.mb_cur_max == -1)
charmap_data.mb_cur_max = 1;
if (charmap_data.mb_cur_min == -1)
charmap_data.mb_cur_min = charmap_data.mb_cur_max;
if ((size_t) charmap_data.mb_cur_max > sizeof (long))
{
error (2, 0, gettext ("program limitation: for now only upto %Zu "
"bytes per character are allowed"), sizeof (long));
}
/* Now process all entries. */
max_char = read_body (infile);
/* We don't need the file anymore. */
fclose (infile);
/* Determine the optimal table size when using the simple modulo hashing
function. */
if (max_char >= 256)
{
int size;
/* Current best values, initialized to some never reached high value. */
int best_count = 10000;
int best_size = 10000;
int best_product = best_count * best_size;
/* Give warning. */
error (-1, 0, gettext ("computing character table size: this may take "
"a while"));
for (size = 256; size <= best_product; ++size)
{
/* Array with slot counters. */
int cnt[size];
/* Current character. */
int ch;
/* Maximal number of characters in any slot. */
int maxcnt = 0;
/* Product of current size and maximal count. */
int product = 0;
/* Iteration pointer through hashing table. */
char *ptr = NULL;
/* Initializes counters to zero. */
memset(cnt, 0, size * sizeof (int));
/* Iterate through whole hashing table. */
while (product < best_product
&& iterate_table (&charmap_data.table, (void **) &ptr,
(void **) &ch))
{
/* Increment slot counter. */
++cnt[ch % size];
/* Test for current maximum. */
if (cnt[ch % size] > maxcnt)
{
maxcnt = cnt[ch % size];
product = maxcnt * size;
}
}
if (product < best_product)
{
best_count = maxcnt;
best_size = size;
best_product = best_count * best_size;
}
}
charmap_data.hash_size = best_size;
charmap_data.hash_layers = best_count;
}
else
{
charmap_data.hash_size = 256;
charmap_data.hash_layers = 1;
}
}
#define SYNTAX_ERROR \
do { error (0, 0, gettext ("%s:%u: syntax error in charmap file"), \
charmap_data.filename, line_no); \
goto end_of_loop; } while (0)
/* Read the prolog of the charmap file until the line containing `CHARMAP'.
All possible entries are processed. */
static void
read_prolog (FILE *infile)
{
size_t bufsize = sysconf (_SC_LINE_MAX);
char buf[bufsize];
while (1)
{
char *cp = buf;
char len;
/* Read the next line. */
fgets (buf, bufsize, infile);
len = strlen (buf);
/* On EOF simply return. */
if (len == 0 || buf[len - 1] != '\n')
error (4, 0, gettext ("%s: unexpected end of file in charmap"),
charmap_data.filename);
/* This is the next line. */
++line_no;
/* Comments and empty lines are ignored. */
if (len == 1 || buf[0] == charmap_data.comment_char)
continue;
buf[len - 1] = '\0';
/* Throw away leading white spaces. This is not defined in POSIX.2
so don't do it if conformance is requested. */
if (!posix_conformance)
while (isspace (*cp))
++cp;
/* If `CHARMAP' is read the prolog is over. */
if (strncmp (cp, "CHARMAP", 7) == 0
&& (!posix_conformance || cp[7] == '\0'))
return;
/* Now it can be only one of special symbols defining the charmap
parameters. All are beginning with '<'. */
if (*cp != '<')
SYNTAX_ERROR;
++cp;
if (strncmp (cp, "code_set_name>", 14) == 0)
{
char *startp;
#define cp_to_arg(no,pred) \
cp += no; \
while (isspace (*cp)) \
++cp; \
if (*cp == '\0' || !pred (*cp)) \
SYNTAX_ERROR;
cp_to_arg (14,isgraph)
if (charmap_data.codeset_name != NULL)
{
error (0, 0, gettext ("%s:%u: duplicate code set name "
"specification"),
charmap_data.filename, line_no);
free (charmap_data.codeset_name);
}
startp = cp;
while (*cp != '\0' && isgraph (*cp) && !isspace (*cp))
++cp;
charmap_data.codeset_name = (char *) xmalloc (cp - startp + 1);
strncpy (startp, startp, cp - startp);
}
else if (strncmp (cp, "mb_cur_max>", 11) == 0)
{
int new_val;
cp_to_arg (11,isdigit)
if (charmap_data.mb_cur_max != -1)
error (0, 0,
gettext ("%s:%u: duplicate definition of mb_cur_max"),
charmap_data.filename, line_no);
new_val = (int) strtol (cp, &cp, posix_conformance ? 10 : 0);
if (new_val < 1)
error (0, 0, gettext ("%s:%u: illegal value for mb_cur_max: %d"),
charmap_data.filename, line_no, new_val);
else
charmap_data.mb_cur_max = new_val;
}
else if (strncmp (cp, "mb_cur_min>", 11) == 0)
{
int new_val;
cp_to_arg (11,isdigit)
if (charmap_data.mb_cur_max != -1)
error (0, 0,
gettext ("%s:%u: duplicate definition of mb_cur_min"),
charmap_data.filename, line_no);
new_val = (int) strtol (cp, &cp, posix_conformance ? 10 : 0);
if (new_val < 1)
error (0, 0, gettext ("%s:%u: illegal value for mb_cur_min: %d"),
charmap_data.filename, line_no, new_val);
else
charmap_data.mb_cur_min = new_val;
}
else if (strncmp (cp, "escape_char>", 12) == 0)
{
cp_to_arg (12, isgraph)
charmap_data.escape_char = *cp;
}
else if (strncmp (cp, "comment_char>", 13) == 0)
{
cp_to_arg (13, isgraph)
charmap_data.comment_char = *cp;
}
else
SYNTAX_ERROR;
end_of_loop:
}
}
#undef cp_to_arg
static unsigned long
read_body (FILE *infile)
{
unsigned long max_char = 0;
size_t bufsize = sysconf (_SC_LINE_MAX);
char buf[bufsize];
char name_str[bufsize / 2];
char code_str[bufsize / 2];
while (1)
{
char *cp = buf;
size_t len;
/* Read the next line. */
fgets (buf, bufsize, infile);
len = strlen (buf);
/* On EOF simply return. */
if (len == 0)
error (0, 0, gettext ("%s: `END CHARMAP' is missing"),
charmap_data.filename);
/* This is the next line. */
++line_no;
if (len == bufsize - 1)
{
error (0, 0, gettext ("%s:%u: line too long; use `getconf "
"LINE_MAX' to get the current maximum line"
"length"), charmap_data.filename, line_no);
do
{
fgets (buf, bufsize, infile);
len = strlen (buf);
}
while (len == bufsize - 1);
continue;
}
/* Comments and empty lines are ignored. */
if (len == 1 || buf[0] == charmap_data.comment_char)
continue;
buf[len - 1] = '\0';
/* Throw away leading white spaces. This is not defined in POSIX.2
so don't do it if conformance is requested. */
if (!posix_conformance)
while (isspace (*cp))
++cp;
if (*cp == '<')
{
char *end1p, *end2p, *start2p;
size_t cnt = 0;
unsigned long char_value = 0;
if (sscanf (cp + 1, "%s %s", name_str, code_str) != 2)
SYNTAX_ERROR;
end1p = cp = name_str;
while (*cp != '\0' && *cp != '>')
{
if (*cp == charmap_data.escape_char)
if (*++cp == '\0')
SYNTAX_ERROR;
*end1p++ = *cp++;
}
if (*cp == '\0')
/* No final '>'. Make error condition. */
end1p = name_str;
else
++cp;
*end1p = '\0';
if (*cp == '.' && *++cp == '.' && *++cp == '.' && *++cp == '<')
{
/* This might be the alternate form. */
start2p = end2p = ++cp;
while (*cp != '\0' && *cp != '>')
{
if (*cp == charmap_data.escape_char)
if (*++cp == '\0')
SYNTAX_ERROR;
*end2p = *cp++;
}
if (*cp == '\0')
/* NO final '>'. Make error condition. */
end2p = start2p;
else
++cp;
}
else
start2p = end2p = NULL;
if (end1p == name_str || (start2p != NULL && start2p != end2p)
|| *cp != '\0'
|| *code_str != charmap_data.escape_char)
SYNTAX_ERROR;
cp = code_str;
do
{
char *begin;
long val;
switch (*++cp)
{
case 'd':
val = strtol ((begin = cp + 1), &cp, 10);
break;
case 'x':
val = strtol ((begin = cp + 1), &cp, 16);
break;
default:
val = strtol ((begin = cp), &cp, 8);
break;
}
if (begin == cp)
SYNTAX_ERROR;
if (posix_conformance && cp - begin < 2)
error (0, 0, gettext ("%s:%u: byte constant has less than "
"two digits"),
charmap_data.filename, line_no);
if (val < 0 || val > 255)
{
error (0, 0, gettext ("%s:%u: character encoding must be "
"given in 8-bit bytes"),
charmap_data.filename, line_no);
goto end_of_loop;
}
if (cnt < (size_t) charmap_data.mb_cur_max)
{
if (cnt < sizeof (long)) /* FIXME */
char_value = (char_value << 8) | val;
}
else
{
error (0, 0, gettext ("%s:%u: number of bytes in character "
"definition exceeds `mb_cur_max'"),
charmap_data.filename, line_no);
break;
}
++cnt;
}
while (*cp == charmap_data.escape_char);
/* Ignore the rest of the line (comment). */
if (end2p == NULL)
{
if (insert_entry (&charmap_data.table, name_str,
end1p - name_str, (void *) char_value))
error (0, 0, gettext ("%s:%u: duplicate entry"),
charmap_data.filename, line_no);
max_char = MAX (max_char, char_value);
}
else
{
char *en1, *en2, *start1p;
long n1, n2, n;
start1p = name_str;
while (*start1p == *start2p && !isdigit (*start1p)
&& start1p < end1p)
++start1p, ++start2p;
n1 = strtol (start1p, &en1, 10);
n2 = strtol (start2p, &en2, 10);
if (en1 - start1p != en2 - start2p || en1 != end1p
|| en2 != end2p)
SYNTAX_ERROR;
if (n1 > n2)
error (0, 0, gettext ("%s:%u: starting character is bigger "
"than last"),
charmap_data.filename, line_no);
n = n1;
while (n <= n2)
{
snprintf(start1p, en1 - start1p, "%0*d", en1 - start1p, n);
if (insert_entry (&charmap_data.table, name_str,
en1 - name_str,
(void *) (char_value + n - n1)))
error (0, 0, gettext ("%s:%u: duplicate entry"),
charmap_data.filename, line_no);
max_char = MAX (max_char, char_value + n - n1);
++n;
}
}
}
else
{
if (strncmp (cp, "END CHARMAP", 11) == 0)
return max_char;
SYNTAX_ERROR;
}
end_of_loop:
}
return max_char;
}
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
-212
View File
@@ -1,212 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <langinfo.h>
#include <libintl.h>
#include "localedef.h"
#include "token.h"
/* defined in locfile-lex.c: flag to indicate that unknown element names
are allowed. */
extern int reject_new_char;
#define SYNTAX_ERROR \
error (0, 0, gettext ("%s:%Zd: syntax error in locale definition file"), \
locfile_data.filename, locfile_data.line_no);
void
collate_input (int token)
{
int read_order_start = 0;
while (1)
{
char *ptr;
int len;
if (token == TOK_END)
/* This is the end of the category. */
{
token = xlocfile_lex (&ptr, &len);
if (token != _NL_NUM_LC_COLLATE)
{
error (0, 0, gettext ("%s:%Zd: category `%s' does not end "
"with `END %s'"), locfile_data.filename,
locfile_data.line_no, "LC_COLLATE", "LC_COLLATE");
ignore_to_eol (0, 0);
}
else
ignore_to_eol (0, 1);
/* Start next category. */
break;
}
#if 0
/* Process line. */
if (read_order_start == 0)
/* We're still in the preambel. */
{
switch (token)
{
case TOK_COLLATING_ELEMENT:
reject_new_char = 0;
token = xlocfile_lex (&ptr, &len);
reject_new_char = 1;
if (token == TOK_CHAR)
{
error (0, 0, gettext ("%s:%Zd: symbolic name must not be "
"duplicate name in charmap"),
locfile_data.filename, locfile_data.line_no);
ignore_to_eol (0, 0);
break;
}
else if (token != TOK_ILL_CHAR)
{
SYNTAX_ERROR;
ignore_to_eol (0, 0);
break;
}
else
{
char elem_name[len + 1];
memcpy (elem_name, ptr, len);
elem_name[len] = '\0';
/* Test whether defined in symbol table. */
token = xlocfile_lex (&ptr, &len);
if (token != TOK_FROM)
{
SYNTAX_ERROR;
ignore_to_eol (0, 0);
break;
}
token = xlocfile_lex (&ptr, &len);
if (token != TOK_STRING)
{
SYNTAX_ERROR;
ignore_to_eol (0, 0);
break;
}
/* Insert collating element into table. */
/* Rest of the line should be empty. */
ignore_to_eol (0, 1);
}
break;
case TOK_COLLATING_SYMBOL:
reject_new_char = 0;
token = xlocfile_lex (&ptr, &len);
reject_new_char = 1;
if (token == TOK_CHAR)
{
error (0, 0, gettext ("%s:%Zd: symbolic name must not "
"duplicate name in charmap"),
locfile_data.filename, locfile_data.line_no);
ignore_to_eol (0, 0);
break;
}
else if (token != TOK_ILL_CHAR)
{
SYNTAX_ERROR;
ignore_to_eol (0, 0);
break;
}
else
{
/* Test whether defined in element table. */
/* Insert collating symbol into table. */
ignore_to_eol (0, 1);
}
case TOK_ORDER_START:
nsort_rules = 0;
do
{
token = xlocfile_lex (&ptr, &len);
if (nsort_rules == 0 && token == ENDOFLINE)
break;
if (token != TOK_BACKWARD && token != TOK_FORWARD
&& token != TOK_POSITION)
{
SYNTAX_ERROR;
break;
}
switch (token)
{
case TOK_BACKWARD:
if ((sort_rule[nsort_rules] & FORWARD_BIT) != 0)
error (0, 0, gettext ("%s:%Zd: directives `forward' "
"and `backward' are mutually "
"exclusive"),
locfile_data.filename, locfile_data.lineno);
else
sort_rule[nsort_rules] |= BACKWARD_BIT;
break;
case TOK_FORWARD:
if ((sort_rule[nsort_rules] & BACKWARD_BIT) != 0)
error (0, 0, gettext ("%s:%Zd: directives `forward' "
"and `backward' are mutually "
"exclusive"),
locfile_data.filename, locfile_data.lineno);
else
sort_rule[nsort_rules] |= FORWARD_BIT;
break;
case TOK_POSITION:
sort_rule[nsort_rules] |= POSITION_BIT;
break;
}
++nsort_rules;
}
break;
default:
SYNTAX_ERROR;
ignore_to_eol (token, 0);
}
}
else
{
}
#endif
ignore_to_eol(token,0);
/* Get next token. */
token = xlocfile_lex (&ptr, &len);
}
}
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
-45
View File
@@ -1,45 +0,0 @@
/* config.h used by locale and localedef programs in GNU libc.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _CONFIG_H
#define _CONFIG_H
#define PACKAGE "libc"
#define VERSION __libc_version
extern const char __libc_version[];
#define DEFAULT_CHARMAP "POSIX"
/* These are tested by xmalloc.c and error.c. */
#define HAVE_VPRINTF 1
#define STDC_HEADERS 1
#define HAVE_STRERROR 1
#define program_name program_invocation_name
typedef unsigned short u16;
typedef int i32;
typedef int u32;
/* Get the global libc configuration info. */
#include_next <config.h>
#endif /* config.h */
-163
View File
@@ -1,163 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <ctype.h>
#include <endian.h>
#include <stdlib.h>
#include <stdio.h>
#include <netinet/in.h> /* Just for htons() */
#include "localedef.h"
#include "localeinfo.h"
/* FIXME: these values should be part of the LC_CTYPE information. */
#define mb_cur_max 1
#define mb_cur_min 1
#define SWAP32(v) \
((u32) (((((u32) (v)) & 0x000000ff) << 24) \
| ((((u32) (v)) & 0x0000ff00) << 8) \
| ((((u32) (v)) & 0x00ff0000) >> 8) \
| ((((u32) (v)) & 0xff000000) >> 24)))
static inline void
print_short_in_char (unsigned short val)
{
const unsigned char *p = (const unsigned char *) &val;
printf ("\"\\%03o\\%03o\"", p[0], p[1]);
}
static inline void
print_int_in_char (unsigned int val)
{
const unsigned char *p = (const unsigned char *) &val;
printf ("\"\\%03o\\%03o\\%03o\\%03o\"", p[0], p[1], p[2], p[3]);
}
int
ctype_output (void)
{
int ch;
int result = 0;
const char *locname = (getenv ("LC_ALL") ?: getenv ("LC_CTYPE") ?:
getenv ("LANG") ?: "POSIX");
puts ("#include <endian.h>\n");
if (mb_cur_max == 1)
{
printf ("const char _nl_%s_LC_CTYPE_class[] = \n", locname);
for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
{
if (((ch + 128) % 6) == 0)
printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
print_short_in_char (htons (__ctype_b [ch < 0 ? 256 + ch : ch]));
fputc (((ch + 128) % 6) == 5 ? '\n' : ' ', stdout);
}
puts (";");
}
printf ("#if BYTE_ORDER == %s\n",
BYTE_ORDER == LITTLE_ENDIAN ? "LITTLE_ENDIAN" : "BIG_ENDIAN");
if (mb_cur_max == 1)
{
printf ("const char _nl_%s_LC_CTYPE_toupper[] = \n", locname);
for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
{
if (((ch + 128) % 3) == 0)
printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
print_int_in_char (__ctype_toupper[ch < 0 ? 256 + ch : ch]);
fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
}
puts (";");
printf ("const char _nl_%s_LC_CTYPE_tolower[] = \n", locname);
for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
{
if (((ch + 128) % 3) == 0)
printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
print_int_in_char (__ctype_tolower[ch < 0 ? 256 + ch : ch]);
fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
}
puts (";");
}
else
/* not implemented */;
printf ("#elif BYTE_ORDER == %s\n",
BYTE_ORDER == LITTLE_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN");
if (mb_cur_max == 1)
{
printf ("const char _nl_%s_LC_CTYPE_toupper[] = \n", locname);
for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
{
if (((ch + 128) % 3) == 0)
printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
print_int_in_char (SWAP32 (__ctype_toupper[ch < 0 ? 256 + ch : ch]));
fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
}
puts (";");
printf ("const char _nl_%s_LC_CTYPE_tolower[] = \n", locname);
for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
{
if (((ch + 128) % 3) == 0)
printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
print_int_in_char (SWAP32 (__ctype_tolower[ch < 0 ? 256 + ch : ch]));
fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
}
puts (";");
}
else
/* not implemented */;
puts ("#else\n#error \"BYTE_ORDER\" BYTE_ORDER \" not handled.\"\n#endif\n");
printf("const struct locale_data _nl_%s_LC_CTYPE = \n\
{\n\
NULL, 0, /* no file mapped */\n\
5,\n\
{\n\
_nl_C_LC_CTYPE_class,\n\
#ifdef BYTE_ORDER == LITTLE_ENDIAN\n\
NULL, NULL,\n\
#endif\n\
_nl_C_LC_CTYPE_toupper,\n\
_nl_C_LC_CTYPE_tolower,\n\
#ifdef BYTE_ORDER == BIG_ENDIAN\n\
NULL, NULL,\n\
#endif\n\
}\n\
};\n", locname);
return result;
}
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
-50
View File
@@ -1,50 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _HASH_H
#define _HASH_H
#include <obstack.h>
typedef struct hash_table
{
unsigned long size;
unsigned long filled;
void *first;
void *table;
struct obstack mem_pool;
}
hash_table;
int init_hash (hash_table *htab, unsigned long init_size);
int delete_hash(hash_table *htab);
int insert_entry (hash_table *htab, const char *key, size_t keylen,
void *data);
int find_entry (hash_table *htab, const char *key, size_t keylen,
void **result);
int iterate_table (hash_table *htab, void **ptr, void **result);
#endif /* hash.h */
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
-77
View File
@@ -1,77 +0,0 @@
%{
/* `strncmp' is used for comparison. */
#include <string.h>
/* This file defines `enum token'. */
#include "token.h"
%}
struct locale_keyword { char *name; enum token token_id; };
%%
END, TOK_END
IGNORE, TOK_IGNORE
LC_COLLATE, _NL_NUM_LC_COLLATE
LC_CTYPE, _NL_NUM_LC_CTYPE
LC_MESSAGES, _NL_NUM_LC_MESSAGES
LC_MONETARY, _NL_NUM_LC_MONETARY
LC_NUMERIC, _NL_NUM_LC_NUMERIC
LC_TIME, _NL_NUM_LC_TIME
UNDEFINED, TOK_UNDEFINED
abday, ABDAY_1
abmon, ABMON_1
alpha, TOK_ALPHA
alt_digits, ALT_DIGITS
am_pm, AM_STR
backward, TOK_BACKWARD
blank, TOK_BLANK
cntrl, TOK_CNTRL
collating_element, TOK_COLLATING_ELEMENT
collating_symbol, TOK_COLLATING_SYMBOL
comment_char, TOK_COMMENT_CHAR
copy, TOK_COPY
currency_symbol, CURRENCY_SYMBOL
d_fmt, D_FMT
d_t_fmt, D_T_FMT
day, DAY_1
decimal_point, DECIMAL_POINT
digit, TOK_DIGIT
era, ERA
era_d_fmt, ERA_D_FMT
era_year, ERA_YEAR
escape_char, TOK_ESCAPE_CHAR
forward, TOK_FORWARD
frac_digits, FRAC_DIGITS
from, TOK_FROM
graph, TOK_GRAPH
grouping, GROUPING
int_curr_symbol, INT_CURR_SYMBOL
int_frac_digits, INT_FRAC_DIGITS
lower, TOK_LOWER
mon, MON_1
mon_decimal_point, MON_DECIMAL_POINT
mon_grouping, MON_GROUPING
mon_thousands_sep, MON_THOUSANDS_SEP
n_cs_precedes, N_CS_PRECEDES
n_sep_by_space, N_SEP_BY_SPACE
n_sign_posn, N_SIGN_POSN
negative_sign, NEGATIVE_SIGN
noexpr, NOEXPR
nostr, NOSTR
order_end, TOK_ORDER_END
order_start, TOK_ORDER_START
p_cs_precedes, P_CS_PRECEDES
p_sep_by_space, P_SEP_BY_SPACE
p_sign_posn, P_SIGN_POSN
position, TOK_POSITION
positive_sign, POSITIVE_SIGN
print, TOK_PRINT
punct, TOK_PUNCT
space, TOK_SPACE
t_fmt, T_FMT
t_fmt_ampm, T_FMT_AMPM
thousands_sep, THOUSANDS_SEP
tolower, TOK_TOLOWER
toupper, TOK_TOUPPER
upper, TOK_UPPER
xdigit, TOK_XDIGIT
yesexpr, YESEXPR
yesstr, YESSTR
-180
View File
@@ -1,180 +0,0 @@
/* C code produced by gperf version 2.5 (GNU C++ version) */
/* Command-line: gperf -acCgopt -k1,2,5, keyword.gperf */
/* `strncmp' is used for comparison. */
#include <string.h>
/* This file defines `enum token'. */
#include "token.h"
struct locale_keyword { char *name; enum token token_id; };
#define TOTAL_KEYWORDS 68
#define MIN_WORD_LENGTH 3
#define MAX_WORD_LENGTH 17
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 140
/* maximum key range = 137, duplicates = 0 */
#ifdef __GNUC__
inline
#endif
static unsigned int
hash (register const char *str, register int len)
{
static const unsigned char asso_values[] =
{
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 0, 141, 65,
5, 0, 141, 30, 141, 141, 0, 141, 0, 95,
141, 141, 0, 141, 45, 10, 141, 141, 141, 141,
141, 141, 141, 141, 141, 5, 141, 10, 85, 0,
20, 0, 40, 35, 30, 10, 141, 0, 30, 15,
15, 0, 0, 141, 55, 0, 0, 80, 141, 15,
10, 0, 141, 141, 141, 141, 141, 141,
};
register int hval = len;
switch (hval)
{
default:
case 5:
hval += asso_values[str[4]];
case 4:
case 3:
case 2:
hval += asso_values[str[1]];
case 1:
hval += asso_values[str[0]];
}
return hval;
}
#ifdef __GNUC__
inline
#endif
const struct locale_keyword *
in_word_set (register const char *str, register int len)
{
static const struct locale_keyword wordlist[] =
{
{"",}, {"",}, {"",}, {"",},
{"copy", TOK_COPY},
{"space", TOK_SPACE},
{"yesstr", YESSTR},
{"toupper", TOK_TOUPPER},
{"position", TOK_POSITION},
{"",},
{"t_fmt", T_FMT},
{"escape_char", TOK_ESCAPE_CHAR},
{"comment_char", TOK_COMMENT_CHAR},
{"positive_sign", POSITIVE_SIGN},
{"",},
{"t_fmt_ampm", T_FMT_AMPM},
{"",},
{"yesexpr", YESEXPR},
{"mon", MON_1},
{"p_sep_by_space", P_SEP_BY_SPACE},
{"LC_NUMERIC", _NL_NUM_LC_NUMERIC},
{"noexpr", NOEXPR},
{"tolower", TOK_TOLOWER},
{"p_cs_precedes", P_CS_PRECEDES},
{"UNDEFINED", TOK_UNDEFINED},
{"",},
{"collating_symbol", TOK_COLLATING_SYMBOL},
{"collating_element", TOK_COLLATING_ELEMENT},
{"negative_sign", NEGATIVE_SIGN},
{"",},
{"d_fmt", D_FMT},
{"",},
{"mon_thousands_sep", MON_THOUSANDS_SEP},
{"day", DAY_1},
{"n_sep_by_space", N_SEP_BY_SPACE},
{"digit", TOK_DIGIT},
{"IGNORE", TOK_IGNORE},
{"LC_TIME", _NL_NUM_LC_TIME},
{"n_cs_precedes", N_CS_PRECEDES},
{"",},
{"int_curr_symbol", INT_CURR_SYMBOL},
{"",}, {"",},
{"thousands_sep", THOUSANDS_SEP},
{"",},
{"am_pm", AM_STR},
{"xdigit", TOK_XDIGIT},
{"",},
{"decimal_point", DECIMAL_POINT},
{"",},
{"cntrl", TOK_CNTRL},
{"p_sign_posn", P_SIGN_POSN},
{"mon_decimal_point", MON_DECIMAL_POINT},
{"LC_CTYPE", _NL_NUM_LC_CTYPE},
{"",},
{"alpha", TOK_ALPHA},
{"",},
{"forward", TOK_FORWARD},
{"era", ERA},
{"",},
{"print", TOK_PRINT},
{"",},
{"mon_grouping", MON_GROUPING},
{"era_year", ERA_YEAR},
{"",}, {"",},
{"n_sign_posn", N_SIGN_POSN},
{"",},
{"END", TOK_END},
{"",},
{"alt_digits", ALT_DIGITS},
{"",},
{"d_t_fmt", D_T_FMT},
{"",}, {"",},
{"nostr", NOSTR},
{"LC_MESSAGES", _NL_NUM_LC_MESSAGES},
{"",}, {"",}, {"",},
{"int_frac_digits", INT_FRAC_DIGITS},
{"",}, {"",}, {"",},
{"era_d_fmt", ERA_D_FMT},
{"punct", TOK_PUNCT},
{"",}, {"",}, {"",}, {"",},
{"lower", TOK_LOWER},
{"",}, {"",}, {"",}, {"",},
{"currency_symbol", CURRENCY_SYMBOL},
{"",}, {"",},
{"grouping", GROUPING},
{"from", TOK_FROM},
{"abday", ABDAY_1},
{"",}, {"",}, {"",}, {"",},
{"LC_COLLATE", _NL_NUM_LC_COLLATE},
{"LC_MONETARY", _NL_NUM_LC_MONETARY},
{"",}, {"",}, {"",}, {"",},
{"frac_digits", FRAC_DIGITS},
{"",}, {"",}, {"",},
{"abmon", ABMON_1},
{"",}, {"",},
{"backward", TOK_BACKWARD},
{"order_end", TOK_ORDER_END},
{"blank", TOK_BLANK},
{"order_start", TOK_ORDER_START},
{"",}, {"",}, {"",},
{"graph", TOK_GRAPH},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",},
{"upper", TOK_UPPER},
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (*s == *str && !strncmp (str + 1, s + 1, len - 1))
return &wordlist[key];
}
}
return 0;
}
+25 -4
View File
@@ -1,5 +1,5 @@
/* nl_langinfo -- Access to locale-dependent parameters.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,9 +98,25 @@ typedef enum
ERA_YEAR, /* Year in alternate era format. */
ERA_D_FMT, /* Date in alternate era format. */
ALT_DIGITS, /* Alternate symbols for digits. */
ERA_D_T_FMT, /* Date and time in alternate era format. */
ERA_T_FMT, /* Time in alternate era format. */
_NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
/* LC_COLLATE category: text sorting.
This information is accessed by the strcoll and strxfrm functions.
These `nl_langinfo' names are used only internally. */
_NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
_NL_COLLATE_RULES,
_NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS,
_NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL,
_NL_COLLATE_UNDEFINED,
_NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL,
_NL_NUM_LC_COLLATE,
/* LC_CTYPE category: character classification.
This information is accessed by the functions in <ctype.h>.
These `nl_langinfo' names are used only internally. */
@@ -109,6 +125,14 @@ typedef enum
_NL_CTYPE_TOLOWER_EB,
_NL_CTYPE_TOUPPER_EL,
_NL_CTYPE_TOLOWER_EL,
_NL_CTYPE_CLASS32,
_NL_CTYPE_NAMES_EB,
_NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE,
_NL_CTYPE_HASH_LAYERS,
_NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES,
_NL_CTYPE_WIDTH,
_NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities.
@@ -144,9 +168,6 @@ typedef enum
NOSTR, /* Output string for ``no''. */
_NL_NUM_LC_MESSAGES,
/* Stubs for unfinished categories. */
_NL_NUM_LC_COLLATE = _NL_ITEM (LC_COLLATE, 0),
/* This marks the highest value used. */
_NL_NUM
} nl_item;
+28 -3
View File
@@ -1,5 +1,5 @@
/* Define current locale data for LC_COLLATE category.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,9 +14,34 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "localeinfo.h"
#include <endian.h>
_NL_CURRENT_DEFINE (LC_COLLATE);
const u32_t *__collate_table;
const u32_t *__collate_extra;
void
_nl_postload_collate (void)
{
#if BYTE_ORDER == BIG_ENDIAN
#define bo(x) x##_EB
#elif BYTE_ORDER == LITTLE_ENDIAN
#define bo(x) x##_EL
#else
#error bizarre byte order
#endif
#define paste(a,b) paste1(a,b)
#define paste1(a,b) a##b
#define current(x) \
((const unsigned int *) _NL_CURRENT (LC_COLLATE, paste(_NL_COLLATE_,x)))
__collate_table = current (bo (TABLE));
__collate_extra = current (bo (EXTRA));
}
+4 -1
View File
@@ -1,5 +1,5 @@
/* Define current locale data for LC_CTYPE category.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,7 +47,10 @@ _nl_postload_ctype (void)
((const unsigned int *) _NL_CURRENT (LC_CTYPE, paste(_NL_CTYPE_,x)) \
+ 128)
extern const unsigned int *__ctype_names;
__ctype_b = current (unsigned short, CLASS);
__ctype_toupper = current (, bo (TOUPPER));
__ctype_tolower = current (, bo (TOLOWER));
__ctype_names = current (unsigned, bo (NAMES));
}
+28 -6
View File
@@ -1,5 +1,5 @@
/* Functions to read locale data files.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,12 +28,31 @@ Cambridge, MA 02139, USA. */
#include "localeinfo.h"
const size_t _nl_category_num_items[] =
{
{
#define DEFINE_CATEGORY(category, category_name, items, a, b, c, d) \
[category] = _NL_ITEM_INDEX (_NL_NUM_##category),
[category] = _NL_ITEM_INDEX (_NL_NUM_##category),
#include "categories.def"
#undef DEFINE_CATEGORY
};
};
#define NO_PAREN(arg, rest...) arg, ##rest
#define DEFINE_CATEGORY(category, category_name, items, a, b, c, d) \
static const enum value_type _nl_value_type_##category[] = { NO_PAREN items };
#define DEFINE_ELEMENT(element, element_name, optstd, type, rest...) \
[_NL_ITEM_INDEX (element)] = type,
#include "categories.def"
#undef DEFINE_CATEGORY
static const enum value_type *_nl_value_types[] =
{
#define DEFINE_CATEGORY(category, category_name, items, a, b, c, d) \
[category] = _nl_value_type_##category,
#include "categories.def"
#undef DEFINE_CATEGORY
};
struct locale_data *
_nl_load_locale (int category, char **name)
@@ -178,7 +197,7 @@ _nl_load_locale (int category, char **name)
}
newdata = malloc (sizeof *newdata +
W (filedata->nstrings) * sizeof (char *));
W (filedata->nstrings) * sizeof (union locale_data_value));
if (! newdata)
goto puntmap;
@@ -194,7 +213,10 @@ _nl_load_locale (int category, char **name)
errno = EINVAL;
goto puntmap;
}
newdata->strings[i] = newdata->filedata + idx;
if (_nl_value_types[category][i] == word)
newdata->values[i].word = W (*((u32_t *) (newdata->filedata + idx)));
else
newdata->values[i].string = newdata->filedata + idx;
}
__close (fd);
-821
View File
@@ -1,821 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <alloca.h>
#include <fcntl.h>
#include <libintl.h>
#include <locale.h>
#include <localeinfo.h>
#include <langinfo.h>
#include <string.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/uio.h>
#include "localedef.h"
#include "token.h"
/* Arrays representing ctype tables. They must be initialized for the
right size to hold the full charmap. */
static u16 *ctype_b;
static i32 *names_b, *toupper_b, *tolower_b;
/* For accessing the element of the (possibly sparse) array we use this
macro. */
#define ELEM(arr, idx) \
(arr)[({ int h = idx % charmap_data.hash_size; \
int n = 0; \
while (n < charmap_data.hash_layers \
&& names_b[n * charmap_data.hash_size + h] != idx) \
++n; \
if (n >= charmap_data.hash_layers) \
error (6, 0, gettext ("internal error in %s, line %u"), \
__FUNCTION__, __LINE__); \
n * charmap_data.hash_size + h; })]
/* The bit used for representing a special class. */
#define BITPOS(class) ((class) - TOK_UPPER)
#define BIT(class) (1 << BITPOS (class))
/* Remember which class or conversion is already done. */
static unsigned short class_done = 0;
static unsigned short toupper_done = 0;
static unsigned short tolower_done = 0;
#define SYNTAX_ERROR \
error (0, 0, gettext ("%s:%Zd: syntax error in locale definition file"), \
locfile_data.filename, locfile_data.line_no);
/* Prototypes for local functions. */
static void allocate_arrays (void);
static void set_class_defaults (void);
static int valid_char (int ch);
/* Read CTYPE category. The initial token is given as a parameter. */
void
ctype_input (int token)
{
char *ptr;
int len;
/* If necessary allocate arrays. */
allocate_arrays ();
while (token != TOK_END)
{
switch (token)
{
case TOK_UPPER: case TOK_LOWER: case TOK_ALPHA: case TOK_DIGIT:
case TOK_XDIGIT: case TOK_SPACE: case TOK_PRINT: case TOK_GRAPH:
case TOK_BLANK: case TOK_CNTRL: case TOK_PUNCT:
{
/* TAKE CARE: the order of the tokens in "token.h" determines
the bit used to indicate the membership in the class. This
also has to correspond to the values used in <ctype.h>. */
int bit = BIT (token);
int was_ell = 0;
int last = -1;
if ((class_done & bit) != 0)
{
char tmp[len + 1];
memcpy (tmp, ptr, len);
tmp[len] = '\0';
error (0, 0, gettext ("%s:%Zd: duplicate definiton of item "
"`%s' in category `LC_CTYPE'"),
locfile_data.filename, locfile_data.line_no, tmp);
}
class_done |= bit;
do
{
token = xlocfile_lex (&ptr, &len);
if (token == TOK_ENDOFLINE)
{
SYNTAX_ERROR;
break;
}
if (token == TOK_ELLIPSIS)
{
if (was_ell != 0 || last < 0)
{
error (0, 0, gettext ("%s:%Zd: illegal use of `...'"),
locfile_data.filename, locfile_data.line_no);
break;
}
was_ell = 1;
continue;
}
if (token != TOK_CHAR)
{
if (token != TOK_ILL_CHAR)
SYNTAX_ERROR;
was_ell = 0;
last = -1;
continue;
}
if (len < 0 || !valid_char (len))
{
was_ell = 0;
last = -1;
continue;
}
/* We have found a valid character. Include it to
the class' bit set. */
if (was_ell == 0)
{
ELEM (ctype_b, len) |= bit;
last = len;
}
else
{
int i;
if (last > len)
{
error (0, 0, gettext ("%s:%Zd: lower bound of "
"ellipsis not smaller"),
locfile_data.filename, locfile_data.line_no);
was_ell = 0;
last = -1;
continue;
}
for (i = last + 1; i <= len; ++i)
ELEM (ctype_b, i) |= bit;
last = -1;
}
was_ell = 0;
}
while ((token = locfile_lex (&ptr, &len)) == TOK_CHAR
&& len == ';');
/* Rest of the line should be empty. */
ignore_to_eol (token, 0);
}
break;
case TOK_TOUPPER: case TOK_TOLOWER:
{
int from;
int to = -1;
int is_upper = token == TOK_TOUPPER;
if (((is_upper ? toupper_done : tolower_done) & BIT (token)) != 0)
error (0, 0, gettext ("%s:%Zd: duplicate definition of item "
"`%s' in category `LC_CTYPE'"),
locfile_data.filename, locfile_data.line_no,
is_upper ? "toupper" : "tolower");
(is_upper ? toupper_done : tolower_done) |= BIT (token);
do
{
int ignore;
token = xlocfile_lex (&ptr, &len);
if (token != TOK_CHAR || len != '(')
{
SYNTAX_ERROR;
break;
}
token = xlocfile_lex (&ptr, &len);
if (token != TOK_CHAR && token != TOK_ILL_CHAR)
{
SYNTAX_ERROR;
break;
}
from = len;
ignore = token == TOK_ILL_CHAR;
token = xlocfile_lex (&ptr, &len);
if (token != TOK_CHAR || len != ',')
{
SYNTAX_ERROR;
break;
}
token = xlocfile_lex (&ptr, &len);
if (token != TOK_CHAR && token != TOK_ILL_CHAR)
{
SYNTAX_ERROR;
break;
}
to = len;
ignore |= token == TOK_ILL_CHAR;
token = xlocfile_lex (&ptr, &len);
if (token != TOK_CHAR || len != ')')
{
SYNTAX_ERROR;
break;
}
if (!ignore && valid_char (from) && valid_char (to))
/* Have a valid pair. */
ELEM (is_upper ? toupper_b : tolower_b, from) = to;
}
while ((token = locfile_lex (&ptr, &len)) == TOK_CHAR
&& len == ';');
/* Rest of the line should be empty. */
ignore_to_eol (token, 1);
}
break;
default:
SYNTAX_ERROR;
ignore_to_eol (0, 0);
break;
}
/* Read next token. */
token = xlocfile_lex (&ptr, &len);
}
token = xlocfile_lex (&ptr, &len);
if (token != _NL_NUM_LC_CTYPE)
{
error (0, 0, gettext ("%s:%Zd: category `%s' does not end with "
"`END %s'"), locfile_data.filename,
locfile_data.line_no, "LC_CTYPE", "LC_CTYPE");
ignore_to_eol (0, 0);
}
else
ignore_to_eol (0, posix_conformance);
}
void
ctype_check(void)
{
/* Here are a lot of things to check. See POSIX.2, table 2-6. */
#define NCLASS 11
static const struct
{
const char *name;
const char allow[NCLASS];
}
valid_table[NCLASS] =
{
/* The order is important. See token.h for more information.
M = Always, D = Default, - = Permitted, X = Mutually exclusive */
[BITPOS (TOK_UPPER)] = { "upper", "--MX-XDDXXX" },
[BITPOS (TOK_LOWER)] = { "lower", "--MX-XDDXXX" },
[BITPOS (TOK_ALPHA)] = { "alpha", "---X-XDDXXX" },
[BITPOS (TOK_DIGIT)] = { "digit", "XXX--XDDXXX" },
[BITPOS (TOK_XDIGIT)] = { "xdigit", "-----XDDXXX" },
[BITPOS (TOK_SPACE)] = { "space", "XXXXX------" },
[BITPOS (TOK_PRINT)] = { "print", "---------X-" },
[BITPOS (TOK_GRAPH)] = { "graph", "---------X-" },
[BITPOS (TOK_BLANK)] = { "blank", "XXXXXM-----" },
[BITPOS (TOK_CNTRL)] = { "cntrl", "XXXXX-XX--X" },
[BITPOS (TOK_PUNCT)] = { "punct", "XXXXX-DD-X-" }
};
int ch, cls1, cls2, eq, space_char;
u16 tmp;
/* Set default value for classes not specified. */
set_class_defaults ();
/* Check according to table. */
for (ch = 0; ch < charmap_data.hash_size * charmap_data.hash_layers; ++ch)
{
if (ch != 0 && names_b[ch] == 0)
continue;
tmp = ELEM (ctype_b, names_b[ch]);
for (cls1 = 0; cls1 < NCLASS; ++cls1)
if ((tmp & (1 << cls1)) != 0)
for (cls2 = 0; cls2 < NCLASS; ++cls2)
if (cls2 != cls1 && valid_table[cls1].allow[cls2] != '-')
{
eq = (tmp & (1 << cls2)) != 0;
switch (valid_table[cls1].allow[cls2])
{
case 'M':
if (!eq)
error (0, 0, gettext ("character '\\%o' in class `%s' "
"must be in class `%s'"), ch,
valid_table[cls1].name, valid_table[cls2].name);
break;
case 'X':
if (eq)
error (0, 0, gettext ("character '\\%o' inc class `%s' "
"must not be in class `%s'"), ch,
valid_table[cls1].name, valid_table[cls2].name);
break;
case 'D':
ELEM (ctype_b, names_b[ch]) |= 1 << cls2;
break;
default:
error (5, 0, gettext ("internal error in %s, line %u"),
__FUNCTION__, __LINE__);
}
}
}
/* ... and now test <SP> as a special case. */
if (find_entry (&charmap_data.table, "SP", 2, (void **) &space_char) == 0)
error (0, 0, gettext ("character <SP> not defined in character map"));
else if ((tmp = BITPOS (TOK_SPACE),
(ELEM (ctype_b, space_char) & BIT (TOK_SPACE)) == 0)
|| (tmp = BITPOS (TOK_BLANK),
(ELEM (ctype_b, space_char) & BIT (TOK_BLANK)) == 0))
error (0, 0, gettext ("<SP> character not in class `%s'"),
valid_table[tmp].name);
else if ((tmp = BITPOS (TOK_PUNCT),
(ELEM (ctype_b, space_char) & BIT (TOK_PUNCT)) != 0)
|| (tmp = BITPOS (TOK_GRAPH),
(ELEM (ctype_b, space_char) & BIT (TOK_GRAPH)) != 0))
error (0, 0, gettext ("<SP> character must not be in class `%s'"),
valid_table[tmp].name);
else
ELEM (ctype_b, space_char) |= BIT (TOK_PRINT);
}
/* These macros can change little to big endian and vice versa. */
#define SWAP16(v) \
((u16) (((((unsigned short) (v)) & 0x00ff) << 8) \
| ((((unsigned short) (v)) & 0xff00) >> 8)))
#define SWAP32(v) \
((u32) (((((u32) (v)) & 0x000000ff) << 24) \
| ((((u32) (v)) & 0x0000ff00) << 8) \
| ((((u32) (v)) & 0x00ff0000) >> 8) \
| ((((u32) (v)) & 0xff000000) >> 24)))
int
ctype_output (void)
{
char *path, *t;
int ch;
/* File descriptor for output file. */
int fd;
/* Magic number. */
i32 magic = LIMAGIC (LC_CTYPE);
/* Number of table. */
int tables = 6;
/* Number ints in leading information table. */
#if 0
i32 n = 2 + 2 * tables;
#else
i32 n = 5;
#endif
/* Values describing the character set. */
char mb_cur_min = (char) charmap_data.mb_cur_min;
char mb_cur_max = (char) charmap_data.mb_cur_max;
/* Optimal size of hashing table. */
i32 hash_size = charmap_data.hash_size;
i32 hash_layers = charmap_data.hash_layers;
/* Number of elements in the tables. */
int size = hash_size * charmap_data.hash_layers;
/* Positions of the tables. */
i32 pos[14] =
{
/* No, no. We don't play towers of Hanoi. This is a more or less
readable table of the offsets of the different strings in the
produced file. It is seperated in three columns which represent
the number of values with 1, 2, and 4 bytes. */
#if 0
4 * (2 + n),
1 + 4 * (2 + n),
2 + 4 * (2 + n),
2 + 4 * (3 + n),
2 + 4 * (4 + n),
2 + 2 * (128 + size) + 4 * (4 + n),
2 + 2 * (128 + size) + 4 * ((4 + n) + (size + 128)),
2 + 2 * (128 + size) + 4 * ((4 + n) + 2 * (size + 128)),
2 + 2 * (128 + size) + 4 * ((4 + n) + 2 * (size + 128) + 1 * size),
2 + 2 * (128 + size) + 4 * ((5 + n) + 2 * (size + 128) + 1 * size),
2 + 2 * (128 + size) + 4 * ((6 + n) + 2 * (size + 128) + 1 * size),
2 + 2 * (2 * (128 + size)) + 4 * ((6 + n) + 2 * (size + 128) + 1 * size),
2 + 2 * (2 * (128 + size)) + 4 * ((6 + n) + 3 * (size + 128) + 1 * size),
2 + 2 * (2 * (128 + size)) + 4 * ((6 + n) + 4 * (size + 128) + 1 * size),
#else
4 * (2 + n),
2 * (128 + size) + 4 * (2 + n),
2 * (128 + size) + 4 * ((2 + n) + (size + 128)),
2 * (128 + size) + 4 * ((2 + n) + 2 * (size + 128)),
2 * (128 + size) + 4 * ((2 + n) + 3 * (size + 128)),
#endif
};
/* Parameter to writev. */
struct iovec iov[11] =
{
{ &magic, sizeof (i32) },
{ &n, sizeof (i32) },
#if 0
{ pos, sizeof (pos) },
{ &mb_cur_min, 1 },
{ &mb_cur_max, 1 },
{ &hash_size, sizeof (i32) },
{ &hash_layers, sizeof (i32) },
#else
{ pos, 5 * 4 },
#endif
{ ctype_b - 128, (size + 128) * sizeof (u16) },
{ toupper_b - 128, (size + 128) * sizeof (i32) },
{ tolower_b - 128, (size + 128) * sizeof (i32) },
{ names_b, size * sizeof (i32) }
};
int result = 0;
/* Now we can bring the representations into the right form. */
for (ch = -128; ch < -1; ++ch)
{
ctype_b[ch] = ctype_b[256 + ch];
toupper_b[ch] = toupper_b[256 + ch];
tolower_b[ch] = tolower_b[256 + ch];
}
/* Set value for EOF. */
ctype_b[-1] = 0;
toupper_b[-1] = -1;
tolower_b[-1] = -1;
for (ch = -128; ch < size; ++ch)
ctype_b[ch] = htons (ctype_b[ch]);
/* Construct the output filename from the argument given to
localedef on the command line. */
path = (char *) alloca (strlen (output_path) +
strlen (category[LC_CTYPE].name) + 1);
t = stpcpy (path, output_path);
strcpy (t, category[LC_CTYPE].name);
fd = creat (path, 0666);
if (fd == -1)
{
error (0, 0, gettext ("cannot open output file `%s': %m"), path);
result = 1;
}
else
{
int idx;
#if 0
if (writev (fd, iov, 10) == -1)
#else
if (writev (fd, iov, 6) == -1)
#endif
{
error (0, 0, gettext ("cannot write output file `%s': %m"), path);
result = 1;
goto close_and_return;
}
/* Now we have to write the three tables with different endianess. */
hash_size = SWAP32 (hash_size);
for (idx = -128; idx < size; ++idx)
{
ctype_b[idx] = SWAP16 (ctype_b[idx]);
toupper_b[idx] = SWAP32 (toupper_b[idx]);
tolower_b[idx] = SWAP32 (tolower_b[idx]);
if (idx >= 0)
names_b[idx] = SWAP32 (names_b[idx]);
}
#if 0
if (writev (fd, iov + 5, 6) == -1)
#else
if (writev (fd, iov + 3, 2) == -1)
#endif
{
error (0, 0, gettext ("cannot write output file `%s': %m"), path);
result = 1;
}
close_and_return:
close (fd);
}
return result;
}
/* If necessary allocate the memory for the arrays according to the
current character map. */
static void
allocate_arrays (void)
{
/* Init ctype data structures. */
if (ctype_b == NULL)
/* All data structures are not initialized yet. */
{
/* You wonder about this amount of memory? This is only because
some users do not manage to address the array with unsigned
values or data types with range >= 256. '\200' would result
in the array index -128. To help these poor people we
duplicate the entries for 128 upto 255 below the entry for \0. */
int ch, h, n;
char *ptr;
int size = charmap_data.hash_size * charmap_data.hash_layers;
ctype_b = xmalloc ((size - (-128)) * sizeof (u16));
bzero (ctype_b, (size - (-128)) * sizeof (u16));
ctype_b += 128;
names_b = xmalloc (size * sizeof (i32));
bzero (names_b, size * sizeof (i32));
toupper_b = xmalloc ((size - (-128)) * sizeof (i32));
bzero (toupper_b, (size - (-128)) * sizeof (i32));
toupper_b += 128;
tolower_b = xmalloc ((size - (-128)) * sizeof (i32));
bzero (tolower_b, (size - (-128)) * sizeof (i32));
tolower_b += 128;
ptr = NULL;
/* Mark the place of the NUL character as occupied. */
names_b[0] = 1;
while (iterate_table (&charmap_data.table, (void **) &ptr,
(void **) &ch))
{
/* We already handled the NUL character. */
if (ch == 0)
continue;
h = ch % charmap_data.hash_size;
n = 0;
while (names_b[h + n * charmap_data.hash_size] != 0)
++n;
names_b[h + n * charmap_data.hash_size] = ch;
toupper_b[h + n * charmap_data.hash_size] = ch;
tolower_b[h + n * charmap_data.hash_size] = ch;
}
/* Correct the value for NUL character. */
names_b[0] = 0;
}
}
static void
set_class_defaults (void)
{
/* These function defines the default values for the classes and conversions
according to POSIX.2 2.5.2.1.
It may seem that the order of these if-blocks is arbitrary but it is NOT.
Don't move them unless you know what you do! */
void set_default (int bit, int from, int to)
{
char tmp[4];
int ch;
/* Define string. */
strcpy (tmp, "<?>");
for (ch = from; ch <= to; ++ch)
{
int code;
tmp[1] = ch;
code = find_char (tmp + 1, 1);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed "
"as default value"), tmp);
ELEM (ctype_b, code) |= bit;
}
}
/* If necessary allocate arrays. */
allocate_arrays ();
/* Set default values if keyword was not present. */
if ((class_done & BIT (TOK_UPPER)) == 0)
/* "If this keyword [lower] is not specified, the lowercase letters
`A' through `Z', ..., shall automatically belong to this class,
with implementation defined character values." */
set_default (BIT (TOK_UPPER), 'A', 'Z');
if ((class_done & BIT (TOK_LOWER)) == 0)
/* "If this keyword [lower] is not specified, the lowercase letters
`a' through `z', ..., shall automatically belong to this class,
with implementation defined character values." */
set_default (BIT (TOK_LOWER), 'a', 'z');
if ((class_done & BIT (TOK_DIGIT)) == 0)
/* "If this keyword [digit] is not specified, the digits `0' through
`9', ..., shall automatically belong to this class, with
implementation-defined character values." */
set_default (BIT (TOK_DIGIT), '0', '9');
if ((class_done & BIT (TOK_SPACE)) == 0)
/* "If this keyword [space] is not specified, the characters <space>,
<form-feed>, <newline>, <carriage-return>, <tab>, and
<vertical-tab>, ..., shall automatically belong to this class,
with implementtation-defined character values." */
{
int code;
code = find_char ("space", 5);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<space>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
code = find_char ("form-feed", 9);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<form-feed>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
code = find_char ("newline", 7);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<newline>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
code = find_char ("carriage-return", 15);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<carriage-return>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
code = find_char ("tab", 3);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<tab>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
code = find_char ("vertical-tab", 11);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<vertical-tab>");
ELEM (ctype_b, code) |= BIT (TOK_SPACE);
}
if ((class_done & BIT (TOK_XDIGIT)) == 0)
/* "If this keyword is not specified, the digits `0' to `9', the
uppercase letters `A' through `F', and the lowercase letters `a'
through `f', ..., shell automatically belong to this class, with
implementation defined character values." */
{
if ((class_done & BIT (TOK_XDIGIT)) == 0)
set_default (BIT (TOK_XDIGIT), '0', '9');
if ((class_done & BIT (TOK_XDIGIT)) == 0)
set_default (BIT (TOK_XDIGIT), 'A', 'F');
if ((class_done & BIT (TOK_XDIGIT)) == 0)
set_default (BIT (TOK_XDIGIT), 'a', 'f');
}
if ((class_done & BIT (TOK_BLANK)) == 0)
/* "If this keyword [blank] is unspecified, the characters <space> and
<tab> shall belong to this character class." */
{
int code;
code = find_char ("space", 5);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<space>");
ELEM (ctype_b, code) |= BIT (TOK_BLANK);
code = find_char ("tab", 3);
if (code == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<tab>");
ELEM (ctype_b, code) |= BIT (TOK_BLANK);
}
if ((class_done & BIT (TOK_GRAPH)) == 0)
/* "If this keyword [graph] is not specified, characters specified for
the keywords `upper', `lower', `alpha', `digit', `xdigit' and `punct',
shall belong to this character class." */
{
int ch;
unsigned short int mask = BIT (TOK_UPPER) | BIT (TOK_LOWER) |
BIT (TOK_ALPHA) | BIT (TOK_DIGIT) | BIT (TOK_XDIGIT) | BIT (TOK_PUNCT);
for (ch = 0; ch < charmap_data.hash_size * charmap_data.hash_layers;
++ch)
{
if (ch != 0 && names_b[ch] == 0)
continue;
if ((ELEM (ctype_b, names_b[ch]) & mask) != 0)
ELEM (ctype_b, names_b[ch]) |= BIT (TOK_GRAPH);
}
}
if ((class_done & BIT (TOK_PRINT)) == 0)
/* "If this keyword [print] is not provided, characters specified for
the keywords `upper', `lower', `alpha', `digit', `xdigit', `punct',
and the <space> character shall belong to this character class." */
{
int ch;
int space = find_char ("space", 5);
unsigned short int mask = BIT (TOK_UPPER) | BIT (TOK_LOWER) |
BIT (TOK_ALPHA) | BIT (TOK_DIGIT) | BIT (TOK_XDIGIT) | BIT (TOK_PUNCT);
if (space == -1)
error (5, 0, gettext ("character `%s' not defined while needed as "
"default value"), "<space>");
for (ch = 0; ch < charmap_data.hash_size * charmap_data.hash_layers;
++ch)
{
if (ch != 0 && names_b[ch] == 0)
continue;
if ((ELEM (ctype_b, names_b[ch]) & mask) != 0)
ELEM (ctype_b, names_b[ch]) |= BIT (TOK_PRINT);
}
ELEM (ctype_b, space) |= BIT (TOK_PRINT);
}
if (toupper_done == 0)
/* "If this keyword [toupper] is not spcified, the lowercase letters
`a' through `z', and their corresponding uppercase letters `A' to
`Z', ..., shall automatically be included, with implementation-
defined character values." */
{
char tmp[4];
int ch;
strcpy (tmp, "<?>");
for (ch = 'a'; ch <= 'z'; ++ch)
{
int code_to, code_from;
tmp[1] = ch;
code_from = find_char (tmp + 1, 1);
if (code_from == -1)
error (5, 0, gettext ("character `%s' not defined while needed "
"as default value"), tmp);
/* This conversion is implementation defined. */
tmp[1] = ch + ('A' - 'a');
code_to = find_char (tmp + 1, 1);
if (code_to == -1)
error (5, 0, gettext ("character `%s' not defined while needed "
"as default value"), tmp);
ELEM (toupper_b, code_from) = code_to;
}
}
if (tolower_done == 0)
/* "If this keyword [tolower] is not specified, the mapping shall be
the reverse mapping of the one specified to `toupper'." */
{
int ch;
for (ch = 0; ch < charmap_data.hash_size * charmap_data.hash_layers;
++ch)
{
if (ch != 0 && names_b[ch] == 0)
continue;
if (toupper_b[ch] != names_b[ch])
ELEM (tolower_b, toupper_b[ch]) = names_b[ch];
}
}
}
/* Test whether the given character is valid for the current charmap. */
static int
valid_char (int ch)
{
/* FIXME: this assumes 32-bit integers. */
int ok = ch >= 0
&& (charmap_data.mb_cur_max < 4
? ch < 1 << (8 * charmap_data.mb_cur_max) : 1);
return ok;
}
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
+8 -8
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -29,12 +29,12 @@ __BEGIN_DECLS
/* These are the possibilities for the first argument to setlocale.
The code assumes that LC_ALL is the highest value, and zero the lowest. */
#define LC_COLLATE 0
#define LC_CTYPE 1
#define LC_MONETARY 2
#define LC_NUMERIC 3
#define LC_TIME 4
#define LC_MESSAGES 5
#define LC_CTYPE 0
#define LC_NUMERIC 1
#define LC_TIME 2
#define LC_COLLATE 3
#define LC_MONETARY 4
#define LC_MESSAGES 5
#define LC_ALL 6
-259
View File
@@ -1,259 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <getopt.h>
#include <libintl.h>
#include <locale.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include "error.h"
#include "localedef.h"
/* The charmap file used. If none given DEFAULT_CHARMAP is used. */
static char *charmap_file;
/* If set output is always written, even when warning are given. */
static int force_output;
/* The input file name. */
static char *input_file;
/* Path leading to the destination directory for the produced files. */
char *output_path;
/* If this is defined be POSIX conform. */
int posix_conformance;
/* If not zero give a lot more messages. */
int verbose;
/* Long options. */
static const struct option long_options[] =
{
{ "charmap", required_argument, NULL, 'f' },
{ "debug", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "force", no_argument, NULL, 'c' },
{ "inputfile", required_argument, NULL, 'i' },
{ "posix", no_argument, &posix_conformance, 1 },
{ "verbose", no_argument, &verbose, 1},
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
/* Prototypes for local functions. */
static void usage (int status) __attribute__ ((noreturn));
static int construct_output_path (const char *path);
int
main(int argc, char *argv[])
{
int optchar;
int cannot_write;
int do_help = 0;
int do_version = 0;
/* Set initial values for global varaibles. */
charmap_file = NULL;
force_output = 0;
input_file = 0;
posix_conformance = getenv ("POSIXLY_CORRECT") != NULL;
verbose = 0;
/* Set locale. Do not set LC_ALL because the other categories must
not be affected (acccording to POSIX.2). */
setlocale (LC_MESSAGES, "");
setlocale (LC_CTYPE, "");
/* Initialize the message catalog. */
textdomain (PACKAGE);
while ((optchar = getopt_long (argc, argv, "cdf:hi:vV", long_options, NULL))
!= EOF)
switch (optchar)
{
case '\0':
break;
case 'c':
force_output = 1;
break;
case 'f':
if (charmap_file != NULL)
error (0, 0, gettext ("\"%s %s\" overwrites old option \"%s\""),
"-f", optarg, charmap_file);
charmap_file = optarg;
break;
case 'h':
do_help = 1;
break;
case 'i':
if (input_file != NULL)
error (0, 0, gettext ("\"%s %s\" overwrites old option \"%s\""),
"-i", optarg, input_file);
input_file = optarg;
break;
case 'v':
verbose = 1;
break;
case 'V':
do_version = 1;
break;
default:
usage (4);
break;
}
/* POSIX.2 requires to be verbose about missing characters in the
character map. */
verbose |= posix_conformance;
/* Version information is requested. */
if (do_version)
{
fprintf (stderr, "GNU %s %s\n", PACKAGE, VERSION);
exit (EXIT_SUCCESS);
}
/* Help is requested. */
if (do_help)
usage (0);
if (argc - optind != 1)
/* We need exactly one non-option parameter. */
usage (4);
/* The parameter describes the output path of the constructed files.
If the files cannot be written return a non-zero value. */
cannot_write = construct_output_path (argv[optind]);
/* Now that the parameters are processed we have to reset the local
ctype locale. (POSIX.2 4.35.5.2) */
setlocale (LC_CTYPE, "POSIX");
/* Look whether the system really allows locale definitions. */
if (sysconf (_SC_2_LOCALEDEF) < 0)
error (3, 0,
gettext ("warning: system does not define `_POSIX2_LOCALEDEF'"));
/* Process charmap file. */
charmap_read (charmap_file);
/* Now read the locale file. */
locfile_read (input_file);
/* Check all categories for consistency. */
categories_check ();
/* We are now able to write the data files. If warning were given we
do it only if it is explicitly requested (--force). */
if (error_message_count == 0 || force_output != 0)
if (cannot_write != 0)
error (0, 0, gettext ("cannot write output file `%s': %s"),
output_path, strerror (cannot_write));
else
categories_write ();
else
error (0, 0,
gettext ("no output file produced because warning were issued"));
exit (EXIT_SUCCESS);
}
/* Display usage information and exit. */
static void
usage(int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, gettext ("Try `%s --help' for more information.\n"),
program_invocation_name);
else
printf(gettext ("\
Usage: %s [OPTION]... name\n\
Mandatory arguments to long options are mandatory for short options too.\n\
-c, --force create output even if warning messages have been issued\n\
-h, --help display this help and exit\n\
-V, --version output version information and exit\n\
\n\
-i, --inputfile=FILE source definitions are found in FILE\n\
-f, --charmap=FILE symbolic character names defined in FILE\n\
\n\
-v, --verbose print more messages\n\
--posix be strictly POSIX conform\n\
\n\
System's directory for character maps: %s\n\
locale files : %s\n\
"), program_invocation_name, CHARMAP_PATH, LOCALE_PATH);
exit (status);
}
/* The parameter to localedef describes the output path. If it does
contain a '/' character it is a relativ path. Otherwise it names the
locale this definition is for. */
static int
construct_output_path (const char *path)
{
int result = 0;
if (strchr (path, '/') == NULL)
{
/* This is a system path. */
int path_max_len = pathconf (LOCALE_PATH, _PC_PATH_MAX) + 1;
output_path = (char *) xmalloc (path_max_len);
snprintf (output_path, path_max_len, "%s/%s", LOCALE_PATH, path);
}
else
{
char *t;
/* This is a user path. */
output_path = malloc (strlen (path) + 2);
t = stpcpy (output_path, path);
*t = '\0';
}
if (euidaccess (output_path, W_OK) == -1)
/* Perhaps the directory does not exist now. Try to create it. */
if (errno == ENOENT)
{
if (mkdir (output_path, 0777) == -1)
result = errno;
}
else
result = errno;
if (result == 0)
strcat (output_path, "/");
return result;
}
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
-196
View File
@@ -1,196 +0,0 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _LOCALEDEF_H
#define _LOCALEDEF_H 1
#define __need_wchar_t
#include <stddef.h>
#include "config.h"
#include "hash.h"
/* Needed always. */
#define MAX(a, b) ({typeof (a) _a = (a); typeof (b) _b = (b); \
_a > _b ? _a : _b; })
#define MIN(a, b) ({typeof (a) _a = (a); typeof (b) _b = (b); \
_a < _b ? _a : _b; })
/* Determine number of elements in ARR. */
#define NELEMS(arr) ((sizeof (arr)) / (sizeof (arr[0])))
/* I simply love these GCC features ... :) */
#define NO_PAREN(arg, rest...) arg, ##rest
/* The character set used in the locale is defined in a character map file.
The information of the file is stored in the following struct. */
struct charmap
{
char *filename;
char *codeset_name;
int mb_cur_min;
int mb_cur_max;
char escape_char;
char comment_char;
hash_table table;
int hash_size;
int hash_layers;
};
/* Data structure for representing charmap database. */
extern struct charmap charmap_data;
/* We can map the types of the entries into four categories. */
enum value_type { none, string, stringarray, byte, bytearray, integer };
/* Definition of the data structure which represents a category and its
items. */
struct category
{
int cat_id;
const char *name;
size_t number;
struct cat_item
{
int item_id;
const char *name;
enum { std, opt } status;
enum value_type value_type;
int min;
int max;
} *item_desc;
char **item_value;
void (*infct)(int);
void (*checkfct)(void);
int (*outfct)(void);
int filled;
char *copy_locale;
};
/* This a the structure which contains all information about all
categories. */
extern struct category category[];
/* The function used to load the contents of a charmap file into the
the global variable `charmap_data'. */
void charmap_read (const char *filename);
/* Find a character constant given by its name in the hash table. */
static inline wchar_t find_char (const char *name, size_t len)
{
wchar_t retval;
if (find_entry (&charmap_data.table, name, len, (void **) &retval) != 0)
return retval;
else
return -1;
}
/* Path to the directory the output files are written in. */
extern char *output_path;
/* If this is defined be POSIX conform. */
extern int posix_conformance;
/* If not zero give a lot more messages. */
extern int verbose;
/* This structure contains all informations about the status of of
reading the locale definition file. */
struct locfile_data
{
const char *filename;
char escape_char;
char comment_char;
size_t bufsize;
char *buf;
char *strbuf;
size_t buf_ptr;
int continue_line;
size_t returned_tokens;
size_t line_no;
};
/* The status variable. */
extern struct locfile_data locfile_data;
/* Open the locale definition file. */
void locfile_open (const char *fname);
/* Return the next token from the locale definition file. */
int locfile_lex (char **token, int *token_len);
/* Dito, but check for EOF. */
int xlocfile_lex (char **token, int *token_len);
/* Ignore the rest of the line. First TOKEN given if != 0. Warn about
anything other than end of line if WARN_FLAG nonzero. */
void ignore_to_eol (int token, int warn_flag);
/* Code a character with UTF-8 if the character map has multi-byte
characters. */
int char_to_utf (char *buf, int char_val);
/* Read the locale defintion file FNAME and fill the appropriate
data structures. */
void locfile_read (const char *fname);
/* Check categories for consistency. */
void categories_check (void);
/* Write out the binary representation of the category data. */
void categories_write (void);
/* Treat reading the LC_COLLATE definition. */
void collate_input (int token);
/* Treat reading the LC_CTYPE definition. */
void ctype_input (int token);
void ctype_check (void);
int ctype_output (void);
/* Treat reading the LC_MONETARY definition. */
void monetary_check (void);
/* Treat reading the LC_MESSAGES definition. */
void messages_check (void);
/* Treat reading the LC_NUMERIC definition. */
void numeric_check (void);
/* Print an error message, possibly with NLS. */
void error (int status, int errnum, const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
/* Library functions. */
void *xmalloc (size_t n);
void *xcalloc (size_t n, size_t s);
void *xrealloc (void *p, size_t n);
/*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
#endif /* _LOCALEDEF_H */
+54 -9
View File
@@ -1,5 +1,5 @@
/* localeinfo.h -- declarations for internal libc locale interfaces
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,51 @@ Cambridge, MA 02139, USA. */
#include <sys/types.h>
/* Magic number at the beginning of a locale data file for CATEGORY. */
#define LIMAGIC(category) (0x051472CA ^ (category))
#define LIMAGIC(category) (0x960316de ^ (category))
/* Two special weight constants for the collation data. */
#define FORWARD_CHAR 0xfffffffd
#define ELLIPSIS_CHAR 0xfffffffe
#define IGNORE_CHAR 0xffffffff
/* Structure describing locale data in core for a category. */
struct locale_data
{
const char *filedata; /* Region mapping the file data. */
off_t filesize; /* Size of the file (and the region). */
{
const char *filedata; /* Region mapping the file data. */
off_t filesize; /* Size of the file (and the region). */
unsigned int nstrings; /* Number of strings below. */
const char *strings[0]; /* Items, usually pointers into `filedata'. */
};
unsigned int nstrings; /* Number of strings below. */
union locale_data_value
{
const char *string;
unsigned int word;
}
values[0]; /* Items, usually pointers into `filedata'. */
};
/* We know three kinds of collation sorting rules. */
enum coll_sort_rule
{
illegal_0__,
sort_forward,
sort_backward,
illegal_3__,
sort_position,
sort_forward_position,
sort_backward_position,
sort_mask
};
/* We can map the types of the entries into four categories. */
enum value_type
{
none,
string,
stringarray,
byte,
bytearray,
word
};
/* For each category declare the variable for the current locale data. */
@@ -49,7 +83,11 @@ extern const struct locale_data * *const _nl_current[LC_ALL];
/* Extract the current CATEGORY locale's string for ITEM. */
#define _NL_CURRENT(category, item) \
(_nl_current_##category->strings[_NL_ITEM_INDEX (item)])
(_nl_current_##category->values[_NL_ITEM_INDEX (item)].string)
/* Extract the current CATEGORY locale's word for ITEM. */
#define _NL_CURRENT_WORD(category, item) \
(_nl_current_##category->values[_NL_ITEM_INDEX (item)].word)
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
#define _NL_CURRENT_DEFINE(category) \
@@ -65,4 +103,11 @@ extern struct locale_data *_nl_load_locale (int category, char **name);
extern void _nl_free_locale (struct locale_data *);
/* XXX For now. */
typedef unsigned int u32_t;
/* Global variables for LC_COLLATE category data. */
extern const u32_t *__collate_table;
extern const u32_t *__collate_extra;
#endif /* localeinfo.h */

Some files were not shown because too many files have changed in this diff Show More