Lines Matching defs:ostream
12 #include "ostream-file-private.h"
32 static struct ostream * o_stream_create_fd_common(int fd,
42 o_stream_get_name(&fstream->ostream.ostream));
47 fstream->ostream.ostream.closed = TRUE;
114 if (fstream->ostream.corked && !fstream->socket_cork_set) {
133 io_stream_set_error(&fstream->ostream.iostream,
135 fstream->ostream.ostream.stream_errno = errno;
140 io_stream_set_error(&fstream->ostream.iostream,
142 fstream->ostream.ostream.stream_errno = EINVAL;
238 fstream->ostream.ostream.stream_errno = errno;
244 fstream->ostream.ostream.stream_errno = ENOSPC;
336 struct iostream_private *iostream = &fstream->ostream.iostream;
339 if (stream->corked != set && !stream->ostream.closed) {
348 !stream->ostream.closed) {
377 struct iostream_private *iostream = &fstream->ostream.iostream;
414 stream->ostream.stream_errno = EINVAL;
418 stream->ostream.stream_errno = ESPIPE;
425 stream->ostream.offset = offset;
435 if (size > fstream->ostream.max_buffer_size) {
437 size = fstream->ostream.max_buffer_size;
438 } else if (fstream->ostream.corked) {
441 fstream->ostream.max_buffer_size);
466 struct ostream *ostream = &fstream->ostream.ostream;
467 struct iostream_private *iostream = &fstream->ostream.iostream;
468 bool use_cork = !fstream->ostream.corked;
477 o_stream_ref(ostream);
479 o_stream_cork(ostream);
480 if (fstream->ostream.callback != NULL)
481 ret = fstream->ostream.callback(fstream->ostream.context);
483 ret = o_stream_file_flush(&fstream->ostream);
485 o_stream_uncork(ostream);
492 } else if (!fstream->ostream.ostream.closed) {
503 o_stream_unref(&ostream);
509 struct iostream_private *iostream = &fstream->ostream.iostream;
539 !fstream->ostream.corked && !fstream->file) {
567 fstream->ostream.max_buffer_size);
592 stream->ostream.offset += ret;
608 stream->ostream.offset += ret;
693 stream->ostream.stream_errno = errno;
762 outstream->ostream.stream_errno = errno;
773 outstream->ostream.offset += ret;
818 out_offset = outstream->ostream.offset + (in_offset - in_start_offset);
862 outstream->ostream.stream_errno = errno;
871 outstream->ostream.offset += in_size - in_start_offset;
891 return io_stream_copy(&outstream->ostream, instream);
896 ret = (off_t)outstream->ostream.offset - in_abs_offset;
908 return io_stream_copy(&outstream->ostream, instream);
935 return io_stream_copy(&outstream->ostream, instream);
948 struct ostream *
952 struct ostream *ostream;
958 fstream->ostream.iostream.close = o_stream_file_close;
959 fstream->ostream.iostream.destroy = o_stream_file_destroy;
961 fstream->ostream.cork = o_stream_file_cork;
962 fstream->ostream.flush = o_stream_file_flush;
963 fstream->ostream.flush_pending = o_stream_file_flush_pending;
964 fstream->ostream.get_used_size = o_stream_file_get_used_size;
965 fstream->ostream.seek = o_stream_file_seek;
966 fstream->ostream.sendv = o_stream_file_sendv;
967 fstream->ostream.write_at = o_stream_file_write_at;
968 fstream->ostream.send_istream = o_stream_file_send_istream;
969 fstream->ostream.switch_ioloop_to = o_stream_file_switch_ioloop_to;
973 fstream->ostream.max_buffer_size = max_buffer_size;
974 ostream = o_stream_create(&fstream->ostream, NULL, fd);
977 fstream->ostream.max_buffer_size = fstream->optimal_block_size;
979 return ostream;
1003 struct ostream * o_stream_create_fd_common(int fd, size_t max_buffer_size,
1007 struct ostream *ostream;
1011 ostream = o_stream_create_file_common
1016 ostream->offset = offset;
1027 return ostream;
1030 struct ostream *
1036 struct ostream *
1039 struct ostream *ostream = o_stream_create_fd_common(*fd,
1042 return ostream;
1045 struct ostream *
1049 struct ostream *ostream;
1055 ostream = o_stream_create_file_common(fstream, fd, 0, autoclose_fd);
1059 ostream->blocking = fstream->file;
1060 ostream->offset = offset;
1061 return ostream;
1064 struct ostream *o_stream_create_fd_file_autoclose(int *fd, uoff_t offset)
1066 struct ostream *output;