#ifndef ISTREAM_PRIVATE_H
#define ISTREAM_PRIVATE_H
#include "istream.h"
#include "iostream-private.h"
struct io;
struct istream_private {
/* inheritance: */
/* methods: */
struct istream_snapshot *
struct istream_snapshot *prev_snapshot);
/* data: */
int fd;
/* added by io_add_istream() -> i_stream_set_io() */
const unsigned char *buffer;
/* parent stream's expected offset is kept here. i_stream_read()
always seeks parent stream to here before calling read(). */
/* 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;
/* Timestamp when read() last returned >0 */
};
struct istream_snapshot {
};
enum istream_create_flag {
/* The stream guarantees that the buffer pointer stays valid when it
returns <= 0. */
};
struct istream * ATTR_NOWARN_UNUSED_RESULT
/* Initialize parent lazily after i_stream_create() has already been called. */
/* Like i_stream_try_alloc(), but compress only if it's the only way to get
more space. This can be useful when stream is marked with
i_stream_seek_mark() */
/* Free memory allocated by i_stream_*alloc() */
/* Default snapshot handling: use memarea if it exists, otherwise snapshot
parent stream. */
struct istream_snapshot *
struct istream_snapshot *prev_snapshot);
/* Filter istreams should be calling this instead of i_stream_read() to avoid
unnecessarily referencing memareas. After this call any pointers to the
parent istream's content must be considered as potentially invalid and have
to be updated, even if the return value is <=0. */
#endif