]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Changes for _G_IO_IO_FILE_VERSION == 0x20001:
authorAndreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Tue, 24 Feb 1998 20:02:06 +0000 (20:02 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 24 Feb 1998 20:02:06 +0000 (13:02 -0700)
        * libioP.h (_IO_showmanyc_t, _IO_SHOWMANYC, _IO_imbue_t,
        _IO_IMBUE): New definitions.
        (struct _IO_jump_t): Add __showmanyc and __imbue fields.
        (_IO_file_fopen): Add new fourth argument.
        * filebuf.cc (filebuf::open): Pass new fourth argument to
        _IO_file_fopen.
        * iolibio.h (_IO_freopen): Likewise.
        * streambuf.cc (streambuf::showmanyc, streambuf::imbue): New
        functions.
        * streambuf.h (_IO_wchar_t): Define to _G_wchar_t.
        (ios::fill): Remove casts.
        (struct streambuf): Add showmanyc and imbue members.
        * iostream.cc (ostream::operator<<(double n)) [__GLIBC_MINOR__ >=
        1]: Initialize new fields is_char of struct printf_info.
        (ostream::operator<<(long double n)) [__GLIBC_MINOR__ >= 1]:
        Likewise.

From-SVN: r18221

libio/ChangeLog
libio/filebuf.cc
libio/iolibio.h
libio/iostream.cc
libio/libioP.h
libio/streambuf.cc
libio/streambuf.h

index 17385a03e4e67826399cfc2fa22d11c49f03423d..73bf40993bd3fd0c07ab7ab4e723f2aeaa55e5cf 100644 (file)
@@ -1,3 +1,24 @@
+1998-02-24  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       Changes for _G_IO_IO_FILE_VERSION == 0x20001:
+       * libioP.h (_IO_showmanyc_t, _IO_SHOWMANYC, _IO_imbue_t,
+       _IO_IMBUE): New definitions.
+       (struct _IO_jump_t): Add __showmanyc and __imbue fields.
+       (_IO_file_fopen): Add new fourth argument.
+       * filebuf.cc (filebuf::open): Pass new fourth argument to
+       _IO_file_fopen.
+       * iolibio.h (_IO_freopen): Likewise.
+       * streambuf.cc (streambuf::showmanyc, streambuf::imbue): New
+       functions.
+       * streambuf.h (_IO_wchar_t): Define to _G_wchar_t.
+       (ios::fill): Remove casts.
+       (struct streambuf): Add showmanyc and imbue members.
+
+       * iostream.cc (ostream::operator<<(double n)) [__GLIBC_MINOR__ >=
+       1]: Initialize new fields is_char of struct printf_info.
+       (ostream::operator<<(long double n)) [__GLIBC_MINOR__ >= 1]:
+       Likewise.
+
 Tue Feb 24 20:57:39 1998  H.J. Lu  (hjl@gnu.org)
 
        * configure.in (topsrcdir): New.
index d4af4985d50ed4ad7e08be935b01942acf509210..e3280bb0df175b7eb3f91f2e0183f8374d583cc3 100644 (file)
@@ -3,3 +3,7 @@
                                  read_write, 0);
 #else
 #endif
+#if _G_IO_IO_FILE_VERSION == 0x20001
+  return (filebuf*)_IO_file_fopen(this, filename, mode, 0);
+#else
+#endif
index 63896780fc0cd9cfa1df15f592289f08be117ac4..083b198b4485da1c294bc765ca5f33bd59861a7d 100644 (file)
@@ -45,8 +45,13 @@ extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...));
   (_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
 #define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
 #define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
+#if _G_IO_IO_FILE_VERSION == 0x20001
+#define _IO_freopen(FILENAME, MODE, FP) \
+  (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
+#else
 #define _IO_freopen(FILENAME, MODE, FP) \
   (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE))
+#endif
 #define _IO_fileno(FP) ((FP)->_fileno)
 extern _IO_FILE* _IO_popen __P((const char*, const char*));
 #define _IO_pclose _IO_fclose
index 96ebd6ee57a85fd0e475dfc647c6a4779ca8cf38..921a00c21a966f351af339945100b2bb622cb500 100644 (file)
@@ -634,6 +634,9 @@ ostream& ostream::operator<<(double n)
                                      group: 0,
 #if defined __GLIBC__ && __GLIBC__ >= 2
                                      extra: 0,
+#if __GLIBC_MINOR__ >= 1
+                                     is_char: 0,
+#endif
 #endif
                                      pad: fill()
          };
@@ -737,6 +740,9 @@ ostream& ostream::operator<<(long double n)
                                  group: 0,
 #if defined __GLIBC__ && __GLIBC__ >= 2
                                  extra: 0,
