about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--NEWS78
-rw-r--r--locale/loadlocale.c38
-rw-r--r--stdio/Makefile59
-rw-r--r--stdio/printf_fp.c9
-rw-r--r--stdlib/fpioconst.c (renamed from stdio/fpioconst.c)0
-rw-r--r--stdlib/fpioconst.h (renamed from stdio/fpioconst.h)0
-rw-r--r--stdlib/gen-mpn-copy (renamed from stdio/gen-mpn-copy)0
-rw-r--r--stdlib/gmp-impl.h (renamed from stdio/gmp-impl.h)0
-rw-r--r--stdlib/gmp.h (renamed from stdio/gmp.h)0
-rw-r--r--stdlib/longlong.h (renamed from stdio/longlong.h)0
-rw-r--r--stdlib/mp_clz_tab.c (renamed from stdio/mp_clz_tab.c)0
-rw-r--r--stdlib/strtod.c8
13 files changed, 104 insertions, 102 deletions
diff --git a/ChangeLog b/ChangeLog
index dfaaf624e1..fed93d23b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
+Tue Mar 21 00:14:27 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+	* locale/loadlocale.c (_nl_load_locale): If LOCALE/LC_* is a
+ 	directory, open LOCALE/LC_*/SYS_LC_* instead.
+
 Mon Mar 20 03:19:23 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
+	* stdio/fpioconst.c, stdio/fpioconst.h, stdio/gmp-impl.h,
+	stdio/gmp.h, stdio/longlong.h, stdio/mp_clz_tab.c,
+	stdio/gen-mpn-copy: Files moved to stdlib.
+	* stdio/Makefile: All mpn stuff moved to stdlib/Makefile.
+	* stdio/printf_fp.c: Use ../stdlib to find fpioconst.h and gmp
+ 	headers.
+	* stdlib/strtod.c: Don't use ../stdio to find fpioconst.h and gmp
+ 	headers.
+
 	* Makefile (parent-mostlyclean): Don't use $(libc.a).
 	(parent-clean): Use $(objpfx) to find sysd-*.
 	* Rules (generated): Append dummy.o dummy.c.
diff --git a/NEWS b/NEWS
index cc2b89fa32..0e8cea02d0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  24 February 1995
+GNU C Library NEWS -- history of user-visible changes.  21 March 1995
 
 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 See the end for copying conditions.
@@ -16,6 +16,50 @@ Version 1.10
   of many files which contained only symbol aliases, reducing the size of
   the source and the compiled library; many other files were renamed to
   less cryptic names previously occupied by the symbol alias files.
