changeset 13529:cf77e448295c

Renamed lib/*-internal.h files to lib/*-private.h for consistency.
author Timo Sirainen <tss@iki.fi>
date Wed, 21 Sep 2011 13:56:13 +0300
parents 1d8009c7b67e
children 8c3c0e01e00d
files src/lib-fs/ostream-cmp.c src/lib-mail/istream-dot.c src/lib-mail/istream-header-filter.c src/lib-ssl-iostream/istream-openssl.c src/lib-ssl-iostream/ostream-openssl.c src/lib-storage/index/istream-attachment.c src/lib-storage/index/istream-mail-stats.c src/lib-storage/index/mbox/istream-raw-mbox.c src/lib-test/test-common.c src/lib/Makefile.am src/lib/ioloop-epoll.c src/lib/ioloop-internal.h src/lib/ioloop-iolist.c src/lib/ioloop-kqueue.c src/lib/ioloop-notify-dn.c src/lib/ioloop-notify-fd.c src/lib/ioloop-notify-inotify.c src/lib/ioloop-notify-kqueue.c src/lib/ioloop-notify-none.c src/lib/ioloop-poll.c src/lib/ioloop-private.h src/lib/ioloop-select.c src/lib/ioloop.c src/lib/iostream-internal.h src/lib/iostream-private.h src/lib/iostream.c src/lib/istream-base64-encoder.c src/lib/istream-concat.c src/lib/istream-crlf.c src/lib/istream-data.c src/lib/istream-file.c src/lib/istream-internal.h src/lib/istream-limit.c src/lib/istream-mmap.c src/lib/istream-private.h src/lib/istream-seekable.c src/lib/istream-tee.c src/lib/istream.c src/lib/ostream-buffer.c src/lib/ostream-file.c src/lib/ostream-internal.h src/lib/ostream-private.h src/lib/ostream.c src/lib/test-istream-base64-encoder.c src/lib/test-istream-concat.c src/lib/test-istream-crlf.c src/lib/test-istream-seekable.c src/lib/test-istream-tee.c src/plugins/zlib/istream-bzlib.c src/plugins/zlib/istream-zlib.c src/plugins/zlib/ostream-bzlib.c src/plugins/zlib/ostream-zlib.c
diffstat 52 files changed, 268 insertions(+), 268 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-fs/ostream-cmp.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-fs/ostream-cmp.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "istream.h"
-#include "ostream-internal.h"
+#include "ostream-private.h"
 #include "ostream-cmp.h"
 
 struct cmp_ostream {
--- a/src/lib-mail/istream-dot.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-mail/istream-dot.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-dot.h"
 
 struct dot_istream {
--- a/src/lib-mail/istream-header-filter.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-mail/istream-header-filter.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 #include "lib.h"
 #include "array.h"
 #include "message-parser.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-header-filter.h"
 
 #include <stdlib.h>
--- a/src/lib-ssl-iostream/istream-openssl.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-ssl-iostream/istream-openssl.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "iostream-openssl.h"
 
 struct ssl_istream {
--- a/src/lib-ssl-iostream/ostream-openssl.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-ssl-iostream/ostream-openssl.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "buffer.h"
-#include "ostream-internal.h"
+#include "ostream-private.h"
 #include "iostream-openssl.h"
 
 struct ssl_ostream {
--- a/src/lib-storage/index/istream-attachment.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-storage/index/istream-attachment.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2003-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-attachment.h"
 
 struct attachment_istream {
--- a/src/lib-storage/index/istream-mail-stats.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-storage/index/istream-mail-stats.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "mail-storage-private.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-mail-stats.h"
 
 struct mail_stats_istream {
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "buffer.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-raw-mbox.h"
 #include "mbox-from.h"
 
--- a/src/lib-test/test-common.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib-test/test-common.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "test-common.h"
 
 #include <stdio.h>
--- a/src/lib/Makefile.am	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/Makefile.am	Wed Sep 21 13:56:13 2011 +0300
@@ -161,17 +161,17 @@
 	hostpid.h \
 	imem.h \
 	ipwd.h \
-	iostream-internal.h \
+	iostream-private.h \
 	istream.h \
 	istream-base64-encoder.h \
 	istream-concat.h \
 	istream-crlf.h \
-	istream-internal.h \
+	istream-private.h \
 	istream-seekable.h \
 	istream-tee.h \
 	ioloop.h \
 	ioloop-iolist.h \
-	ioloop-internal.h \
+	ioloop-private.h \
 	ioloop-notify-fd.h \
 	lib.h \
 	lib-signals.h \
@@ -188,7 +188,7 @@
 	network.h \
 	nfs-workarounds.h \
 	ostream.h \
-	ostream-internal.h \
+	ostream-private.h \
 	primes.h \
 	printf-format-fix.h \
 	process-title.h \
--- a/src/lib/ioloop-epoll.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-epoll.c	Wed Sep 21 13:56:13 2011 +0300
@@ -9,7 +9,7 @@
 #include "lib.h"
 #include "array.h"
 #include "fd-close-on-exec.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "ioloop-iolist.h"
 
 #ifdef IOLOOP_EPOLL
--- a/src/lib/ioloop-internal.h	Mon Sep 19 17:10:11 2011 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-#ifndef IOLOOP_INTERNAL_H
-#define IOLOOP_INTERNAL_H
-
-#include "priorityq.h"
-#include "ioloop.h"
-
-#ifndef IOLOOP_INITIAL_FD_COUNT
-#  define IOLOOP_INITIAL_FD_COUNT 128
-#endif
-
-struct ioloop {
-        struct ioloop *prev;
-
-	struct ioloop_context *cur_ctx;
-
-	struct io_file *io_files;
-	struct io_file *next_io_file;
-	struct priorityq *timeouts;
-
-        struct ioloop_handler_context *handler_context;
-        struct ioloop_notify_handler_context *notify_handler_context;
-	unsigned int max_fd_count;
-
-	io_loop_time_moved_callback_t *time_moved_callback;
-	time_t next_max_time;
-
-	unsigned int running:1;
-};
-
-struct io {
-	enum io_condition condition;
-
-	io_callback_t *callback;
-        void *context;
-
-	struct ioloop *ioloop;
-	struct ioloop_context *ctx;
-};
-
-struct io_file {
-	struct io io;
-
-	/* use a doubly linked list so that io_remove() is quick */
-	struct io_file *prev, *next;
-
-	int refcount;
-	int fd;
-};
-
-struct timeout {
-	struct priorityq_item item;
-
-        unsigned int msecs;
-	struct timeval next_run;
-
-	timeout_callback_t *callback;
-        void *context;
-
-	struct ioloop *ioloop;
-	struct ioloop_context *ctx;
-};
-
-struct ioloop_context_callback {
-	io_callback_t *activate;
-	io_callback_t *deactivate;
-	void *context;
-};
-
-struct ioloop_context {
-	int refcount;
-	struct ioloop *ioloop;
-	ARRAY_DEFINE(callbacks, struct ioloop_context_callback);
-};
-
-int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
-void io_loop_handle_timeouts(struct ioloop *ioloop);
-void io_loop_call_io(struct io *io);
-
-/* I/O handler calls */
-void io_loop_handle_add(struct io_file *io);
-void io_loop_handle_remove(struct io_file *io, bool closed);
-
-void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count);
-void io_loop_handler_deinit(struct ioloop *ioloop);
-
-void io_loop_notify_remove(struct io *io);
-void io_loop_notify_handler_deinit(struct ioloop *ioloop);
-
-void io_loop_context_activate(struct ioloop_context *ctx);
-void io_loop_context_deactivate(struct ioloop_context *ctx);
-
-#endif
--- a/src/lib/ioloop-iolist.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-iolist.c	Wed Sep 21 13:56:13 2011 +0300
@@ -5,7 +5,7 @@
  */
 
 #include "lib.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "ioloop-iolist.h"
 
 bool ioloop_iolist_add(struct io_list *list, struct io_file *io)
