annotate src/lib/istream-seekable.h @ 9084:82949209612e HEAD

istream-seekable: Changed API to use a callback function to create the temp file.
author Timo Sirainen <tss@iki.fi>
date Mon, 25 May 2009 22:18:55 -0400
parents e4eb71ae8e96
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6142
diff changeset
1 #ifndef ISTREAM_SEEKABLE_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6142
diff changeset
2 #define ISTREAM_SEEKABLE_H
3244
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 /* Create a seekable stream from given NULL-terminated list of input streams.
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 Try to keep it in memory, but use a temporary file if it's too large.
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6
9084
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
7 When max_buffer_size is reached, fd_callback is called. It should return
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
8 the fd and path of the created file. Typically the callback would also
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
9 unlink the file before returning. */
3244
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 struct istream *
6142
6c0bfc35af03 Removed memory pool parameter from iostreams. Default pool was almost always
Timo Sirainen <tss@iki.fi>
parents: 3244
diff changeset
11 i_stream_create_seekable(struct istream *input[],
9084
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
12 size_t max_buffer_size,
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
13 int (*fd_callback)(const char **path_r, void *context),
82949209612e istream-seekable: Changed API to use a callback function to create the temp file.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
14 void *context);
3244
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15
f104e4197ac1 Added istream-seekable, which allows combining multiple input streams and
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 #endif