baf346e71ebd7b44fcba4b48f4d39845453b778bTimo Sirainen /* if o_stream_send_istream() is called with a readable fd, don't
baf346e71ebd7b44fcba4b48f4d39845453b778bTimo Sirainen actually copy the input stream, just have iostream_temp_finish()
baf346e71ebd7b44fcba4b48f4d39845453b778bTimo Sirainen return a new iostream pointing to the fd dup()ed */
cf636afb3826f0d8e15c248aa1fc04ce72820e08Timo Sirainen/* Start writing to given output stream. The data is initially written to
cf636afb3826f0d8e15c248aa1fc04ce72820e08Timo Sirainen memory, and later to a temporary file that is immediately unlinked. */
baf346e71ebd7b44fcba4b48f4d39845453b778bTimo Sirainenstruct ostream *iostream_temp_create(const char *temp_path_prefix,
2f4f603d4cebab2cc956c72164efb02da83515c5Timo Sirainenstruct ostream *iostream_temp_create_named(const char *temp_path_prefix,
2f4f603d4cebab2cc956c72164efb02da83515c5Timo Sirainen const char *name);
8a8a3b43987b5ade914f22765e51c9e3de8179d3Timo Sirainenstruct ostream *iostream_temp_create_sized(const char *temp_path_prefix,
cf636afb3826f0d8e15c248aa1fc04ce72820e08Timo Sirainen/* Finished writing to stream. Return input stream for it and free the
8a8a3b43987b5ade914f22765e51c9e3de8179d3Timo Sirainen output stream. (It's also possible to abort iostream-temp by simply
8a8a3b43987b5ade914f22765e51c9e3de8179d3Timo Sirainen destroying the ostream.) */
cf636afb3826f0d8e15c248aa1fc04ce72820e08Timo Sirainenstruct istream *iostream_temp_finish(struct ostream **output,
d97f081a3de44852197ced772e21560c108895a6Timo Sirainen/* For internal testing: */