mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Compare commits
102
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e165c9059 | ||
|
|
d4fff052ce | ||
|
|
22c4356832 | ||
|
|
6f69fa17e5 | ||
|
|
a23087343b | ||
|
|
ba2ccfa167 | ||
|
|
71c5289b0f | ||
|
|
1893ec6a38 | ||
|
|
e2f8a38f47 | ||
|
|
e16db41ba6 | ||
|
|
13babeb0d3 | ||
|
|
c424f2da59 | ||
|
|
cac34d519a | ||
|
|
b47d1816eb | ||
|
|
8fbe82ee26 | ||
|
|
dd23f3b0d6 | ||
|
|
3365152cb0 | ||
|
|
4b3769bc7c | ||
|
|
cf2b29bfe0 | ||
|
|
98e994340a | ||
|
|
f4a0465b69 | ||
|
|
1908c08641 | ||
|
|
31d7822815 | ||
|
|
9b5225b600 | ||
|
|
f13f1b26e4 | ||
|
|
967578d96c | ||
|
|
421dcdf3a9 | ||
|
|
87a5e8a7a4 | ||
|
|
a2a3fc55fd | ||
|
|
02f25bd59b | ||
|
|
c7b0194ac3 | ||
|
|
885ba00117 | ||
|
|
3cfcebc885 | ||
|
|
2047317f3b | ||
|
|
ac7c207f14 | ||
|
|
a18be620a1 | ||
|
|
177f9d5cd4 | ||
|
|
afc1d235b7 | ||
|
|
c293f9bc63 | ||
|
|
24ea71e942 | ||
|
|
79df061031 | ||
|
|
375676b1b6 | ||
|
|
94f1773041 | ||
|
|
77055d99e4 | ||
|
|
fb63ae13d0 | ||
|
|
44a09a3306 | ||
|
|
579749498e | ||
|
|
52cff2eeb6 | ||
|
|
94f8647f1c | ||
|
|
88f4537c77 | ||
|
|
32fff90d82 | ||
|
|
00aec83a30 | ||
|
|
ff046934fd | ||
|
|
31f43cffe0 | ||
|
|
4c2d948abe | ||
|
|
c5cb336b87 | ||
|
|
8d7899fbb6 | ||
|
|
bca9fd93a8 | ||
|
|
9f3168cf9a | ||
|
|
24a09ef771 | ||
|
|
f0427c13e4 | ||
|
|
347415b76e | ||
|
|
ff407b13b9 | ||
|
|
265ede2a16 | ||
|
|
1bdf7624dc | ||
|
|
95a5089d2f | ||
|
|
760f9f4cd0 | ||
|
|
3a1db3bf88 | ||
|
|
0b7f4318c0 | ||
|
|
3316c605ba | ||
|
|
aa8ecd3c01 | ||
|
|
d35ffac1c7 | ||
|
|
b1f911a801 | ||
|
|
5b2cfa7797 | ||
|
|
3967ae2f20 | ||
|
|
3a7c62f09a | ||
|
|
571286fe50 | ||
|
|
28b5b97f16 | ||
|
|
4db14580ca | ||
|
|
379091f89d | ||
|
|
a6a5f54f28 | ||
|
|
a06faff6c1 | ||
|
|
e3d3d6c990 | ||
|
|
00926c6660 | ||
|
|
2f54e18d8b | ||
|
|
eb3b8b2ea7 | ||
|
|
731640fc24 | ||
|
|
1f574fe0be | ||
|
|
1b4d62a18d | ||
|
|
ce328bf180 | ||
|
|
58f6951944 | ||
|
|
450867ffea | ||
|
|
992b2c400b | ||
|
|
6145c5ea69 | ||
|
|
e3f24cf1bf | ||
|
|
1217a671f4 | ||
|
|
8814d1a72e | ||
|
|
d730f1d27c | ||
|
|
2e12a92961 | ||
|
|
4f72518358 | ||
|
|
655fe31070 | ||
|
|
9652be3de8 |
@@ -1,3 +1,293 @@
|
||||
1997-03-06 05:55 David Engel <david@sw.ods.com>
|
||||
|
||||
* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Also
|
||||
recognize cache entries with flag == 3.
|
||||
|
||||
1997-03-05 23:14 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* time/antarctica: Update from tzdata1997c.
|
||||
* time/asia: Likewise.
|
||||
* time/zone.tab: Likewise.
|
||||
|
||||
1997-03-05 03:59 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* inet/rcmd.c (__ivaliduser): Don't use getline, but __getline
|
||||
instead to avoid namespace problems.
|
||||
Reported by David Mosberger-Tang <davidm@AZStarNet.COM>.
|
||||
|
||||
1997-03-04 04:31 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/poll.c: Implement poll function by
|
||||
falling back to select-based implementation if syscall isn't
|
||||
available.
|
||||
* sysdeps/unix/sysv/linux/syscalls.list: Add s_poll.
|
||||
|
||||
* time/leapseconds: Update from tzdata1997b.
|
||||
* time/zic.c: Update from tzcode1997b.
|
||||
|
||||
1997-03-01 15:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* time/Makefile $(tzfiles:%=$(objpfx)z.%): Remove unneeded
|
||||
depedencies between installed $(tzlinks) and $(tzbases) files.
|
||||
|
||||
1997-02-28 03:27 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* stdlib/strtod.c (STRTOF): Make sure return value is large enough
|
||||
so that clearing second word is necessary.
|
||||
|
||||
* sysdeps/unix/sysv/linux/netinet/in_systm.h: Don't use kernel
|
||||
header since it is wrong for 64 bit systems.
|
||||
Patch by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
1997-02-27 10:34:11 Richard Henderson <rth@tamu.edu>
|
||||
|
||||
* sysdeps/unix/sysv/linux/alpha/brk.S: Support both the Linux/i386
|
||||
and OSF/1 style brk syscalls. We may want to change Linux/Alpha
|
||||
for the benefit of running foreign binaries.
|
||||
|
||||
1997-02-27 05:12 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* manual/Makefile: Add rules to run and distribute xtract-typefun.
|
||||
* manual/xtract-typefun.awk: New file. Script to extract function,
|
||||
variable, macro anchor to put into the `dir' file.
|
||||
|
||||
* sysdeps/libm-i387/e_acoshl.c: Clear upper half of word containing
|
||||
exponent before comparing.
|
||||
|
||||
1997-02-27 01:13 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/generic/netinet/in.h (htonl, htons, ntohl, ntohs): Change
|
||||
prototypes to use types with explicit width. `unsigned long' is
|
||||
different on 64 bit systems.
|
||||
* sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
|
||||
* sysdeps/generic/htonl.c: Likewise.
|
||||
* sysdeps/generic/htons.c: Likewise.
|
||||
* sysdeps/generic/ntohl.c: Likewise.
|
||||
* sysdeps/generic/ntohs.c: Likewise.
|
||||
Suggested by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
1997-02-02 19:53 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* misc/getpass.c: Don't disable canonical input.
|
||||
Reverted patch of Mon Jan 6 01:35:29 1997.
|
||||
|
||||
1996-12-14 22:07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* libio/libioP.h (_IO_finish_t): Take additional parameter, to
|
||||
match the hidden __in_chrg parameter of the destructor.
|
||||
(_IO_FINISH): Pass zero for it.
|
||||
* libio/genops.c (_IO_default_finish): Add second parameter, which
|
||||
is ignored.
|
||||
* libio/memstream.c (_IO_mem_finish): Likewise.
|
||||
* libio/fileops.c (_IO_file_finish): Likewise.
|
||||
* libio/strops.c (_IO_str_finish): Likewise. All callers changed.
|
||||
|
||||
1997-02-27 00:23 H.J. Lu <hjl@lucon.org>
|
||||
|
||||
* time/Makefile: Avoid using patterns in dependencies.
|
||||
|
||||
1997-02-26 03:28 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* shadow/sgetspent_r.c (LINE_PARSER): Add missing ')'.
|
||||
|
||||
1997-02-25 15:11 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/libm-i387/e_acoshf.S (__ieee754_acoshf): Test correct
|
||||
word on stack for overflow.
|
||||
|
||||
1997-02-24 23:05 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
|
||||
|
||||
* malloc/malloc.c (malloc_get_state): New function.
|
||||
Saves global malloc state to an opaque data structure which
|
||||
is dynamically allocated in the heap.
|
||||
* malloc/malloc.c (malloc_set_state): New function.
|
||||
Restore previously obtained state.
|
||||
* malloc/malloc.h: Add declaration of malloc_get_state()
|
||||
and malloc_set_state().
|
||||
|
||||
1997-02-24 23:29 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/libm-ieee754/s_cbrtl.c: Shift B1_EXP value to right
|
||||
position.
|
||||
|
||||
1997-02-24 17:38 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* misc/error.c: Make error and error_at_line weak aliases of
|
||||
__error and __error_at_line respectively.
|
||||
Suggested by David Mosberger-Tang <davidm@AZStarNet.COM>.
|
||||
|
||||
1997-02-22 12:25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* locale/C-time.c (_nl_C_LC_TIME): Add missing entry for
|
||||
time-era-num-entries.
|
||||
|
||||
1997-02-24 15:20 Jonathan T. Agnew <jtagnew@amherst.edu>
|
||||
|
||||
* glibcbug.in: Don't mention destination on MAIL_AGENT command line
|
||||
to avoid duplicate mail.
|
||||
|
||||
1997-02-23 02:32 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* stdio-common/vfprintf.c (printf_unknown): Correct printing of
|
||||
numeric values.
|
||||
|
||||
1997-02-22 03:02 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* math/math.h: Prevent definition of struct exception when using
|
||||
C++.
|
||||
|
||||
1997-02-22 01:46 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/syscalls.list: Dup takes only one argument.
|
||||
Reported by Greg McGary.
|
||||
|
||||
1997-02-20 17:51 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/generic/netinet/in.h: Protect contents using
|
||||
__BEGIN/END_DECLS. Reported by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
* inet/net/ethernet.h: Move to sysdeps/unix/sysv/linux/net.
|
||||
* inet/Makefile (headers): Remove net/ethernet.h.
|
||||
* sysdeps/unix/sysv/linux/Makefile: Install net/ethernet.h.
|
||||
* sysdeps/unix/sysv/linux/Dist: Distribute net/ethernet.h.
|
||||
|
||||
1997-02-20 19:19 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/mman/syscalls.list: Explain msync interface.
|
||||
* sysdeps/unix/bsd/syscalls.list: Add msync with two parameters.
|
||||
|
||||
1997-02-19 01:37 Erik Troan <ewt@redhat.com>
|
||||
|
||||
* shadow/sgetspent_r.c: Accept empty third, fourth and fifth fields.
|
||||
|
||||
1997-02-20 14:44 Andreas Jaeger <aj@arthur.pfalz.de>
|
||||
|
||||
* stdio-common/test-fseek.c: Remove temporary file, add
|
||||
copyright.
|
||||
|
||||
1997-02-19 11:46 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* string/strxfrm.c (STRCOLL): Correct handling of `position'
|
||||
levels with no non-IGNOREd element and handling of NUL byte.
|
||||
* string/strcoll.c (STRXFRM): Likewise.
|
||||
* locale/weight.h: Likewise.
|
||||
|
||||
* shadow/sgetspent_r.c (LINE_PARSER): Add missing ')'.
|
||||
|
||||
1997-02-19 01:02 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/mman/syscalls.list: msync takes 3 arguments.
|
||||
Reported by Andreas Jaeger <aj@arthur.pfalz.de>.
|
||||
|
||||
1997-02-19 00:29 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/bsd/sigsuspend.c: Call __sigpause with needed
|
||||
additional argument.
|
||||
|
||||
1997-02-18 22:13 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* inet/net/ethernet.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/if_ether.c: Add BSD compatibility.
|
||||
* sysdeps/unix/sysv/linux/net/if_slip.h: New file.
|
||||
Contributed by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
* sysdeps/unix/sysv/linux/net/if_arp.h: Include <sys/socket.h>.
|
||||
* sunrpc/rpc/rpc_msg.h: Include <rpc/clnt.h>.
|
||||
Reported by a sun <asun@zoology.washington.edu>.
|
||||
|
||||
1997-02-18 03:28 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* stdio-common/bug10.c (main): Correct parameter.
|
||||
|
||||
* string/strcoll.c: Update copyright.
|
||||
|
||||
1997-02-17 02:51 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* malloc/obstack.h: Add `extern "C"' protection.
|
||||
* posix/regex.h: Likewise.
|
||||
* io/ftw.h: Likewise.
|
||||
* misc/libgen.h: Likewise.
|
||||
* login/utmp.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/reboot.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
|
||||
* sunrpc/rpc/pmap_rmt.h: Likewise.
|
||||
* sunrpc/rpc/auth_des.h: Likewise.
|
||||
* elf/link.h: Likewise.
|
||||
* inet/netinet/ether.h: Likewise.
|
||||
Reported by HJ Lu.
|
||||
|
||||
1997-02-17 01:45 a sun <asun@zoology.washington.edu>
|
||||
|
||||
Linux specific network headers.
|
||||
* sysdeps/unix/sysv/linux/netinet/if_fddi.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/if_tr.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/ip_icmp.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/ip_fw.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/igmp.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/icmp.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/ip.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netinet/tcp.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netipx/ipx.h: New file.
|
||||
* sysdeps/unix/sysv/linux/netatalk/atalk.h: New file.
|
||||
* sysdeps/unix/sysv/linux/Dist: Add new network headers.
|
||||
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=misc] (sysdep_headers):
|
||||
Add sys/quota.h.
|
||||
[$(subdir)=inet] (sysdep_headers): Add new network header.
|
||||
|
||||
* sysdeps/unix/sysv/linux/netinet/udp.h: Add Linux specific changes.
|
||||
* sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
|
||||
|
||||
* inet/netinet/ip.h: Move to sysdeps/generic.
|
||||
|
||||
1997-02-16 13:15 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
|
||||
|
||||
* inet/netinet/ip.h: Add protection.
|
||||
|
||||
1997-02-17 01:18 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* misc/sys/syslog.h (prioritynames): Correct definition to use
|
||||
braces where necessary.
|
||||
(facilitynames): Likewise.
|
||||
Patch by Ronald F. Guilmette <rfg@monkeys.com>.
|
||||
Comment and beautify declarations.
|
||||
|
||||
1997-02-16 03:54 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/netinet/in.h: Declare bindresvport.
|
||||
Reported by fabsoft@fabserver1.zarm.uni-bremen.de.
|
||||
|
||||
1997-02-16 03:48 Thorsten Kukuk <kukuk@weber.uni-paderborn.de>
|
||||
|
||||
* nis/nss_nis/nis-ethers.c (_nss_nis_getethernam_r): Rename to
|
||||
_nss_nis_gethostton_r.
|
||||
(_nss_nis_getetherbyaddr_r): Rename to _nss_nis_getntohost_r.
|
||||
|
||||
1997-02-16 02:45 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* intl/l10nflist.c (_nl_make_l10nflist): Fix bug in computation of
|
||||
length of abs_filename.
|
||||
|
||||
1997-02-15 22:37 Andy Berkheimer <andy@tho.org>
|
||||
|
||||
* resolv/gethnamaddr.c (gethostbyname2): Test for ':' in name before
|
||||
trying to resolv name as numeric IPv6 address.
|
||||
* nss/digits_dots.c: Likewise.
|
||||
|
||||
1997-02-13 22:32 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* locale/programs/localedef.c: Implement --quiet option.
|
||||
* locale/programs/charset.h: Declare be_quiet variable.
|
||||
* locale/programs/locfile.h: Likewise.
|
||||
* locale/programs/charmap.c: Don't print warnings if quiet option
|
||||
was given.
|
||||
* locale/programs/ld-collate.c: Likewise.
|
||||
* locale/programs/ld-ctype.c: Likewise.
|
||||
* locale/programs/ld-messages.c: Likewise.
|
||||
* locale/programs/ld-monetary.c: Likewise.
|
||||
* locale/programs/ld-numeric.c: Likewise.
|
||||
* locale/programs/ld-time.c: Likewise.
|
||||
* locale/programs/locfile.c: Likewise.
|
||||
|
||||
1997-02-13 11:44 Andreas Jaeger <aj@arthur.pfalz.de>
|
||||
|
||||
* stdlib/qsort.c: Add prototype for _quicksort.
|
||||
|
||||
+2
-1
@@ -239,7 +239,8 @@ endif
|
||||
# other than there, so the zoneinfo directory contains only universal data,
|
||||
# localizing the configuration data elsewhere.
|
||||
ifndef localtime-file
|
||||
localtime-file = $(inst_sysconfdir)/localtime
|
||||
localtime-file = $(sysconfdir)/localtime
|
||||
inst_localtime-file = $(install_root)$(localtime-file)
|
||||
endif
|
||||
|
||||
# What to use for leap second specifications in compiling the default
|
||||
|
||||
@@ -339,6 +339,8 @@ $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||||
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
|
||||
-Wl,--whole-archive $^ $(no-whole-archive) \
|
||||
$(LDLIBS-$(@F:lib%.so=%).so)
|
||||
test -z "$($(@F)-version)" || \
|
||||
(rm -f $@$($(@F)-version); $(LN_S) $(@F) $@$($(@F)-version))
|
||||
endef
|
||||
|
||||
# Don't try to use -lc when making libc.so itself.
|
||||
@@ -354,12 +356,6 @@ $(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||
$(common-objpfx)libc_pic.a \
|
||||
$(elfobjdir)/sofini.so $(elfobjdir)/ld.so
|
||||
$(build-shlib)
|
||||
|
||||
ifdef libc.so-version
|
||||
$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
|
||||
rm -f $@
|
||||
ln -s $(<F) $@ || ln $< $@
|
||||
endif
|
||||
endif
|
||||
|
||||
# Some files must not be compiled with the exception handler mechanism
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -34,6 +34,7 @@ catopen (const char *cat_name, int flag)
|
||||
{
|
||||
__nl_catd result;
|
||||
const char *env_var;
|
||||
const char *nlspath;
|
||||
|
||||
result = (__nl_catd) malloc (sizeof (*result));
|
||||
if (result == NULL)
|
||||
@@ -82,8 +83,16 @@ catopen (const char *cat_name, int flag)
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
|
||||
if (__secure_getenv ("NLSPATH") != NULL)
|
||||
result->nlspath = __strdup (getenv ("NLSPATH"));
|
||||
nlspath = __secure_getenv ("NLSPATH");
|
||||
if (nlspath != NULL && *nlspath != '\0')
|
||||
{
|
||||
/* Append the system dependent directory. */
|
||||
size_t len = strlen (nlspath + 1 + sizeof NLSPATH);
|
||||
char *tmp = alloca (len);
|
||||
|
||||
__stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH);
|
||||
nlspath = tmp;
|
||||
}
|
||||
else
|
||||
result->nlspath = __strdup (NLSPATH);
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ __big_delete(hashp, bufp)
|
||||
bufp->flags |= BUF_MOD;
|
||||
if (rbufp)
|
||||
__free_ovflpage(hashp, rbufp);
|
||||
if (last_bfp != rbufp)
|
||||
if (last_bfp && last_bfp != rbufp)
|
||||
__free_ovflpage(hashp, last_bfp);
|
||||
|
||||
hashp->NKEYS--;
|
||||
|
||||
+17
-19
@@ -1,29 +1,27 @@
|
||||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1992, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
DEFUN(alphasort, (a, b),
|
||||
CONST PTR a AND CONST PTR b)
|
||||
alphasort (const void *a, const void *b)
|
||||
{
|
||||
return strcmp (((struct dirent *) a)->d_name,
|
||||
((struct dirent *) b)->d_name);
|
||||
return strcmp ((*(const struct dirent **) a)->d_name,
|
||||
(*(const struct dirent **) b)->d_name);
|
||||
}
|
||||
|
||||
@@ -18,13 +18,17 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
|
||||
#define _LINK_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#include <elf.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* We use this macro to refer to ELF types independent of the native wordsize.
|
||||
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
|
||||
#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
|
||||
@@ -340,5 +344,6 @@ extern void _dl_debug_state (void);
|
||||
in the `r_ldbase' member. Returns the address of the structure. */
|
||||
extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* link.h */
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ sed -e "
|
||||
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
||||
" $TEMP > $TEMP.x
|
||||
|
||||
if $MAIL_AGENT $BUGGLIBC < $TEMP.x; then
|
||||
if $MAIL_AGENT < $TEMP.x; then
|
||||
echo "$COMMAND: problem report sent"
|
||||
xs=0; exit
|
||||
else
|
||||
|
||||
+23
-17
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996, 1997 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 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.
|
||||
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. */
|
||||
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 _HURD_H
|
||||
|
||||
@@ -109,11 +109,10 @@ extern pid_t _hurd_pid, _hurd_ppid, _hurd_pgrp;
|
||||
extern int _hurd_orphaned;
|
||||
|
||||
/* This variable is incremented every time the process IDs change. */
|
||||
|
||||
unsigned int _hurd_pids_changed_stamp;
|
||||
extern unsigned int _hurd_pids_changed_stamp;
|
||||
|
||||
/* This condition is broadcast every time the process IDs change. */
|
||||
struct condition _hurd_pids_changed_sync;
|
||||
extern struct condition _hurd_pids_changed_sync;
|
||||
|
||||
/* Unix `data break', for brk and sbrk.
|
||||
If brk and sbrk are not used, this info will not be initialized or used. */
|
||||
@@ -304,4 +303,11 @@ extern int hurd_check_cancel (void);
|
||||
extern io_t __getdport (int fd), getdport (int fd);
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Write formatted output to PORT, a Mach port supporting the i/o protocol,
|
||||
according to the format string FORMAT, using the argument list in ARG. */
|
||||
int vpprintf (io_t port, const char *format, va_list arg);
|
||||
|
||||
|
||||
#endif /* hurd.h */
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* Set a host configuration item kept as the whole contents of a file.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996, 1997 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 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.
|
||||
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. */
|
||||
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 <fcntl.h>
|
||||
#include <hurd.h>
|
||||
@@ -28,7 +28,7 @@ _hurd_set_host_config (const char *item, const char *value, size_t valuelen)
|
||||
mach_msg_type_number_t nwrote;
|
||||
file_t new, dir;
|
||||
|
||||
dir = __file_name_split (item, &item);
|
||||
dir = __file_name_split (item, (char **)&item);
|
||||
if (dir == MACH_PORT_NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
+23
-22
@@ -1,30 +1,30 @@
|
||||
/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 1994, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <hurd.h>
|
||||
|
||||
static ssize_t
|
||||
DEFUN(pwrite, (cookie, buf, n),
|
||||
PTR cookie AND CONST char *buf AND size_t n)
|
||||
pwrite (void *cookie,
|
||||
const char *buf,
|
||||
size_t n)
|
||||
{
|
||||
error_t error = __io_write ((io_t) cookie, buf, n, -1,
|
||||
(mach_msg_type_number_t *) &n);
|
||||
@@ -37,24 +37,25 @@ DEFUN(pwrite, (cookie, buf, n),
|
||||
/* Write formatted output to PORT, a Mach port supporting the i/o protocol,
|
||||
according to the format string FORMAT, using the argument list in ARG. */
|
||||
int
|
||||
DEFUN(vpprintf, (port, format, arg),
|
||||
io_t port AND CONST char *format AND va_list arg)
|
||||
vpprintf (io_t port,
|
||||
const char *format,
|
||||
va_list arg)
|
||||
{
|
||||
int done;
|
||||
FILE f;
|
||||
|
||||
/* Create an unbuffered stream talking to PORT on the stack. */
|
||||
memset((PTR) &f, 0, sizeof(f));
|
||||
memset ((void *) &f, 0, sizeof (f));
|
||||
f.__magic = _IOMAGIC;
|
||||
f.__mode.__write = 1;
|
||||
f.__cookie = (PTR) port;
|
||||
f.__cookie = (void *) port;
|
||||
f.__room_funcs = __default_room_functions;
|
||||
f.__io_funcs.__write = pwrite;
|
||||
f.__seen = 1;
|
||||
f.__userbuf = 1;
|
||||
|
||||
/* vfprintf will use a buffer on the stack for the life of the call. */
|
||||
done = vfprintf(&f, format, arg);
|
||||
done = vfprintf (&f, format, arg);
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
+29
-23
@@ -1,21 +1,21 @@
|
||||
/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996, 1997 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 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.
|
||||
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. */
|
||||
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 __NETINET_ETHER_H
|
||||
|
||||
@@ -25,24 +25,30 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Get definition of `struct ether_addr'. */
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Convert 48 bit Ethernet ADDRess to ASCII. */
|
||||
char *ether_ntoa __P ((const struct ether_addr *__addr));
|
||||
char *ether_ntoa_r __P ((const struct ether_addr *__addr, char *__buf));
|
||||
extern char *ether_ntoa __P ((__const struct ether_addr *__addr));
|
||||
extern char *ether_ntoa_r __P ((__const struct ether_addr *__addr,
|
||||
char *__buf));
|
||||
|
||||
/* Convert ASCII string S to 48 bit Ethernet address. */
|
||||
struct ether_addr *ether_aton __P ((const char *__asc));
|
||||
struct ether_addr *ether_aton_r __P ((const char *__asc,
|
||||
struct ether_addr *__addr));
|
||||
extern struct ether_addr *ether_aton __P ((__const char *__asc));
|
||||
extern struct ether_addr *ether_aton_r __P ((__const char *__asc,
|
||||
struct ether_addr *__addr));
|
||||
|
||||
/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
|
||||
int ether_ntohost __P ((char *__hostname, const struct ether_addr *__addr));
|
||||
extern int ether_ntohost __P ((char *__hostname,
|
||||
__const struct ether_addr *__addr));
|
||||
|
||||
/* Map HOSTNAME to 48 bit Ethernet address. */
|
||||
int ether_hostton __P ((const char *__hostname, struct ether_addr *__addr));
|
||||
extern int ether_hostton __P ((__const char *__hostname,
|
||||
struct ether_addr *__addr));
|
||||
|
||||
/* Scan LINE and set ADDR and HOSTNAME. */
|
||||
int ether_line __P ((const char *__line, struct ether_addr *__addr,
|
||||
char *__hostname));
|
||||
extern int ether_line __P ((__const char *__line, struct ether_addr *__addr,
|
||||
char *__hostname));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* netinet/ether.h */
|
||||
|
||||
+11
-7
@@ -306,7 +306,6 @@ iruserok(raddr, superuser, ruser, luser)
|
||||
struct stat sbuf;
|
||||
struct passwd pwdbuf, *pwd;
|
||||
FILE *hostf;
|
||||
uid_t uid;
|
||||
int first;
|
||||
|
||||
first = 1;
|
||||
@@ -326,7 +325,7 @@ again:
|
||||
char *buffer = __alloca (buflen);
|
||||
|
||||
first = 0;
|
||||
if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
|
||||
if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
|
||||
return -1;
|
||||
|
||||
dirlen = strlen (pwd->pw_dir);
|
||||
@@ -339,10 +338,15 @@ again:
|
||||
* reading an NFS mounted file system, can't read files that
|
||||
* are protected read/write owner only.
|
||||
*/
|
||||
uid = geteuid();
|
||||
(void)seteuid(pwd->pw_uid);
|
||||
hostf = fopen(pbuf, "r");
|
||||
(void)seteuid(uid);
|
||||
if (__euidaccess (pbuf, R_OK) != 0)
|
||||
hostf = NULL;
|
||||
else
|
||||
{
|
||||
uid_t uid = geteuid ();
|
||||
seteuid (pwd->pw_uid);
|
||||
hostf = fopen (pbuf, "r");
|
||||
seteuid (uid);
|
||||
}
|
||||
|
||||
if (hostf == NULL)
|
||||
return (-1);
|
||||
@@ -390,7 +394,7 @@ __ivaliduser(hostf, raddr, luser, ruser)
|
||||
size_t bufsize = 0;
|
||||
ssize_t nread;
|
||||
|
||||
while ((nread = getline (&buf, &bufsize, hostf)) > 0) {
|
||||
while ((nread = __getline (&buf, &bufsize, hostf)) > 0) {
|
||||
buf[bufsize - 1] = '\0'; /* Make sure it's terminated. */
|
||||
p = buf;
|
||||
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
|
||||
|
||||
+2
-1
@@ -206,7 +206,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||
? strlen (modifier) + 1 : 0)
|
||||
+ ((mask & CEN_SPECIAL) != 0
|
||||
? strlen (special) + 1 : 0)
|
||||
+ ((mask & (CEN_SPONSOR | CEN_REVISION) != 0)
|
||||
+ (((mask & CEN_SPONSOR) != 0
|
||||
|| (mask & CEN_REVISION) != 0)
|
||||
? (1 + ((mask & CEN_SPONSOR) != 0
|
||||
? strlen (sponsor) + 1 : 0)
|
||||
+ ((mask & CEN_REVISION) != 0
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#define _FTW_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <statbuf.h>
|
||||
|
||||
/* The FLAG argument to the user function passed to ftw. */
|
||||
@@ -41,4 +43,6 @@ extern int ftw __P ((__const char *__dir,
|
||||
int __flag),
|
||||
int __descriptors));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ftw.h */
|
||||
|
||||
+3
-3
@@ -138,8 +138,8 @@ DEFUN(_IO_file_close_it, (fp),
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_file_finish, (fp),
|
||||
register _IO_FILE* fp)
|
||||
DEFUN(_IO_file_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
{
|
||||
if (_IO_file_is_open(fp))
|
||||
{
|
||||
@@ -147,7 +147,7 @@ DEFUN(_IO_file_finish, (fp),
|
||||
if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
|
||||
_IO_SYSCLOSE (fp);
|
||||
}
|
||||
_IO_default_finish(fp);
|
||||
_IO_default_finish(fp, 0);
|
||||
}
|
||||
|
||||
_IO_FILE *
|
||||
|
||||
+2
-2
@@ -481,8 +481,8 @@ DEFUN(_IO_default_sync, (fp),
|
||||
current implementation, this function can get called twice! */
|
||||
|
||||
void
|
||||
DEFUN(_IO_default_finish, (fp),
|
||||
_IO_FILE *fp)
|
||||
DEFUN(_IO_default_finish, (fp, dummy),
|
||||
_IO_FILE *fp AND int dummy)
|
||||
{
|
||||
struct _IO_marker *mark;
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
|
||||
+5
-5
@@ -101,8 +101,8 @@ extern "C" {
|
||||
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
|
||||
It does not delete (free) it, but does everything else to finalize it/
|
||||
It matches the streambuf::~streambuf virtual destructor. */
|
||||
typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */
|
||||
#define _IO_FINISH(FP) JUMP0(__finish, FP)
|
||||
typedef void (*_IO_finish_t) __P((_IO_FILE*, int)); /* finalize */
|
||||
#define _IO_FINISH(FP) JUMP1(__finish, FP, 0)
|
||||
|
||||
/* The 'overflow' hook flushes the buffer.
|
||||
The second argument is a character, or EOF.
|
||||
@@ -295,7 +295,7 @@ extern int _IO_seekmark __P((_IO_FILE *, struct _IO_marker *, int));
|
||||
extern int _IO_default_underflow __P((_IO_FILE*));
|
||||
extern int _IO_default_uflow __P((_IO_FILE*));
|
||||
extern int _IO_default_doallocate __P((_IO_FILE*));
|
||||
extern void _IO_default_finish __P((_IO_FILE *));
|
||||
extern void _IO_default_finish __P((_IO_FILE *, int));
|
||||
extern int _IO_default_pbackfail __P((_IO_FILE*, int));
|
||||
extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
|
||||
extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
|
||||
@@ -352,7 +352,7 @@ extern _IO_ssize_t _IO_file_read __P((_IO_FILE*, void*, _IO_ssize_t));
|
||||
extern int _IO_file_sync __P((_IO_FILE*));
|
||||
extern int _IO_file_close_it __P((_IO_FILE*));
|
||||
extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int));
|
||||
extern void _IO_file_finish __P((_IO_FILE*));
|
||||
extern void _IO_file_finish __P((_IO_FILE*, int));
|
||||
|
||||
/* Other file functions. */
|
||||
extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int));
|
||||
@@ -366,7 +366,7 @@ extern int _IO_str_underflow __P((_IO_FILE*));
|
||||
extern int _IO_str_overflow __P((_IO_FILE *, int));
|
||||
extern int _IO_str_pbackfail __P((_IO_FILE*, int));
|
||||
extern _IO_fpos_t _IO_str_seekoff __P((_IO_FILE*,_IO_off_t,int,int));
|
||||
extern void _IO_str_finish __P ((_IO_FILE*));
|
||||
extern void _IO_str_finish __P ((_IO_FILE*, int));
|
||||
|
||||
/* Other strfile functions */
|
||||
extern void _IO_str_init_static __P((_IO_FILE *, char*, int, char*));
|
||||
|
||||
+18
-17
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1995, 1996, 1997 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 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.
|
||||
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. */
|
||||
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 "libioP.h"
|
||||
#include "strfile.h"
|
||||
@@ -31,7 +31,7 @@ struct _IO_FILE_memstream
|
||||
|
||||
|
||||
static int _IO_mem_sync __P ((_IO_FILE* fp));
|
||||
static void _IO_mem_finish __P ((_IO_FILE* fp));
|
||||
static void _IO_mem_finish __P ((_IO_FILE* fp, int));
|
||||
|
||||
|
||||
static const struct _IO_jump_t _IO_mem_jumps =
|
||||
@@ -124,8 +124,9 @@ _IO_mem_sync (fp)
|
||||
|
||||
|
||||
static void
|
||||
_IO_mem_finish (fp)
|
||||
_IO_mem_finish (fp, dummy)
|
||||
_IO_FILE* fp;
|
||||
int dummy;
|
||||
{
|
||||
struct _IO_FILE_memstream *mp = (struct _IO_FILE_memstream *) fp;
|
||||
|
||||
@@ -139,5 +140,5 @@ _IO_mem_finish (fp)
|
||||
|
||||
fp->_IO_buf_base = NULL;
|
||||
|
||||
_IO_default_finish (fp);
|
||||
_IO_default_finish (fp, 0);
|
||||
}
|
||||
|
||||
+3
-3
@@ -258,14 +258,14 @@ DEFUN(_IO_str_pbackfail, (fp, c),
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN (_IO_str_finish, (fp),
|
||||
register _IO_FILE* fp)
|
||||
DEFUN (_IO_str_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
{
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
(((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base);
|
||||
fp->_IO_buf_base = NULL;
|
||||
|
||||
_IO_default_finish(fp);
|
||||
_IO_default_finish(fp, 0);
|
||||
}
|
||||
|
||||
struct _IO_jump_t _IO_str_jumps = {
|
||||
|
||||
+2
-1
@@ -26,7 +26,7 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
{
|
||||
_nl_C_name,
|
||||
NULL, 0, /* no file mapped */
|
||||
53,
|
||||
54,
|
||||
{
|
||||
{ string: "Sun" },
|
||||
{ string: "Mon" },
|
||||
@@ -79,6 +79,7 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ word: 0 },
|
||||
{ word: 0 },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ charmap_read (const char *filename)
|
||||
|
||||
result = parse_charmap (pathnfile);
|
||||
|
||||
if (result == NULL)
|
||||
if (result == NULL && !be_quiet)
|
||||
error (0, errno, _("character map file `%s' not found"), filename);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ parse_charmap (const char *filename)
|
||||
result->mb_cur_max = 1;
|
||||
if (result->mb_cur_min == 0)
|
||||
result->mb_cur_min = result->mb_cur_max;
|
||||
if (result->mb_cur_min > result->mb_cur_max)
|
||||
if (result->mb_cur_min > result->mb_cur_max && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
%s: <mb_cur_max> must be greater than <mb_cur_min>\n"),
|
||||
@@ -596,7 +596,7 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (state != 91)
|
||||
if (state != 91 && !be_quiet)
|
||||
error (0, 0, _("%s: premature end of file"), cmfile->fname);
|
||||
|
||||
lr_close (cmfile);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -56,6 +56,9 @@ struct charset_t
|
||||
#define ILLEGAL_CHAR_VALUE ((wchar_t) 0xffffffffu)
|
||||
|
||||
|
||||
/* Declared in localedef.c. */
|
||||
extern int be_quiet;
|
||||
|
||||
/* Prototypes for charmap handling functions. */
|
||||
struct charset_t *charmap_read (const char *filename);
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ collate_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
else
|
||||
value = 0;
|
||||
|
||||
if (value == 0)
|
||||
if (value == 0 && !be_quiet)
|
||||
error_at_line (0, 0, patch->fname, patch->lineno,
|
||||
_("no weight defined for symbol `%s'"), patch->token);
|
||||
else
|
||||
@@ -256,7 +256,8 @@ collate_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
\**************************************************************/
|
||||
u_int32_t weight;
|
||||
|
||||
error (0, 0, _("no definition of `UNDEFINED'"));
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("no definition of `UNDEFINED'"));
|
||||
|
||||
collate->undefined.ordering_len = collate->nrules;
|
||||
weight = ++collate->order_cnt;
|
||||
@@ -324,9 +325,10 @@ collate_output (struct localedef_t *locale, struct charset_t *charset,
|
||||
level_best = 0xffff;
|
||||
|
||||
/* Compute table size. */
|
||||
fputs (_("\
|
||||
if (!be_quiet)
|
||||
fputs (_("\
|
||||
Computing table size for collation information might take a while..."),
|
||||
stderr);
|
||||
stderr);
|
||||
for (table_size = 256; table_size < sum_best; ++table_size)
|
||||
{
|
||||
size_t hits[table_size];
|
||||
@@ -357,7 +359,8 @@ Computing table size for collation information might take a while..."),
|
||||
}
|
||||
}
|
||||
assert (table_best != 0xffff || level_best != 0xffff);
|
||||
fputs (_(" done\n"), stderr);
|
||||
if (!be_quiet)
|
||||
fputs (_(" done\n"), stderr);
|
||||
|
||||
obstack_init (&non_simple);
|
||||
obstack_init (&string_pool);
|
||||
|
||||
+43
-36
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -262,10 +262,11 @@ ctype_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
cp += sprintf (cp, "\\%o", (value >> 8) & 0xff);
|
||||
sprintf (cp, "\\%o", value & 0xff);
|
||||
|
||||
error (0, 0, _("\
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("\
|
||||
character %s'%s' in class `%s' must be in class `%s'"), value > 256 ? "L" : "",
|
||||
cp, valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
cp, valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -286,10 +287,12 @@ character %s'%s' in class `%s' must be in class `%s'"), value > 256 ? "L" : "",
|
||||
cp += sprintf (cp, "\\%o", (value >> 8) & 0xff);
|
||||
sprintf (cp, "\\%o", value & 0xff);
|
||||
|
||||
error (0, 0, _("\
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("\
|
||||
character %s'%s' in class `%s' must not be in class `%s'"),
|
||||
value > 256 ? "L" : "", cp,
|
||||
valid_table[cls1].name, valid_table[cls2].name);
|
||||
value > 256 ? "L" : "", cp,
|
||||
valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -306,23 +309,25 @@ character %s'%s' in class `%s' must not be in class `%s'"),
|
||||
|
||||
/* ... and now test <SP> as a special case. */
|
||||
space_value = charset_find_value (charset, "SP", 2);
|
||||
if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("character <SP> not defined in character map"));
|
||||
else if ((cnt = BITPOS (tok_space),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_space)) == 0)
|
||||
|| (cnt = BITPOS (tok_blank),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_blank)) == 0))
|
||||
else if (((cnt = BITPOS (tok_space),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_space)) == 0)
|
||||
|| (cnt = BITPOS (tok_blank),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_blank)) == 0))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("<SP> character not in class `%s'"),
|
||||
valid_table[cnt].name);
|
||||
else if ((cnt = BITPOS (tok_punct),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_punct)) != 0)
|
||||
|| (cnt = BITPOS (tok_graph),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_graph))
|
||||
!= 0))
|
||||
else if (((cnt = BITPOS (tok_punct),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_punct)) != 0)
|
||||
|| (cnt = BITPOS (tok_graph),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_graph))
|
||||
!= 0))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("<SP> character must not be in class `%s'"),
|
||||
valid_table[cnt].name);
|
||||
else
|
||||
@@ -934,7 +939,7 @@ set_class_defaults (struct locale_ctype_t *ctype, struct charset_t *charset)
|
||||
tmp[0] = ch;
|
||||
|
||||
value = charset_find_value (charset, tmp, 1);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -998,7 +1003,7 @@ character `%s' not defined while needed as default value"),
|
||||
unsigned int value;
|
||||
|
||||
value = charset_find_value (charset, "space", 5);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1006,7 +1011,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "form-feed", 9);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<form-feed>");
|
||||
@@ -1014,7 +1019,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "newline", 7);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<newline>");
|
||||
@@ -1022,7 +1027,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "carriage-return", 15);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<carriage-return>");
|
||||
@@ -1030,7 +1035,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "tab", 3);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<tab>");
|
||||
@@ -1038,7 +1043,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "vertical-tab", 12);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<vertical-tab>");
|
||||
@@ -1064,7 +1069,7 @@ character `%s' not defined while needed as default value"),
|
||||
unsigned int value;
|
||||
|
||||
value = charset_find_value (charset, "space", 5);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1072,7 +1077,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_blank);
|
||||
|
||||
value = charset_find_value (charset, "tab", 3);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<tab>");
|
||||
@@ -1110,7 +1115,7 @@ character `%s' not defined while needed as default value"),
|
||||
ctype->class_collection[cnt] |= BIT (tok_print);
|
||||
|
||||
space = charset_find_value (charset, "space", 5);
|
||||
if (space == ILLEGAL_CHAR_VALUE)
|
||||
if (space == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1136,7 +1141,7 @@ character `%s' not defined while needed as default value"),
|
||||
tmp[1] = (char) ch;
|
||||
|
||||
value_from = charset_find_value (charset, &tmp[1], 1);
|
||||
if ((wchar_t) value_from == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value_from == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -1147,7 +1152,7 @@ character `%s' not defined while needed as default value"),
|
||||
/* This conversion is implementation defined. */
|
||||
tmp[1] = (char) (ch + ('A' - 'a'));
|
||||
value_to = charset_find_value (charset, &tmp[1], 1);
|
||||
if ((wchar_t) value_to == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value_to == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -1195,9 +1200,10 @@ allocate_arrays (struct locale_ctype_t *ctype, struct charset_t *charset)
|
||||
size_t min_total = UINT_MAX;
|
||||
size_t act_size = 256;
|
||||
|
||||
fputs (_("\
|
||||
if (!be_quiet)
|
||||
fputs (_("\
|
||||
Computing table size for character classes might take a while..."),
|
||||
stderr);
|
||||
stderr);
|
||||
|
||||
while (act_size < min_total)
|
||||
{
|
||||
@@ -1232,7 +1238,8 @@ Computing table size for character classes might take a while..."),
|
||||
++act_size;
|
||||
}
|
||||
|
||||
fprintf (stderr, _(" done\n"));
|
||||
if (!be_quiet)
|
||||
fprintf (stderr, _(" done\n"));
|
||||
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -77,7 +77,7 @@ messages_finish (struct localedef_t *locale)
|
||||
= locale->categories[LC_MESSAGES].messages;
|
||||
|
||||
/* The fields YESSTR and NOSTR are optional. */
|
||||
if (messages->yesexpr == NULL)
|
||||
if (messages->yesexpr == NULL && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' undefined"),
|
||||
"yesexpr", "LC_MESSAGES");
|
||||
else
|
||||
@@ -87,7 +87,7 @@ messages_finish (struct localedef_t *locale)
|
||||
|
||||
/* Test whether it are correct regular expressions. */
|
||||
result = regcomp (&re, messages->yesexpr, REG_EXTENDED);
|
||||
if (result != 0)
|
||||
if (result != 0 && !be_quiet)
|
||||
{
|
||||
char errbuf[BUFSIZ];
|
||||
|
||||
@@ -98,7 +98,7 @@ no correct regular expression for field `%s' in category `%s': %s"),
|
||||
}
|
||||
}
|
||||
|
||||
if (messages->noexpr == NULL)
|
||||
if (messages->noexpr == NULL && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' undefined"),
|
||||
"noexpr", "LC_MESSAGES");
|
||||
else
|
||||
@@ -108,7 +108,7 @@ no correct regular expression for field `%s' in category `%s': %s"),
|
||||
|
||||
/* Test whether it are correct regular expressions. */
|
||||
result = regcomp (&re, messages->noexpr, REG_EXTENDED);
|
||||
if (result != 0)
|
||||
if (result != 0 && !be_quiet)
|
||||
{
|
||||
char errbuf[BUFSIZ];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -115,7 +115,7 @@ monetary_finish (struct localedef_t *locale)
|
||||
= locale->categories[LC_MONETARY].monetary;
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (monetary->cat == NULL) \
|
||||
if (monetary->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_MONETARY")
|
||||
|
||||
@@ -129,12 +129,13 @@ monetary_finish (struct localedef_t *locale)
|
||||
/* The international currency symbol must come from ISO 4217. */
|
||||
if (monetary->int_curr_symbol != NULL)
|
||||
{
|
||||
if (strlen (monetary->int_curr_symbol) != 4)
|
||||
if (strlen (monetary->int_curr_symbol) != 4 && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
value of field `int_curr_symbol' in category `LC_MONETARY' has wrong length"));
|
||||
else if (bsearch (monetary->int_curr_symbol, valid_int_curr,
|
||||
NR_VALID_INT_CURR, sizeof (const char *),
|
||||
(comparison_fn_t) curr_strcmp) == NULL)
|
||||
(comparison_fn_t) curr_strcmp) == NULL
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("\
|
||||
value of field `int_curr_symbol' in category `LC_MONETARY' does \
|
||||
not correspond to a valid name in ISO 4217"));
|
||||
@@ -143,23 +144,23 @@ not correspond to a valid name in ISO 4217"));
|
||||
/* The decimal point must not be empty. This is not said explicitly
|
||||
in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be
|
||||
!= "". */
|
||||
if (monetary->mon_decimal_point[0] == '\0')
|
||||
if (monetary->mon_decimal_point[0] == '\0' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must not be the empty string"),
|
||||
"mon_decimal_point", "LC_MONETARY");
|
||||
}
|
||||
|
||||
if (monetary->mon_grouping_act == 0)
|
||||
if (monetary->mon_grouping_act == 0 && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"),
|
||||
"mon_grouping", "LC_MONETARY");
|
||||
|
||||
#undef TEST_ELEM
|
||||
#define TEST_ELEM(cat, min, max) \
|
||||
if (monetary->cat == -2) \
|
||||
if (monetary->cat == -2 && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_MONETARY"); \
|
||||
else if (monetary->cat < min || monetary->cat > max) \
|
||||
else if ((monetary->cat < min || monetary->cat > max) && !be_quiet) \
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must be in range %d...%d"), \
|
||||
#cat, "LC_MONETARY", min, max)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -74,7 +74,7 @@ numeric_finish (struct localedef_t *locale)
|
||||
struct locale_numeric_t *numeric = locale->categories[LC_NUMERIC].numeric;
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (numeric->cat == NULL) \
|
||||
if (numeric->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_NUMERIC")
|
||||
|
||||
@@ -84,14 +84,14 @@ numeric_finish (struct localedef_t *locale)
|
||||
/* The decimal point must not be empty. This is not said explicitly
|
||||
in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be
|
||||
!= "". */
|
||||
if (numeric->decimal_point[0] == '\0')
|
||||
if (numeric->decimal_point[0] == '\0' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must not be the empty string"),
|
||||
"decimal_point", "LC_NUMERIC");
|
||||
}
|
||||
|
||||
if (numeric->grouping_act == 0)
|
||||
if (numeric->grouping_act == 0 && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"),
|
||||
"grouping", "LC_NUMERIC");
|
||||
}
|
||||
|
||||
+31
-29
@@ -106,10 +106,10 @@ time_finish (struct localedef_t *locale)
|
||||
struct locale_time_t *time = locale->categories[LC_TIME].time;
|
||||
|
||||
#define TESTARR_ELEM(cat, max) \
|
||||
if (time->cur_num_##cat == 0) \
|
||||
if (time->cur_num_##cat == 0 && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_TIME"); \
|
||||
else if (time->cur_num_##cat != max) \
|
||||
else if (time->cur_num_##cat != max && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' has not enough values"), \
|
||||
#cat, "LC_TIME")
|
||||
|
||||
@@ -120,7 +120,7 @@ time_finish (struct localedef_t *locale)
|
||||
TESTARR_ELEM (am_pm, 2);
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (time->cat == NULL) \
|
||||
if (time->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_TIME")
|
||||
|
||||
@@ -149,7 +149,7 @@ time_finish (struct localedef_t *locale)
|
||||
memcpy (str, time->era[idx], era_len + 1);
|
||||
|
||||
/* First character must be + or - for the direction. */
|
||||
if (*str != '+' && *str != '-')
|
||||
if (*str != '+' && *str != '-' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("direction flag in string %d in `era' field"
|
||||
" in category `%s' is not '+' nor '-'"),
|
||||
@@ -159,7 +159,7 @@ time_finish (struct localedef_t *locale)
|
||||
}
|
||||
else
|
||||
time->era_entries[idx].direction = *str;
|
||||
if (*++str != ':')
|
||||
if (*++str != ':' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("direction flag in string %d in `era' field"
|
||||
" in category `%s' is not a single character"),
|
||||
@@ -171,14 +171,14 @@ time_finish (struct localedef_t *locale)
|
||||
|
||||
/* Now the offset year. */
|
||||
time->era_entries[idx].offset = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("illegal number for offset in string %d in"
|
||||
" `era' field in category `%s'"),
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("garbage at end of offset value in string %d in"
|
||||
" `era' field in category `%s'"),
|
||||
@@ -224,7 +224,7 @@ time_finish (struct localedef_t *locale)
|
||||
time->era_entries[idx].start_date[1] -= 1;
|
||||
|
||||
time->era_entries[idx].start_date[2] = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
invalid_start_date:
|
||||
error (0, 0, _("illegal starting date in string %d in"
|
||||
@@ -232,7 +232,7 @@ time_finish (struct localedef_t *locale)
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
garbage_start_date:
|
||||
error (0, 0, _("garbage at end of starting date in string %d"
|
||||
@@ -245,14 +245,15 @@ time_finish (struct localedef_t *locale)
|
||||
str = endp + 1;
|
||||
|
||||
/* Check for valid value. */
|
||||
if (time->era_entries[idx].start_date[1] < 0
|
||||
|| time->era_entries[idx].start_date[1] >= 12
|
||||
|| time->era_entries[idx].start_date[2] < 0
|
||||
|| (time->era_entries[idx].start_date[2]
|
||||
> days_per_month[time->era_entries[idx].start_date[1]])
|
||||
|| (time->era_entries[idx].start_date[1] == 2
|
||||
&& time->era_entries[idx].start_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].start_date[0])))
|
||||
if ((time->era_entries[idx].start_date[1] < 0
|
||||
|| time->era_entries[idx].start_date[1] >= 12
|
||||
|| time->era_entries[idx].start_date[2] < 0
|
||||
|| (time->era_entries[idx].start_date[2]
|
||||
> days_per_month[time->era_entries[idx].start_date[1]])
|
||||
|| (time->era_entries[idx].start_date[1] == 2
|
||||
&& time->era_entries[idx].start_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].start_date[0])))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("starting date is illegal in"
|
||||
" string %d in `era' field in"
|
||||
" category `%s'"),
|
||||
@@ -296,7 +297,7 @@ time_finish (struct localedef_t *locale)
|
||||
time->era_entries[idx].stop_date[1] -= 1;
|
||||
|
||||
time->era_entries[idx].stop_date[2] = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
invalid_stop_date:
|
||||
error (0, 0, _("illegal stopping date in string %d in"
|
||||
@@ -304,7 +305,7 @@ time_finish (struct localedef_t *locale)
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
garbage_stop_date:
|
||||
error (0, 0, _("garbage at end of stopping date in string %d"
|
||||
@@ -317,14 +318,15 @@ time_finish (struct localedef_t *locale)
|
||||
str = endp + 1;
|
||||
|
||||
/* Check for valid value. */
|
||||
if (time->era_entries[idx].stop_date[1] < 0
|
||||
|| time->era_entries[idx].stop_date[1] >= 12
|
||||
|| time->era_entries[idx].stop_date[2] < 0
|
||||
|| (time->era_entries[idx].stop_date[2]
|
||||
> days_per_month[time->era_entries[idx].stop_date[1]])
|
||||
|| (time->era_entries[idx].stop_date[1] == 2
|
||||
&& time->era_entries[idx].stop_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].stop_date[0])))
|
||||
if ((time->era_entries[idx].stop_date[1] < 0
|
||||
|| time->era_entries[idx].stop_date[1] >= 12
|
||||
|| time->era_entries[idx].stop_date[2] < 0
|
||||
|| (time->era_entries[idx].stop_date[2]
|
||||
> days_per_month[time->era_entries[idx].stop_date[1]])
|
||||
|| (time->era_entries[idx].stop_date[1] == 2
|
||||
&& time->era_entries[idx].stop_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].stop_date[0])))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("stopping date is illegal in"
|
||||
" string %d in `era' field in"
|
||||
" category `%s'"),
|
||||
@@ -332,7 +334,7 @@ time_finish (struct localedef_t *locale)
|
||||
}
|
||||
}
|
||||
|
||||
if (str == NULL || *str == '\0')
|
||||
if ((str == NULL || *str == '\0') && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("missing era name in string %d in `era' field"
|
||||
" in category `%s'"), idx + 1, "LC_TIME");
|
||||
@@ -343,7 +345,7 @@ time_finish (struct localedef_t *locale)
|
||||
{
|
||||
time->era_entries[idx].name = strsep (&str, ":");
|
||||
|
||||
if (str == NULL || *str == '\0')
|
||||
if ((str == NULL || *str == '\0') && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("missing era format in string %d in `era'"
|
||||
" field in category `%s'"),
|
||||
|
||||
@@ -70,6 +70,8 @@ int posix_conformance;
|
||||
/* If not zero give a lot more messages. */
|
||||
int verbose;
|
||||
|
||||
/* If not zero don't print warnings. */
|
||||
int be_quiet;
|
||||
|
||||
|
||||
/* Long options. */
|
||||
@@ -81,6 +83,7 @@ static const struct option long_options[] =
|
||||
{ "force", no_argument, NULL, 'c' },
|
||||
{ "inputfile", required_argument, NULL, 'i' },
|
||||
{ "posix", no_argument, &posix_conformance, 1 },
|
||||
{ "quiet", no_argument, &be_quiet, 1 },
|
||||
{ "verbose", no_argument, &verbose, 1},
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
@@ -258,21 +261,22 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
||||
|
||||
if (! avail)
|
||||
{
|
||||
const char *locale_names[] = { "LC_COLLATE", "LC_CTYPE",
|
||||
"LC_MONETARY", "LC_NUMERIC",
|
||||
"LC_TIME", "LC_MESSAGES" };
|
||||
static const char *locale_names[] =
|
||||
{ "LC_COLLATE", "LC_CTYPE", "LC_MONETARY",
|
||||
"LC_NUMERIC", "LC_TIME", "LC_MESSAGES"
|
||||
};
|
||||
char *fname;
|
||||
int fd;
|
||||
struct stat st;
|
||||
|
||||
asprintf (&fname, LOCALE_PATH "/%s/%s", act_add_locdef->name,
|
||||
asprintf (&fname, LOCALEDIR "/%s/%s", act_add_locdef->name,
|
||||
locale_names[cat]);
|
||||
fd = open (fname, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
free (fname);
|
||||
|
||||
asprintf (&fname, LOCALE_PATH "/%s/%s/SYS_%s",
|
||||
asprintf (&fname, LOCALEDIR "/%s/%s/SYS_%s",
|
||||
act_add_locdef->name, locale_names[cat],
|
||||
locale_names[cat]);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
|
||||
|
||||
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
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <locale.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -76,10 +77,31 @@ locfile_read (const char *filename, struct charset_t *charset)
|
||||
{
|
||||
if (filename[0] != '/')
|
||||
{
|
||||
char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
|
||||
char *i18npath = __secure_getenv ("I18NPATH");
|
||||
if (i18npath != NULL && *i18npath != '\0')
|
||||
{
|
||||
char path[strlen (filename) + 1 + strlen (i18npath) + 1];
|
||||
char *next;
|
||||
i18npath = strdupa (i18npath);
|
||||
|
||||
stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
|
||||
while (ldfile == NULL
|
||||
&& (next = strsep (&i18npath, ":")) != NULL)
|
||||
{
|
||||
stpcpy (stpcpy (stpcpy (path, next), "/"), filename);
|
||||
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
}
|
||||
}
|
||||
|
||||
/* Test in the default directory. */
|
||||
if (ldfile == NULL)
|
||||
{
|
||||
char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
|
||||
|
||||
stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
}
|
||||
}
|
||||
|
||||
if (ldfile == NULL)
|
||||
@@ -981,7 +1003,7 @@ write_locale_data (const char *output_path, const char *category,
|
||||
save_err = errno;
|
||||
}
|
||||
|
||||
if (fd == -1)
|
||||
if (fd == -1 && !be_quiet)
|
||||
{
|
||||
error (0, save_err, _("\
|
||||
cannot open output file `%s' for category `%s'"),
|
||||
@@ -1005,7 +1027,7 @@ cannot open output file `%s' for category `%s'"),
|
||||
if (maxiov > 0)
|
||||
step = MIN (maxiov, step);
|
||||
|
||||
if (writev (fd, &vec[cnt], step) < 0)
|
||||
if (writev (fd, &vec[cnt], step) < 0 && !be_quiet)
|
||||
{
|
||||
error (0, errno, _("failure while writing data for category `%s'"),
|
||||
category);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -53,6 +53,8 @@ struct localedef_t
|
||||
size_t len[6];
|
||||
};
|
||||
|
||||
/* Declared in localedef.c. */
|
||||
extern int be_quiet;
|
||||
|
||||
/* Found in localedef.c. */
|
||||
void def_to_process (const char *name, int category);
|
||||
|
||||
+7
-9
@@ -55,8 +55,8 @@ typedef struct weight_t
|
||||
((u_int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULES))
|
||||
|
||||
|
||||
static __inline int get_weight (const STRING_TYPE **str, weight_t *result);
|
||||
static __inline int
|
||||
static __inline void get_weight (const STRING_TYPE **str, weight_t *result);
|
||||
static __inline void
|
||||
get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
{
|
||||
unsigned int ch = *((USTRING_TYPE *) (*str))++;
|
||||
@@ -86,7 +86,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].value = &__collate_extra[idx];
|
||||
idx += result->data[cnt].number;
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
slot += level_size;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].number = 1;
|
||||
result->data[cnt].value = &__collate_table[slot + 1 + cnt];
|
||||
}
|
||||
return ch == 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We now look for any collation element which starts with CH.
|
||||
@@ -135,14 +135,12 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].value = &__collate_extra[idx];
|
||||
idx += result->data[cnt].number;
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* To next entry in list. */
|
||||
slot += __collate_extra[slot];
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return 0; /* To calm down gcc. */
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +153,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
do \
|
||||
{ \
|
||||
weight_t *newp; \
|
||||
do \
|
||||
while (*str != '\0') \
|
||||
{ \
|
||||
newp = (weight_t *) alloca (sizeof (weight_t) \
|
||||
+ (collate_nrules \
|
||||
@@ -168,7 +166,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
backw->next = newp; \
|
||||
newp->next = NULL; \
|
||||
backw = newp; \
|
||||
get_weight (&str, newp); \
|
||||
} \
|
||||
while (get_weight (&str, newp) == 0); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Get system dependent values and data structures. */
|
||||
#include <utmpbits.h>
|
||||
|
||||
+23
-2
@@ -26,6 +26,28 @@
|
||||
|
||||
/* This file was broken out from:
|
||||
$Log$
|
||||
Revision 1.1.2.1 1997/03/17 03:52:14 drepper
|
||||
(__mach_error_map_compat): Give full prototype.
|
||||
|
||||
Revision 1.2 1997/03/16 17:41:36 drepper
|
||||
(__mach_error_map_compat): Give full prototype.
|
||||
|
||||
Revision 1.2 1997/03/14 15:26:28 thomas
|
||||
Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
|
||||
* mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
|
||||
* mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
swtch_pri.
|
||||
|
||||
* mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
|
||||
* mach/mach_error.h (mach_error_string, mach_error,
|
||||
mach_error_type): Always provide prototypes.
|
||||
|
||||
Revision 1.1 1993/11/30 17:35:24 roland
|
||||
entered into RCS
|
||||
|
||||
@@ -39,8 +61,7 @@
|
||||
|
||||
|
||||
void
|
||||
__mach_error_map_compat( org_err )
|
||||
mach_error_t * org_err;
|
||||
__mach_error_map_compat(mach_error_t *org_err)
|
||||
{
|
||||
mach_error_t err = *org_err;
|
||||
|
||||
|
||||
+24
-3
@@ -26,6 +26,28 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.1.2.1 1997/03/17 03:52:30 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/16 17:41:48 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/14 15:26:29 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.1 1993/11/30 17:35:58 roland
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -67,9 +89,8 @@ mach_error_type( err )
|
||||
boolean_t mach_error_full_diag = FALSE;
|
||||
|
||||
const char *
|
||||
mach_error_string_int( err, diag )
|
||||
mach_error_t err;
|
||||
boolean_t * diag;
|
||||
mach_error_string_int(mach_error_t err,
|
||||
boolean_t * diag)
|
||||
{
|
||||
int sub, system, code;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994, 1996, 1997 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
|
||||
@@ -26,7 +26,7 @@
|
||||
#define _MACH_MACH_TRAPS_H_ 1
|
||||
|
||||
#include <mach/port.h>
|
||||
|
||||
#include <mach/kern_return.h>
|
||||
|
||||
/* Create and return a new receive right. */
|
||||
extern mach_port_t mach_reply_port (void);
|
||||
|
||||
+23
-1
@@ -26,6 +26,28 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.1.2.1 1997/03/17 03:52:38 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/16 17:42:02 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/14 15:26:30 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.1 1992/10/06 18:29:54 roland
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -63,7 +85,7 @@
|
||||
#include <mach_error.h>
|
||||
#include <mach/boolean.h>
|
||||
|
||||
extern char * mach_error_string_int();
|
||||
extern char * mach_error_string_int(mach_error_t, boolean_t *);
|
||||
|
||||
void
|
||||
mach_error( str, err )
|
||||
|
||||
+26
-6
@@ -26,6 +26,32 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.2.2.1 1997/03/17 03:52:48 drepper
|
||||
* (mach_error_string, mach_error, mach_error_type): Always provide
|
||||
* prototypes.
|
||||
*
|
||||
* Revision 1.3 1997/03/16 17:42:25 drepper
|
||||
* (mach_error_string, mach_error, mach_error_type): Always provide
|
||||
* prototypes.
|
||||
* (mach_error_fn_t): Comment out declaration; it appears to be entirely
|
||||
* unused dead code.
|
||||
*
|
||||
* Revision 1.3 1997/03/14 15:26:31 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.2 1993/11/23 20:39:08 mib
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -53,28 +79,22 @@ const char *mach_error_string(
|
||||
/*
|
||||
* Returns a string appropriate to the error argument given
|
||||
*/
|
||||
#if c_plusplus
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
void mach_error(
|
||||
/*
|
||||
* Prints an appropriate message on the standard error stream
|
||||
*/
|
||||
#if c_plusplus
|
||||
char *str,
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
const char *mach_error_type(
|
||||
/*
|
||||
* Returns a string with the error system, subsystem and code
|
||||
*/
|
||||
#if c_plusplus
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
#endif _MACH_ERROR_
|
||||
|
||||
+15
-14
@@ -1,23 +1,24 @@
|
||||
/* Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1992, 1993, 1995, 1997 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 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.
|
||||
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. */
|
||||
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 <mach_init.h>
|
||||
#include <mach/mach_interface.h>
|
||||
#include <mach/mig_support.h>
|
||||
|
||||
mach_port_t __mach_task_self_;
|
||||
vm_size_t __vm_page_size = 0; /* Must be data not bss for weak alias. */
|
||||
|
||||
+16
-15
@@ -1,28 +1,29 @@
|
||||
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1994, 1995, 1997 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 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.
|
||||
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. */
|
||||
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 <spin-lock.h>
|
||||
#include <mach/mach_traps.h>
|
||||
|
||||
void
|
||||
__spin_lock_solid (spin_lock_t *lock)
|
||||
{
|
||||
while (__spin_lock_locked (lock) || ! __spin_try_lock (lock))
|
||||
/* Yield to another thread (system call). */
|
||||
__swtch_pri ();
|
||||
__swtch_pri (0);
|
||||
}
|
||||
weak_alias (__spin_lock_solid, spin_lock_solid);
|
||||
|
||||
+160
-3
@@ -19,7 +19,7 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* V2.6.4-pt2 Sat Dec 14 1996
|
||||
/* V2.6.4-pt3 Thu Feb 20 1997
|
||||
|
||||
This work is mainly derived from malloc-2.6.4 by Doug Lea
|
||||
<dl@cs.oswego.edu>, which is available from:
|
||||
@@ -835,6 +835,7 @@ Void_t *(*__morecore)() = __default_morecore;
|
||||
#define mmap __mmap
|
||||
#define munmap __munmap
|
||||
#define mremap __mremap
|
||||
#define mprotect __mprotect
|
||||
#undef malloc_getpagesize
|
||||
#define malloc_getpagesize __getpagesize()
|
||||
|
||||
@@ -874,6 +875,8 @@ extern Void_t* sbrk();
|
||||
#define mALLOC_STATs __malloc_stats
|
||||
#define mALLOC_USABLE_SIZe __malloc_usable_size
|
||||
#define mALLOC_TRIm __malloc_trim
|
||||
#define mALLOC_GET_STATe __malloc_get_state
|
||||
#define mALLOC_SET_STATe __malloc_set_state
|
||||
|
||||
#else
|
||||
|
||||
@@ -889,6 +892,8 @@ extern Void_t* sbrk();
|
||||
#define mALLOC_STATs malloc_stats
|
||||
#define mALLOC_USABLE_SIZe malloc_usable_size
|
||||
#define mALLOC_TRIm malloc_trim
|
||||
#define mALLOC_GET_STATe malloc_get_state
|
||||
#define mALLOC_SET_STATe malloc_set_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -912,7 +917,11 @@ size_t mALLOC_USABLE_SIZe(Void_t*);
|
||||
void mALLOC_STATs(void);
|
||||
int mALLOPt(int, int);
|
||||
struct mallinfo mALLINFo(void);
|
||||
#else
|
||||
Void_t* mALLOC_GET_STATe(void);
|
||||
int mALLOC_SET_STATe(Void_t*);
|
||||
|
||||
#else /* !__STD_C */
|
||||
|
||||
#ifndef _LIBC
|
||||
void ptmalloc_init();
|
||||
#endif
|
||||
@@ -929,7 +938,10 @@ size_t mALLOC_USABLE_SIZe();
|
||||
void mALLOC_STATs();
|
||||
int mALLOPt();
|
||||
struct mallinfo mALLINFo();
|
||||
#endif
|
||||
Void_t* mALLOC_GET_STATe();
|
||||
int mALLOC_SET_STATe();
|
||||
|
||||
#endif /* __STD_C */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -3775,6 +3787,144 @@ int mALLOPt(param_number, value) int param_number; int value;
|
||||
|
||||
|
||||
|
||||
/* Get/set state: malloc_get_state() records the current state of all
|
||||
malloc variables (_except_ for the actual heap contents and `hook'
|
||||
function pointers) in a system dependent, opaque data structure.
|
||||
This data structure is dynamically allocated and can be free()d
|
||||
after use. malloc_set_state() restores the state of all malloc
|
||||
variables to the previously obtained state. This is especially
|
||||
useful when using this malloc as part of a shared library, and when
|
||||
the heap contents are saved/restored via some other method. The
|
||||
primary example for this is GNU Emacs with its `dumping' procedure.
|
||||
`Hook' function pointers are never saved or restored by these
|
||||
functions. */
|
||||
|
||||
#define MALLOC_STATE_MAGIC 0x444c4541l
|
||||
#define MALLOC_STATE_VERSION (0*0x100l + 0l) /* major*0x100 + minor */
|
||||
|
||||
struct malloc_state {
|
||||
long magic;
|
||||
long version;
|
||||
mbinptr av[NAV * 2 + 2];
|
||||
char* sbrk_base;
|
||||
int sbrked_mem_bytes;
|
||||
unsigned long trim_threshold;
|
||||
unsigned long top_pad;
|
||||
unsigned int n_mmaps_max;
|
||||
unsigned long mmap_threshold;
|
||||
int check_action;
|
||||
unsigned long max_sbrked_mem;
|
||||
unsigned long max_total_mem;
|
||||
unsigned int n_mmaps;
|
||||
unsigned int max_n_mmaps;
|
||||
unsigned long mmapped_mem;
|
||||
unsigned long max_mmapped_mem;
|
||||
};
|
||||
|
||||
Void_t*
|
||||
mALLOC_GET_STATe()
|
||||
{
|
||||
mchunkptr victim;
|
||||
struct malloc_state* ms;
|
||||
int i;
|
||||
mbinptr b;
|
||||
|
||||
ptmalloc_init();
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
victim = chunk_alloc(&main_arena, request2size(sizeof(*ms)));
|
||||
if(!victim) {
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return 0;
|
||||
}
|
||||
ms = (struct malloc_state*)chunk2mem(victim);
|
||||
ms->magic = MALLOC_STATE_MAGIC;
|
||||
ms->version = MALLOC_STATE_VERSION;
|
||||
ms->av[0] = main_arena.av[0];
|
||||
ms->av[1] = main_arena.av[1];
|
||||
for(i=0; i<NAV; i++) {
|
||||
b = bin_at(&main_arena, i);
|
||||
if(first(b) == b)
|
||||
ms->av[2*i+2] = ms->av[2*i+3] = 0; /* empty bin (or initial top) */
|
||||
else {
|
||||
ms->av[2*i+2] = first(b);
|
||||
ms->av[2*i+3] = last(b);
|
||||
}
|
||||
}
|
||||
ms->sbrk_base = sbrk_base;
|
||||
ms->sbrked_mem_bytes = sbrked_mem;
|
||||
ms->trim_threshold = trim_threshold;
|
||||
ms->top_pad = top_pad;
|
||||
ms->n_mmaps_max = n_mmaps_max;
|
||||
ms->mmap_threshold = mmap_threshold;
|
||||
ms->check_action = check_action;
|
||||
ms->max_sbrked_mem = max_sbrked_mem;
|
||||
#ifdef NO_THREADS
|
||||
ms->max_total_mem = max_total_mem;
|
||||
#else
|
||||
ms->max_total_mem = 0;
|
||||
#endif
|
||||
ms->n_mmaps = n_mmaps;
|
||||
ms->max_n_mmaps = max_n_mmaps;
|
||||
ms->mmapped_mem = mmapped_mem;
|
||||
ms->max_mmapped_mem = max_mmapped_mem;
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return (Void_t*)ms;
|
||||
}
|
||||
|
||||
int
|
||||
#if __STD_C
|
||||
mALLOC_SET_STATe(Void_t* msptr)
|
||||
#else
|
||||
mALLOC_SET_STATe(msptr) Void_t* msptr;
|
||||
#endif
|
||||
{
|
||||
struct malloc_state* ms = (struct malloc_state*)msptr;
|
||||
int i;
|
||||
mbinptr b;
|
||||
|
||||
ptmalloc_init();
|
||||
if(ms->magic != MALLOC_STATE_MAGIC) return -1;
|
||||
/* Must fail if the major version is too high. */
|
||||
if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2;
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
main_arena.av[0] = ms->av[0];
|
||||
main_arena.av[1] = ms->av[1];
|
||||
for(i=0; i<NAV; i++) {
|
||||
b = bin_at(&main_arena, i);
|
||||
if(ms->av[2*i+2] == 0)
|
||||
first(b) = last(b) = b;
|
||||
else {
|
||||
first(b) = ms->av[2*i+2];
|
||||
last(b) = ms->av[2*i+3];
|
||||
if(i > 0) {
|
||||
/* Make sure the links to the `av'-bins in the heap are correct. */
|
||||
first(b)->bk = b;
|
||||
last(b)->fd = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbrk_base = ms->sbrk_base;
|
||||
sbrked_mem = ms->sbrked_mem_bytes;
|
||||
trim_threshold = ms->trim_threshold;
|
||||
top_pad = ms->top_pad;
|
||||
n_mmaps_max = ms->n_mmaps_max;
|
||||
mmap_threshold = ms->mmap_threshold;
|
||||
check_action = ms->check_action;
|
||||
max_sbrked_mem = ms->max_sbrked_mem;
|
||||
#ifdef NO_THREADS
|
||||
max_total_mem = ms->max_total_mem;
|
||||
#endif
|
||||
n_mmaps = ms->n_mmaps;
|
||||
max_n_mmaps = ms->max_n_mmaps;
|
||||
mmapped_mem = ms->mmapped_mem;
|
||||
max_mmapped_mem = ms->max_mmapped_mem;
|
||||
/* add version-dependent code here */
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
|
||||
/* A simple, standard set of debugging hooks. Overhead is `only' one
|
||||
@@ -4048,12 +4198,19 @@ weak_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
|
||||
weak_alias (__malloc_stats, malloc_stats)
|
||||
weak_alias (__malloc_usable_size, malloc_usable_size)
|
||||
weak_alias (__malloc_trim, malloc_trim)
|
||||
weak_alias (__malloc_get_state, malloc_get_state)
|
||||
weak_alias (__malloc_set_state, malloc_set_state)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
History:
|
||||
|
||||
V2.6.4-pt3 Thu Feb 20 1997 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
||||
* Added malloc_get/set_state() (mainly for use in GNU emacs),
|
||||
using interface from Marcus Daniels
|
||||
* All parameters are now adjustable via environment variables
|
||||
|
||||
V2.6.4-pt2 Sat Dec 14 1996 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
||||
* Added debugging hooks
|
||||
* Fixed possible deadlock in realloc() when out of memory
|
||||
|
||||
@@ -171,6 +171,13 @@ extern size_t malloc_usable_size __MALLOC_P ((__malloc_ptr_t __ptr));
|
||||
/* Prints brief summary statistics on stderr. */
|
||||
extern void malloc_stats __MALLOC_P ((void));
|
||||
|
||||
/* Record the state of all malloc variables in an opaque data structure. */
|
||||
extern __malloc_ptr_t malloc_get_state __MALLOC_P ((void));
|
||||
|
||||
/* Restore the state of all malloc variables from data obtained with
|
||||
malloc_get_state(). */
|
||||
extern int malloc_set_state __MALLOC_P ((__malloc_ptr_t __ptr));
|
||||
|
||||
#if defined(__GLIBC__) || defined(MALLOC_HOOKS)
|
||||
|
||||
/* Hooks for debugging versions. */
|
||||
|
||||
@@ -106,6 +106,10 @@ Summary:
|
||||
|
||||
#ifndef __OBSTACK_H__
|
||||
#define __OBSTACK_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* We use subtraction of (char *) 0 instead of casting to int
|
||||
because on word-addressable machines a simple cast to int
|
||||
@@ -578,4 +582,8 @@ __extension__ \
|
||||
|
||||
#endif /* not __GNUC__ or not __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not __OBSTACK_H__ */
|
||||
|
||||
+16
-1
@@ -21,6 +21,9 @@
|
||||
subdir := manual
|
||||
export subdir := $(subdir)
|
||||
|
||||
# We need GNU awk for the xtract-typefun script.
|
||||
GAWK = gawk
|
||||
|
||||
.PHONY: all dvi info
|
||||
all: dvi info
|
||||
dvi: libc.dvi
|
||||
@@ -60,6 +63,17 @@ stamp-summary: summary.awk $(chapters) $(chapters-incl)
|
||||
# touch is broken on our machines. Sigh.
|
||||
date > $@
|
||||
|
||||
# Generate a file which can be added to the `dir' content to provide direct
|
||||
# access to the documentation of the function, variables, and other
|
||||
# definitions.
|
||||
dir-add.texi: manual/xtract-typefun.awk $(chapters-incl)
|
||||
if test -n "$(chapters-incl)"; then \
|
||||
(for i in $(chapters-incl); do \
|
||||
$(GAWK) -f $< < $i; \
|
||||
done) | sort > $@.new; \
|
||||
./move-if-change $@.new $@; \
|
||||
fi
|
||||
|
||||
# Generate Texinfo files from the C source for the example programs.
|
||||
%.c.texi: examples/%.c
|
||||
sed -e 's,[{}],@&,g' \
|
||||
@@ -78,7 +92,8 @@ distribute = $(minimal-dist) \
|
||||
$(patsubst examples/%.c,%.c.texi,$(filter examples/%.c, \
|
||||
$(minimal-dist))) \
|
||||
libc.info* libc.?? libc.??s texinfo.tex summary.texi \
|
||||
stamp-summary chapters chapters-incl
|
||||
stamp-summary chapters chapters-incl \
|
||||
xtract-typefun.awk
|
||||
export distribute := $(distribute)
|
||||
|
||||
tar-it = tar chovf $@ $^
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*@group*/
|
||||
#include <stdio.h>
|
||||
#include <dirent.h>
|
||||
/*@end group*/
|
||||
|
||||
static int
|
||||
one (struct dirent *unused)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
struct dirent **eps;
|
||||
int n;
|
||||
|
||||
n = scandir ("./", &eps, one, alphasort);
|
||||
if (n >= 0)
|
||||
{
|
||||
int cnt;
|
||||
for (cnt = 0; cnt < n; ++cnt)
|
||||
puts (eps[cnt]->d_name);
|
||||
}
|
||||
else
|
||||
perror ("Couldn't open the directory");
|
||||
|
||||
return 0;
|
||||
}
|
||||
+68
-2
@@ -166,6 +166,9 @@ parallels here to the stream facilities for ordinary files, described in
|
||||
* Simple Directory Lister:: A very simple directory listing program.
|
||||
* Random Access Directory:: Rereading part of the directory
|
||||
already read with the same stream.
|
||||
* Scanning Directory Content:: Get entries for user selected subset of
|
||||
contents in given directory.
|
||||
* Simple Directory Lister Mark II:: Revised version of the program.
|
||||
@end menu
|
||||
|
||||
@node Directory Entries
|
||||
@@ -386,9 +389,9 @@ the current working directory:
|
||||
|
||||
The order in which files appear in a directory tends to be fairly
|
||||
random. A more useful program would sort the entries (perhaps by
|
||||
alphabetizing them) before printing them; see @ref{Array Sort Function}.
|
||||
alphabetizing them) before printing them; see
|
||||
@ref{Scanning Directory Content} and @ref{Array Sort Function}.
|
||||
|
||||
@c ??? not documented: scandir, alphasort
|
||||
|
||||
@node Random Access Directory
|
||||
@subsection Random Access in a Directory Stream
|
||||
@@ -429,6 +432,69 @@ closing and reopening the directory can invalidate values returned by
|
||||
@code{telldir}.
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@node Scanning Directory Content
|
||||
@subsection Scanning the Content of a Directory
|
||||
|
||||
A higher-level interface to the directory handling functions is the
|
||||
@code{scandir} function. With its help one can select a subset of the
|
||||
entries in a directory, possibly sort them and get as the result a list
|
||||
of names.
|
||||
|
||||
@deftypefun int scandir (const char *@var{dir}, struct dirent ***@var{namelist}, int (*@var{selector}) (struct dirent *), int (*@var{cmp}) (const void *, const void *))
|
||||
|
||||
The @code{scandir} function scans the contents of the directory selected
|
||||
by @var{dir}. The result in @var{namelist} is an array of pointers to
|
||||
structure of type @code{struct dirent} which describe all selected
|
||||
directory entries and which is allocated using @code{malloc}. Instead
|
||||
of always getting all directory entries returned, the user supplied
|
||||
function @var{selector} can be used to decide which entries are in the
|
||||
result. Only the entries for which @var{selector} returns a nonzero
|
||||
value are selected.
|
||||
|
||||
Finally the entries in the @var{namelist} are sorted using the user
|
||||
supplied function @var{cmp}. The arguments of the @var{cmp} function
|
||||
are of type @code{struct dirent **}. I.e., one cannot directly use the
|
||||
@code{strcmp} or @code{strcoll} function; see the function
|
||||
@code{alphasort} below.
|
||||
|
||||
The return value of the function gives the number of entries placed in
|
||||
@var{namelist}. If it is @code{-1} an error occurred and the global
|
||||
variable @code{errno} contains more information on the error.
|
||||
@end deftypefun
|
||||
|
||||
As said above the fourth argument to the @code{scandir} function must be
|
||||
a pointer to a sorting function. For the convenience of the programmer
|
||||
the GNU C library contains an implementation of a function which is very
|
||||
helpful for this purpose.
|
||||
|
||||
@deftypefun int alphasort (const void *@var{a}, const void *@var{b})
|
||||
The @code{alphasort} function behaves like the @code{strcmp} function
|
||||
(@pxref{String/Array Comparison}). The difference is that the arguments
|
||||
are not string pointers but instead they are of type
|
||||
@code{struct dirent **}.
|
||||
|
||||
Return value of is less than, equal to, or greater than zero depending
|
||||
on the order of the two entries @var{a} and @var{b}.
|
||||
@end deftypefun
|
||||
|
||||
@node Simple Directory Lister Mark II
|
||||
@subsection Simple Program to List a Directory, Mark II
|
||||
|
||||
Here is a revised version of the directory lister found above
|
||||
(@pxref{Simple Directory Lister}). Using the @code{scandir} function we
|
||||
can avoid using the functions which directly work with the directory
|
||||
contents. After the call the found entries are available for direct
|
||||
used.
|
||||
|
||||
@smallexample
|
||||
@include dir2.c.texi
|
||||
@end smallexample
|
||||
|
||||
Please note the simple selector function for this example. Since
|
||||
we want to see all directory entries we always return @code{1}.
|
||||
|
||||
|
||||
@node Hard Links
|
||||
@section Hard Links
|
||||
@cindex hard link
|
||||
|
||||
+1
-1
@@ -830,7 +830,7 @@ unsuccessful program completion in a general sense.
|
||||
|
||||
On POSIX systems, the value of this macro is @code{1}. On other
|
||||
systems, the value might be some other (possibly non-constant) integer
|
||||
expression. Other nonzero status values also indicate future. Certain
|
||||
expression. Other nonzero status values also indicate failures. Certain
|
||||
programs use different nonzero status values to indicate particular
|
||||
kinds of "non-success". For example, @code{diff} uses status value
|
||||
@code{1} to mean that the files are different, and @code{2} or more to
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#! /usr/local/bin/gawk -f
|
||||
BEGIN {
|
||||
last_node="";
|
||||
}
|
||||
|
||||
/^@node/ {
|
||||
last_node = gensub (/@node +([^@,]+).*/, "\\1", 1);
|
||||
}
|
||||
|
||||
/^@deftypefun/ {
|
||||
printf ("* %s: (libc)%s.\n",
|
||||
gensub (/@deftypefun +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\2", 1),
|
||||
last_node);
|
||||
}
|
||||
|
||||
/^@deftypevr/ {
|
||||
printf ("* %s: (libc)%s.\n",
|
||||
gensub (/@deftypevr +([^{ ]+|\{[^}]+\}) +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
|
||||
last_node);
|
||||
}
|
||||
|
||||
/^@deftypefn/ {
|
||||
printf ("* %s: (libc)%s.\n",
|
||||
gensub (/@deftypefn +([^{ ]+|\{[^}]+\}) +[^{ ]*(\{[^}]+\})? +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
|
||||
last_node);
|
||||
}
|
||||
+7
-4
@@ -1,5 +1,5 @@
|
||||
/* Declarations for math functions.
|
||||
Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 92, 93, 95, 96, 97 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
|
||||
@@ -99,9 +99,12 @@ extern _LIB_VERSION_TYPE _LIB_VERSION;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_SVID
|
||||
#if defined __USE_SVID && !defined __cplusplus
|
||||
/* In SVID error handling, `matherr' is called with this description
|
||||
of the exceptional condition. */
|
||||
of the exceptional condition.
|
||||
|
||||
We have a problem when using C++ since `exception' is reserved in
|
||||
C++. */
|
||||
struct exception
|
||||
{
|
||||
int type;
|
||||
@@ -128,7 +131,7 @@ extern int matherr __P ((struct exception *));
|
||||
#define HUGE FLT_MAX
|
||||
#include <float.h> /* Defines FLT_MAX. */
|
||||
|
||||
#endif
|
||||
#endif /* SVID && !C++ */
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
|
||||
@@ -71,6 +71,11 @@ unsigned int error_message_count;
|
||||
#define program_name program_invocation_name
|
||||
#include <errno.h>
|
||||
|
||||
/* In GNU libc we want do not want to use the common name `error' directly.
|
||||
Instead make it a weak alias. */
|
||||
#define error __error
|
||||
#define error_at_line __error_at_line
|
||||
|
||||
#else
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
@@ -230,3 +235,11 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
||||
if (status)
|
||||
exit (status);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Make the weak alias. */
|
||||
#undef error
|
||||
#undef error_at_line
|
||||
weak_alias (__error, error)
|
||||
weak_alias (__error_at_line, error_at_line)
|
||||
#endif
|
||||
|
||||
+1
-3
@@ -59,9 +59,7 @@ getpass (prompt)
|
||||
/* Save the old one. */
|
||||
s = t;
|
||||
/* Tricky, tricky. */
|
||||
t.c_lflag &= ~(ECHO|ISIG|ICANON);
|
||||
t.c_cc[VTIME] = 0;
|
||||
t.c_cc[VMIN] = 1;
|
||||
t.c_lflag &= ~(ECHO|ISIG);
|
||||
tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
|
||||
}
|
||||
else
|
||||
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 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,10 +21,14 @@
|
||||
#define _LIBGEN_H 1
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return directory part of PATH or "." if none is available. */
|
||||
extern char *dirname __P ((char *__path));
|
||||
|
||||
/* Return filename part of PATH. */
|
||||
extern char *basename __P ((__const char *__path));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* libgen.h */
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* search.h -- declarations for System V style searching functions.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Declarations for System V style searching functions.
|
||||
Copyright (C) 1995, 1996, 1997 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
|
||||
|
||||
+59
-45
@@ -67,21 +67,22 @@ typedef struct _code {
|
||||
int c_val;
|
||||
} CODE;
|
||||
|
||||
CODE prioritynames[] = {
|
||||
"alert", LOG_ALERT,
|
||||
"crit", LOG_CRIT,
|
||||
"debug", LOG_DEBUG,
|
||||
"emerg", LOG_EMERG,
|
||||
"err", LOG_ERR,
|
||||
"error", LOG_ERR, /* DEPRECATED */
|
||||
"info", LOG_INFO,
|
||||
"none", INTERNAL_NOPRI, /* INTERNAL */
|
||||
"notice", LOG_NOTICE,
|
||||
"panic", LOG_EMERG, /* DEPRECATED */
|
||||
"warn", LOG_WARNING, /* DEPRECATED */
|
||||
"warning", LOG_WARNING,
|
||||
NULL, -1,
|
||||
};
|
||||
CODE prioritynames[] =
|
||||
{
|
||||
{ "alert", LOG_ALERT },
|
||||
{ "crit", LOG_CRIT },
|
||||
{ "debug", LOG_DEBUG },
|
||||
{ "emerg", LOG_EMERG },
|
||||
{ "err", LOG_ERR },
|
||||
{ "error", LOG_ERR }, /* DEPRECATED */
|
||||
{ "info", LOG_INFO },
|
||||
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
|
||||
{ "notice", LOG_NOTICE },
|
||||
{ "panic", LOG_EMERG }, /* DEPRECATED */
|
||||
{ "warn", LOG_WARNING }, /* DEPRECATED */
|
||||
{ "warning", LOG_WARNING },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* facility codes */
|
||||
@@ -114,31 +115,32 @@ CODE prioritynames[] = {
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
|
||||
#ifdef SYSLOG_NAMES
|
||||
CODE facilitynames[] = {
|
||||
"auth", LOG_AUTH,
|
||||
"authpriv", LOG_AUTHPRIV,
|
||||
"cron", LOG_CRON,
|
||||
"daemon", LOG_DAEMON,
|
||||
"ftp", LOG_FTP,
|
||||
"kern", LOG_KERN,
|
||||
"lpr", LOG_LPR,
|
||||
"mail", LOG_MAIL,
|
||||
"mark", INTERNAL_MARK, /* INTERNAL */
|
||||
"news", LOG_NEWS,
|
||||
"security", LOG_AUTH, /* DEPRECATED */
|
||||
"syslog", LOG_SYSLOG,
|
||||
"user", LOG_USER,
|
||||
"uucp", LOG_UUCP,
|
||||
"local0", LOG_LOCAL0,
|
||||
"local1", LOG_LOCAL1,
|
||||
"local2", LOG_LOCAL2,
|
||||
"local3", LOG_LOCAL3,
|
||||
"local4", LOG_LOCAL4,
|
||||
"local5", LOG_LOCAL5,
|
||||
"local6", LOG_LOCAL6,
|
||||
"local7", LOG_LOCAL7,
|
||||
NULL, -1,
|
||||
};
|
||||
CODE facilitynames[] =
|
||||
{
|
||||
{ "auth", LOG_AUTH },
|
||||
{ "authpriv", LOG_AUTHPRIV },
|
||||
{ "cron", LOG_CRON },
|
||||
{ "daemon", LOG_DAEMON },
|
||||
{ "ftp", LOG_FTP },
|
||||
{ "kern", LOG_KERN },
|
||||
{ "lpr", LOG_LPR },
|
||||
{ "mail", LOG_MAIL },
|
||||
{ "mark", INTERNAL_MARK }, /* INTERNAL */
|
||||
{ "news", LOG_NEWS },
|
||||
{ "security", LOG_AUTH }, /* DEPRECATED */
|
||||
{ "syslog", LOG_SYSLOG },
|
||||
{ "user", LOG_USER },
|
||||
{ "uucp", LOG_UUCP },
|
||||
{ "local0", LOG_LOCAL0 },
|
||||
{ "local1", LOG_LOCAL1 },
|
||||
{ "local2", LOG_LOCAL2 },
|
||||
{ "local3", LOG_LOCAL3 },
|
||||
{ "local4", LOG_LOCAL4 },
|
||||
{ "local5", LOG_LOCAL5 },
|
||||
{ "local6", LOG_LOCAL6 },
|
||||
{ "local7", LOG_LOCAL7 },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL
|
||||
@@ -186,11 +188,23 @@ CODE facilitynames[] = {
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
void closelog __P((void));
|
||||
void openlog __P((const char *, int, int));
|
||||
int setlogmask __P((int));
|
||||
void syslog __P((int, const char *, ...));
|
||||
void vsyslog __P((int, const char *, _BSD_VA_LIST_));
|
||||
|
||||
/* Close desriptor used to write to system logger. */
|
||||
extern void closelog __P ((void));
|
||||
|
||||
/* Open connection to system logger. */
|
||||
extern void openlog __P ((__const char *__ident, int __option,
|
||||
int __facility));
|
||||
|
||||
/* Set the log mask level. */
|
||||
extern int setlogmask __P ((int __mask));
|
||||
|
||||
/* Generate a log message using FMT string and option arguments. */
|
||||
extern void syslog __P ((int __pri, __const char *__fmt, ...));
|
||||
|
||||
/* Generate a log message using FMT and using arguments pointed to by AP. */
|
||||
extern void vsyslog __P ((int __pri, __const char *__fmt, _BSD_VA_LIST_ __ap));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !KERNEL */
|
||||
|
||||
+87
-55
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -43,26 +43,82 @@ struct ether
|
||||
#define EXTERN_PARSER
|
||||
#include "../nss/nss_files/files-parse.c"
|
||||
|
||||
static bool_t new_start = 1;
|
||||
static char *oldkey = NULL;
|
||||
static int oldkeylen = 0;
|
||||
struct response
|
||||
{
|
||||
char *val;
|
||||
struct response *next;
|
||||
};
|
||||
|
||||
static struct response *start = NULL;
|
||||
static struct response *next = NULL;
|
||||
|
||||
static int
|
||||
saveit (int instatus, char *inkey, int inkeylen, char *inval,
|
||||
int invallen, char *indata)
|
||||
{
|
||||
if (instatus != YP_TRUE)
|
||||
return instatus;
|
||||
|
||||
if (inkey && inkeylen > 0 && inval && invallen > 0)
|
||||
{
|
||||
if (start == NULL)
|
||||
{
|
||||
start = malloc (sizeof (struct response));
|
||||
next = start;
|
||||
}
|
||||
else
|
||||
{
|
||||
next->next = malloc (sizeof (struct response));
|
||||
next = next->next;
|
||||
}
|
||||
next->next = NULL;
|
||||
next->val = malloc (invallen + 1);
|
||||
strncpy (next->val, inval, invallen);
|
||||
next->val[invallen] = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
internal_nis_setetherent (void)
|
||||
{
|
||||
char *domainname;
|
||||
struct ypall_callback ypcb;
|
||||
enum nss_status status;
|
||||
|
||||
yp_get_default_domain (&domainname);
|
||||
|
||||
while (start != NULL)
|
||||
{
|
||||
if (start->val != NULL)
|
||||
free (start->val);
|
||||
next = start;
|
||||
start = start->next;
|
||||
free (next);
|
||||
}
|
||||
start = NULL;
|
||||
|
||||
ypcb.foreach = saveit;
|
||||
ypcb.data = NULL;
|
||||
status = yperr2nss (yp_all (domainname, "ethers.byname", &ypcb));
|
||||
next = start;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_setetherent (void)
|
||||
{
|
||||
enum nss_status result;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
new_start = 1;
|
||||
if (oldkey != NULL)
|
||||
{
|
||||
free (oldkey);
|
||||
oldkey = NULL;
|
||||
oldkeylen = 0;
|
||||
}
|
||||
result = internal_nis_setetherent ();
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
@@ -70,13 +126,16 @@ _nss_nis_endetherent (void)
|
||||
{
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
new_start = 1;
|
||||
if (oldkey != NULL)
|
||||
while (start != NULL)
|
||||
{
|
||||
free (oldkey);
|
||||
oldkey = NULL;
|
||||
oldkeylen = 0;
|
||||
if (start->val != NULL)
|
||||
free (start->val);
|
||||
next = start;
|
||||
start = start->next;
|
||||
free (next);
|
||||
}
|
||||
start = NULL;
|
||||
next = NULL;
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
@@ -87,54 +146,27 @@ static enum nss_status
|
||||
internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
|
||||
{
|
||||
struct parser_data *data = (void *) buffer;
|
||||
char *domain, *result, *outkey;
|
||||
int len, keylen, parse_res;
|
||||
int parse_res;
|
||||
|
||||
if (yp_get_default_domain (&domain))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
if (start == NULL)
|
||||
internal_nis_setetherent ();
|
||||
|
||||
/* Get the next entry until we found a correct one. */
|
||||
do
|
||||
{
|
||||
enum nss_status retval;
|
||||
char *p;
|
||||
|
||||
if (new_start)
|
||||
retval = yperr2nss (yp_first (domain, "ethers.byaddr",
|
||||
&outkey, &keylen, &result, &len));
|
||||
else
|
||||
retval = yperr2nss ( yp_next (domain, "ethers.byaddr",
|
||||
oldkey, oldkeylen,
|
||||
&outkey, &keylen, &result, &len));
|
||||
if (next == NULL)
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
p = strcpy (buffer, next->val);
|
||||
next = next->next;
|
||||
|
||||
if (retval != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
__set_errno (EAGAIN);
|
||||
return retval;
|
||||
}
|
||||
|
||||
if ((size_t) (len + 1) > buflen)
|
||||
{
|
||||
free (result);
|
||||
__set_errno (ERANGE);
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
p = strncpy (buffer, result, len);
|
||||
buffer[len] = '\0';
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
free (result);
|
||||
|
||||
parse_res = _nss_files_parse_etherent (p, eth, data, buflen);
|
||||
if (!parse_res && errno == ERANGE)
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
|
||||
free (oldkey);
|
||||
oldkey = outkey;
|
||||
oldkeylen = keylen;
|
||||
new_start = 0;
|
||||
}
|
||||
while (!parse_res);
|
||||
|
||||
@@ -156,8 +188,8 @@ _nss_nis_getetherent_r (struct ether *result, char *buffer, size_t buflen)
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_getethernam_r (const char *name, struct ether *eth,
|
||||
char *buffer, size_t buflen)
|
||||
_nss_nis_gethostton_r (const char *name, struct ether *eth,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
struct parser_data *data = (void *) buffer;
|
||||
enum nss_status retval;
|
||||
@@ -210,8 +242,8 @@ _nss_nis_getethernam_r (const char *name, struct ether *eth,
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_getetherbyaddr_r (struct ether_addr *addr, struct ether *eth,
|
||||
char *buffer, size_t buflen)
|
||||
_nss_nis_getntohost_r (struct ether_addr *addr, struct ether *eth,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
struct parser_data *data = (void *) buffer;
|
||||
enum nss_status retval;
|
||||
|
||||
+22
-4
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -242,7 +242,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_gethostbyname_r (const char *name, struct hostent *host,
|
||||
_nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
||||
char *buffer, size_t buflen, int *h_errnop)
|
||||
{
|
||||
enum nss_status retval;
|
||||
@@ -297,9 +297,9 @@ _nss_nis_gethostbyname_r (const char *name, struct hostent *host,
|
||||
|
||||
parse_res = parse_line (p, host, data, buflen);
|
||||
|
||||
if (!parse_res)
|
||||
if (!parse_res || host->h_addrtype != af)
|
||||
{
|
||||
if (errno == ERANGE)
|
||||
if (!parse_res && errno == ERANGE)
|
||||
{
|
||||
*h_errnop = NETDB_INTERNAL;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
@@ -315,6 +315,24 @@ _nss_nis_gethostbyname_r (const char *name, struct hostent *host,
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_gethostbyname_r (const char *name, struct hostent *host,
|
||||
char *buffer, size_t buflen, int *h_errnop)
|
||||
{
|
||||
if (_res.options & RES_USE_INET6)
|
||||
{
|
||||
enum nss_status status;
|
||||
|
||||
status = _nss_nis_gethostbyname2_r (name, AF_INET6, host, buffer, buflen,
|
||||
h_errnop);
|
||||
if (status == NSS_STATUS_SUCCESS)
|
||||
return status;
|
||||
}
|
||||
|
||||
return _nss_nis_gethostbyname2_r (name, AF_INET, host, buffer, buflen,
|
||||
h_errnop);
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_gethostbyaddr_r (char *addr, int addrlen, int type,
|
||||
struct hostent *host, char *buffer, size_t buflen,
|
||||
|
||||
+88
-56
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -35,26 +35,82 @@
|
||||
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
static bool_t new_start = 1;
|
||||
static char *oldkey = NULL;
|
||||
static int oldkeylen = 0;
|
||||
struct response
|
||||
{
|
||||
char *val;
|
||||
struct response *next;
|
||||
};
|
||||
|
||||
static struct response *start = NULL;
|
||||
static struct response *next = NULL;
|
||||
|
||||
static int
|
||||
saveit (int instatus, char *inkey, int inkeylen, char *inval,
|
||||
int invallen, char *indata)
|
||||
{
|
||||
if (instatus != YP_TRUE)
|
||||
return instatus;
|
||||
|
||||
if (inkey && inkeylen > 0 && inval && invallen > 0)
|
||||
{
|
||||
if (start == NULL)
|
||||
{
|
||||
start = malloc (sizeof (struct response));
|
||||
next = start;
|
||||
}
|
||||
else
|
||||
{
|
||||
next->next = malloc (sizeof (struct response));
|
||||
next = next->next;
|
||||
}
|
||||
next->next = NULL;
|
||||
next->val = malloc (invallen + 1);
|
||||
strncpy (next->val, inval, invallen);
|
||||
next->val[invallen] = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
internal_nis_setprotoent (void)
|
||||
{
|
||||
char *domainname;
|
||||
struct ypall_callback ypcb;
|
||||
enum nss_status status;
|
||||
|
||||
yp_get_default_domain (&domainname);
|
||||
|
||||
while (start != NULL)
|
||||
{
|
||||
if (start->val != NULL)
|
||||
free (start->val);
|
||||
next = start;
|
||||
start = start->next;
|
||||
free (next);
|
||||
}
|
||||
start = NULL;
|
||||
|
||||
ypcb.foreach = saveit;
|
||||
ypcb.data = NULL;
|
||||
status = yperr2nss (yp_all (domainname, "protocols.bynumber", &ypcb));
|
||||
next = start;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
_nss_nis_setprotoent (void)
|
||||
{
|
||||
enum nss_status status;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
new_start = 1;
|
||||
if (oldkey != NULL)
|
||||
{
|
||||
free (oldkey);
|
||||
oldkey = NULL;
|
||||
oldkeylen = 0;
|
||||
}
|
||||
status = internal_nis_setprotoent ();
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
@@ -62,16 +118,19 @@ _nss_nis_endprotoent (void)
|
||||
{
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
new_start = 1;
|
||||
if (oldkey != NULL)
|
||||
while (start != NULL)
|
||||
{
|
||||
free (oldkey);
|
||||
oldkey = NULL;
|
||||
oldkeylen = 0;
|
||||
if (start->val != NULL)
|
||||
free (start->val);
|
||||
next = start;
|
||||
start = start->next;
|
||||
free (next);
|
||||
}
|
||||
|
||||
start = NULL;
|
||||
next = NULL;
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -80,57 +139,30 @@ internal_nis_getprotoent_r (struct protoent *proto,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
struct parser_data *data = (void *) buffer;
|
||||
char *domain, *result, *outkey;
|
||||
int len, keylen, parse_res;
|
||||
int parse_res;
|
||||
|
||||
if (yp_get_default_domain (&domain))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
if (start == NULL)
|
||||
internal_nis_setprotoent ();
|
||||
|
||||
/* Get the next entry until we found a correct one. */
|
||||
do
|
||||
{
|
||||
enum nss_status retval;
|
||||
char *p;
|
||||
|
||||
if (new_start)
|
||||
retval = yperr2nss (yp_first (domain, "protocols.bynumber",
|
||||
&outkey, &keylen, &result, &len));
|
||||
else
|
||||
retval = yperr2nss ( yp_next (domain, "protocols.bynumber",
|
||||
oldkey, oldkeylen,
|
||||
&outkey, &keylen, &result, &len));
|
||||
|
||||
if (retval != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
__set_errno (EAGAIN);
|
||||
return retval;
|
||||
}
|
||||
|
||||
if ((size_t) (len + 1) > buflen)
|
||||
{
|
||||
free (result);
|
||||
__set_errno (ERANGE);
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
p = strncpy (buffer, result, len);
|
||||
buffer[len] = '\0';
|
||||
|
||||
if (next == NULL)
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
p = strcpy (buffer, next->val);
|
||||
next = next->next;
|
||||
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
free (result);
|
||||
|
||||
parse_res = _nss_files_parse_protoent (p, proto, data, buflen);
|
||||
if (!parse_res && errno == ERANGE)
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
|
||||
free (oldkey);
|
||||
oldkey = outkey;
|
||||
oldkeylen = keylen;
|
||||
new_start = 0;
|
||||
}
|
||||
while (!parse_res);
|
||||
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -130,6 +130,7 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp,
|
||||
gid_t *gidlist)
|
||||
{
|
||||
char *p;
|
||||
int gidlen;
|
||||
|
||||
if (!s || !isdigit (*s))
|
||||
{
|
||||
@@ -162,14 +163,15 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp,
|
||||
|
||||
*gidp = (atoi (p));
|
||||
|
||||
*gidlenp = 0;
|
||||
#if 0
|
||||
gidlen = 0;
|
||||
|
||||
while ((p = strchr (p, ',')) != NULL)
|
||||
{
|
||||
p++;
|
||||
gidlist[*gidlenp++] = atoi (p);
|
||||
gidlist[gidlen++] = atoi (p);
|
||||
}
|
||||
#endif
|
||||
|
||||
*gidlenp = gidlen;
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+83
-62
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -35,27 +35,77 @@
|
||||
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
struct response_t
|
||||
{
|
||||
char *val;
|
||||
struct response_t *next;
|
||||
};
|
||||
|
||||
struct intern_t
|
||||
{
|
||||
bool_t new_start;
|
||||
char *oldkey;
|
||||
int oldkeylen;
|
||||
struct response_t *start;
|
||||
struct response_t *next;
|
||||
};
|
||||
typedef struct intern_t intern_t;
|
||||
|
||||
static intern_t intern = {TRUE, NULL, 0};
|
||||
static intern_t intern = {NULL, NULL};
|
||||
|
||||
static int
|
||||
saveit (int instatus, char *inkey, int inkeylen, char *inval,
|
||||
int invallen, char *indata)
|
||||
{
|
||||
intern_t *intern = (intern_t *)indata;
|
||||
|
||||
if (instatus != YP_TRUE)
|
||||
return instatus;
|
||||
|
||||
if (inkey && inkeylen > 0 && inval && invallen > 0)
|
||||
{
|
||||
if (intern->start == NULL)
|
||||
{
|
||||
intern->start = malloc (sizeof (struct response_t));
|
||||
intern->next = intern->start;
|
||||
}
|
||||
else
|
||||
{
|
||||
intern->next->next = malloc (sizeof (struct response_t));
|
||||
intern->next = intern->next->next;
|
||||
}
|
||||
intern->next->next = NULL;
|
||||
intern->next->val = malloc (invallen + 1);
|
||||
strncpy (intern->next->val, inval, invallen);
|
||||
intern->next->val[invallen] = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum nss_status
|
||||
internal_nis_setrpcent (intern_t *data)
|
||||
internal_nis_setrpcent (intern_t *intern)
|
||||
{
|
||||
data->new_start = 1;
|
||||
if (data->oldkey != NULL)
|
||||
char *domainname;
|
||||
struct ypall_callback ypcb;
|
||||
enum nss_status status;
|
||||
|
||||
if (yp_get_default_domain (&domainname))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
|
||||
while (intern->start != NULL)
|
||||
{
|
||||
free (data->oldkey);
|
||||
data->oldkey = NULL;
|
||||
data->oldkeylen = 0;
|
||||
if (intern->start->val != NULL)
|
||||
free (intern->start->val);
|
||||
intern->next = intern->start;
|
||||
intern->start = intern->start->next;
|
||||
free (intern->next);
|
||||
}
|
||||
return NSS_STATUS_SUCCESS;
|
||||
intern->start = NULL;
|
||||
|
||||
ypcb.foreach = saveit;
|
||||
ypcb.data = (char *)intern;
|
||||
status = yperr2nss (yp_all(domainname, "rpc.bynumber", &ypcb));
|
||||
intern->next = intern->start;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum nss_status
|
||||
@@ -73,15 +123,18 @@ _nss_nis_setrpcent (void)
|
||||
}
|
||||
|
||||
static enum nss_status
|
||||
internal_nis_endrpcent (intern_t *data)
|
||||
internal_nis_endrpcent (intern_t *intern)
|
||||
{
|
||||
data->new_start = 1;
|
||||
if (data->oldkey != NULL)
|
||||
while (intern->start != NULL)
|
||||
{
|
||||
free (data->oldkey);
|
||||
data->oldkey = NULL;
|
||||
data->oldkeylen = 0;
|
||||
if (intern->start->val != NULL)
|
||||
free (intern->start->val);
|
||||
intern->next = intern->start;
|
||||
intern->start = intern->start->next;
|
||||
free (intern->next);
|
||||
}
|
||||
intern->start = NULL;
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -104,60 +157,28 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
|
||||
intern_t *data)
|
||||
{
|
||||
struct parser_data *pdata = (void *) buffer;
|
||||
char *domain;
|
||||
char *result;
|
||||
int len, parse_res;
|
||||
char *outkey;
|
||||
int keylen;
|
||||
int parse_res;
|
||||
char *p;
|
||||
|
||||
if (yp_get_default_domain (&domain))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
|
||||
|
||||
if (data->start == NULL)
|
||||
internal_nis_setrpcent (data);
|
||||
|
||||
/* Get the next entry until we found a correct one. */
|
||||
do
|
||||
{
|
||||
enum nss_status retval;
|
||||
|
||||
if (data->new_start)
|
||||
retval = yperr2nss (yp_first (domain, "rpc.bynumber",
|
||||
&outkey, &keylen, &result, &len));
|
||||
else
|
||||
retval = yperr2nss ( yp_next (domain, "rpc.bynumber",
|
||||
data->oldkey, data->oldkeylen,
|
||||
&outkey, &keylen, &result, &len));
|
||||
|
||||
if (retval != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
__set_errno (EAGAIN);
|
||||
return retval;
|
||||
}
|
||||
|
||||
if ((size_t) (len + 1) > buflen)
|
||||
{
|
||||
free (result);
|
||||
__set_errno (ERANGE);
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
p = strncpy (buffer, result, len);
|
||||
buffer[len] = '\0';
|
||||
if (data->next == NULL)
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
p = strcpy (buffer, data->next->val);
|
||||
data->next = data->next->next;
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
free (result);
|
||||
|
||||
|
||||
parse_res = _nss_files_parse_rpcent (p, rpc, pdata, buflen);
|
||||
if (!parse_res && errno == ERANGE)
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
|
||||
free (data->oldkey);
|
||||
data->oldkey = outkey;
|
||||
data->oldkeylen = keylen;
|
||||
data->new_start = 0;
|
||||
}
|
||||
while (!parse_res);
|
||||
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -179,7 +200,7 @@ enum nss_status
|
||||
_nss_nis_getrpcbyname_r (const char *name, struct rpcent *rpc,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
intern_t data = {TRUE, NULL, 0};
|
||||
intern_t data = {NULL, NULL};
|
||||
enum nss_status status;
|
||||
int found;
|
||||
|
||||
|
||||
+90
-65
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -37,27 +37,77 @@ extern int _nss_files_parse_servent (char *line, struct servent *result,
|
||||
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
|
||||
struct response_t
|
||||
{
|
||||
char *val;
|
||||
struct response_t *next;
|
||||
};
|
||||
|
||||
struct intern_t
|
||||
{
|
||||
bool_t new_start;
|
||||
char *oldkey;
|
||||
int oldkeylen;
|
||||
struct response_t *start;
|
||||
struct response_t *next;
|
||||
};
|
||||
typedef struct intern_t intern_t;
|
||||
|
||||
static intern_t intern = {TRUE, NULL, 0};
|
||||
static intern_t intern = { NULL, NULL };
|
||||
|
||||
static int
|
||||
saveit (int instatus, char *inkey, int inkeylen, char *inval,
|
||||
int invallen, char *indata)
|
||||
{
|
||||
intern_t *intern = (intern_t *) indata;
|
||||
|
||||
if (instatus != YP_TRUE)
|
||||
return instatus;
|
||||
|
||||
if (inkey && inkeylen > 0 && inval && invallen > 0)
|
||||
{
|
||||
if (intern->start == NULL)
|
||||
{
|
||||
intern->start = malloc (sizeof (struct response_t));
|
||||
intern->next = intern->start;
|
||||
}
|
||||
else
|
||||
{
|
||||
intern->next->next = malloc (sizeof (struct response_t));
|
||||
intern->next = intern->next->next;
|
||||
}
|
||||
intern->next->next = NULL;
|
||||
intern->next->val = malloc (invallen + 1);
|
||||
strncpy (intern->next->val, inval, invallen);
|
||||
intern->next->val[invallen] = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum nss_status
|
||||
internal_nis_setservent (intern_t * intern)
|
||||
internal_nis_setservent (intern_t *intern)
|
||||
{
|
||||
intern->new_start = 1;
|
||||
if (intern->oldkey != NULL)
|
||||
char *domainname;
|
||||
struct ypall_callback ypcb;
|
||||
enum nss_status status;
|
||||
|
||||
if (yp_get_default_domain (&domainname))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
|
||||
while (intern->start != NULL)
|
||||
{
|
||||
free (intern->oldkey);
|
||||
intern->oldkey = NULL;
|
||||
intern->oldkeylen = 0;
|
||||
if (intern->start->val != NULL)
|
||||
free (intern->start->val);
|
||||
intern->next = intern->start;
|
||||
intern->start = intern->start->next;
|
||||
free (intern->next);
|
||||
}
|
||||
return NSS_STATUS_SUCCESS;
|
||||
intern->start = NULL;
|
||||
|
||||
ypcb.foreach = saveit;
|
||||
ypcb.data = (char *) intern;
|
||||
status = yperr2nss (yp_all (domainname, "services.byname", &ypcb));
|
||||
intern->next = intern->start;
|
||||
|
||||
return status;
|
||||
}
|
||||
enum nss_status
|
||||
_nss_nis_setservent (void)
|
||||
@@ -76,13 +126,16 @@ _nss_nis_setservent (void)
|
||||
static enum nss_status
|
||||
internal_nis_endservent (intern_t * intern)
|
||||
{
|
||||
intern->new_start = 1;
|
||||
if (intern->oldkey != NULL)
|
||||
while (intern->start != NULL)
|
||||
{
|
||||
free (intern->oldkey);
|
||||
intern->oldkey = NULL;
|
||||
intern->oldkeylen = 0;
|
||||
if (intern->start->val != NULL)
|
||||
free (intern->start->val);
|
||||
intern->next = intern->start;
|
||||
intern->start = intern->start->next;
|
||||
free (intern->next);
|
||||
}
|
||||
intern->start = NULL;
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -104,57 +157,25 @@ static enum nss_status
|
||||
internal_nis_getservent_r (struct servent *serv, char *buffer,
|
||||
size_t buflen, intern_t *data)
|
||||
{
|
||||
char *domain;
|
||||
char *result;
|
||||
int len, parse_res;
|
||||
char *outkey;
|
||||
int keylen;
|
||||
int parse_res;
|
||||
char *p;
|
||||
|
||||
if (yp_get_default_domain (&domain))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
if (data->start == NULL)
|
||||
internal_nis_setservent (data);
|
||||
|
||||
/* Get the next entry until we found a correct one. */
|
||||
do
|
||||
{
|
||||
enum nss_status retval;
|
||||
|
||||
if (data->new_start)
|
||||
retval = yperr2nss (yp_first (domain, "services.byname",
|
||||
&outkey, &keylen, &result, &len));
|
||||
else
|
||||
retval = yperr2nss ( yp_next (domain, "services.byname",
|
||||
data->oldkey, data->oldkeylen,
|
||||
&outkey, &keylen, &result, &len));
|
||||
|
||||
if (retval != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
__set_errno (EAGAIN);
|
||||
return retval;
|
||||
}
|
||||
|
||||
if ((size_t) (len + 1) > buflen)
|
||||
{
|
||||
free (result);
|
||||
__set_errno (ERANGE);
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
p = strncpy (buffer, result, len);
|
||||
buffer[len] = '\0';
|
||||
if (data->next == NULL)
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
p = strcpy (buffer, data->next->val);
|
||||
data->next = data->next->next;
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
free (result);
|
||||
|
||||
parse_res = _nss_files_parse_servent (p, serv, buffer, buflen);
|
||||
if (!parse_res && errno == ERANGE)
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
|
||||
free (data->oldkey);
|
||||
data->oldkey = outkey;
|
||||
data->oldkeylen = keylen;
|
||||
data->new_start = 0;
|
||||
}
|
||||
while (!parse_res);
|
||||
|
||||
@@ -179,7 +200,7 @@ enum nss_status
|
||||
_nss_nis_getservbyname_r (const char *name, char *protocol,
|
||||
struct servent *serv, char *buffer, size_t buflen)
|
||||
{
|
||||
intern_t data = {TRUE, NULL, 0};
|
||||
intern_t data = { NULL, NULL };
|
||||
enum nss_status status;
|
||||
int found;
|
||||
|
||||
@@ -198,13 +219,17 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
|
||||
((status = internal_nis_getservent_r (serv, buffer, buflen, &data))
|
||||
== NSS_STATUS_SUCCESS))
|
||||
{
|
||||
if (strcmp (serv->s_name, name) == 0)
|
||||
{
|
||||
if (strcmp (serv->s_proto, protocol) == 0)
|
||||
{
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
if (strcmp (serv->s_proto, protocol) == 0)
|
||||
{
|
||||
char **cp;
|
||||
|
||||
if (strcmp (serv->s_name, name) == 0)
|
||||
found = 1;
|
||||
else
|
||||
for (cp = serv->s_aliases; *cp; cp++)
|
||||
if (strcmp (name, *cp) == 0)
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
internal_nis_endservent (&data);
|
||||
@@ -219,7 +244,7 @@ enum nss_status
|
||||
_nss_nis_getservbyport_r (int port, char *protocol, struct servent *serv,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
intern_t data = {TRUE, NULL, 0};
|
||||
intern_t data = { NULL, NULL };
|
||||
enum nss_status status;
|
||||
int found;
|
||||
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@@ -167,7 +167,8 @@ __yp_bind (const char *domain, dom_binding ** ypdb)
|
||||
ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr,
|
||||
sizeof (ysd->dom_server_addr.sin_addr.s_addr));
|
||||
ysd->dom_vers = YPVERS;
|
||||
strcpy (ysd->dom_domain, domain);
|
||||
strncpy (ysd->dom_domain, domain, YPMAXDOMAIN);
|
||||
ysd->dom_domain[YPMAXDOMAIN] = '\0';
|
||||
}
|
||||
|
||||
if (ysd->dom_client)
|
||||
|
||||
+4
-1
@@ -236,7 +236,10 @@
|
||||
{
|
||||
if (!*cp)
|
||||
{
|
||||
if (*--cp == '.') break;
|
||||
if (*--cp == '.')
|
||||
break;
|
||||
if (!strchr (name, ':'))
|
||||
break;
|
||||
|
||||
/* All-IPv6-legal, no dot at the end. Fake up a
|
||||
hostent as if we'd actually done a lookup. */
|
||||
|
||||
@@ -98,6 +98,13 @@ DB_LOOKUP (hostbyname, ,,
|
||||
LOOKUP_NAME (h_name, h_aliases),
|
||||
const char *name)
|
||||
|
||||
DB_LOOKUP (hostbyname2, ,,
|
||||
{
|
||||
if (result->h_addrtype != af)
|
||||
continue;
|
||||
LOOKUP_NAME (h_name, h_aliases)
|
||||
}, const char *name, int af)
|
||||
|
||||
DB_LOOKUP (hostbyaddr, ,,
|
||||
{
|
||||
if (result->h_addrtype == type && result->h_length == len &&
|
||||
|
||||
+9
-2
@@ -27,7 +27,7 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \
|
||||
utsnamelen.h confname.h waitflags.h waitstatus.h sys/unistd.h \
|
||||
sched.h schedbits.h re_comp.h wait.h
|
||||
|
||||
distribute := confstr.h
|
||||
distribute := confstr.h TESTS TESTS2C.sed testcases.h
|
||||
|
||||
routines := \
|
||||
uname \
|
||||
@@ -49,12 +49,14 @@ routines := \
|
||||
getaddrinfo
|
||||
|
||||
aux := init-posix environ
|
||||
tests := tstgetopt testfnm
|
||||
tests := tstgetopt testfnm runtests
|
||||
others := getconf
|
||||
install-bin := getconf
|
||||
install-lib := libposix.a
|
||||
gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h
|
||||
|
||||
before-compile := testcases.h
|
||||
|
||||
include ../Rules
|
||||
|
||||
CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes
|
||||
@@ -62,6 +64,11 @@ CFLAGS-getaddrinfo.c = -DRESOLVER
|
||||
|
||||
$(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib)
|
||||
lib: $(objpfx)libposix.a
|
||||
|
||||
testcases.h: TESTS TESTS2C.sed
|
||||
sed -f TESTS2C.sed < $< > $@T
|
||||
mv -f $@T $@
|
||||
test ! -d CVS || cvs commit -mRegenerated $@
|
||||
|
||||
# Make the standalone glob/fnmatch package.
|
||||
|
||||
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
0:(.*)*\1:xx
|
||||
0:^:
|
||||
0:$:
|
||||
0:^$:
|
||||
0:^a$:a
|
||||
0:abc:abc
|
||||
1:abc:xbc
|
||||
1:abc:axc
|
||||
1:abc:abx
|
||||
0:abc:xabcy
|
||||
0:abc:ababc
|
||||
0:ab*c:abc
|
||||
0:ab*bc:abc
|
||||
0:ab*bc:abbc
|
||||
0:ab*bc:abbbbc
|
||||
0:ab+bc:abbc
|
||||
1:ab+bc:abc
|
||||
1:ab+bc:abq
|
||||
0:ab+bc:abbbbc
|
||||
0:ab?bc:abbc
|
||||
0:ab?bc:abc
|
||||
1:ab?bc:abbbbc
|
||||
0:ab?c:abc
|
||||
0:^abc$:abc
|
||||
1:^abc$:abcc
|
||||
0:^abc:abcc
|
||||
1:^abc$:aabc
|
||||
0:abc$:aabc
|
||||
0:^:abc
|
||||
0:$:abc
|
||||
0:a.c:abc
|
||||
0:a.c:axc
|
||||
0:a.*c:axyzc
|
||||
1:a.*c:axyzd
|
||||
1:a[bc]d:abc
|
||||
0:a[bc]d:abd
|
||||
1:a[b-d]e:abd
|
||||
0:a[b-d]e:ace
|
||||
0:a[b-d]:aac
|
||||
0:a[-b]:a-
|
||||
0:a[b-]:a-
|
||||
1:a[b-a]:-
|
||||
2:a[]b:-
|
||||
2:a[:-
|
||||
0:a]:a]
|
||||
0:a[]]b:a]b
|
||||
0:a[^bc]d:aed
|
||||
1:a[^bc]d:abd
|
||||
0:a[^-b]c:adc
|
||||
1:a[^-b]c:a-c
|
||||
1:a[^]b]c:a]c
|
||||
0:a[^]b]c:adc
|
||||
0:ab|cd:abc
|
||||
0:ab|cd:abcd
|
||||
0:()ef:def
|
||||
0:()*:-
|
||||
1:*a:-
|
||||
0:^*:-
|
||||
0:$*:-
|
||||
1:(*)b:-
|
||||
1:$b:b
|
||||
2:a\:-
|
||||
0:a\(b:a(b
|
||||
0:a\(*b:ab
|
||||
0:a\(*b:a((b
|
||||
1:a\x:a\x
|
||||
1:abc):-
|
||||
2:(abc:-
|
||||
0:((a)):abc
|
||||
0:(a)b(c):abc
|
||||
0:a+b+c:aabbabc
|
||||
0:a**:-
|
||||
0:a*?:-
|
||||
0:(a*)*:-
|
||||
0:(a*)+:-
|
||||
0:(a|)*:-
|
||||
0:(a*|b)*:-
|
||||
0:(a+|b)*:ab
|
||||
0:(a+|b)+:ab
|
||||
0:(a+|b)?:ab
|
||||
0:[^ab]*:cde
|
||||
0:(^)*:-
|
||||
0:(ab|)*:-
|
||||
2:)(:-
|
||||
1:abc:
|
||||
1:abc:
|
||||
0:a*:
|
||||
0:([abc])*d:abbbcd
|
||||
0:([abc])*bcd:abcd
|
||||
0:a|b|c|d|e:e
|
||||
0:(a|b|c|d|e)f:ef
|
||||
0:((a*|b))*:-
|
||||
0:abcd*efg:abcdefg
|
||||
0:ab*:xabyabbbz
|
||||
0:ab*:xayabbbz
|
||||
0:(ab|cd)e:abcde
|
||||
0:[abhgefdc]ij:hij
|
||||
1:^(ab|cd)e:abcde
|
||||
0:(abc|)ef:abcdef
|
||||
0:(a|b)c*d:abcd
|
||||
0:(ab|ab*)bc:abc
|
||||
0:a([bc]*)c*:abc
|
||||
0:a([bc]*)(c*d):abcd
|
||||
0:a([bc]+)(c*d):abcd
|
||||
0:a([bc]*)(c+d):abcd
|
||||
0:a[bcd]*dcdcde:adcdcde
|
||||
1:a[bcd]+dcdcde:adcdcde
|
||||
0:(ab|a)b*c:abc
|
||||
0:((a)(b)c)(d):abcd
|
||||
0:[A-Za-z_][A-Za-z0-9_]*:alpha
|
||||
0:^a(bc+|b[eh])g|.h$:abh
|
||||
0:(bc+d$|ef*g.|h?i(j|k)):effgz
|
||||
0:(bc+d$|ef*g.|h?i(j|k)):ij
|
||||
1:(bc+d$|ef*g.|h?i(j|k)):effg
|
||||
1:(bc+d$|ef*g.|h?i(j|k)):bcdd
|
||||
0:(bc+d$|ef*g.|h?i(j|k)):reffgz
|
||||
1:((((((((((a)))))))))):-
|
||||
0:(((((((((a))))))))):a
|
||||
1:multiple words of text:uh-uh
|
||||
0:multiple words:multiple words, yeah
|
||||
0:(.*)c(.*):abcde
|
||||
1:\((.*),:(.*)\)
|
||||
1:[k]:ab
|
||||
0:abcd:abcd
|
||||
0:a(bc)d:abcd
|
||||
0:a[-]?c:ac
|
||||
0:(....).*\1:beriberi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Qaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mo'ammar Gadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Kaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Qadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar El Kadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Gadafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qadafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamer El Kazzafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar al-Gaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Al Qathafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Al Qathafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mo'ammar el-Gadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar El Kadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar al-Qadhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qadhdhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Qadafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar Gaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Qadhdhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Khaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar al-Khaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'amar al-Kadafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghaddafy
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghadafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muamar Kaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Quathafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Gheddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muamar Al-Kaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar Khadafy
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar Qudhafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qaddafi
|
||||
0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi
|
||||
@@ -0,0 +1,2 @@
|
||||
s/\\/\\\\/g
|
||||
s/\(.*\):\(.*\):\(.*\)/ {\1, "\2", "\3"},/
|
||||
+177
-57
@@ -3,25 +3,25 @@
|
||||
(Implements POSIX draft P10003.2/D11.2, except for
|
||||
internationalization features.)
|
||||
|
||||
Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
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 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
|
||||
License, or (at your option) any later version.
|
||||
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.
|
||||
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. */
|
||||
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. */
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if defined (_AIX) && !defined (REGEX_MALLOC)
|
||||
@@ -35,8 +35,12 @@ Cambridge, MA 02139, USA. */
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) && !defined(emacs)
|
||||
#include <stddef.h>
|
||||
#else
|
||||
/* We need this for `regex.h', and perhaps for the Emacs include files. */
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
#if HAVE_LIBINTL_H || defined (_LIBC)
|
||||
@@ -500,6 +504,7 @@ typedef enum
|
||||
} while (0)
|
||||
|
||||
#ifdef DEBUG
|
||||
static void extract_number _RE_ARGS ((int *dest, unsigned char *source));
|
||||
static void
|
||||
extract_number (dest, source)
|
||||
int *dest;
|
||||
@@ -527,6 +532,8 @@ extract_number (dest, source)
|
||||
} while (0)
|
||||
|
||||
#ifdef DEBUG
|
||||
static void extract_number_and_incr _RE_ARGS ((int *destination,
|
||||
unsigned char **source));
|
||||
static void
|
||||
extract_number_and_incr (destination, source)
|
||||
int *destination;
|
||||
@@ -890,6 +897,13 @@ print_double_string (where, string1, size1, string2, size2)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
printchar (c)
|
||||
int c;
|
||||
{
|
||||
putc (c, stderr);
|
||||
}
|
||||
|
||||
#else /* not DEBUG */
|
||||
|
||||
#undef assert
|
||||
@@ -1007,9 +1021,35 @@ static const char *re_error_msgid[] =
|
||||
#endif
|
||||
|
||||
/* Roughly the maximum number of failure points on the stack. Would be
|
||||
exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
|
||||
exactly that if always used MAX_FAILURE_SPACE each time we failed.
|
||||
This is a variable only so users of regex can assign to it; we never
|
||||
change it ourselves. */
|
||||
|
||||
#ifdef INT_IS_16BIT
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
long re_max_failures = 4000;
|
||||
#else
|
||||
long re_max_failures = 2000;
|
||||
#endif
|
||||
|
||||
union fail_stack_elt
|
||||
{
|
||||
unsigned char *pointer;
|
||||
long integer;
|
||||
};
|
||||
|
||||
typedef union fail_stack_elt fail_stack_elt_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fail_stack_elt_t *stack;
|
||||
unsigned long size;
|
||||
unsigned long avail; /* Offset of next open position. */
|
||||
} fail_stack_type;
|
||||
|
||||
#else /* not INT_IS_16BIT */
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
@@ -1033,6 +1073,8 @@ typedef struct
|
||||
unsigned avail; /* Offset of next open position. */
|
||||
} fail_stack_type;
|
||||
|
||||
#endif /* INT_IS_16BIT */
|
||||
|
||||
#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
|
||||
#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
|
||||
#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
|
||||
@@ -1123,7 +1165,7 @@ typedef struct
|
||||
/* Used to omit pushing failure point id's when we're not debugging. */
|
||||
#ifdef DEBUG
|
||||
#define DEBUG_PUSH PUSH_FAILURE_INT
|
||||
#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
|
||||
#define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT ()
|
||||
#else
|
||||
#define DEBUG_PUSH(item)
|
||||
#define DEBUG_POP(item_addr)
|
||||
@@ -1144,7 +1186,10 @@ typedef struct
|
||||
char *destination; \
|
||||
/* Must be int, so when we don't save any registers, the arithmetic \
|
||||
of 0 + -1 isn't done as unsigned. */ \
|
||||
unsigned this_reg; \
|
||||
/* Can't be int, since there is not a shred of a guarantee that int \
|
||||
is wide enough to hold a value of something to which pointer can \
|
||||
be assigned */ \
|
||||
s_reg_t this_reg; \
|
||||
\
|
||||
DEBUG_STATEMENT (failure_id++); \
|
||||
DEBUG_STATEMENT (nfailure_points_pushed++); \
|
||||
@@ -1257,7 +1302,7 @@ typedef struct
|
||||
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
|
||||
{ \
|
||||
DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
|
||||
unsigned this_reg; \
|
||||
s_reg_t this_reg; \
|
||||
const unsigned char *string_temp; \
|
||||
\
|
||||
assert (!FAIL_STACK_EMPTY ()); \
|
||||
@@ -1288,10 +1333,10 @@ typedef struct
|
||||
DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
|
||||
\
|
||||
/* Restore register info. */ \
|
||||
high_reg = (unsigned) POP_FAILURE_INT (); \
|
||||
high_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
|
||||
\
|
||||
low_reg = (unsigned) POP_FAILURE_INT (); \
|
||||
low_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
|
||||
\
|
||||
if (1) \
|
||||
@@ -1336,6 +1381,9 @@ typedef struct
|
||||
the type of `word', i.e., is something that fits into one item on the
|
||||
failure stack. */
|
||||
|
||||
|
||||
/* Declarations and macros for re_match_2. */
|
||||
|
||||
typedef union
|
||||
{
|
||||
fail_stack_elt_t word;
|
||||
@@ -1365,7 +1413,7 @@ typedef union
|
||||
{ \
|
||||
if (!set_regs_matched_done) \
|
||||
{ \
|
||||
unsigned r; \
|
||||
active_reg_t r; \
|
||||
set_regs_matched_done = 1; \
|
||||
for (r = lowest_active_reg; r <= highest_active_reg; r++) \
|
||||
{ \
|
||||
@@ -1384,11 +1432,25 @@ static char reg_unset_dummy;
|
||||
|
||||
/* Subroutine declarations and macros for regex_compile. */
|
||||
|
||||
static void store_op1 (), store_op2 ();
|
||||
static void insert_op1 (), insert_op2 ();
|
||||
static boolean at_begline_loc_p (), at_endline_loc_p ();
|
||||
static boolean group_in_compile_stack ();
|
||||
static reg_errcode_t compile_range ();
|
||||
static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size,
|
||||
reg_syntax_t syntax,
|
||||
struct re_pattern_buffer *bufp));
|
||||
static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg));
|
||||
static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
|
||||
int arg1, int arg2));
|
||||
static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
|
||||
int arg, unsigned char *end));
|
||||
static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
|
||||
int arg1, int arg2, unsigned char *end));
|
||||
static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
|
||||
reg_syntax_t syntax));
|
||||
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
|
||||
reg_syntax_t syntax));
|
||||
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
const char *pend,
|
||||
char *translate,
|
||||
reg_syntax_t syntax,
|
||||
unsigned char *b));
|
||||
|
||||
/* Fetch the next character in the uncompiled pattern---translating it
|
||||
if necessary. Also cast from a signed character in the constant
|
||||
@@ -1463,26 +1525,39 @@ static reg_errcode_t compile_range ();
|
||||
/* Store a jump with opcode OP at LOC to location TO. We store a
|
||||
relative address offset by the three bytes the jump itself occupies. */
|
||||
#define STORE_JUMP(op, loc, to) \
|
||||
store_op1 (op, loc, (to) - (loc) - 3)
|
||||
store_op1 (op, loc, (int) ((to) - (loc) - 3))
|
||||
|
||||
/* Likewise, for a two-argument jump. */
|
||||
#define STORE_JUMP2(op, loc, to, arg) \
|
||||
store_op2 (op, loc, (to) - (loc) - 3, arg)
|
||||
store_op2 (op, loc, (int) ((to) - (loc) - 3), arg)
|
||||
|
||||
/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
|
||||
#define INSERT_JUMP(op, loc, to) \
|
||||
insert_op1 (op, loc, (to) - (loc) - 3, b)
|
||||
insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
|
||||
|
||||
/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
|
||||
#define INSERT_JUMP2(op, loc, to, arg) \
|
||||
insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
|
||||
insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
|
||||
|
||||
|
||||
/* This is not an arbitrary limit: the arguments which represent offsets
|
||||
into the pattern are two bytes long. So if 2^16 bytes turns out to
|
||||
be too small, many things would have to change. */
|
||||
/* Any other compiler which, like MSC, has allocation limit below 2^16
|
||||
bytes will have to use approach similar to what was done below for
|
||||
MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
|
||||
reallocating to 0 bytes. Such thing is not going to work too well.
|
||||
You have been warned!! */
|
||||
#ifdef _MSC_VER
|
||||
/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
|
||||
The REALLOC define eliminates a flurry of conversion warnings,
|
||||
but is not required. */
|
||||
#define MAX_BUF_SIZE 65500L
|
||||
#define REALLOC(p,s) realloc ((p), (size_t) (s))
|
||||
#else
|
||||
#define MAX_BUF_SIZE (1L << 16)
|
||||
|
||||
#define REALLOC(p,s) realloc ((p), (s))
|
||||
#endif
|
||||
|
||||
/* Extend the buffer by twice its current size via realloc and
|
||||
reset the pointers that pointed into the old block to point to the
|
||||
@@ -1496,7 +1571,7 @@ static reg_errcode_t compile_range ();
|
||||
bufp->allocated <<= 1; \
|
||||
if (bufp->allocated > MAX_BUF_SIZE) \
|
||||
bufp->allocated = MAX_BUF_SIZE; \
|
||||
bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
|
||||
bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\
|
||||
if (bufp->buffer == NULL) \
|
||||
return REG_ESPACE; \
|
||||
/* If the buffer moved, move all the pointers into it. */ \
|
||||
@@ -1528,7 +1603,8 @@ typedef unsigned regnum_t;
|
||||
|
||||
/* Since offsets can go either forwards or backwards, this type needs to
|
||||
be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
|
||||
typedef int pattern_offset_t;
|
||||
/* int may be not enough when sizeof(int) == 2. */
|
||||
typedef long pattern_offset_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -1638,6 +1714,10 @@ regex_grow_registers (num_regs)
|
||||
|
||||
#endif /* not MATCH_MAY_ALLOCATE */
|
||||
|
||||
static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
|
||||
compile_stack,
|
||||
regnum_t regnum));
|
||||
|
||||
/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
|
||||
Returns one of error codes defined in `regex.h', or zero for success.
|
||||
|
||||
@@ -1663,7 +1743,7 @@ regex_grow_registers (num_regs)
|
||||
static reg_errcode_t
|
||||
regex_compile (pattern, size, syntax, bufp)
|
||||
const char *pattern;
|
||||
int size;
|
||||
size_t size;
|
||||
reg_syntax_t syntax;
|
||||
struct re_pattern_buffer *bufp;
|
||||
{
|
||||
@@ -2104,6 +2184,9 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|| (is_upper && ISUPPER (ch))
|
||||
|| (is_xdigit && ISXDIGIT (ch)))
|
||||
SET_LIST_BIT (ch);
|
||||
if ( translate && (is_upper || is_lower)
|
||||
&& (ISUPPER (ch) || ISLOWER (ch)))
|
||||
SET_LIST_BIT (ch);
|
||||
}
|
||||
had_char_class = true;
|
||||
}
|
||||
@@ -2529,38 +2612,54 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
|
||||
case 'w':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
laststart = b;
|
||||
BUF_PUSH (wordchar);
|
||||
break;
|
||||
|
||||
|
||||
case 'W':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
laststart = b;
|
||||
BUF_PUSH (notwordchar);
|
||||
break;
|
||||
|
||||
|
||||
case '<':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordbeg);
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordend);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordbound);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (notwordbound);
|
||||
break;
|
||||
|
||||
case '`':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (begbuf);
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (endbuf);
|
||||
break;
|
||||
|
||||
@@ -2575,7 +2674,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
FREE_STACK_RETURN (REG_ESUBREG);
|
||||
|
||||
/* Can't back reference to a subexpression if inside of it. */
|
||||
if (group_in_compile_stack (compile_stack, c1))
|
||||
if (group_in_compile_stack (compile_stack, (regnum_t) c1))
|
||||
goto normal_char;
|
||||
|
||||
laststart = b;
|
||||
@@ -2802,7 +2901,7 @@ at_begline_loc_p (pattern, p, syntax)
|
||||
static boolean
|
||||
at_endline_loc_p (p, pend, syntax)
|
||||
const char *p, *pend;
|
||||
int syntax;
|
||||
reg_syntax_t syntax;
|
||||
{
|
||||
const char *next = p;
|
||||
boolean next_backslash = *next == '\\';
|
||||
@@ -2924,13 +3023,14 @@ re_compile_fastmap (bufp)
|
||||
|
||||
register char *fastmap = bufp->fastmap;
|
||||
unsigned char *pattern = bufp->buffer;
|
||||
unsigned long size = bufp->used;
|
||||
unsigned char *p = pattern;
|
||||
register unsigned char *pend = pattern + size;
|
||||
register unsigned char *pend = pattern + bufp->used;
|
||||
|
||||
#ifdef REL_ALLOC
|
||||
/* This holds the pointer to the failure stack, when
|
||||
it is allocated relocatably. */
|
||||
fail_stack_elt_t *failure_stack_ptr;
|
||||
#endif
|
||||
|
||||
/* Assume that each path through the pattern can be null until
|
||||
proven otherwise. We set this false at the bottom of switch
|
||||
@@ -3406,13 +3506,6 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
return -1;
|
||||
} /* re_search_2 */
|
||||
|
||||
/* Declarations and macros for re_match_2. */
|
||||
|
||||
static int bcmp_translate ();
|
||||
static boolean alt_match_null_string_p (),
|
||||
common_op_match_null_string_p (),
|
||||
group_match_null_string_p ();
|
||||
|
||||
/* This converts PTR, a pointer into one of the search strings `string1'
|
||||
and `string2' into an offset from the beginning of that string. */
|
||||
#define POINTER_TO_OFFSET(ptr) \
|
||||
@@ -3453,14 +3546,12 @@ static boolean alt_match_null_string_p (),
|
||||
: (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
|
||||
== Sword)
|
||||
|
||||
/* Disabled due to a compiler bug -- see comment at case wordbound */
|
||||
#if 0
|
||||
/* Test if the character before D and the one at D differ with respect
|
||||
to being word-constituent. */
|
||||
#define AT_WORD_BOUNDARY(d) \
|
||||
(AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
|
||||
|| WORDCHAR_P (d - 1) != WORDCHAR_P (d))
|
||||
#endif
|
||||
|
||||
|
||||
/* Free everything we malloc. */
|
||||
#ifdef MATCH_MAY_ALLOCATE
|
||||
@@ -3506,11 +3597,26 @@ re_match (bufp, string, size, pos, regs)
|
||||
{
|
||||
int result = re_match_2_internal (bufp, NULL, 0, string, size,
|
||||
pos, regs, size);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
#endif /* not emacs */
|
||||
|
||||
static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p,
|
||||
unsigned char *end,
|
||||
register_info_type *reg_info));
|
||||
static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p,
|
||||
unsigned char *end,
|
||||
register_info_type *reg_info));
|
||||
static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p,
|
||||
unsigned char *end,
|
||||
register_info_type *reg_info));
|
||||
static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
|
||||
int len, char *translate));
|
||||
|
||||
/* re_match_2 matches the compiled pattern in BUFP against the
|
||||
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
|
||||
@@ -3536,7 +3642,11 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
{
|
||||
int result = re_match_2_internal (bufp, string1, size1, string2, size2,
|
||||
pos, regs, stop);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3593,18 +3703,20 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
|
||||
#endif
|
||||
|
||||
#ifdef REL_ALLOC
|
||||
/* This holds the pointer to the failure stack, when
|
||||
it is allocated relocatably. */
|
||||
fail_stack_elt_t *failure_stack_ptr;
|
||||
#endif
|
||||
|
||||
/* We fill all the registers internally, independent of what we
|
||||
return, for use in backreferences. The number here includes
|
||||
an element for register zero. */
|
||||
unsigned num_regs = bufp->re_nsub + 1;
|
||||
size_t num_regs = bufp->re_nsub + 1;
|
||||
|
||||
/* The currently active registers. */
|
||||
unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
|
||||
unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
|
||||
active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
|
||||
active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
|
||||
|
||||
/* Information on the contents of registers. These are pointers into
|
||||
the input strings; they record just what was matched (on this
|
||||
@@ -4511,10 +4623,17 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
= *p2 == (unsigned char) endline ? '\n' : p2[2];
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if ((re_opcode_t) p1[3] == exactn
|
||||
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
|
||||
&& (p2[2 + p1[5] / BYTEWIDTH]
|
||||
& (1 << (p1[5] % BYTEWIDTH)))))
|
||||
#else
|
||||
if ((re_opcode_t) p1[3] == exactn
|
||||
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
|
||||
&& (p2[2 + p1[4] / BYTEWIDTH]
|
||||
& (1 << (p1[4] % BYTEWIDTH)))))
|
||||
#endif
|
||||
{
|
||||
p[-3] = (unsigned char) pop_failure_jump;
|
||||
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
|
||||
@@ -4580,7 +4699,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
actual values. Otherwise, we will restore only one
|
||||
register from the stack, since lowest will == highest in
|
||||
`pop_failure_point'. */
|
||||
unsigned dummy_low_reg, dummy_high_reg;
|
||||
active_reg_t dummy_low_reg, dummy_high_reg;
|
||||
unsigned char *pdummy;
|
||||
const char *sdummy;
|
||||
|
||||
@@ -5133,11 +5252,12 @@ common_op_match_null_string_p (p, end, reg_info)
|
||||
|
||||
static int
|
||||
bcmp_translate (s1, s2, len, translate)
|
||||
unsigned char *s1, *s2;
|
||||
const char *s1, *s2;
|
||||
register int len;
|
||||
RE_TRANSLATE_TYPE translate;
|
||||
{
|
||||
register unsigned char *p1 = s1, *p2 = s2;
|
||||
register const unsigned char *p1 = (const unsigned char *) s1;
|
||||
register const unsigned char *p2 = (const unsigned char *) s2;
|
||||
while (len)
|
||||
{
|
||||
if (translate[*p1++] != translate[*p2++]) return 1;
|
||||
@@ -5160,7 +5280,7 @@ bcmp_translate (s1, s2, len, translate)
|
||||
const char *
|
||||
re_compile_pattern (pattern, length, bufp)
|
||||
const char *pattern;
|
||||
int length;
|
||||
size_t length;
|
||||
struct re_pattern_buffer *bufp;
|
||||
{
|
||||
reg_errcode_t ret;
|
||||
@@ -5289,7 +5409,7 @@ regcomp (preg, pattern, cflags)
|
||||
int cflags;
|
||||
{
|
||||
reg_errcode_t ret;
|
||||
unsigned syntax
|
||||
reg_syntax_t syntax
|
||||
= (cflags & REG_EXTENDED) ?
|
||||
RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
|
||||
|
||||
|
||||
+38
-10
@@ -1,6 +1,6 @@
|
||||
/* Definitions for data structures and routines for the regular
|
||||
expression library, version 0.12.
|
||||
Copyright (C) 1985,89,90,91,92,93,95,96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
|
||||
|
||||
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.
|
||||
@@ -23,6 +23,11 @@
|
||||
#ifndef __REGEXP_LIBRARY_H__
|
||||
#define __REGEXP_LIBRARY_H__
|
||||
|
||||
/* Allow the use in C++ code. */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* POSIX says that <sys/types.h> must be included (by the caller) before
|
||||
<regex.h>. */
|
||||
|
||||
@@ -32,17 +37,23 @@
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* The following two types have to be signed and unsigned integer type
|
||||
wide enough to hold a value of a pointer. For most ANSI compilers
|
||||
ptrdiff_t and size_t should be likely OK. Still size of these two
|
||||
types is 2 for Microsoft C. Ugh... */
|
||||
typedef long int s_reg_t;
|
||||
typedef unsigned long int active_reg_t;
|
||||
|
||||
/* The following bits are used to determine the regexp syntax we
|
||||
recognize. The set/not-set meanings are chosen so that Emacs syntax
|
||||
remains the value 0. The bits are given in alphabetical order, and
|
||||
the definitions shifted by one from the previous bit; thus, when we
|
||||
add or remove a bit, only one other definition need change. */
|
||||
typedef unsigned reg_syntax_t;
|
||||
typedef unsigned long int reg_syntax_t;
|
||||
|
||||
/* If this bit is not set, then \ inside a bracket expression is literal.
|
||||
If set, then such a \ quotes the following character. */
|
||||
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
||||
#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
|
||||
|
||||
/* If this bit is not set, then + and ? are operators, and \+ and \? are
|
||||
literals.
|
||||
@@ -137,6 +148,10 @@ typedef unsigned reg_syntax_t;
|
||||
without further backtracking. */
|
||||
#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
|
||||
|
||||
/* If this bit is set, do not process the GNU regex operators.
|
||||
If not set, then the GNU regex operators are recognized. */
|
||||
#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
|
||||
|
||||
/* This global variable defines the particular regexp syntax to use (for
|
||||
some interfaces). When a regexp is compiled, the syntax used is
|
||||
stored in the pattern buffer, so changing this does not affect
|
||||
@@ -150,13 +165,18 @@ extern reg_syntax_t re_syntax_options;
|
||||
#define RE_SYNTAX_EMACS 0
|
||||
|
||||
#define RE_SYNTAX_AWK \
|
||||
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
||||
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
|
||||
| RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
||||
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
|
||||
| RE_DOT_NEWLINE \
|
||||
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
|
||||
|
||||
#define RE_SYNTAX_GNU_AWK \
|
||||
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS) \
|
||||
& ~(RE_DOT_NOT_NULL | RE_INTERVALS))
|
||||
|
||||
#define RE_SYNTAX_POSIX_AWK \
|
||||
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
|
||||
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_NO_GNU_OPS)
|
||||
|
||||
#define RE_SYNTAX_GREP \
|
||||
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
|
||||
@@ -212,7 +232,8 @@ extern reg_syntax_t re_syntax_options;
|
||||
#ifdef RE_DUP_MAX
|
||||
#undef RE_DUP_MAX
|
||||
#endif
|
||||
#define RE_DUP_MAX ((1 << 15) - 1)
|
||||
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
|
||||
#define RE_DUP_MAX (0x7fff)
|
||||
|
||||
|
||||
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
||||
@@ -413,7 +434,7 @@ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
||||
and syntax given by the global `re_syntax_options', into the buffer
|
||||
BUFFER. Return NULL if successful, and an error string if not. */
|
||||
extern const char *re_compile_pattern
|
||||
_RE_ARGS ((const char *pattern, int length,
|
||||
_RE_ARGS ((const char *pattern, size_t length,
|
||||
struct re_pattern_buffer *buffer));
|
||||
|
||||
|
||||
@@ -472,10 +493,12 @@ extern void re_set_registers
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
|
||||
#ifdef _REGEX_RE_COMP
|
||||
#ifndef _CRAY
|
||||
/* 4.2 bsd compatibility. */
|
||||
extern char *re_comp _RE_ARGS ((const char *));
|
||||
extern int re_exec _RE_ARGS ((const char *));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* POSIX compatibility. */
|
||||
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
|
||||
@@ -487,6 +510,11 @@ extern size_t regerror
|
||||
size_t errbuf_size));
|
||||
extern void regfree _RE_ARGS ((regex_t *preg));
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* C++ */
|
||||
|
||||
#endif /* not __REGEXP_LIBRARY_H__ */
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1995 by Tom Lord
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of the copyright holder not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
Tom Lord DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
EVENT SHALL TOM LORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
||||
struct a_test
|
||||
{
|
||||
int expected;
|
||||
const char * pattern;
|
||||
const unsigned char * data;
|
||||
};
|
||||
|
||||
static const struct a_test the_tests[] =
|
||||
{
|
||||
#include "testcases.h"
|
||||
{-1, 0, 0}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
int
|
||||
run_a_test (int id, const struct a_test * t)
|
||||
{
|
||||
static const char * last_pattern = 0;
|
||||
static regex_t r;
|
||||
int err;
|
||||
char errmsg[100];
|
||||
int x;
|
||||
regmatch_t regs[10];
|
||||
|
||||
if (!last_pattern || strcmp (last_pattern, t->pattern))
|
||||
{
|
||||
if (last_pattern)
|
||||
regfree (&r);
|
||||
last_pattern = t->pattern;
|
||||
err = regcomp (&r, t->pattern, REG_EXTENDED);
|
||||
if (err)
|
||||
{
|
||||
if (t->expected)
|
||||
{
|
||||
puts (" OK.");
|
||||
return 0;
|
||||
}
|
||||
regerror (err, &r, errmsg, 100);
|
||||
printf ("test %d\n", id);
|
||||
puts (errmsg);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
err = regexec (&r, t->data, 10, regs, 0);
|
||||
|
||||
if (err != t->expected)
|
||||
{
|
||||
printf ("test %d\n", id);
|
||||
printf ("pattern \"%s\" data \"%s\" wanted %d got %d\n",
|
||||
t->pattern, t->data, t->expected, err);
|
||||
for (x = 0; x < 10; ++x)
|
||||
printf ("reg %d == (%d, %d) %.*s\n",
|
||||
x,
|
||||
regs[x].rm_so,
|
||||
regs[x].rm_eo,
|
||||
regs[x].rm_eo - regs[x].rm_so,
|
||||
t->data + regs[x].rm_so);
|
||||
return 1;
|
||||
}
|
||||
puts (" OK.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char * argv[])
|
||||
{
|
||||
int x;
|
||||
int lo;
|
||||
int hi;
|
||||
int res = 0;
|
||||
|
||||
lo = 0;
|
||||
hi = (sizeof (the_tests) / sizeof (the_tests[0])) - 1;
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
lo = atoi (argv[1]);
|
||||
hi = lo + 1;
|
||||
|
||||
if (argc > 2)
|
||||
hi = atoi (argv[2]);
|
||||
}
|
||||
|
||||
for (x = lo; x < hi; ++x)
|
||||
{
|
||||
printf ("#%d:", x);
|
||||
res |= run_a_test (x, &the_tests[x]);
|
||||
}
|
||||
{
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
{0, "(.*)*\\1", "xx"},
|
||||
{0, "^", ""},
|
||||
{0, "$", ""},
|
||||
{0, "^$", ""},
|
||||
{0, "^a$", "a"},
|
||||
{0, "abc", "abc"},
|
||||
{1, "abc", "xbc"},
|
||||
{1, "abc", "axc"},
|
||||
{1, "abc", "abx"},
|
||||
{0, "abc", "xabcy"},
|
||||
{0, "abc", "ababc"},
|
||||
{0, "ab*c", "abc"},
|
||||
{0, "ab*bc", "abc"},
|
||||
{0, "ab*bc", "abbc"},
|
||||
{0, "ab*bc", "abbbbc"},
|
||||
{0, "ab+bc", "abbc"},
|
||||
{1, "ab+bc", "abc"},
|
||||
{1, "ab+bc", "abq"},
|
||||
{0, "ab+bc", "abbbbc"},
|
||||
{0, "ab?bc", "abbc"},
|
||||
{0, "ab?bc", "abc"},
|
||||
{1, "ab?bc", "abbbbc"},
|
||||
{0, "ab?c", "abc"},
|
||||
{0, "^abc$", "abc"},
|
||||
{1, "^abc$", "abcc"},
|
||||
{0, "^abc", "abcc"},
|
||||
{1, "^abc$", "aabc"},
|
||||
{0, "abc$", "aabc"},
|
||||
{0, "^", "abc"},
|
||||
{0, "$", "abc"},
|
||||
{0, "a.c", "abc"},
|
||||
{0, "a.c", "axc"},
|
||||
{0, "a.*c", "axyzc"},
|
||||
{1, "a.*c", "axyzd"},
|
||||
{1, "a[bc]d", "abc"},
|
||||
{0, "a[bc]d", "abd"},
|
||||
{1, "a[b-d]e", "abd"},
|
||||
{0, "a[b-d]e", "ace"},
|
||||
{0, "a[b-d]", "aac"},
|
||||
{0, "a[-b]", "a-"},
|
||||
{0, "a[b-]", "a-"},
|
||||
{1, "a[b-a]", "-"},
|
||||
{2, "a[]b", "-"},
|
||||
{2, "a[", "-"},
|
||||
{0, "a]", "a]"},
|
||||
{0, "a[]]b", "a]b"},
|
||||
{0, "a[^bc]d", "aed"},
|
||||
{1, "a[^bc]d", "abd"},
|
||||
{0, "a[^-b]c", "adc"},
|
||||
{1, "a[^-b]c", "a-c"},
|
||||
{1, "a[^]b]c", "a]c"},
|
||||
{0, "a[^]b]c", "adc"},
|
||||
{0, "ab|cd", "abc"},
|
||||
{0, "ab|cd", "abcd"},
|
||||
{0, "()ef", "def"},
|
||||
{0, "()*", "-"},
|
||||
{1, "*a", "-"},
|
||||
{0, "^*", "-"},
|
||||
{0, "$*", "-"},
|
||||
{1, "(*)b", "-"},
|
||||
{1, "$b", "b"},
|
||||
{2, "a\\", "-"},
|
||||
{0, "a\\(b", "a(b"},
|
||||
{0, "a\\(*b", "ab"},
|
||||
{0, "a\\(*b", "a((b"},
|
||||
{1, "a\\x", "a\\x"},
|
||||
{1, "abc)", "-"},
|
||||
{2, "(abc", "-"},
|
||||
{0, "((a))", "abc"},
|
||||
{0, "(a)b(c)", "abc"},
|
||||
{0, "a+b+c", "aabbabc"},
|
||||
{0, "a**", "-"},
|
||||
{0, "a*?", "-"},
|
||||
{0, "(a*)*", "-"},
|
||||
{0, "(a*)+", "-"},
|
||||
{0, "(a|)*", "-"},
|
||||
{0, "(a*|b)*", "-"},
|
||||
{0, "(a+|b)*", "ab"},
|
||||
{0, "(a+|b)+", "ab"},
|
||||
{0, "(a+|b)?", "ab"},
|
||||
{0, "[^ab]*", "cde"},
|
||||
{0, "(^)*", "-"},
|
||||
{0, "(ab|)*", "-"},
|
||||
{2, ")(", "-"},
|
||||
{1, "abc", ""},
|
||||
{1, "abc", ""},
|
||||
{0, "a*", ""},
|
||||
{0, "([abc])*d", "abbbcd"},
|
||||
{0, "([abc])*bcd", "abcd"},
|
||||
{0, "a|b|c|d|e", "e"},
|
||||
{0, "(a|b|c|d|e)f", "ef"},
|
||||
{0, "((a*|b))*", "-"},
|
||||
{0, "abcd*efg", "abcdefg"},
|
||||
{0, "ab*", "xabyabbbz"},
|
||||
{0, "ab*", "xayabbbz"},
|
||||
{0, "(ab|cd)e", "abcde"},
|
||||
{0, "[abhgefdc]ij", "hij"},
|
||||
{1, "^(ab|cd)e", "abcde"},
|
||||
{0, "(abc|)ef", "abcdef"},
|
||||
{0, "(a|b)c*d", "abcd"},
|
||||
{0, "(ab|ab*)bc", "abc"},
|
||||
{0, "a([bc]*)c*", "abc"},
|
||||
{0, "a([bc]*)(c*d)", "abcd"},
|
||||
{0, "a([bc]+)(c*d)", "abcd"},
|
||||
{0, "a([bc]*)(c+d)", "abcd"},
|
||||
{0, "a[bcd]*dcdcde", "adcdcde"},
|
||||
{1, "a[bcd]+dcdcde", "adcdcde"},
|
||||
{0, "(ab|a)b*c", "abc"},
|
||||
{0, "((a)(b)c)(d)", "abcd"},
|
||||
{0, "[A-Za-z_][A-Za-z0-9_]*", "alpha"},
|
||||
{0, "^a(bc+|b[eh])g|.h$", "abh"},
|
||||
{0, "(bc+d$|ef*g.|h?i(j|k))", "effgz"},
|
||||
{0, "(bc+d$|ef*g.|h?i(j|k))", "ij"},
|
||||
{1, "(bc+d$|ef*g.|h?i(j|k))", "effg"},
|
||||
{1, "(bc+d$|ef*g.|h?i(j|k))", "bcdd"},
|
||||
{0, "(bc+d$|ef*g.|h?i(j|k))", "reffgz"},
|
||||
{1, "((((((((((a))))))))))", "-"},
|
||||
{0, "(((((((((a)))))))))", "a"},
|
||||
{1, "multiple words of text", "uh-uh"},
|
||||
{0, "multiple words", "multiple words, yeah"},
|
||||
{0, "(.*)c(.*)", "abcde"},
|
||||
{1, "\\((.*),", "(.*)\\)"},
|
||||
{1, "[k]", "ab"},
|
||||
{0, "abcd", "abcd"},
|
||||
{0, "a(bc)d", "abcd"},
|
||||
{0, "a[-]?c", "ac"},
|
||||
{0, "(....).*\\1", "beriberi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Qaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mo'ammar Gadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Kaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Qadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar El Kadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Gadafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qadafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamer El Kazzafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar al-Gaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Al Qathafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Al Qathafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mo'ammar el-Gadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar El Kadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar al-Qadhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qadhdhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Qadafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar Gaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Qadhdhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Khaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar al-Khaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'amar al-Kadafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghaddafy"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghadafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muamar Kaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Quathafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Gheddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muamar Al-Kaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar Khadafy "},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar Qudhafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qaddafi"},
|
||||
{0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi"},
|
||||
@@ -171,6 +171,7 @@ extern int access __P ((__const char *__name, int __type));
|
||||
#ifdef __USE_GNU
|
||||
/* Test for access to NAME using the effective UID and GID
|
||||
(as normal file operations use). */
|
||||
extern int __euidaccess __P ((__const char *__name, int __type));
|
||||
extern int euidaccess __P ((__const char *__name, int __type));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -513,6 +513,8 @@ gethostbyname2(name, af)
|
||||
if (!*cp) {
|
||||
if (*--cp == '.')
|
||||
break;
|
||||
if (!strchr (name, ':'))
|
||||
break;
|
||||
/*
|
||||
* All-IPv6-legal, no dot at the end.
|
||||
* Fake up a hostent as if we'd actually
|
||||
|
||||
@@ -51,9 +51,12 @@ LINE_PARSER
|
||||
else
|
||||
{
|
||||
STRING_FIELD (result->sp_pwdp, ISCOLON, 0);
|
||||
INT_FIELD (result->sp_lstchg, ISCOLON, 0, 10, (long int));
|
||||
INT_FIELD (result->sp_min, ISCOLON, 0, 10, (long int));
|
||||
INT_FIELD (result->sp_max, ISCOLON, 0, 10, (long int));
|
||||
INT_FIELD_MAYBE_NULL (result->sp_lstchg, ISCOLON, 0, 10, (long int),
|
||||
(long int) -1);
|
||||
INT_FIELD_MAYBE_NULL (result->sp_min, ISCOLON, 0, 10, (long int),
|
||||
(long int) -1);
|
||||
INT_FIELD_MAYBE_NULL (result->sp_max, ISCOLON, 0, 10, (long int),
|
||||
(long int) -1);
|
||||
while (isspace (*line))
|
||||
++line;
|
||||
if (*line == '\0')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (int arc, char *argv)
|
||||
main (int arc, char *argv[])
|
||||
{
|
||||
int n, res;
|
||||
unsigned int val;
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
#include <ansidecl.h>
|
||||
/* Copyright (C) 1991, 1992, 1996, 1997 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. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define TESTFILE "/tmp/test.dat"
|
||||
|
||||
int
|
||||
main __P((void))
|
||||
main (void)
|
||||
{
|
||||
FILE *fp;
|
||||
int i, j;
|
||||
@@ -61,6 +78,7 @@ main __P((void))
|
||||
}
|
||||
}
|
||||
fclose (fp);
|
||||
remove (TESTFILE);
|
||||
|
||||
puts ((i > 255) ? "Test succeeded." : "Test FAILED!");
|
||||
return (i > 255) ? 0 : 1;
|
||||
|
||||
@@ -1405,16 +1405,16 @@ printf_unknown (FILE *s, const struct printf_info *info,
|
||||
if (info->width != 0)
|
||||
{
|
||||
w = _itoa_word (info->width, workend + 1, 10, 0);
|
||||
while (++w <= workend)
|
||||
outchar (*w);
|
||||
while (w <= workend)
|
||||
outchar (*w++);
|
||||
}
|
||||
|
||||
if (info->prec != -1)
|
||||
{
|
||||
outchar ('.');
|
||||
w = _itoa_word (info->prec, workend + 1, 10, 0);
|
||||
while (++w <= workend)
|
||||
outchar (*w);
|
||||
while (w <= workend)
|
||||
outchar (*w++);
|
||||
}
|
||||
|
||||
if (info->spec != '\0')
|
||||
|
||||
+22
-6
@@ -163,8 +163,7 @@ int
|
||||
__vfscanf (FILE *s, const char *format, va_list argptr)
|
||||
#endif
|
||||
{
|
||||
va_list arg = (va_list) argptr;
|
||||
|
||||
va_list arg;
|
||||
register const char *f = format;
|
||||
register unsigned char fc; /* Current character of the format. */
|
||||
register size_t done = 0; /* Assignments done. */
|
||||
@@ -222,6 +221,12 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#ifdef __va_copy
|
||||
__va_copy (arg, argptr);
|
||||
#else
|
||||
arg = (va_list) argptr;
|
||||
#endif
|
||||
|
||||
ARGCHECK (s, format);
|
||||
|
||||
/* Figure out the decimal point character. */
|
||||
@@ -243,23 +248,34 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
||||
/* Extract the next argument, which is of type TYPE.
|
||||
For a %N$... spec, this is the Nth argument from the beginning;
|
||||
otherwise it is the next argument after the state now in ARG. */
|
||||
#if 0
|
||||
#ifdef __va_copy
|
||||
# define ARG(type) (argpos == 0 ? va_arg (arg, type) : \
|
||||
({ unsigned int pos = argpos; \
|
||||
va_list arg; \
|
||||
__va_copy (arg, argptr); \
|
||||
while (--pos > 0) \
|
||||
(void) va_arg (arg, void *); \
|
||||
va_arg (arg, type); \
|
||||
}))
|
||||
#else
|
||||
# if 0
|
||||
/* XXX Possible optimization. */
|
||||
# define ARG(type) (argpos == 0 ? va_arg (arg, type) : \
|
||||
# define ARG(type) (argpos == 0 ? va_arg (arg, type) : \
|
||||
({ va_list arg = (va_list) argptr; \
|
||||
arg = (va_list) ((char *) arg \
|
||||
+ (argpos - 1) \
|
||||
* __va_rounded_size (void *)); \
|
||||
va_arg (arg, type); \
|
||||
}))
|
||||
#else
|
||||
# define ARG(type) (argpos == 0 ? va_arg (arg, type) : \
|
||||
# else
|
||||
# define ARG(type) (argpos == 0 ? va_arg (arg, type) : \
|
||||
({ unsigned int pos = argpos; \
|
||||
va_list arg = (va_list) argptr; \
|
||||
while (--pos > 0) \
|
||||
(void) va_arg (arg, void *); \
|
||||
va_arg (arg, type); \
|
||||
}))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (!isascii (*f))
|
||||
|
||||
+23
-22
@@ -1,22 +1,21 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 1992, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@@ -27,17 +26,18 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Enlarge STREAM's buffer. */
|
||||
static void
|
||||
DEFUN(enlarge_buffer, (stream, c),
|
||||
register FILE *stream AND int c)
|
||||
enlarge_buffer (stream, c)
|
||||
FILE *stream;
|
||||
int c;
|
||||
{
|
||||
ptrdiff_t bufp_offset = stream->__bufp - stream->__buffer;
|
||||
char *newbuf;
|
||||
|
||||
stream->__bufsize += 100;
|
||||
newbuf = (char *) realloc ((PTR) stream->__buffer, stream->__bufsize);
|
||||
newbuf = (char *) realloc ((void *) stream->__buffer, stream->__bufsize);
|
||||
if (newbuf == NULL)
|
||||
{
|
||||
free ((PTR) stream->__buffer);
|
||||
free ((void *) stream->__buffer);
|
||||
stream->__buffer = stream->__bufp
|
||||
= stream->__put_limit = stream->__get_limit = NULL;
|
||||
stream->__error = 1;
|
||||
@@ -56,13 +56,14 @@ DEFUN(enlarge_buffer, (stream, c),
|
||||
/* Write formatted output from FORMAT to a string which is
|
||||
allocated with malloc and stored in *STRING_PTR. */
|
||||
int
|
||||
DEFUN(vasprintf, (string_ptr, format, args),
|
||||
char **string_ptr AND CONST char *format AND va_list args)
|
||||
vasprintf (char **string_ptr,
|
||||
const char *format,
|
||||
va_list args)
|
||||
{
|
||||
FILE f;
|
||||
int done;
|
||||
|
||||
memset ((PTR) &f, 0, sizeof (f));
|
||||
memset ((void *) &f, 0, sizeof (f));
|
||||
f.__magic = _IOMAGIC;
|
||||
f.__bufsize = 100;
|
||||
f.__buffer = (char *) malloc (f.__bufsize);
|
||||
|
||||
+6
-4
@@ -106,10 +106,10 @@ static const mp_limb_t _tens_in_limb[MAX_DIG_PER_LIMB + 1] =
|
||||
1000000, 10000000, 100000000,
|
||||
1000000000
|
||||
#if BITS_PER_MP_LIMB > 32
|
||||
, 10000000000, 100000000000,
|
||||
1000000000000, 10000000000000, 100000000000000,
|
||||
1000000000000000, 10000000000000000, 100000000000000000,
|
||||
1000000000000000000, 10000000000000000000U
|
||||
, 10000000000U, 100000000000U,
|
||||
1000000000000U, 10000000000000U, 100000000000000U,
|
||||
1000000000000000U, 10000000000000000U, 100000000000000000U,
|
||||
1000000000000000000U, 10000000000000000000U
|
||||
#endif
|
||||
#if BITS_PER_MP_LIMB > 64
|
||||
#error "Need to expand tens_in_limb table to" MAX_DIG_PER_LIMB
|
||||
@@ -1076,7 +1076,9 @@ INTERNAL (STRTOF) (nptr, endptr, group)
|
||||
for (i = RETURN_LIMB_SIZE; i > empty; --i)
|
||||
retval[i] = retval[i - empty];
|
||||
#endif
|
||||
#if RETURN_LIMB_SIZE > 1
|
||||
retval[1] = 0;
|
||||
#endif
|
||||
for (i = numsize; i > 0; --i)
|
||||
num[i + empty] = num[i - 1];
|
||||
MPN_ZERO (num, empty + 1);
|
||||
|
||||
+11
-2
@@ -1,5 +1,5 @@
|
||||
/* Routines for dealing with '\0' separated arg vectors.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -22,9 +22,18 @@
|
||||
#define __ARGZ_H__ 1
|
||||
#include <features.h>
|
||||
|
||||
#include <errno.h> /* Define error_t. */
|
||||
#define __need_error_t
|
||||
#include <errno.h>
|
||||
#include <string.h> /* Need size_t, and strchr is called below. */
|
||||
|
||||
#ifndef __const
|
||||
#define __const const
|
||||
#endif
|
||||
|
||||
#ifndef __error_t_defined
|
||||
typedef int error_t;
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
+38
-26
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
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 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.
|
||||
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. */
|
||||
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 <stddef.h>
|
||||
#include <stdlib.h>
|
||||
@@ -67,16 +67,18 @@ STRCOLL (s1, s2)
|
||||
int s1idx = forward ? 0 : s1run->data[pass].number - 1;
|
||||
int s2idx = forward ? 0 : s2run->data[pass].number - 1;
|
||||
|
||||
do
|
||||
while (1)
|
||||
{
|
||||
int s1ignore = 0;
|
||||
int s2ignore = 0;
|
||||
u_int32_t w1, w2;
|
||||
u_int32_t w1 = 0;
|
||||
u_int32_t w2 = 0;
|
||||
|
||||
/* Here we have to check for IGNORE entries. If these are
|
||||
found we count them and go on with the next value. */
|
||||
while ((w1 = s1run->data[pass].value[s1idx])
|
||||
== (u_int32_t) IGNORE_CHAR)
|
||||
while (s1run != NULL
|
||||
&& ((w1 = s1run->data[pass].value[s1idx])
|
||||
== (u_int32_t) IGNORE_CHAR))
|
||||
{
|
||||
++s1ignore;
|
||||
if ((forward && ++s1idx >= s1run->data[pass].number)
|
||||
@@ -86,15 +88,19 @@ STRCOLL (s1, s2)
|
||||
if (nextp == NULL)
|
||||
{
|
||||
w1 = 0;
|
||||
break;
|
||||
/* No more non-INGOREd elements means lowest
|
||||
possible value. */
|
||||
s1ignore = -1;
|
||||
}
|
||||
else
|
||||
s1idx = forward ? 0 : nextp->data[pass].number - 1;
|
||||
s1run = nextp;
|
||||
s1idx = forward ? 0 : s1run->data[pass].number - 1;
|
||||
}
|
||||
}
|
||||
|
||||
while ((w2 = s2run->data[pass].value[s2idx])
|
||||
== (u_int32_t) IGNORE_CHAR)
|
||||
while (s2run != NULL
|
||||
&& ((w2 = s2run->data[pass].value[s2idx])
|
||||
== (u_int32_t) IGNORE_CHAR))
|
||||
{
|
||||
++s2ignore;
|
||||
if ((forward && ++s2idx >= s2run->data[pass].number)
|
||||
@@ -104,13 +110,20 @@ STRCOLL (s1, s2)
|
||||
if (nextp == NULL)
|
||||
{
|
||||
w2 = 0;
|
||||
break;
|
||||
/* No more non-INGOREd elements means lowest
|
||||
possible value. */
|
||||
s2ignore = -1;
|
||||
}
|
||||
else
|
||||
s2idx = forward ? 0 : nextp->data[pass].number - 1;
|
||||
s2run = nextp;
|
||||
s2idx = forward ? 0 : s2run->data[pass].number - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If one string is completely processed stop. */
|
||||
if (s1run == NULL || s2run == NULL)
|
||||
break;
|
||||
|
||||
/* Now we have information of the number of ignored
|
||||
weights and the value of the next weight. */
|
||||
if ((collate_rules[pass] & sort_position) != 0
|
||||
@@ -150,7 +163,6 @@ STRCOLL (s1, s2)
|
||||
}
|
||||
|
||||
}
|
||||
while (s1run != NULL && s2run != NULL);
|
||||
|
||||
if (s1run != s2run)
|
||||
return s1run != NULL ? 1 : -1;
|
||||
|
||||
+15
-7
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
@@ -172,14 +172,16 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n)
|
||||
const weight_t *run = forward ? forw : backw;
|
||||
int idx = forward ? 0 : run->data[pass].number - 1;
|
||||
|
||||
do
|
||||
while (1)
|
||||
{
|
||||
int ignore = 0;
|
||||
u_int32_t w;
|
||||
u_int32_t w = 0;
|
||||
|
||||
/* Here we have to check for IGNORE entries. If these are
|
||||
found we count them and go on with he next value. */
|
||||
while ((w = run->data[pass].value[idx]) == (u_int32_t) IGNORE_CHAR)
|
||||
while (run != NULL
|
||||
&& ((w = run->data[pass].value[idx])
|
||||
== (u_int32_t) IGNORE_CHAR))
|
||||
{
|
||||
++ignore;
|
||||
if ((forward && ++idx >= run->data[pass].number)
|
||||
@@ -189,13 +191,20 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n)
|
||||
if (nextp == NULL)
|
||||
{
|
||||
w = 0;
|
||||
break;
|
||||
/* No more non-INGOREd elements means lowest
|
||||
possible value. */
|
||||
ignore = -1;
|
||||
}
|
||||
else
|
||||
idx = forward ? 0 : nextp->data[pass].number - 1;
|
||||
run = nextp;
|
||||
idx = forward ? 0 : run->data[pass].number - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Stop if all characters are processed. */
|
||||
if (run == NULL)
|
||||
break;
|
||||
|
||||
/* Now we have information of the number of ignored weights
|
||||
and the value of the next weight. We have to add 2
|
||||
because 0 means EOS and 1 is the intermediate string end. */
|
||||
@@ -220,7 +229,6 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n)
|
||||
idx = run->data[pass].number - 1;
|
||||
}
|
||||
}
|
||||
while (run != NULL);
|
||||
|
||||
/* Write marker for end of word. */
|
||||
if (pass + 1 < collate_nrules)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 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,6 +21,8 @@
|
||||
#define _RPC_AUTH_DES_H 1
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This is no complete version of this header. More definitions with
|
||||
the real authentication stuff will come in 1997. For now we only
|
||||
need to define the function for handling public keys. */
|
||||
@@ -39,4 +41,6 @@ extern int getpublickey __P ((__const char *__name, char *__key));
|
||||
extern int getsecretkey __P ((__const char *__name, char *__key,
|
||||
__const char *__passwd));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* rpc/auth_des.h */
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#define _RPC_PMAP_RMT_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct rmtcallargs {
|
||||
u_long prog, vers, proc, arglen;
|
||||
@@ -47,7 +48,7 @@ struct rmtcallargs {
|
||||
xdrproc_t xdr_args;
|
||||
};
|
||||
|
||||
bool_t xdr_rmtcall_args __P ((XDR *__xdrs, struct rmtcallargs *__crp));
|
||||
extern bool_t xdr_rmtcall_args __P ((XDR *__xdrs, struct rmtcallargs *__crp));
|
||||
|
||||
struct rmtcallres {
|
||||
u_long *port_ptr;
|
||||
@@ -56,7 +57,8 @@ struct rmtcallres {
|
||||
xdrproc_t xdr_results;
|
||||
};
|
||||
|
||||
bool_t xdr_rmtcallres __P ((XDR *__xdrs, struct rmtcallres *__crp));
|
||||
extern bool_t xdr_rmtcallres __P ((XDR *__xdrs, struct rmtcallres *__crp));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* rpc/pmap_rmt.h */
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#define _RPC_MSG_H 1
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <rpc/clnt.h>
|
||||
|
||||
/*
|
||||
* rpc_msg.h
|
||||
* rpc message definition
|
||||
|
||||
@@ -77,7 +77,8 @@ _dl_load_cache_lookup (const char *name)
|
||||
}
|
||||
|
||||
for (i = 0; i < cache->nlibs; ++i)
|
||||
if (cache->libs[i].flags == 1 && /* ELF library entry. */
|
||||
if ((cache->libs[i].flags == 1 ||
|
||||
cache->libs[i].flags == 3) && /* ELF library entry. */
|
||||
/* Make sure string table indices are not bogus before using them. */
|
||||
cache->libs[i].key < cachesize - sizeof *cache &&
|
||||
cache->libs[i].value < cachesize - sizeof *cache &&
|
||||
|
||||
+17
-17
@@ -1,28 +1,28 @@
|
||||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#undef htonl
|
||||
|
||||
unsigned long int
|
||||
DEFUN(htonl, (x), unsigned long int x)
|
||||
u_int32_t
|
||||
htonl (x)
|
||||
u_int32_t x;
|
||||
{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
|
||||
|
||||
+17
-17
@@ -1,28 +1,28 @@
|
||||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#undef htons
|
||||
|
||||
unsigned short int
|
||||
DEFUN(htons, (x), unsigned short int x)
|
||||
u_int16_t
|
||||
htons (x)
|
||||
u_int16_t x;
|
||||
{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
x = (x << 8) | (x >> 8);
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
* @(#)ip.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_IP_H
|
||||
#define _NETINET_IP_H
|
||||
|
||||
#include <gnu/types.h>
|
||||
#include <endian.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -165,3 +168,5 @@ struct ip_timestamp {
|
||||
#define IPTTLDEC 1 /* subtracted when forwarding */
|
||||
|
||||
#define IP_MSS 576 /* default maximum segment size */
|
||||
|
||||
#endif /* netinet/ip.h. */
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Standard well-defined IP protocols. */
|
||||
enum
|
||||
@@ -189,12 +190,17 @@ struct ip_mreq
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
/* Functions to convert between host and network byte order. */
|
||||
/* Functions to convert between host and network byte order.
|
||||
|
||||
extern unsigned long int ntohl __P ((unsigned long int));
|
||||
extern unsigned short int ntohs __P ((unsigned short int));
|
||||
extern unsigned long int htonl __P ((unsigned long int));
|
||||
extern unsigned short int htons __P ((unsigned short int));
|
||||
Please note that these functions normally take `unsigned long int' or
|
||||
`unsigned short int' values as arguments and also return them. But
|
||||
this was a short-sighted decision since on different systems the types
|
||||
may have different representations but the values are always the same. */
|
||||
|
||||
extern u_int32_t ntohl __P ((u_int32_t __netlong));
|
||||
extern u_int16_t ntohs __P ((u_int16_t __netshort));
|
||||
extern u_int32_t htonl __P ((u_int32_t __hostlong));
|
||||
extern u_int16_t htons __P ((u_int16_t __hostshort));
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
@@ -207,4 +213,6 @@ extern unsigned short int htons __P ((unsigned short int));
|
||||
#define htons(x) (x)
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* netinet/in.h */
|
||||
|
||||
+17
-17
@@ -1,28 +1,28 @@
|
||||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#undef ntohl
|
||||
|
||||
unsigned long int
|
||||
DEFUN(ntohl, (x), unsigned long int x)
|
||||
u_int32_t
|
||||
ntohl (x)
|
||||
u_int32_t x;
|
||||
{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
|
||||
|
||||
+17
-17
@@ -1,28 +1,28 @@
|
||||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1997 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 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.
|
||||
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. */
|
||||
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 <ansidecl.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#undef ntohs
|
||||
|
||||
unsigned short int
|
||||
DEFUN(ntohs, (x), unsigned short int x)
|
||||
u_int16_t
|
||||
ntohs (x)
|
||||
u_int16_t x;
|
||||
{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
x = (x << 8) | (x >> 8);
|
||||
|
||||
@@ -50,6 +50,7 @@ enum __socket_type
|
||||
#define PF_UNSPEC 0 /* Unspecified. */
|
||||
#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
|
||||
#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
|
||||
#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */
|
||||
#define PF_INET 2 /* IP protocol family. */
|
||||
#define PF_IMPLINK 3 /* ARPAnet IMP protocol. */
|
||||
#define PF_PUP 4 /* PUP protocols. */
|
||||
@@ -82,6 +83,7 @@ enum __socket_type
|
||||
#define AF_UNSPEC PF_UNSPEC
|
||||
#define AF_LOCAL PF_LOCAL
|
||||
#define AF_UNIX PF_UNIX
|
||||
#define AF_FILE PF_FILE
|
||||
#define AF_INET PF_INET
|
||||
#define AF_IMPLINK PF_IMPLINK
|
||||
#define AF_PUP PF_PUP
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definitions for BSD-style memory management. Generic/4.4 BSD version.
|
||||
Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1995, 1996, 1997 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
|
||||
@@ -97,8 +97,8 @@ int mprotect __P ((__caddr_t __addr, size_t __len, int __prot));
|
||||
|
||||
/* Synchronize the region starting at ADDR and extending LEN bytes with the
|
||||
file it maps. Filesystem operations on a file being mapped are
|
||||
unpredictable before this is done. */
|
||||
int msync __P ((__caddr_t __addr, size_t __len));
|
||||
unpredictable before this is done. Flags are from the MS_* set. */
|
||||
int msync __P ((__caddr_t __addr, size_t __len, int flags));
|
||||
|
||||
/* Advise the system about particular usage patterns the program follows
|
||||
for the region starting at ADDR and extending LEN bytes. */
|
||||
|
||||
@@ -73,6 +73,8 @@ nofini:
|
||||
boundary to avoid penalties from misaligned accesses. Thanks
|
||||
to Edward Seidl <seidl@janed.com> for pointing this out. */
|
||||
andl $0xfffffff8, %esp
|
||||
pushl %eax /* Push garbage because we allocate
|
||||
twelve more bytes. */
|
||||
|
||||
pushl %eax /* Push third argument: envp. */
|
||||
pushl %edx /* Push second argument: argv. */
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/* `HUGE_VAL' constants for ix86 (where it is infinity).
|
||||
Used by <stdlib.h> and <math.h> functions for overflow.
|
||||
Copyright (C) 1992, 1995, 1996, 1997 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 _HUGE_VAL_H
|
||||
#define _HUGE_VAL_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <endian.h>
|
||||
|
||||
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
|
||||
#endif
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
|
||||
#endif
|
||||
|
||||
#define __huge_val_t union { unsigned char __c[8]; double __d; }
|
||||
#ifdef __GNUC__
|
||||
#define HUGE_VAL (__extension__ \
|
||||
((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
|
||||
#else /* Not GCC. */
|
||||
static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
|
||||
#define HUGE_VAL (__huge_val.__d)
|
||||
#endif /* GCC. */
|
||||
|
||||
|
||||
/* GNU extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __HUGE_VALf_bytes { 0x7f, 0x80, 0, 0 }
|
||||
#endif
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define __HUGE_VALf_bytes { 0, 0, 0x80, 0x7f }
|
||||
#endif
|
||||
|
||||
#define __huge_valf_t union { unsigned char __c[4]; float __f; }
|
||||
#ifdef __GNUC__
|
||||
#define HUGE_VALf (__extension__ \
|
||||
((__huge_valf_t) { __c: __HUGE_VALf_bytes }).__f)
|
||||
#else /* Not GCC. */
|
||||
static __huge_valf_t __huge_valf = { __HUGE_VALf_bytes };
|
||||
#define HUGE_VALf (__huge_valf.__f)
|
||||
#endif /* GCC. */
|
||||
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __HUGE_VALl_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
#endif
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define __HUGE_VALl_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
|
||||
#endif
|
||||
|
||||
#define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
|
||||
#ifdef __GNUC__
|
||||
#define HUGE_VALl (__extension__ \
|
||||
((__huge_vall_t) { __c: __HUGE_VALl_bytes }).__ld)
|
||||
#else /* Not GCC. */
|
||||
static __huge_vall_t __huge_vall = { __HUGE_VALl_bytes };
|
||||
#define HUGE_VALl (__huge_vall.__ld)
|
||||
#endif /* GCC. */
|
||||
|
||||
#endif /* __USE_GNU. */
|
||||
|
||||
|
||||
#endif /* huge_val.h */
|
||||
@@ -1,6 +1,6 @@
|
||||
/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
|
||||
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
|
||||
Used by <stdlib.h> and <math.h> functions for overflow.
|
||||
Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1995, 1996, 1997 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
|
||||
@@ -46,7 +46,7 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
|
||||
|
||||
/* GNU extensions: (float) HUGE_VALf and (long double) HUGE_VALl. */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_GNU
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __HUGE_VALf_bytes { 0x7f, 0x80, 0, 0 }
|
||||
@@ -64,21 +64,10 @@ static __huge_valf_t __huge_valf = { __HUGE_VALf_bytes };
|
||||
#define HUGE_VALf (__huge_valf.__f)
|
||||
#endif /* GCC. */
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __HUGE_VALl_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
#endif
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define __HUGE_VALl_bytes { 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0x7f, 0, 0 }
|
||||
#endif
|
||||
|
||||
#define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
|
||||
#ifdef __GNUC__
|
||||
#define HUGE_VALl (__extension__ \
|
||||
((__huge_vall_t) { __c: __HUGE_VALl_bytes }).__ld)
|
||||
#else /* Not GCC. */
|
||||
static __huge_vall_t __huge_vall = { __HUGE_VALl_bytes };
|
||||
#define HUGE_VALl (__huge_vall.__ld)
|
||||
#endif /* GCC. */
|
||||
/* Generally there is no separate `long double' format and it is the
|
||||
same as `double'. */
|
||||
#define HUGE_VALl HUGE_VAL
|
||||
|
||||
#endif /* __USE_GNU. */
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ RCSID("$NetBSD: e_acos.S,v 1.4 1995/05/08 23:44:37 jtc Exp $")
|
||||
/* acos = atan (sqrt(1 - x^2) / x) */
|
||||
ENTRY(__ieee754_acos)
|
||||
fldl 4(%esp) /* x */
|
||||
fst %st(1)
|
||||
fmul %st(0) /* x^2 */
|
||||
fld1
|
||||
fsubp /* 1 - x^2 */
|
||||
fsqrt /* sqrt (1 - x^2) */
|
||||
fxch %st(1)
|
||||
fpatan
|
||||
fld %st /* x : x */
|
||||
fmul %st(0) /* x^2 : x */
|
||||
fld1 /* 1 : x^2 : x */
|
||||
fsubp /* 1 - x^2 : x */
|
||||
fsqrt /* sqrt (1 - x^2) : x */
|
||||
fxch %st(1) /* x : sqrt (1 - x^2) */
|
||||
fpatan /* atan (sqrt(1 - x^2) / x) */
|
||||
ret
|
||||
END (__ieee754_acos)
|
||||
|
||||
@@ -11,7 +11,7 @@ RCSID("$NetBSD: $")
|
||||
/* acos = atan (sqrt(1 - x^2) / x) */
|
||||
ENTRY(__ieee754_acosf)
|
||||
flds 4(%esp) /* x */
|
||||
fst %st(1)
|
||||
fld %st
|
||||
fmul %st(0) /* x^2 */
|
||||
fld1
|
||||
fsubp /* 1 - x^2 */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user