* Makefile (subdirs): Replace stdio with stdio-common and $(stdio).
authorRoland McGrath <roland@gnu.org>
Tue, 17 Oct 1995 00:41:39 +0000 (00:41 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 17 Oct 1995 00:41:39 +0000 (00:41 +0000)
* configure.in: Grok arg --enable-libio.
($stdio = libio): Define USE_IN_LIBIO.
* config.h.in (USE_IN_LIBIO): Add #undef.
* config.make.in (stdio): New variable, set by configure.
* Makeconfig (stdio): New variable.
* stdio.h [USE_IN_LIBIO]: Include libio/stdio.h instead of
stdio/stdio.h.
* stdio-common/Makefile: New file.
* stdio/Makefile: Half the contents moved to stdio-common/Makefile.
* stdio/_itoa.c: Moved to stdio-common.
* stdio/_itoa.h: Moved to stdio-common.
* stdio/asprintf.c: Moved to stdio-common.
* stdio/bug1.c: Moved to stdio-common.
* stdio/bug1.input: Moved to stdio-common.
* stdio/bug2.c: Moved to stdio-common.
* stdio/bug3.c: Moved to stdio-common.
* stdio/bug4.c: Moved to stdio-common.
* stdio/bug5.c: Moved to stdio-common.
* stdio/bug6.c: Moved to stdio-common.
* stdio/bug6.input: Moved to stdio-common.
* stdio/bug7.c: Moved to stdio-common.
* stdio/dprintf.c: Moved to stdio-common.
* stdio/errnobug.c: Moved to stdio-common.
* stdio/getline.c: Moved to stdio-common.
* stdio/getw.c: Moved to stdio-common.
* stdio/perror.c: Moved to stdio-common.
* stdio/printf-parse.h: Moved to stdio-common.
* stdio/printf-prs.c: Moved to stdio-common.
* stdio/printf.c: Moved to stdio-common.
* stdio/printf.h: Moved to stdio-common.
* stdio/printf_fp.c: Moved to stdio-common.
* stdio/psignal.c: Moved to stdio-common.
* stdio/putw.c: Moved to stdio-common.
* stdio/reg-printf.c: Moved to stdio-common.
* stdio/scanf.c: Moved to stdio-common.
* stdio/snprintf.c: Moved to stdio-common.
* stdio/sprintf.c: Moved to stdio-common.
* stdio/sscanf.c: Moved to stdio-common.
* stdio/tempnam.c: Moved to stdio-common.
* stdio/temptest.c: Moved to stdio-common.
* stdio/test-fseek.c: Moved to stdio-common.
* stdio/test-fwrite.c: Moved to stdio-common.
* stdio/test-popen.c: Moved to stdio-common.
* stdio/test_rdwr.c: Moved to stdio-common.
* stdio/tmpfile.c: Moved to stdio-common.
* stdio/tmpnam.c: Moved to stdio-common.
* stdio/tst-fileno.c: Moved to stdio-common.
* stdio/tst-printf.c: Moved to stdio-common.
* stdio/tstgetln.c: Moved to stdio-common.
* stdio/tstgetln.input: Moved to stdio-common.
* stdio/tstscanf.c: Moved to stdio-common.
* stdio/tstscanf.input: Moved to stdio-common.
* stdio/vfprintf.c: Moved to stdio-common.
* stdio/vfscanf.c: Moved to stdio-common.
* stdio/vprintf.c: Moved to stdio-common.
* stdio/xbug.c: Moved to stdio-common.
* sysdeps/generic/Makefile (siglist.c rules): Do this in subdir
stdio-common instead of stdio.
* sysdeps/unix/Makefile (errlist.c rules): Likewise.
* stdio-common/asprintf.c [USE_IN_LIBIO]: Call libio primitive
function.
* stdio-common/dprintf.c: Likewise.
* stdio-common/printf.c: Likewise.
* stdio-common/scanf.c: Likewise.
* stdio-common/snprintf.c: Likewise.
* stdio-common/sprintf.c: Likewise.
* stdio-common/sscanf.c: Likewise.
* stdio-common/vprintf.c: Likewise.

* Makerules: Include $(+depfiles) directly instead of generating
depend-$(subdir).
(depend-$(subdir)): Target removed.
(common-clean): Don't remove depend-$(subdir).

66 files changed:
ChangeLog
Makeconfig
Makefile
Makerules
config.h.in
config.make.in
configure.in
stdio-common/Makefile [new file with mode: 0644]
stdio-common/_itoa.c [moved from stdio/_itoa.c with 100% similarity]
stdio-common/_itoa.h [moved from stdio/_itoa.h with 100% similarity]
stdio-common/asprintf.c [moved from stdio/asprintf.c with 77% similarity]
stdio-common/bug1.c [moved from stdio/bug1.c with 100% similarity]
stdio-common/bug1.input [moved from stdio/bug1.input with 100% similarity]
stdio-common/bug2.c [moved from stdio/bug2.c with 100% similarity]
stdio-common/bug3.c [moved from stdio/bug3.c with 100% similarity]
stdio-common/bug4.c [moved from stdio/bug4.c with 100% similarity]
stdio-common/bug5.c [moved from stdio/bug5.c with 100% similarity]
stdio-common/bug6.c [moved from stdio/bug6.c with 100% similarity]
stdio-common/bug6.input [moved from stdio/bug6.input with 100% similarity]
stdio-common/bug7.c [moved from stdio/bug7.c with 100% similarity]
stdio-common/dprintf.c [moved from stdio/dprintf.c with 79% similarity]
stdio-common/errnobug.c [moved from stdio/errnobug.c with 100% similarity]
stdio-common/fprintf.c [moved from stdio/fprintf.c with 100% similarity]
stdio-common/fscanf.c [moved from stdio/fscanf.c with 100% similarity]
stdio-common/getline.c [moved from stdio/getline.c with 100% similarity]
stdio-common/getw.c [moved from stdio/getw.c with 100% similarity]
stdio-common/perror.c [moved from stdio/perror.c with 100% similarity]
stdio-common/printf-parse.h [moved from stdio/printf-parse.h with 100% similarity]
stdio-common/printf-prs.c [moved from stdio/printf-prs.c with 100% similarity]
stdio-common/printf.c [moved from stdio/printf.c with 80% similarity]
stdio-common/printf.h [moved from stdio/printf.h with 100% similarity]
stdio-common/printf_fp.c [moved from stdio/printf_fp.c with 100% similarity]
stdio-common/psignal.c [moved from stdio/psignal.c with 100% similarity]
stdio-common/putw.c [moved from stdio/putw.c with 100% similarity]
stdio-common/reg-printf.c [moved from stdio/reg-printf.c with 100% similarity]
stdio-common/scanf.c [moved from stdio/scanf.c with 80% similarity]
stdio-common/snprintf.c [moved from stdio/snprintf.c with 77% similarity]
stdio-common/sprintf.c [moved from stdio/sprintf.c with 79% similarity]
stdio-common/sscanf.c [moved from stdio/sscanf.c with 78% similarity]
stdio-common/tempnam.c [moved from stdio/tempnam.c with 100% similarity]
stdio-common/temptest.c [moved from stdio/temptest.c with 100% similarity]
stdio-common/test-fseek.c [moved from stdio/test-fseek.c with 100% similarity]
stdio-common/test-fwrite.c [moved from stdio/test-fwrite.c with 100% similarity]
stdio-common/test-popen.c [moved from stdio/test-popen.c with 100% similarity]
stdio-common/test_rdwr.c [moved from stdio/test_rdwr.c with 100% similarity]
stdio-common/tmpfile.c [moved from stdio/tmpfile.c with 100% similarity]
stdio-common/tmpnam.c [moved from stdio/tmpnam.c with 100% similarity]
stdio-common/tst-fileno.c [moved from stdio/tst-fileno.c with 100% similarity]
stdio-common/tst-printf.c [moved from stdio/tst-printf.c with 100% similarity]
stdio-common/tstgetln.c [moved from stdio/tstgetln.c with 100% similarity]
stdio-common/tstgetln.input [moved from stdio/tstgetln.input with 100% similarity]
stdio-common/tstscanf.c [moved from stdio/tstscanf.c with 100% similarity]
stdio-common/tstscanf.input [moved from stdio/tstscanf.input with 100% similarity]
stdio-common/vasprintf.c [moved from stdio/vasprintf.c with 100% similarity]
stdio-common/vdprintf.c [moved from stdio/vdprintf.c with 100% similarity]
stdio-common/vfprintf.c [moved from stdio/vfprintf.c with 100% similarity]
stdio-common/vfscanf.c [moved from stdio/vfscanf.c with 100% similarity]
stdio-common/vprintf.c [moved from stdio/vprintf.c with 84% similarity]
stdio-common/vscanf.c [moved from stdio/vscanf.c with 100% similarity]
stdio-common/vsnprintf.c [moved from stdio/vsnprintf.c with 100% similarity]
stdio-common/vsprintf.c [moved from stdio/vsprintf.c with 100% similarity]
stdio-common/vsscanf.c [moved from stdio/vsscanf.c with 100% similarity]
stdio-common/xbug.c [moved from stdio/xbug.c with 100% similarity]
stdio.h
stdio/Makefile
sysdeps/generic/Makefile

index 610def7..5e0887b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,80 @@
 Mon Oct 16 03:22:37 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
+       * Makefile (subdirs): Replace stdio with stdio-common and $(stdio).
+       * configure.in: Grok arg --enable-libio.
+       ($stdio = libio): Define USE_IN_LIBIO.
+       * config.h.in (USE_IN_LIBIO): Add #undef.
+       * config.make.in (stdio): New variable, set by configure.
+       * Makeconfig (stdio): New variable.
+       * stdio.h [USE_IN_LIBIO]: Include libio/stdio.h instead of
+       stdio/stdio.h.
+       * stdio-common/Makefile: New file.
+       * stdio/Makefile: Half the contents moved to stdio-common/Makefile.
+       * stdio/_itoa.c: Moved to stdio-common.
+       * stdio/_itoa.h: Moved to stdio-common.
+       * stdio/asprintf.c: Moved to stdio-common.
+       * stdio/bug1.c: Moved to stdio-common.
+       * stdio/bug1.input: Moved to stdio-common.
+       * stdio/bug2.c: Moved to stdio-common.
+       * stdio/bug3.c: Moved to stdio-common.
+       * stdio/bug4.c: Moved to stdio-common.
+       * stdio/bug5.c: Moved to stdio-common.
+       * stdio/bug6.c: Moved to stdio-common.
+       * stdio/bug6.input: Moved to stdio-common.
+       * stdio/bug7.c: Moved to stdio-common.
+       * stdio/dprintf.c: Moved to stdio-common.
+       * stdio/errnobug.c: Moved to stdio-common.
+       * stdio/getline.c: Moved to stdio-common.
+       * stdio/getw.c: Moved to stdio-common.
+       * stdio/perror.c: Moved to stdio-common.
+       * stdio/printf-parse.h: Moved to stdio-common.
+       * stdio/printf-prs.c: Moved to stdio-common.
+       * stdio/printf.c: Moved to stdio-common.
+       * stdio/printf.h: Moved to stdio-common.
+       * stdio/printf_fp.c: Moved to stdio-common.
+       * stdio/psignal.c: Moved to stdio-common.
+       * stdio/putw.c: Moved to stdio-common.
+       * stdio/reg-printf.c: Moved to stdio-common.
+       * stdio/scanf.c: Moved to stdio-common.
+       * stdio/snprintf.c: Moved to stdio-common.
+       * stdio/sprintf.c: Moved to stdio-common.
+       * stdio/sscanf.c: Moved to stdio-common.
+       * stdio/tempnam.c: Moved to stdio-common.
+       * stdio/temptest.c: Moved to stdio-common.
+       * stdio/test-fseek.c: Moved to stdio-common.
+       * stdio/test-fwrite.c: Moved to stdio-common.
+       * stdio/test-popen.c: Moved to stdio-common.
+       * stdio/test_rdwr.c: Moved to stdio-common.
+       * stdio/tmpfile.c: Moved to stdio-common.
+       * stdio/tmpnam.c: Moved to stdio-common.
+       * stdio/tst-fileno.c: Moved to stdio-common.
+       * stdio/tst-printf.c: Moved to stdio-common.
+       * stdio/tstgetln.c: Moved to stdio-common.
+       * stdio/tstgetln.input: Moved to stdio-common.
+       * stdio/tstscanf.c: Moved to stdio-common.
+       * stdio/tstscanf.input: Moved to stdio-common.
+       * stdio/vfprintf.c: Moved to stdio-common.
+       * stdio/vfscanf.c: Moved to stdio-common.
+       * stdio/vprintf.c: Moved to stdio-common.
+       * stdio/xbug.c: Moved to stdio-common.
+       * sysdeps/generic/Makefile (siglist.c rules): Do this in subdir
+       stdio-common instead of stdio.
+       * sysdeps/unix/Makefile (errlist.c rules): Likewise.
+       * stdio-common/asprintf.c [USE_IN_LIBIO]: Call libio primitive
+       function.
+       * stdio-common/dprintf.c: Likewise.
+       * stdio-common/printf.c: Likewise.
+       * stdio-common/scanf.c: Likewise.
+       * stdio-common/snprintf.c: Likewise.
+       * stdio-common/sprintf.c: Likewise.
+       * stdio-common/sscanf.c: Likewise.
+       * stdio-common/vprintf.c: Likewise.
+
+       * Makerules: Include $(+depfiles) directly instead of generating
+       depend-$(subdir).
+       (depend-$(subdir)): Target removed.
+       (common-clean): Don't remove depend-$(subdir).
+
        * sysdeps/unix/sysv/linux/Makefile (rtld-installed-name): New variable.
        (config-LDFLAGS): Variable removed.
 
index d21d711..cbb2db0 100644 (file)
@@ -114,6 +114,12 @@ export sysdep_dir := $(sysdep_dir)
 ####
 
 
+# Set this to either `stdio' or `libio', to compile in either GNU stdio
+# or GNU libio.
+ifndef stdio
+stdio = stdio
+endif
+
 # Common prefix for machine-independent installation directories.
 ifeq ($(origin prefix),undefined) # ifndef would override explicit empty value.
 prefix = /usr/local
index f3d5e1c..f1aae8e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -51,10 +51,10 @@ sysdep-subdirs := $(subst $(\n), ,$(sysdep-subdirs))
 endif
 
 # These are the subdirectories containing the library source.
-subdirs := csu assert ctype locale intl math setjmp signal stdio stdlib        \
-          malloc string time dirent grp pwd posix io termios resource  \
-          misc socket sysvipc gmon gnulib $(wildcard crypt) manual     \
-          $(sysdep-subdirs) elf
+subdirs = csu assert ctype locale intl math setjmp signal stdlib       \
+         stdio-common $(stdio) malloc string time dirent grp pwd       \
+         posix io termios resource misc socket sysvipc gmon gnulib     \
+         $(wildcard crypt) manual $(sysdep-subdirs) elf
 export subdirs := $(subdirs)   # Benign, useless in GNU make before 3.63.
 
 # The mach and hurd subdirectories have many generated header files which
index 56f8cc8..ac1ac39 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -301,19 +301,10 @@ endif
                         $(filter-out $(addsuffix .d,$(omit-deps)),\
                                      $(+depfiles)))
 
