+Mon Mar 25 03:35:16 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ * malloc/malloc.c (morecore): Don't attempt recursive realloc of info
+ table when _heaplimit==0 during realloc growing large block.
+
+ * MakeTAGS (extract): Remove /dev/null from xgettext command line.
+ (text-srcs): New variable: extract only C sources from $(tags_sources).
+ (po/$(domain).pot): Depend on that.
+ If it's empty, cp /dev/null $@ instead of $(extract).
+
+ * misc/Makefile (headers): Add iovec.h.
+ * sysdeps/unix/sysv/linux/iovec.h: New file.
+ * sysdeps/generic/iovec.h: New file.
+ * misc/sys/uio.h (struct iovec): Type replaced with #include <iovec.h>.
+
+ * configure.in (NO_UNDERSCORES check): Use AC_TRY_LINK instead of
+ AC_TRY_COMPILE.
+
+ * misc/sys/cdefs.h [__USE_BSD] (const, signed, volatile): Move these
+ macros inside [! __STDC__].
+
+ * stdlib/rpmatch.c: New file.
+ * stdlib/Makefile (routines): Add rpmatch.
+ * stdlib/stdlib.h [__USE_SVID]: Declare rpmatch.
+
+ * MakeTAGS (MSGJOIN): Variable removed.
+ (po/SYS_libc.pot): Use $(XGETTEXT) instead of $(MSGJOIN).
+
+Wed Mar 20 20:08:46 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/unix/sysdep.h: Don't define C_SYMBOL_NAME.
+
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h: Don't define
+ NO_UNDERSCORES.
+
Thu Mar 21 11:19:15 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* mach/devstream.c (input): Translate \r to \n on input.
ifndef XGETTEXT
XGETTEXT = xgettext
endif
-ifndef MSGJOIN
-MSGJOIN = msgjoin
-endif
P = $(..)po
define extract
@rm -f $@.new
$(XGETTEXT) --keyword=_ --keyword=N_ --sort-output -d - \
- $(XGETTEXTFLAGS-$(@F)) > $@.new /dev/null $^
+ $(XGETTEXTFLAGS-$(@F)) > $@.new $^
mv -f $@.new $@
endef
-$P/$(domain).pot: $(tags_sources); $(extract)
+text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
+$P/$(domain).pot: $(text-srcs)
+ifeq (,$(text-srcs))
+ cp /dev/null $@
+else
+ $(extract)
+endif
$P/siglist.pot: $(common-objpfx)siglist.c; $(extract)
$P/errlist.pot: $(..)sysdeps/mach/hurd/errlist.c; $(extract)
ifndef subdir
$P/SYS_libc.pot: $(all-pot)
@rm -f $@.new
- $(MSGJOIN) $^ > $@.new
+ $(XGETTEXT) -d - --omit-header $^ > $@.new
mv -f $@.new $@
test ! -d CVS || cvs ci -m'Regenerated from source files' $@
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:1385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
libc_cv_asm_underscores=no
else
AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
- [AC_TRY_COMPILE([asm ("_glibc_foobar:");], [glibc_foobar ();],
- libc_cv_asm_underscores=yes,
- libc_cv_asm_underscores=no)])
+ [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
+ libc_cv_asm_underscores=yes,
+ libc_cv_asm_underscores=no)])
fi
if test $libc_cv_asm_underscores = no; then
AC_DEFINE(NO_UNDERSCORES)
/* finddomain.c -- handle list of needed message catalogs
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify
/* Rename the non ANSI C functions. This is required by the standard
because some ANSI C functions will require linking with this object
file and the name space must not be polluted. */
-# define stpcpy __stpcpy
+# define stpcpy(dest, src) __stpcpy(dest, src)
#endif
/* Encoding of locale name parts. */
-#define CEN_REVISION 1
-#define CEN_SPONSOR 2
-#define CEN_SPECIAL 4
-#define XPG_CODESET 8
-#define TERRITORY 16
-#define CEN_AUDIENCE 32
-#define XPG_MODIFIER 64
+#define CEN_REVISION 1
+#define CEN_SPONSOR 2
+#define CEN_SPECIAL 4
+#define XPG_NORM_CODESET 8
+#define XPG_CODESET 16
+#define TERRITORY 32
+#define CEN_AUDIENCE 64
+#define XPG_MODIFIER 128
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
-#define XPG_SPECIFIC (XPG_CODESET|XPG_MODIFIER)
+#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
/* List of already loaded domains. */
const char *language,
const char *territory,
const char *codeset,
+ const char *normalized_codeset,
const char *modifier,
const char *special,
const char *sponsor,
const char *domainname,
int do_allocate));
+/* Normalize name of selected codeset. */
+static const char *normalize_codeset PARAMS ((const char *codeset));
+
/* Substitution for systems lacking this function in their C library. */
#if !_LIBC && !HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
+static char *stpcpy__ PARAMS ((char *dest, const char *src));
+# define stpcpy(dest, src) stpcpy__ (dest, src)
#endif
const char *modifier = NULL;
const char *territory = NULL;
const char *codeset = NULL;
+ const char *normalized_codeset = NULL;
const char *special = NULL;
const char *sponsor = NULL;
const char *revision = NULL;
(2) sponsor
(3) special
(4) codeset
- (5) territory
- (6) audience/modifier
+ (5) normalized codeset
+ (6) territory
+ (7) audience/modifier
*/
/* If we have already tested for this locale entry there has to
be one data set in the list of loaded domains. */
- retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL,
+ retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, domainname, 0);
if (retval != NULL)
{
++cp;
mask |= XPG_CODESET;
+
+ if (codeset != cp && codeset[0] != '\0')
+ {
+ normalized_codeset = normalize_codeset (codeset);
+ if (strcmp (codeset, normalized_codeset) == 0)
+ free ((char *) normalized_codeset);
+ else
+ mask |= XPG_NORM_CODESET;
+ }
}
}
/* Create all possible locale entries which might be interested in
generalzation. */
retval = make_entry_rec (dirname, mask, language, territory, codeset,
- modifier, special, sponsor, revision,
- domainname, 1);
+ normalized_codeset, modifier, special, sponsor,
+ revision, domainname, 1);
if (retval == NULL)
/* This means we are out of core. */
return NULL;
static struct loaded_domain *
-make_entry_rec (dirname, mask, language, territory, codeset, modifier,
- special, sponsor, revision, domain, do_allocate)
+make_entry_rec (dirname, mask, language, territory, codeset,
+ normalized_codeset, modifier, special, sponsor, revision,
+ domain, do_allocate)
const char *dirname;
int mask;
const char *language;
const char *territory;
const char *codeset;
+ const char *normalized_codeset;
const char *modifier;
const char *special;
const char *sponsor;
both syntaces set this is necessary to prevent constructing
illegal local names. */
/* FIXME: Rewrite because test is necessary only in first round. */
- if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0)
+ if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0
+ || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0))
{
/* Allocate room for the full file name. */
filename = (char *) malloc (strlen (dirname) + 1
+ strlen (language)
+ ((mask & TERRITORY) != 0
- ? strlen (territory) : 0)
+ ? strlen (territory) + 1 : 0)
+ ((mask & XPG_CODESET) != 0
- ? strlen (codeset) : 0)
+ ? strlen (codeset) + 1 : 0)
+ + ((mask & XPG_NORM_CODESET) != 0
+ ? strlen (normalized_codeset) + 1 : 0)
+ ((mask & XPG_MODIFIER) != 0 ?
- strlen (modifier) : 0)
+ strlen (modifier) + 1 : 0)
+ ((mask & CEN_SPECIAL) != 0
- ? strlen (special) : 0)
+ ? strlen (special) + 1 : 0)
+ ((mask & CEN_SPONSOR) != 0
- ? strlen (sponsor) : 0)
+ ? strlen (sponsor) + 1 : 0)
+ ((mask & CEN_REVISION) != 0
- ? strlen (revision) : 0) + 1
+ ? strlen (revision) + 1 : 0) + 1
+ strlen (domain) + 1);
if (filename == NULL)
if ((mask & XPG_CODESET) != 0)
{
*cp++ = '.';
- cp = stpcpy (cp, codeset);
+ cp = stpcpy (cp, codeset);
+ }
+ if ((mask & XPG_NORM_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, normalized_codeset);
}
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{
}
entries = 0;
- for (cnt = 126; cnt >= 0; --cnt)
+ for (cnt = 254; cnt >= 0; --cnt)
if (cnt < mask && (cnt & ~mask) == 0
- && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0))
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
retval->successor[entries++] = make_entry_rec (dirname, cnt,
language, territory,
- codeset, modifier,
- special, sponsor,
- revision, domain, 1);
+ codeset,
+ normalized_codeset,
+ modifier, special,
+ sponsor, revision,
+ domain, 1);
retval->successor[entries] = NULL;
return retval;
}
+static const char *
+normalize_codeset (codeset)
+ const char *codeset;
+{
+ int len = 0;
+ int only_digit = 1;
+ const char *cp;
+ char *retval;
+ char *wp;
+
+ for (cp = codeset; cp[0] != '\0'; ++cp)
+ if (isalnum (cp[0]))
+ {
+ ++len;
+
+ if (isalpha (cp[0]))
+ only_digit = 0;
+ }
+
+ retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+ if (retval != NULL)
+ {
+ if (only_digit)
+ wp = stpcpy (retval, "ISO");
+ else
+ wp = retval;
+
+ for (cp = codeset; cp[0] != '\0'; ++cp)
+ if (isalpha (cp[0]))
+ *wp++ = toupper (cp[0]);
+ else if (isdigit (cp[0]))
+ *wp++ = cp[0];
+
+ *wp = '\0';
+ }
+
+ return (const char *) retval;
+}
+
+
/* @@ begin of epilog @@ */
/* We don't want libintl.a to depend on any other library. So we
to be defined. */
#if !_LIBC && !HAVE_STPCPY
static char *
-stpcpy (dest, src)
+stpcpy__ (dest, src)
char *dest;
const char *src;
{
subdir := misc
-headers := sys/uio.h sys/ioctl.h sys/ptrace.h ioctls.h sys/file.h \
+headers := sys/uio.h iovec.h sys/ioctl.h sys/ptrace.h ioctls.h sys/file.h\
a.out.h nlist.h stab.h stab.def sgtty.h sys/dir.h sys/cdefs.h \
ttyent.h syscall.h syslog.h sys/syslog.h paths.h sys/reboot.h \
sys/mman.h sys/param.h fstab.h mntent.h search.h utmp.h \
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#define __ptr_t char *
typedef double __long_double_t;
-#endif
-
-/* The BSD header files use the ANSI keywords unmodified. (This means that
- old programs may lose if they use the new keywords as identifiers.) We
- define them to their __ versions, which are taken care of above. */
-
+/* The BSD header files use the ANSI keywords unmodified (this means that
+ old programs may lose if they use the new keywords as identifiers), but
+ those names are not available under -traditional. We define them to
+ their __ versions, which are taken care of above. */
#ifdef __USE_BSD
#define const __const
#define signed __signed
#define volatile __volatile
#endif
+#endif /* __STDC__ */
+
+
/* C++ needs to know that types and declarations are C, not C++. */
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#define __need_size_t
#include <stddef.h>
-
-/* Structure describing a section of memory. */
-
-struct iovec
-{
- /* Starting address. */
- __ptr_t iov_base;
- /* Length in bytes. */
- size_t iov_len;
-};
+/* This file defines `struct iovec'. */
+#include <iovec.h>
/* Read data from file descriptor FD, and put the result in the
-# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
strtol strtoul strtoq strtouq \
strtof strtod strtold \
system \
- a64l l64a
+ a64l l64a \
+ rpmatch
distribute := exit.h grouping.h
tests := tst-strtol tst-strtod testmb testrand testsort testdiv
--- /dev/null
+/* rpmatch - determine whether string value is affirmation or negative
+ response according to current locale's data
+Copyright (C) 1996 Free Software Foundation, Inc.
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <langinfo.h>
+#include <stdlib.h>
+#include <regex.h>
+
+
+int
+rpmatch (response)
+ const char *response;
+{
+ /* Match against one of the response patterns, compiling the pattern
+ first if necessary. */
+ inline int try (const int tag, const int match,
+ const char **lastp, regex_t *re)
+ {
+ const char *pattern = nl_langinfo (tag);
+ if (pattern != *lastp)
+ {
+ /* The pattern has changed. */
+ if (*lastp)
+ {
+ /* Free the old compiled pattern. */
+ regfree (re);
+ *lastp = NULL;
+ }
+ /* Compile the pattern and cache it for future runs. */
+ if (regcomp (re, pattern, REG_EXTENDED) != 0)
+ return -1;
+ *lastp = pattern;
+ }
+
+ /* Try the pattern. */
+ return regexec (re, response, 0, NULL, 0) == 0 ? match : !match;
+ }
+
+ /* We cache the response patterns and compiled regexps here. */
+ static const char *yesexpr, *noexpr;
+ static regex_t yesre, nore;
+
+ return (try (YESEXPR, 1, &yesexpr, &yesre) ?:
+ try (NOEXPR, 0, &noexpr, &nore));
+}
extern size_t wcstombs __P ((char *__s, __const wchar_t * __pwcs, size_t __n));
+#ifdef __USE_SVID
+/* Determine whether the string value of RESPONSE matches the affirmation
+ or negative response expression as specified by the LC_MESSAGES category
+ in the program's current locale. Returns 1 if affirmative, 0 if
+ negative, and -1 if not matching. */
+extern int rpmatch __P ((__const char *__response));
+#endif
+
+
__END_DECLS
#endif /* stdlib.h */
--- /dev/null
+/* `struct iovec' -- Structure describing a section of memory. */
+
+struct iovec
+{
+ /* Starting address. */
+ __ptr_t iov_base;
+ /* Length in bytes. */
+ size_t iov_len;
+};
off_t base;
ssize_t bytes;
- if (sizeof (dp->d_name) > 1)
- /* Fixed-size struct; must read one at a time (see below). */
- maxread = sizeof *dp;
- else
- maxread = dirp->allocation;
+#ifndef _DIRENT_HAVE_D_RECLEN
+ /* Fixed-size struct; must read one at a time (see below). */
+ maxread = sizeof *dp;
+#else
+ maxread = dirp->allocation;
+#endif
base = dirp->filepos;
bytes = __getdirentries (dirp->fd, dirp->data, maxread, &base);
/* Define a macro we can use to construct the asm name for a C symbol. */
#ifdef NO_UNDERSCORES
-#define C_SYMBOL_NAME(name) name
#ifdef __STDC__
#define C_LABEL(name) name##:
#else
#endif
#else
#ifdef __STDC__
-#define C_SYMBOL_NAME(name) _##name
#define C_LABEL(name) _##name##:
#else
-#define C_SYMBOL_NAME(name) _/**/name
#define C_LABEL(name) _/**/name/**/:
#endif
#endif
--- /dev/null
+/* The Linux kernel header defines `struct iovec' for us. */
+
+#include <linux/uio.h>
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-/* In the Linux/ELF world, C symbols are asm symbols. */
-#define NO_UNDERSCORES
-
#include <sysdeps/unix/sysdep.h>
/* For Linux we can use the system call table in the header file