comparison libinterp/interp-core/c-file-ptr-stream.h @ 16011:8122286c69a9

initial large file support for 32-bit systems * bootstrap.conf (gnulib_modules): Explicitly list largefile. * c-file-ptr-stream.cc, c-file-ptr-stream.h, oct-fstrm.cc, oct-fstrm.h, oct-iostrm.cc, oct-iostrm.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, file-io.cc: Use off_t instead of long for seek and tell file position values.
author John W. Eaton <jwe@octave.org>
date Thu, 07 Feb 2013 11:58:46 -0500
parents 2fc554ffbc28
children
comparison
equal deleted inserted replaced
16010:c5d548e4101f 16011:8122286c69a9
72 72
73 int buf_close (void); 73 int buf_close (void);
74 74
75 int file_number () const { return f ? fileno (f) : -1; } 75 int file_number () const { return f ? fileno (f) : -1; }
76 76
77 int seek (long offset, int origin); 77 int seek (off_t offset, int origin);
78 78
79 long tell (void); 79 off_t tell (void);
80 80
81 void clear (void) { if (f) clearerr (f); } 81 void clear (void) { if (f) clearerr (f); }
82 82
83 static int file_close (FILE *f); 83 static int file_close (FILE *f);
84 84
115 115
116 BUF_T *rdbuf (void) { return buf; } 116 BUF_T *rdbuf (void) { return buf; }
117 117
118 void stream_close (void) { if (buf) buf->buf_close (); } 118 void stream_close (void) { if (buf) buf->buf_close (); }
119 119
120 int seek (long offset, int origin) 120 int seek (off_t offset, int origin)
121 { return buf ? buf->seek (offset, origin) : -1; } 121 { return buf ? buf->seek (offset, origin) : -1; }
122 122
123 long tell (void) { return buf ? buf->tell () : -1; } 123 off_t tell (void) { return buf ? buf->tell () : -1; }
124 124
125 void clear (void) { if (buf) buf->clear (); STREAM_T::clear (); } 125 void clear (void) { if (buf) buf->clear (); STREAM_T::clear (); }
126 126
127 private: 127 private:
128 128
190 190
191 int buf_close (void); 191 int buf_close (void);
192 192
193 int file_number () const { return -1; } 193 int file_number () const { return -1; }
194 194
195 int seek (long offset, int origin) 195 int seek (off_t offset, int origin)
196 { return f ? gzseek (f, offset, origin) : -1; } 196 { return f ? gzseek (f, offset, origin) >= 0 : -1; }
197 197
198 long tell (void) { return f ? gztell (f) : -1; } 198 off_t tell (void) { return f ? gztell (f) : -1; }
199 199
200 void clear (void) { if (f) gzclearerr (f); } 200 void clear (void) { if (f) gzclearerr (f); }
201 201
202 static int file_close (gzFile f) { return ::gzclose (f); } 202 static int file_close (gzFile f) { return ::gzclose (f); }
203 203