--- a/src/lib/ioloop-kqueue.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-kqueue.c	Wed Sep 21 13:56:13 2011 +0300
@@ -10,7 +10,7 @@
 
 #include "array.h"
 #include "fd-close-on-exec.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 
 #include <unistd.h>
 #include <fcntl.h>
--- a/src/lib/ioloop-notify-dn.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-notify-dn.c	Wed Sep 21 13:56:13 2011 +0300
@@ -7,7 +7,7 @@
 
 #ifdef IOLOOP_NOTIFY_DNOTIFY
 
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "ioloop-notify-fd.h"
 #include "fd-set-nonblock.h"
 #include "fd-close-on-exec.h"
--- a/src/lib/ioloop-notify-fd.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-notify-fd.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "ioloop-notify-fd.h"
 
 #if defined(IOLOOP_NOTIFY_DNOTIFY) || defined(IOLOOP_NOTIFY_INOTIFY)
--- a/src/lib/ioloop-notify-inotify.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-notify-inotify.c	Wed Sep 21 13:56:13 2011 +0300
@@ -7,7 +7,7 @@
 
 #include "fd-close-on-exec.h"
 #include "fd-set-nonblock.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "ioloop-notify-fd.h"
 #include "buffer.h"
 #include "network.h"
--- a/src/lib/ioloop-notify-kqueue.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-notify-kqueue.c	Wed Sep 21 13:56:13 2011 +0300
@@ -9,7 +9,7 @@
 
 #ifdef IOLOOP_NOTIFY_KQUEUE
 
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 #include "fd-close-on-exec.h"
 #include <unistd.h>
 #include <fcntl.h>
