Mercurial > octave-nkf
comparison src/c-file-ptr-stream.cc @ 10411:479cc8a0a846
use gnulib namespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 15 Mar 2010 15:57:23 -0400 |
parents | 57a59eae83cc |
children | 12d25a1d84bf |
comparison
equal
deleted
inserted
replaced
10410:b3ec24dc305a | 10411:479cc8a0a846 |
---|---|
51 c_file_ptr_buf::int_type | 51 c_file_ptr_buf::int_type |
52 c_file_ptr_buf::overflow (int_type c) | 52 c_file_ptr_buf::overflow (int_type c) |
53 { | 53 { |
54 #if defined (CXX_ISO_COMPLIANT_LIBRARY) | 54 #if defined (CXX_ISO_COMPLIANT_LIBRARY) |
55 if (f) | 55 if (f) |
56 return (c != traits_type::eof ()) ? fputc (c, f) : flush (); | 56 return (c != traits_type::eof ()) ? gnulib::fputc (c, f) : flush (); |
57 else | 57 else |
58 return traits_type::not_eof (c); | 58 return traits_type::not_eof (c); |
59 #else | 59 #else |
60 if (f) | 60 if (f) |
61 return (c != EOF) ? fputc (c, f) : flush (); | 61 return (c != EOF) ? gnulib::fputc (c, f) : flush (); |
62 else | 62 else |
63 return EOF; | 63 return EOF; |
64 #endif | 64 #endif |
65 } | 65 } |
66 | 66 |
102 | 102 |
103 std::streamsize | 103 std::streamsize |
104 c_file_ptr_buf::xsputn (const char* s, std::streamsize n) | 104 c_file_ptr_buf::xsputn (const char* s, std::streamsize n) |
105 { | 105 { |
106 if (f) | 106 if (f) |
107 return fwrite (s, 1, n, f); | 107 return gnulib::fwrite (s, 1, n, f); |
108 else | 108 else |
109 return 0; | 109 return 0; |
110 } | 110 } |
111 | 111 |
112 std::streamsize | 112 std::streamsize |
191 } | 191 } |
192 | 192 |
193 return retval; | 193 return retval; |
194 } | 194 } |
195 | 195 |
196 int | |
197 c_file_ptr_buf::file_close (FILE *f) | |
198 { | |
199 return gnulib::fclose (f); | |
200 } | |
201 | |
196 #ifdef HAVE_ZLIB | 202 #ifdef HAVE_ZLIB |
197 | 203 |
198 c_zfile_ptr_buf::~c_zfile_ptr_buf (void) | 204 c_zfile_ptr_buf::~c_zfile_ptr_buf (void) |
199 { | 205 { |
200 buf_close (); | 206 buf_close (); |