+  There is a new header file <elf.h> and new library `-lelf' for
+  programs which operate on files in the ELF format.
+
+* Converted to Autoconf version 2, so `configure' has more options.
+  Run `configure --help' to see the details.
+
+* The library can now be configured to build profiling, highly-optimized
+  (but undebuggable), and/or shared libraries (ELF with GNU ld only).
+  The `--enable-profile', `--enable-omitfp', and `--enable-shared'
+  options to `configure' enable building these extra libraries.
+  The shared library is built by default when using both ELF and GNU ld.
+
+* The new functions `strtoq' and `strtouq' parse integer values from
+  strings, like `strtol' and `strtoul', but they return `long long int' and
+  `unsigned long long int' values, respectively (64-bit quantities).
+
+* The new functions `strtof' and `strtold' parse floating-point values from
+  strings, like `strtod', but they return `float' and `long double' values,
+  respectively (on some machines `double' and `long double' are the same).
+
+* Ulrich Drepper has contributed new implementations of the floating-point
+  printing and reading code used in the `printf' family of functions and
+  `strtod', `strtof', and `strtold'.  These new functions are perfectly
+  accurate, and much faster than the old ones.
+
+* The new header <langinfo.h> defines an interface for accessing
+  various locale-dependent data (using the locale chosen with `setlocale').
+
+* You can now use positional parameter specifications in format strings 
+  for the `printf' and `scanf' families of functions.  For example,
+  `printf ("Number %2$d, Mr %1$s\n", "Jones", 6);'' prints
+  ``Number 6, Mr Jones''.  This is mainly useful when providing different
+  format strings for different languages, whose grammar may dictate
+  a different ordering of the values being printed.  To support this
+  feature, the interface for `register_printf_handler' has changed; see
+  the header file <printf.h>.
+
+* The `printf' and `scanf' families of functions now understand a new
+  formatting flag for numeric conversions: the ' flag (e.g. %'d or %'f) says
+  to group numbers as indicated by the locale; for `scanf' and friends, this
+  says to accept as valid only a number with all the proper grouping
+  separators in the right places.  In the default "C" locale, numbers are
+  not grouped; but locales for specific countries will define the usual
+  conventions (i.e. separate thousands with `,' in the US locale).
 
 * The pgrp functions have been regularized, slightly incompatibly but much
   less confusingly.  The core functions are now `getpgid' and `setpgid',
@@ -27,23 +71,12 @@ Version 1.10
 * The new header file <fts.h> and suite of functions simplify programs that
   operate on directory trees.  This code comes from 4.4 BSD.
 
-* Converted to Autoconf version 2, so `configure' has more options.
-  Run `configure --help' to see the details.
-
 * The resolver code has been updated from the BIND-4.9.3-BETA14 release.
 
 * The new function `malloc_find_object_address' finds the starting address
   of a malloc'd block, given any address within the block.  This can be
   useful for debugging.
 
-* The new functions `strtoq' and `strtouq' parse integer values from
-  strings, like `strtol' and `strtoul', but they return `long long int' and
-  `unsigned long long int' values, respectively (64-bit quantities).
-
-* The new functions `strtof' and `strtold' parse floating-point values from
-  strings, like `strtod', but they return `float' and `long double' values,
-  respectively (on some machines `double' and `long double' are the same).
-
 * There is a new malloc debugging hook `__memalign_hook'.
 
 * There are new typedefs `ushort' for `unsigned short int' and `uint' for
@@ -53,19 +86,18 @@ Version 1.10
 * The `-lmcheck' library to enable standard malloc debugging hooks is now
   done differently, so that it works even without GNU ld.
 
-* Ulrich Drepper has contributed new implementations of the floating-point
-  printing and reading code used in the `printf' family of functions and
-  `strtod', `strtof', and `strtold'.  These new functions are perfectly
-  accurate, and much faster than the old ones.
-
-* The `printf' family of functions now understand a new formatting flag
-  for numeric conversions: the ' flag (e.g. %'d or %'f) says to group
-  numbers as indicated by the locale.  In the default "C" locale, numbers
-  are not grouped; but locales for specific countries will define the
-  usual conventions (i.e. separate thousands with `,' in the US locale).
-
 * New function `euidaccess' checks allowed access to a file like `access',
   but using the effective IDs instead of the real IDs.
+
+* The time zone data files have been updated for the latest and greatest
+  local time conventions of the countries of the world.
+
+* The new function `dirfd' extracts the file descriptor used by a DIR stream;
+  see <dirent.h>.
+
+* The new functions `ecvt', `fcvt', and `gcvt' provide an obsolete interface
+  for formatting floating-point numbers.  They are provided only for
+  compatibility; new programs should use `sprintf' instead.
 
 Version 1.09
 
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 7ad7a21b53..a8cf7d5448 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -38,7 +38,6 @@ const size_t _nl_category_num_items[] =
 struct locale_data *
 _nl_load_locale (int category, char **name)
 {
-  char *file;
   int fd;
   struct
     {
@@ -69,18 +68,31 @@ _nl_load_locale (int category, char **name)
 	*name = (char *) "local";
     }
 
-/* XXX can't use asprintf here */
-  if (asprintf (&file, "%s%s/%s",
-		strchr (*name, '/') != NULL ? "" : "/share/locale/", /* XXX */
-		*name, _nl_category_names[category]) == -1)
-    return NULL;
-
-  fd = __open (file, O_RDONLY);
-  free (file);
-  if (fd < 0)
-    return NULL;
-  if (__fstat (fd, &st) < 0)
-    goto puntfd;
+  {
+    const char localedir[] = "/share/locale/"; /* XXX */
+    const char *catname = _nl_category_names[category];
+    size_t namelen = strlen (*name);
+    size_t catlen = strlen (catname);
+    char file[sizeof localedir + namelen + catlen * 2 + 4];
+    sprintf (file, "%s%s/%s",
+	     strchr (*name, '/') != NULL ? "" : localedir, *name, catname);
+    fd = __open (file, O_RDONLY);
+    if (fd < 0)
+      return NULL;
+    if (__fstat (fd, &st) < 0)
+      goto puntfd;
+    if (S_ISDIR (st.st_mode))
+      {
+	/* LOCALE/LC_* is a directory; open LOCALE/LC_*/SYS_LC_* instead.  */
+	__close (fd);
+	memcpy (stpcpy (strchr (file, '\0'), "SYS_"), catname, catlen);
+	fd = __open (file, O_RDONLY);
+	if (fd < 0)
+	  return NULL;
+	if (__fstat (fd, &st) < 0)
+	  goto puntfd;
+      }
+  }
 
   {
     /* Map in the file's data.  */
diff --git a/stdio/Makefile b/stdio/Makefile
index 579426186f..64b0598111 100644
--- a/stdio/Makefile
+++ b/stdio/Makefile
@@ -47,17 +47,8 @@ routines	:=							      \
 	remove rename							      \
 	memstream obstream						      \
 	internals sysd-stdio pipestream stdio_init libc_fatal
-
-# Several mpn functions from GNU MP are used by the printf_fp function.
-mpn-routines := add_1 add_n addmul_1 cmp divmod divmod_1 udiv_qrnnd \
-		lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1 
-mpn-headers = longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
-
-routines := $(strip $(routines) $(mpn-routines))	\
-	    dbl2mpn ldbl2mpn				\
-	    mpn2flt mpn2dbl mpn2ldbl
-aux	:= errlist siglist defs glue mp_clz_tab fpioconst 
-distribute = $(mpn-headers) gen-mpn-copy _itoa.h fpioconst.h
+aux	:= errlist siglist defs glue
+distribute := _itoa.h 
 
 tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
 	 temptest tst-fileno test-fwrite \
@@ -66,49 +57,3 @@ tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
 
 
 include ../Rules
-
-
-ifdef gmp-srcdir
-
-gmp-srcdir := $(firstword $(filter-out ..//%,$(..)$(gmp-srcdir) $(gmp-srcdir)))
-
-# Copy the mpn source files we use from the GNU MP source directory.
-# `gmp-srcdir' is set by doing `configure --with-gmp=DIR'.
-# (Do not try this at home.  You need an as yet unreleased version of GNU MP.)
-
-mpn-sysdep := $(addsuffix .c,$(mpn-routines)) \
-	      $(addsuffix .S,$(mpn-routines)) \
-	      $(addsuffix .s,$(mpn-routines)) gmp-mparam.h asm-syntax.h
-
-mpn-try := $(addprefix $(gmp-srcdir)/mpn/*/,$(mpn-sysdep))
-mpn-found := $(wildcard $(mpn-try))
-mpn-found := $(filter-out $(patsubst %.S,%.s,$(filter %.s,$(mpn-found))),\
-			  $(mpn-found))
-
-include mpn-copy.mk
-%.mk: gen-%; sh $< > $@
-
-mpn-copy-1 := $(patsubst $(gmp-srcdir)/mpn/%,$(sysdep_dir)/%,$(mpn-found))
-mpn-copy-sysdep := $(mpn-copy-sysdep) $(mpn-copy-1)
-$(mpn-copy-1): $(sysdep_dir)/%: $(ignore gmp2glibc.sed) $(gmp-srcdir)/mpn/%
-	$(gmp2glibc)
-
-mpn-stuff = $(mpn-copy-sysdep) $(mpn-copy)
-
-# chmod so I don't edit them by mistake.
-define gmp2glibc
-$(ignore sed -f $^ > $@-tmp)
-cp $< $@-tmp
-chmod a-w $@-tmp
-mv -f $@-tmp $@
-endef
-
-mpn-copy = $(filter-out $(mpn-sysdep),$(mpn-headers) mp_clz_tab.c)
-$(mpn-copy): %: $(ignore gmp2glibc.sed) $(gmp-srcdir)/%; $(gmp2glibc)
-
-.PHONY: copy-mpn clean-mpn
-copy-mpn: $(mpn-stuff)
-clean-mpn:
-	rm -f $(mpn-stuff)
-
-endif
diff --git a/stdio/printf_fp.c b/stdio/printf_fp.c
index 33fe427999..28d13d61b8 100644
--- a/stdio/printf_fp.c
+++ b/stdio/printf_fp.c
@@ -29,9 +29,10 @@ Cambridge, MA 02139, USA.  */
 #include <ctype.h>
 #include <float.h>
 #include <gmp-mparam.h>
-#include <gmp.h>
-#include <gmp-impl.h>
-#include <longlong.h>
+#include "../stdlib/gmp.h"
+#include "../stdlib/gmp-impl.h"
+#include "../stdlib/longlong.h"
+#include "../stdlib/fpioconst.h"
 #include "../locale/localeinfo.h"
 #include <limits.h>
 #include <math.h>
@@ -119,8 +120,6 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
 					    int *expt, int *is_neg,
 					    long double value);
 
-#include "fpioconst.h"
-
 
 static unsigned int guess_grouping (unsigned int intdig_max,
 				    const char *grouping, wchar_t sepchar);
diff --git a/stdio/fpioconst.c b/stdlib/fpioconst.c
index 8d0a8233b0..8d0a8233b0 100644
--- a/stdio/fpioconst.c
+++ b/stdlib/fpioconst.c
diff --git a/stdio/fpioconst.h b/stdlib/fpioconst.h
index 8edbdccb17..8edbdccb17 100644
--- a/stdio/fpioconst.h
+++ b/stdlib/fpioconst.h
diff --git a/stdio/gen-mpn-copy b/stdlib/gen-mpn-copy
index b403f27a55..b403f27a55 100644
--- a/stdio/gen-mpn-copy
+++ b/stdlib/gen-mpn-copy
diff --git a/stdio/gmp-impl.h b/stdlib/gmp-impl.h
index ccffe7bb1e..ccffe7bb1e 100644
--- a/stdio/gmp-impl.h
+++ b/stdlib/gmp-impl.h
diff --git a/stdio/gmp.h b/stdlib/gmp.h
index 95c2f1beba..95c2f1beba 100644
--- a/stdio/gmp.h
+++ b/stdlib/gmp.h
diff --git a/stdio/longlong.h b/stdlib/longlong.h
index 97c469d8c0..97c469d8c0 100644
--- a/stdio/longlong.h
+++ b/stdlib/longlong.h
diff --git a/stdio/mp_clz_tab.c b/stdlib/mp_clz_tab.c
index ed1b7eebe8..ed1b7eebe8 100644
--- a/stdio/mp_clz_tab.c
+++ b/stdlib/mp_clz_tab.c
diff --git a/stdlib/strtod.c b/stdlib/strtod.c
index 78f480a600..94f9da3bfb 100644
--- a/stdlib/strtod.c
+++ b/stdlib/strtod.c
@@ -36,11 +36,11 @@ Cambridge, MA 02139, USA.  */
 #include "../locale/localeinfo.h"
 #include <math.h>
 #include <stdlib.h>
-#include "../stdio/gmp.h"
-#include "../stdio/gmp-impl.h"
+#include "gmp.h"
+#include "gmp-impl.h"
 #include <gmp-mparam.h>
-#include "../stdio/longlong.h"
-#include "../stdio/fpioconst.h"
+#include "longlong.h"
+#include "fpioconst.h"
 
 #define NDEBUG 1
 #include <assert.h>