-$(objpfx)depend-$(subdir): Makefile
 ifdef +depfiles
-       for file in $(+depfiles:$(objpfx)%=%); do \
-         echo "include \$$(objpfx)$$file";     \
-       done > $@-tmp
-       mv -f $@-tmp $@
-else
-       cp /dev/null $@
-endif
-
 ifneq ($(no_deps),t)
-# Include the generated dependencies of the sources in this directory.
-include $(objpfx)depend-$(subdir)
+include $(+depfiles)
+endif
 endif
 \f\f
 # Maximize efficiency by minimizing the number of rules.
@@ -623,8 +614,7 @@ endef
 
 # Also remove the dependencies and generated source files.
 common-clean: common-mostlyclean
-       -rm -f $(objpfx)depend-$(subdir) $(+depfiles)
-       -rm -f $(addprefix $(objpfx),$(generated))
+       -rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
 \f
 # Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION'
 # for each function which is a stub.  We grovel over all the .d files
index 800fe15..485f861 100644 (file)
 #define HAVE_WEAK_SYMBOLS
 #endif
 #endif
+
+/* Define to use GNU libio instead of GNU stdio.
+   This is defined by configure under --enable-libio.  */
+#undef USE_IN_LIBIO
 /* \f */
 /* These symbols might be defined by some sysdeps configures.  */
 