+#if __GLIBC_MINOR__ >= 1
+                                 is_char: 0,
+#endif
 #endif
                                  pad: fill()
       };
index 3a138f0c077e6dcdc663dc75967238a07b80bad4..8f39e0ef67ceccdaf8152e955cde8601fa71c252 100644 (file)
@@ -226,6 +226,19 @@ typedef int (*_IO_close_t) __P ((_IO_FILE *)); /* finalize */
 typedef int (*_IO_stat_t) __P ((_IO_FILE *, void *));
 #define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
 
+#if _G_IO_IO_FILE_VERSION == 0x20001
+/* The 'showmany' hook can be used to get an image how much input is
+   available.  In many cases the answer will be 0 which means unknown
+   but some cases one can provide real information.  */
+typedef int (*_IO_showmanyc_t) __P ((_IO_FILE *));
+#define _IO_SHOWMANYC(FP) JUMP0 (__showmanyc, FP)
+
+/* The 'imbue' hook is used to get information about the currently
+   installed locales.  */
+typedef void (*_IO_imbue_t) __P ((_IO_FILE *, void *));
+#define _IO_IMBUE(FP, LOCALE) JUMP1 (__imbue, FP, LOCALE)
+#endif
+
 
 #define _IO_CHAR_TYPE char /* unsigned char ? */
 #define _IO_INT_TYPE int
@@ -254,6 +267,10 @@ struct _IO_jump_t
     JUMP_FIELD(_IO_seek_t, __seek);
     JUMP_FIELD(_IO_close_t, __close);
     JUMP_FIELD(_IO_stat_t, __stat);
+#if _G_IO_IO_FILE_VERSION == 0x20001
+    JUMP_FIELD(_IO_showmanyc_t, __showmanyc);
+    JUMP_FIELD(_IO_imbue_t, __imbue);
+#endif
 #if 0
     get_column;
     set_column;
@@ -381,7 +398,12 @@ extern void _IO_file_init __P ((_IO_FILE *));
 extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
 extern _IO_FILE* _IO_file_open __P ((_IO_FILE *, const char *, int, int,
                                     int, int));
+#if _G_IO_IO_FILE_VERSION == 0x20001
+extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *,
+                                     int));
+#else
 extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *));
+#endif
 extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
                                        _IO_ssize_t));
 extern _IO_ssize_t _IO_file_read __P ((_IO_FILE *, void *, _IO_ssize_t));
index 4393cf08cfd426b82f992ba08d17a8776c5ee957..6be926b23721dc245508605668539fd6b7442db2 100644 (file)
@@ -301,6 +301,17 @@ streampos streambuf::sys_seek(streamoff, _seek_dir)
 
 int streambuf::sys_close() { return 0; /* Suceess; do nothing */ }
 
+#if _G_IO_IO_FILE_VERSION == 0x20001
+int streambuf::showmanyc()
+{
+  return -1;
+}
+
+void streambuf::imbue(void *)
+{
+}
+#endif
+
 streammarker::streammarker(streambuf *sb)
 {
   _IO_init_marker(this, sb);
index 9ef47243be64bffeeb1646b5f8bf6f95f4612c07..bc734bc75b0aa6643514d50728ab05aa40029563 100644 (file)
@@ -55,8 +55,12 @@ extern "C" {
 #endif
 
 #ifndef _IO_wchar_t
+#if _G_IO_IO_FILE_VERSION == 0x20001
+#define _IO_wchar_t _G_wchar_t
+#else
 #define _IO_wchar_t short
 #endif
+#endif
 
 extern "C++" {
 class istream; /* Work-around for a g++ name mangling bug. Fixed in 2.6. */
@@ -176,9 +180,9 @@ class ios : public _ios_fields {
     ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
 
     // Methods to change the format state.
-    _IO_wchar_t fill() const { return (_IO_wchar_t)_fill; }
+    _IO_wchar_t fill() const { return _fill; }
     _IO_wchar_t fill(_IO_wchar_t newf)
-       {_IO_wchar_t oldf = (_IO_wchar_t)_fill; _fill = (char)newf; return oldf;}
+       {_IO_wchar_t oldf = _fill; _fill = newf; return oldf;}
     fmtflags flags() const { return _flags; }
     fmtflags flags(fmtflags new_val) {
        fmtflags old_val = _flags; _flags = new_val; return old_val; }
@@ -409,6 +413,10 @@ struct streambuf : public _IO_FILE { // protected??
     virtual streampos sys_seek(streamoff, _seek_dir);
     virtual int sys_close();
     virtual int sys_stat(void*); // Actually, a (struct stat*)
+#if _G_IO_IO_FILE_VERSION == 0x20001
+    virtual int showmanyc();
+    virtual void imbue(void *);
+#endif
 };
 
 // A backupbuf is a streambuf with full backup and savepoints on reading.