--- a/src/lib/ioloop-notify-none.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-notify-none.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2003-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 
 #ifdef IOLOOP_NOTIFY_NONE
 
--- a/src/lib/ioloop-poll.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-poll.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 /* @UNSAFE: whole file */
 
 #include "lib.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 
 #ifdef IOLOOP_POLL
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/ioloop-private.h	Wed Sep 21 13:56:13 2011 +0300
@@ -0,0 +1,92 @@
+#ifndef IOLOOP_PRIVATE_H
+#define IOLOOP_PRIVATE_H
+
+#include "priorityq.h"
+#include "ioloop.h"
+
+#ifndef IOLOOP_INITIAL_FD_COUNT
+#  define IOLOOP_INITIAL_FD_COUNT 128
+#endif
+
+struct ioloop {
+        struct ioloop *prev;
+
+	struct ioloop_context *cur_ctx;
+
+	struct io_file *io_files;
+	struct io_file *next_io_file;
+	struct priorityq *timeouts;
+
+        struct ioloop_handler_context *handler_context;
+        struct ioloop_notify_handler_context *notify_handler_context;
+	unsigned int max_fd_count;
+
+	io_loop_time_moved_callback_t *time_moved_callback;
+	time_t next_max_time;
+
+	unsigned int running:1;
+};
+
+struct io {
+	enum io_condition condition;
+
+	io_callback_t *callback;
+        void *context;
+
+	struct ioloop *ioloop;
+	struct ioloop_context *ctx;
+};
+
+struct io_file {
+	struct io io;
+
+	/* use a doubly linked list so that io_remove() is quick */
+	struct io_file *prev, *next;
+
+	int refcount;
+	int fd;
+};
+
+struct timeout {
+	struct priorityq_item item;
+
+        unsigned int msecs;
+	struct timeval next_run;
+
+	timeout_callback_t *callback;
+        void *context;
+
+	struct ioloop *ioloop;
+	struct ioloop_context *ctx;
+};
+
+struct ioloop_context_callback {
+	io_callback_t *activate;
+	io_callback_t *deactivate;
+	void *context;
+};
+
+struct ioloop_context {
+	int refcount;
+	struct ioloop *ioloop;
+	ARRAY_DEFINE(callbacks, struct ioloop_context_callback);
+};
+
+int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
+void io_loop_handle_timeouts(struct ioloop *ioloop);
+void io_loop_call_io(struct io *io);
+
+/* I/O handler calls */
+void io_loop_handle_add(struct io_file *io);
+void io_loop_handle_remove(struct io_file *io, bool closed);
+
+void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count);
+void io_loop_handler_deinit(struct ioloop *ioloop);
+
+void io_loop_notify_remove(struct io *io);
+void io_loop_notify_handler_deinit(struct ioloop *ioloop);
+
+void io_loop_context_activate(struct ioloop_context *ctx);
+void io_loop_context_deactivate(struct ioloop_context *ctx);
+
+#endif
--- a/src/lib/ioloop-select.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop-select.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 
 #ifdef IOLOOP_SELECT
 