index 69d4fcb..2af925d 100644 (file)
@@ -24,6 +24,7 @@ gnu-ld = @gnu_ld@
 build-shared = @shared@
 build-profile = @profile@
 build-omitfp = @omitfp@
+stdio = @stdio@
 
 # Build tools.
 CC = @CC@
index e7d4ecb..239e7fd 100644 (file)
@@ -40,6 +40,11 @@ AC_ARG_WITH(weak-symbols, dnl
   --with-weak-symbols    if weak symbols are available in as and ld,
            weak=$withval, weak=no)
 
+AC_ARG_ENABLE(libio, dnl
+[  --enable-libio          build in GNU libio instead of GNU stdio],
+             stdio=libio, stdio=stdio)
+AC_SUBST(stdio)
+
 dnl Arguments to enable or disable building the shared, profiled, and
 dnl -fomit-frame-pointer libraries.
 AC_ARG_ENABLE(shared, dnl
@@ -485,6 +490,9 @@ fi
 AC_SUBST(profile)
 AC_SUBST(omitfp)
 
+if test $stdio = libio; then
+  AC_DEFINE(USE_IN_LIBIO)
+fi
 
 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
   config_makefile=
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
new file mode 100644 (file)
index 0000000..6ca6c7d
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public
+# License along with the GNU C Library; see the file COPYING.LIB.  If
+# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+# Cambridge, MA 02139, USA.
+
+#
+#      Specific makefile for stdio-common.
+#
+subdir := stdio-common
+
+headers        := stdio_lim.h printf.h
+
+routines       :=                                                            \
+       ctermid cuserid                                                       \
+       vfprintf vprintf printf_fp reg-printf printf-prs _itoa                \
+       vsnprintf vsprintf vasprintf                                          \
+       fprintf printf snprintf sprintf asprintf                              \
+       dprintf vdprintf                                                      \
+       vfscanf vscanf vsscanf                                                \
+       fscanf scanf sscanf                                                   \
+       perror psignal                                                        \
+       tmpfile tmpnam tempnam tempname                                       \
+       getline getw putw                                                     \
+       remove rename
+aux    := errlist siglist
+distribute := _itoa.h printf-parse.h
+
+tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
+        temptest tst-fileno test-fwrite \
+        xbug errnobug \
+        bug1 bug2 bug3 bug4 bug5 bug6 bug7
+
+
+include ../Rules
similarity index 100%
rename from stdio/_itoa.c
rename to stdio-common/_itoa.c
similarity index 100%
rename from stdio/_itoa.h
rename to stdio-common/_itoa.h
similarity index 77%
rename from stdio/asprintf.c
rename to stdio-common/asprintf.c
index 9b69800..85ab7b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,24 +16,27 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vasprintf _IO_vasprintf
+#endif
 
 /* Write formatted output from FORMAT to a string which is
    allocated with malloc and stored in *STRING_PTR.  */
 /* VARARGS2 */
 int
-DEFUN(asprintf, (string_ptr, format),
-      char **string_ptr AND CONST char *format DOTS)
+asprintf (string_ptr, format)
+     char **string_ptr;
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vasprintf(string_ptr, format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vasprintf (string_ptr, format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 100%
rename from stdio/bug1.c
rename to stdio-common/bug1.c
similarity index 100%
rename from stdio/bug1.input
rename to stdio-common/bug1.input
similarity index 100%
rename from stdio/bug2.c
rename to stdio-common/bug2.c
similarity index 100%
rename from stdio/bug3.c
rename to stdio-common/bug3.c
similarity index 100%
rename from stdio/bug4.c
rename to stdio-common/bug4.c
similarity index 100%
rename from stdio/bug5.c
rename to stdio-common/bug5.c
similarity index 100%
rename from stdio/bug6.c
rename to stdio-common/bug6.c
similarity index 100%
rename from stdio/bug6.input
rename to stdio-common/bug6.input
similarity index 100%
rename from stdio/bug7.c
rename to stdio-common/bug7.c
similarity index 79%
rename from stdio/dprintf.c
rename to stdio-common/dprintf.c
index fc9faa4..5746d49 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,22 +16,26 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vdprintf _IO_vdprintf
+#endif
 
 /* Write formatted output to D, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
-DEFUN(dprintf, (d, format), int d AND CONST char *format DOTS)
+dprintf (d, format)
+     int d;
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vdprintf(d, format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vdprintf (d, format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 100%
rename from stdio/errnobug.c
rename to stdio-common/errnobug.c
similarity index 100%
rename from stdio/fprintf.c
rename to stdio-common/fprintf.c
similarity index 100%
rename from stdio/fscanf.c
rename to stdio-common/fscanf.c
similarity index 100%
rename from stdio/getline.c
rename to stdio-common/getline.c
similarity index 100%
rename from stdio/getw.c
rename to stdio-common/getw.c
similarity index 100%
rename from stdio/perror.c
rename to stdio-common/perror.c
similarity index 100%
rename from stdio/printf-prs.c
rename to stdio-common/printf-prs.c
similarity index 80%
rename from stdio/printf.c
rename to stdio-common/printf.c
index 9cdae76..d8aa895 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,22 +16,25 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vprintf _IO_vprintf
+#endif
 
 /* Write formatted output to stdout from the format string FORMAT.  */
 /* VARARGS1 */
 int
-DEFUN(printf, (format), CONST char *format DOTS)
+printf (format)
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vprintf(format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vprintf (format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 100%
rename from stdio/printf.h
rename to stdio-common/printf.h
similarity index 100%
rename from stdio/printf_fp.c
rename to stdio-common/printf_fp.c
similarity index 100%
rename from stdio/psignal.c
rename to stdio-common/psignal.c
similarity index 100%
rename from stdio/putw.c
rename to stdio-common/putw.c
similarity index 100%
rename from stdio/reg-printf.c
rename to stdio-common/reg-printf.c
similarity index 80%
rename from stdio/scanf.c
rename to stdio-common/scanf.c
index aa70215..cf43363 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,22 +16,25 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vscanf _IO_vscanf
+#endif
 
 /* Read formatted input from stdin according to the format string FORMAT.  */
 /* VARARGS1 */
 int
-DEFUN(scanf, (format), CONST char *format DOTS)
+scanf (format)
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vscanf(format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vscanf (format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 77%
rename from stdio/snprintf.c
rename to stdio-common/snprintf.c
index 9f3e0c4..00b85f3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,24 +16,28 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vsnprintf _IO_vsnprintf
+#endif
 
 /* Write formatted output into S, according to the format
    string FORMAT, writing no more than MAXLEN characters.  */
 /* VARARGS3 */
 int
-DEFUN(snprintf, (s, maxlen, format),
-      char *s AND size_t maxlen AND CONST char *format DOTS)
+snprintf (s, maxlen, format)
+      char *s;
+      size_t maxlen;
+      const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vsnprintf(s, maxlen, format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vsnprintf (s, maxlen, format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 79%
rename from stdio/sprintf.c
rename to stdio-common/sprintf.c
index ce3a970..9cfc89c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,22 +16,26 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define vsprintf _IO_vsprintf
+#endif
 
 /* Write formatted output into S, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
-DEFUN(sprintf, (s, format), char *s AND CONST char *format DOTS)
+sprintf (s, format)
+     char *s;
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = vsprintf(s, format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = vsprintf (s, format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 78%
rename from stdio/sscanf.c
rename to stdio-common/sscanf.c
index 33bc203..794a3ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,22 +16,26 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef USE_IN_LIBIO
+# define __vsscanf _IO_vsscanf
+#endif
 
 /* Read formatted input from S, according to the format string FORMAT.  */
 /* VARARGS2 */
 int
-DEFUN(sscanf, (s, format), CONST char *s AND CONST char *format DOTS)
+sscanf (s, format)
+     const char *s;
+     const char *format;
 {
   va_list arg;
   int done;
 
-  va_start(arg, format);
-  done = __vsscanf(s, format, arg);
-  va_end(arg);
+  va_start (arg, format);
+  done = __vsscanf (s, format, arg);
+  va_end (arg);
 
   return done;
 }
similarity index 100%
rename from stdio/tempnam.c
rename to stdio-common/tempnam.c
similarity index 100%
rename from stdio/temptest.c
rename to stdio-common/temptest.c
similarity index 100%
rename from stdio/test-fseek.c
rename to stdio-common/test-fseek.c
similarity index 100%
rename from stdio/test-popen.c
rename to stdio-common/test-popen.c
similarity index 100%
rename from stdio/test_rdwr.c
rename to stdio-common/test_rdwr.c
similarity index 100%
rename from stdio/tmpfile.c
rename to stdio-common/tmpfile.c
similarity index 100%
rename from stdio/tmpnam.c
rename to stdio-common/tmpnam.c
similarity index 100%
rename from stdio/tst-fileno.c
rename to stdio-common/tst-fileno.c
similarity index 100%
rename from stdio/tst-printf.c
rename to stdio-common/tst-printf.c
similarity index 100%
rename from stdio/tstgetln.c
rename to stdio-common/tstgetln.c
similarity index 100%
rename from stdio/tstscanf.c
rename to stdio-common/tstscanf.c
similarity index 100%
rename from stdio/vasprintf.c
rename to stdio-common/vasprintf.c
similarity index 100%
rename from stdio/vdprintf.c
rename to stdio-common/vdprintf.c
similarity index 100%
rename from stdio/vfprintf.c
rename to stdio-common/vfprintf.c
similarity index 100%
rename from stdio/vfscanf.c
rename to stdio-common/vfscanf.c
similarity index 84%
rename from stdio/vprintf.c
rename to stdio-common/vprintf.c
index 97264f4..77f1da4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,18 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdarg.h>
 #undef __OPTIMIZE__    /* Avoid inline `vprintf' function.  */
 #include <stdio.h>
 
 #undef vprintf
 
+#ifdef USE_IN_LIBIO
+# define vfprintf _IO_vfprintf
+#endif
 
 /* Write formatted output to stdout according to the
    format string FORMAT, using the argument list in ARG.  */
 int
-DEFUN(vprintf, (format, arg), CONST char *format AND __gnuc_va_list arg)
+vprintf (format, arg)
+     const char *format;
+     __gnuc_va_list arg;
 {
   return vfprintf (stdout, format, arg);
 }
similarity index 100%
rename from stdio/vscanf.c
rename to stdio-common/vscanf.c
similarity index 100%
rename from stdio/vsnprintf.c
rename to stdio-common/vsnprintf.c
similarity index 100%
rename from stdio/vsprintf.c
rename to stdio-common/vsprintf.c
similarity index 100%
rename from stdio/vsscanf.c
rename to stdio-common/vsscanf.c
similarity index 100%
rename from stdio/xbug.c
rename to stdio-common/xbug.c
diff --git a/stdio.h b/stdio.h
index a82be07..457eabe 100644 (file)
--- a/stdio.h
+++ b/stdio.h
@@ -1 +1,5 @@
+#ifdef USE_IN_LIBIO
+#include <libio/stdio.h>
+#else
 #include <stdio/stdio.h>
+#endif
index 955d7f1..a15aa56 100644 (file)
 #
 subdir := stdio
 
-headers        := stdio.h stdio_lim.h printf.h
+headers        := stdio.h
 
 routines       :=                                                            \
-       ctermid cuserid                                                       \
        feof ferror clearerr fileno                                           \
        newstream fopen freopen fdopen fopncook fmemopen                      \
        setbuf setvbuf setbuffer setlinebuf                                   \
        fseek ftell rewind fgetpos fsetpos                                    \
-       vfprintf vprintf printf_fp reg-printf printf-prs _itoa                \
-       vsnprintf vsprintf vasprintf                                          \
-       fprintf printf snprintf sprintf asprintf                              \
-       dprintf vdprintf                                                      \
-       vfscanf vscanf vsscanf                                                \
-       fscanf scanf sscanf                                                   \
        fread fwrite                                                          \
        ungetc                                                                \
-       fgetc getc getchar getw                                               \
-       fputc putc putchar putw                                               \
+       fgetc getc getchar                                                    \
+       fputc putc putchar                                                    \
        fgets gets fputs puts                                                 \
-       getdelim getline                                                      \
-       perror psignal                                                        \
-       tmpfile tmpnam tempnam tempname                                       \
+       getdelim                                                              \
        fclose fflush                                                         \
-       remove rename                                                         \
        memstream obstream                                                    \
        internals sysd-stdio pipestream stdio_init libc_fatal
-aux    := errlist siglist defs glue
-distribute := _itoa.h printf-parse.h
-
-tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
-        temptest tst-fileno test-fwrite \
-        xbug errnobug \
-        bug1 bug2 bug3 bug4 bug5 bug6 bug7
+aux    := defs glue
 
 
 include ../Rules
index b80b073..1315a26 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@ common-generated := $(common-generated) bytesex.h det_endian
 
 endif
 \f
-ifeq ($(subdir),stdio)
+ifeq ($(subdir),stdio-common)
 
 ifeq   "$(filter $(objpfx)siglist.c,$(before-compile))" ""
 before-compile := $(before-compile) $(objpfx)siglist.c