]> gcc.gnu.org Git - gcc.git/blobdiff - libio/libio.h
New test
[gcc.git] / libio / libio.h
index 3d7bce3c18178e388ef293f6d2f9608298cf0b47..b4dffa85ea43337f6d23b3c2babbdaa4fb09d4e5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
 #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
 #define _IO_BUFSIZ _G_BUFSIZ
 #define _IO_va_list _G_va_list
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+#define _IO_fpos64_t _G_fpos64_t
+#define _IO_off64_t _G_off64_t
+#endif
 
 #ifdef _G_NEED_STDARG_H
 /* This define avoids name pollution if we're using GNU stdarg.h */
 #  include <sys/cdefs.h>
 # else
 #  ifdef __STDC__
-#   define __P(protos) protos
+#   define __P(p) p
 #  else
-#   define __P(protos) ()
+#   define __P(p) ()
 #  endif
 # endif
 #endif /*!__P*/
 
+#ifndef __PMT
+# ifdef __STDC__
+#  define __PMT(p) p
+# else
+#  define __PMT(p) ()
+# endif
+#endif /*!__P*/
+
 /* For backward compatibility */
 #ifndef _PARAMS
 # define _PARAMS(protos) __P(protos)
@@ -71,7 +83,7 @@
 # define const
 #endif
 #define _IO_UNIFIED_JUMPTABLES 1
-#ifndef _G_HAVE_PRINTF_FP
+#if !_G_HAVE_PRINTF_FP
 # define _IO_USE_DTOA 1
 #endif
 
@@ -150,22 +162,26 @@ struct _IO_jump_t;  struct _IO_FILE;
 /* Handle lock.  */
 #ifdef _IO_MTSAFE_IO
 # if defined __GLIBC__ && __GLIBC__ >= 2
-#  include <bits/stdio-lock.h>
+#  if __GLIBC_MINOR__ > 0
+#   include <bits/stdio-lock.h>
+#  else
+#   include <stdio-lock.h>
+#  endif
 #  define _IO_LOCK_T _IO_lock_t *
 # else
 /*# include <comthread.h>*/
 # endif
 #else
-/* XXX This will go away as soon as comthread is finished.  */
-# ifdef __linux__
-struct _IO_lock_t {
-  void *ptr;
-  short int field1;
-  short int field2;
-};
-#  define _IO_LOCK_T struct _IO_lock_t
+# if defined(__GLIBC__) && __GLIBC__ >= 2
+   typedef void _IO_lock_t;
+#  define _IO_LOCK_T void *
 # else
-typedef void _IO_lock_t;
+#  ifdef __linux__
+    struct _IO_lock_t { void *ptr; short int field1; short int field2; };
+#   define _IO_LOCK_T struct _IO_lock_t
+#  else
+    typedef void _IO_lock_t;
+#  endif
 # endif
 #endif
 
@@ -216,7 +232,11 @@ struct _IO_FILE {
 
   int _fileno;
   int _blksize;
+#ifdef _G_IO_IO_FILE_VERSION
+  _IO_off_t _old_offset;
+#else
   _IO_off_t _offset;
+#endif
 
 #define __HAVE_COLUMN /* temporary */
   /* 1+column number of pbase(); 0 is unknown. */
@@ -229,12 +249,22 @@ struct _IO_FILE {
 #ifdef _IO_LOCK_T
   _IO_LOCK_T _lock;
 #endif
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+  _IO_off64_t _offset;
+  int _unused2[16];    /* Make sure we don't get into trouble again.  */
+#endif
 };
 
 #ifndef __cplusplus
 typedef struct _IO_FILE _IO_FILE;
 #endif
 
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+#define _IO_stdin_ _IO_2_1_stdin_
+#define _IO_stdout_ _IO_2_1_stdout_
+#define _IO_stderr_ _IO_2_1_stderr_
+#endif
+
 struct _IO_FILE_plus;
 extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
 #define _IO_stdin ((_IO_FILE*)(&_IO_stdin_))
@@ -245,10 +275,10 @@ extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
 /* Define the user-visible type, with user-friendly member names.  */
 typedef struct
 {
-  _IO_ssize_t (*read) __P ((struct _IO_FILE *, void *, _IO_ssize_t));
-  _IO_ssize_t (*write) __P ((struct _IO_FILE *, const void *, _IO_ssize_t));
-  _IO_fpos_t (*seek) __P ((struct _IO_FILE *, _IO_off_t, int));
-  int (*close) __P ((struct _IO_FILE *));
+  _IO_ssize_t (*read) __PMT ((struct _IO_FILE *, void *, _IO_ssize_t));
+  _IO_ssize_t (*write) __PMT ((struct _IO_FILE *, const void *, _IO_ssize_t));
+  _IO_off_t (*seek) __PMT ((struct _IO_FILE *, _IO_off_t, int));
+  int (*close) __PMT ((struct _IO_FILE *));
 } _IO_cookie_io_functions_t;
 
 /* Special file type for fopencookie function.  */
@@ -317,8 +347,13 @@ extern int _IO_vfprintf __P ((_IO_FILE *, const char *, _IO_va_list));
 extern _IO_ssize_t _IO_padn __P ((_IO_FILE *, int, _IO_ssize_t));
 extern _IO_size_t _IO_sgetn __P ((_IO_FILE *, void *, _IO_size_t));
 
-extern _IO_fpos_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+extern _IO_off64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
+extern _IO_off64_t _IO_seekpos __P ((_IO_FILE *, _IO_off64_t, int));
+#else
+extern _IO_off_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
+extern _IO_off_t _IO_seekpos __P ((_IO_FILE *, _IO_off_t, int));
+#endif
 
 extern void _IO_free_backup_area __P ((_IO_FILE *));
 
This page took 0.030104 seconds and 5 git commands to generate.