--- a/src/lib/ioloop.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ioloop.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 #include "lib.h"
 #include "array.h"
 #include "time-util.h"
-#include "ioloop-internal.h"
+#include "ioloop-private.h"
 
 #include <unistd.h>
 
--- a/src/lib/iostream-internal.h	Mon Sep 19 17:10:11 2011 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#ifndef IOSTREAM_INTERNAL_H
-#define IOSTREAM_INTERNAL_H
-
-/* This file is private to input stream and output stream implementations */
-
-struct iostream_private {
-	int refcount;
-	char *name;
-
-	void (*close)(struct iostream_private *stream);
-	void (*destroy)(struct iostream_private *stream);
-	void (*set_max_buffer_size)(struct iostream_private *stream,
-				    size_t max_size);
-
-	void (*destroy_callback)(void *context);
-	void *destroy_context;
-};
-
-void io_stream_init(struct iostream_private *stream);
-void io_stream_ref(struct iostream_private *stream);
-void io_stream_unref(struct iostream_private *stream);
-void io_stream_close(struct iostream_private *stream);
-void io_stream_set_max_buffer_size(struct iostream_private *stream,
-				   size_t max_size);
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/iostream-private.h	Wed Sep 21 13:56:13 2011 +0300
@@ -0,0 +1,26 @@
+#ifndef IOSTREAM_PRIVATE_H
+#define IOSTREAM_PRIVATE_H
+
+/* This file is private to input stream and output stream implementations */
+
+struct iostream_private {
+	int refcount;
+	char *name;
+
+	void (*close)(struct iostream_private *stream);
+	void (*destroy)(struct iostream_private *stream);
+	void (*set_max_buffer_size)(struct iostream_private *stream,
+				    size_t max_size);
+
+	void (*destroy_callback)(void *context);
+	void *destroy_context;
+};
+
+void io_stream_init(struct iostream_private *stream);
+void io_stream_ref(struct iostream_private *stream);
+void io_stream_unref(struct iostream_private *stream);
+void io_stream_close(struct iostream_private *stream);
+void io_stream_set_max_buffer_size(struct iostream_private *stream,
+				   size_t max_size);
+
+#endif
--- a/src/lib/iostream.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/iostream.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "iostream-internal.h"
+#include "iostream-private.h"
 
 static void
 io_stream_default_close_destroy(struct iostream_private *stream ATTR_UNUSED)
--- a/src/lib/istream-base64-encoder.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-base64-encoder.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 #include "lib.h"
 #include "buffer.h"
 #include "base64.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-base64-encoder.h"
 
 struct base64_encoder_istream {
--- a/src/lib/istream-concat.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-concat.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "buffer.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-concat.h"
 
 struct concat_istream {
--- a/src/lib/istream-crlf.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-crlf.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-crlf.h"
 
 struct crlf_istream {
--- a/src/lib/istream-data.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-data.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 
 static ssize_t i_stream_data_read(struct istream_private *stream)
 {
--- a/src/lib/istream-file.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-file.c	Wed Sep 21 13:56:13 2011 +0300
@@ -4,7 +4,7 @@
 
 #include "lib.h"
 #include "ioloop.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "network.h"
 
 #include <time.h>
--- a/src/lib/istream-internal.h	Mon Sep 19 17:10:11 2011 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#ifndef ISTREAM_INTERNAL_H
-#define ISTREAM_INTERNAL_H
-
-#include "istream.h"
-#include "iostream-internal.h"
-
-#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
-
-struct istream_private {
-/* inheritance: */
-	struct iostream_private iostream;
-
-/* methods: */
-	ssize_t (*read)(struct istream_private *stream);
-	void (*seek)(struct istream_private *stream,
-		     uoff_t v_offset, bool mark);
-	void (*sync)(struct istream_private *stream);
-	const struct stat *(*stat)(struct istream_private *stream, bool exact);
-	int (*get_size)(struct istream_private *stream, bool exact, uoff_t *size_r);
-
-/* data: */
-	struct istream istream;
-
-	int fd;
-	uoff_t abs_start_offset;
-	struct stat statbuf;
-
-	const unsigned char *buffer;
-	unsigned char *w_buffer; /* may be NULL */
-
-	size_t buffer_size, max_buffer_size, init_buffer_size;
-	size_t skip, pos;
-
-	struct istream *parent; /* for filter streams */
-	uoff_t parent_start_offset;
-
-	/* parent stream's expected offset is kept here. i_stream_read()
-	   always seeks parent stream to here before calling read(). */
-	uoff_t parent_expected_offset;
-
-	/* increased every time the stream is changed (e.g. seek, read).
-	   this way streams can check if their parent streams have been
-	   accessed behind them. */
-	unsigned int access_counter;
-
-	string_t *line_str; /* for i_stream_next_line() if w_buffer == NULL */
-	unsigned int return_nolf_line:1;
-};
-
-struct istream *
-i_stream_create(struct istream_private *stream, struct istream *parent, int fd);
-
-void i_stream_compress(struct istream_private *stream);
-void i_stream_grow_buffer(struct istream_private *stream, size_t bytes);
-bool i_stream_get_buffer_space(struct istream_private *stream,
-			       size_t wanted_size, size_t *size_r);
-ssize_t i_stream_read_copy_from_parent(struct istream *istream);
-void i_stream_default_seek(struct istream_private *stream,
-			   uoff_t v_offset, bool mark);
-
-#endif
--- a/src/lib/istream-limit.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-limit.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2003-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 
 struct limit_istream {
 	struct istream_private istream;
--- a/src/lib/istream-mmap.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-mmap.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 #include "lib.h"
 #include "ioloop.h"
 #include "mmap-util.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 
 #include <unistd.h>
 #include <sys/stat.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/istream-private.h	Wed Sep 21 13:56:13 2011 +0300
@@ -0,0 +1,61 @@
+#ifndef ISTREAM_PRIVATE_H
+#define ISTREAM_PRIVATE_H
+
+#include "istream.h"
+#include "iostream-private.h"
+
+#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
+
+struct istream_private {
+/* inheritance: */
+	struct iostream_private iostream;
+
+/* methods: */
+	ssize_t (*read)(struct istream_private *stream);
+	void (*seek)(struct istream_private *stream,
+		     uoff_t v_offset, bool mark);
+	void (*sync)(struct istream_private *stream);
+	const struct stat *(*stat)(struct istream_private *stream, bool exact);
+	int (*get_size)(struct istream_private *stream, bool exact, uoff_t *size_r);
+
+/* data: */
+	struct istream istream;
+
+	int fd;
+	uoff_t abs_start_offset;
+	struct stat statbuf;
+
+	const unsigned char *buffer;
+	unsigned char *w_buffer; /* may be NULL */
+
+	size_t buffer_size, max_buffer_size, init_buffer_size;
+	size_t skip, pos;
+
+	struct istream *parent; /* for filter streams */
+	uoff_t parent_start_offset;
+
+	/* parent stream's expected offset is kept here. i_stream_read()
+	   always seeks parent stream to here before calling read(). */
+	uoff_t parent_expected_offset;
+
+	/* increased every time the stream is changed (e.g. seek, read).
+	   this way streams can check if their parent streams have been
+	   accessed behind them. */
+	unsigned int access_counter;
+
+	string_t *line_str; /* for i_stream_next_line() if w_buffer == NULL */
+	unsigned int return_nolf_line:1;
+};
+
+struct istream *
+i_stream_create(struct istream_private *stream, struct istream *parent, int fd);
+
+void i_stream_compress(struct istream_private *stream);
+void i_stream_grow_buffer(struct istream_private *stream, size_t bytes);
+bool i_stream_get_buffer_space(struct istream_private *stream,
+			       size_t wanted_size, size_t *size_r);
+ssize_t i_stream_read_copy_from_parent(struct istream *istream);
+void i_stream_default_seek(struct istream_private *stream,
+			   uoff_t v_offset, bool mark);
+
+#endif
--- a/src/lib/istream-seekable.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-seekable.c	Wed Sep 21 13:56:13 2011 +0300
@@ -5,7 +5,7 @@
 #include "close-keep-errno.h"
 #include "read-full.h"
 #include "write-full.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-concat.h"
 #include "istream-seekable.h"
 
--- a/src/lib/istream-tee.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream-tee.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2006-2011 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-tee.h"
 
 struct tee_istream {
--- a/src/lib/istream.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/istream.c	Wed Sep 21 13:56:13 2011 +0300
@@ -3,7 +3,7 @@
 #include "lib.h"
 #include "ioloop.h"
 #include "str.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 
 void i_stream_set_name(struct istream *stream, const char *name)
 {
--- a/src/lib/ostream-buffer.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ostream-buffer.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "buffer.h"
-#include "ostream-internal.h"
+#include "ostream-private.h"
 
 struct buffer_ostream {
 	struct ostream_private ostream;
--- a/src/lib/ostream-file.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ostream-file.c	Wed Sep 21 13:56:13 2011 +0300
@@ -8,8 +8,8 @@
 #include "network.h"
 #include "sendfile-util.h"
 #include "istream.h"
-#include "istream-internal.h"
-#include "ostream-internal.h"
+#include "istream-private.h"
+#include "ostream-private.h"
 
 #include <unistd.h>
 #include <sys/stat.h>
--- a/src/lib/ostream-internal.h	Mon Sep 19 17:10:11 2011 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#ifndef OSTREAM_INTERNAL_H
-#define OSTREAM_INTERNAL_H
-
-#include "ostream.h"
-#include "iostream-internal.h"
-
-struct ostream_private {
-/* inheritance: */
-	struct iostream_private iostream;
-
-/* methods: */
-	void (*cork)(struct ostream_private *stream, bool set);
-	int (*flush)(struct ostream_private *stream);
-	void (*flush_pending)(struct ostream_private *stream, bool set);
-	size_t (*get_used_size)(const struct ostream_private *stream);
-	int (*seek)(struct ostream_private *stream, uoff_t offset);
-	ssize_t (*sendv)(struct ostream_private *stream,
-			 const struct const_iovec *iov,
-			 unsigned int iov_count);
-	int (*write_at)(struct ostream_private *stream,
-			const void *data, size_t size, uoff_t offset);
-	off_t (*send_istream)(struct ostream_private *outstream,
-			      struct istream *instream);
-	void (*switch_ioloop)(struct ostream_private *stream);
-
-/* data: */
-	struct ostream ostream;
-	size_t max_buffer_size;
-
-	stream_flush_callback_t *callback;
-	void *context;
-
-	unsigned int corked:1;
-};
-
-struct ostream *o_stream_create(struct ostream_private *_stream);
-
-off_t io_stream_copy(struct ostream *outstream, struct istream *instream,
-		     size_t block_size);
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/ostream-private.h	Wed Sep 21 13:56:13 2011 +0300
@@ -0,0 +1,41 @@
+#ifndef OSTREAM_PRIVATE_H
+#define OSTREAM_PRIVATE_H
+
+#include "ostream.h"
+#include "iostream-private.h"
+
+struct ostream_private {
+/* inheritance: */
+	struct iostream_private iostream;
+
+/* methods: */
+	void (*cork)(struct ostream_private *stream, bool set);
+	int (*flush)(struct ostream_private *stream);
+	void (*flush_pending)(struct ostream_private *stream, bool set);
+	size_t (*get_used_size)(const struct ostream_private *stream);
+	int (*seek)(struct ostream_private *stream, uoff_t offset);
+	ssize_t (*sendv)(struct ostream_private *stream,
+			 const struct const_iovec *iov,
+			 unsigned int iov_count);
+	int (*write_at)(struct ostream_private *stream,
+			const void *data, size_t size, uoff_t offset);
+	off_t (*send_istream)(struct ostream_private *outstream,
+			      struct istream *instream);
+	void (*switch_ioloop)(struct ostream_private *stream);
+
+/* data: */
+	struct ostream ostream;
+	size_t max_buffer_size;
+
+	stream_flush_callback_t *callback;
+	void *context;
+
+	unsigned int corked:1;
+};
+
+struct ostream *o_stream_create(struct ostream_private *_stream);
+
+off_t io_stream_copy(struct ostream *outstream, struct istream *instream,
+		     size_t block_size);
+
+#endif
--- a/src/lib/ostream.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/ostream.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "lib.h"
 #include "istream.h"
-#include "ostream-internal.h"
+#include "ostream-private.h"
 
 void o_stream_set_name(struct ostream *stream, const char *name)
 {
--- a/src/lib/test-istream-base64-encoder.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/test-istream-base64-encoder.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "test-lib.h"
 #include "str.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-base64-encoder.h"
 
 static const char *hello = "hello world";
--- a/src/lib/test-istream-concat.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/test-istream-concat.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
 
 #include "test-lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-concat.h"
 
 #include <stdlib.h>
--- a/src/lib/test-istream-crlf.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/test-istream-crlf.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "test-lib.h"
 #include "str.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-crlf.h"
 
 static void test_istream_crlf_input(const char *input)
--- a/src/lib/test-istream-seekable.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/test-istream-seekable.c	Wed Sep 21 13:56:13 2011 +0300
@@ -1,7 +1,7 @@
 /* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
 
 #include "test-lib.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-seekable.h"
 
 #include <stdlib.h>
--- a/src/lib/test-istream-tee.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/lib/test-istream-tee.c	Wed Sep 21 13:56:13 2011 +0300
@@ -2,7 +2,7 @@
 
 #include "test-lib.h"
 #include "str.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-tee.h"
 
 #include <stdlib.h>
--- a/src/plugins/zlib/istream-bzlib.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/plugins/zlib/istream-bzlib.c	Wed Sep 21 13:56:13 2011 +0300
@@ -4,7 +4,7 @@
 
 #ifdef HAVE_BZLIB
 
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-zlib.h"
 #include <bzlib.h>
 
--- a/src/plugins/zlib/istream-zlib.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/plugins/zlib/istream-zlib.c	Wed Sep 21 13:56:13 2011 +0300
@@ -5,7 +5,7 @@
 #ifdef HAVE_ZLIB
 
 #include "crc32.h"
-#include "istream-internal.h"
+#include "istream-private.h"
 #include "istream-zlib.h"
 #include <zlib.h>
 
--- a/src/plugins/zlib/ostream-bzlib.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/plugins/zlib/ostream-bzlib.c	Wed Sep 21 13:56:13 2011 +0300
@@ -4,7 +4,7 @@
 
 #ifdef HAVE_BZLIB
 
-#include "ostream-internal.h"
+#include "ostream-private.h"
 #include "ostream-zlib.h"
 #include <bzlib.h>
 
--- a/src/plugins/zlib/ostream-zlib.c	Mon Sep 19 17:10:11 2011 +0300
+++ b/src/plugins/zlib/ostream-zlib.c	Wed Sep 21 13:56:13 2011 +0300
@@ -5,7 +5,7 @@
 #ifdef HAVE_ZLIB
 
 #include "crc32.h"
-#include "ostream-internal.h"
+#include "ostream-private.h"
 #include "ostream-zlib.h"
 #include <zlib.h>