Commit 5f3942cc 5f3942cc7d2cff317d9e72a4613844780dc6720a by Sam Roberts

Forgot to add stdio_stream_create() to the header, it opens a stream_t on

an existing FILE, and you can choose whether it fcloses() it or not.
1 parent a2a2c3a0
...@@ -49,6 +49,11 @@ Stream doesn't close it's underlying resource when it is closed or destroyed. ...@@ -49,6 +49,11 @@ Stream doesn't close it's underlying resource when it is closed or destroyed.
49 @deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding}) 49 @deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding})
50 @end deftypefun 50 @end deftypefun
51 51
52 @deftypefun int stdio_stream_create (stream_t *@var{pstream}, FILE* @var{stdio}, int @var{flags})
53 If MU_STREAM_NO_CLOSE is specified, fclose() will not be called on
54 @var{stdio} when the stream is closed.
55 @end deftypefun
56
52 @deftypefun void stream_destroy (stream_t *@var{pstream}, void *@var{owner}) 57 @deftypefun void stream_destroy (stream_t *@var{pstream}, void *@var{owner})
53 @end deftypefun 58 @end deftypefun
54 59
......
...@@ -57,6 +57,7 @@ extern int mapfile_stream_create __P ((stream_t *stream, const char* filename, i ...@@ -57,6 +57,7 @@ extern int mapfile_stream_create __P ((stream_t *stream, const char* filename, i
57 extern int memory_stream_create __P ((stream_t *stream, const char* filename, int flags)); 57 extern int memory_stream_create __P ((stream_t *stream, const char* filename, int flags));
58 extern int encoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding)); 58 extern int encoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding));
59 extern int decoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding)); 59 extern int decoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding));
60 extern int stdio_stream_create __P ((stream_t *stream, FILE* stdio, int flags));
60 61
61 extern void stream_destroy __P ((stream_t *, void *owner)); 62 extern void stream_destroy __P ((stream_t *, void *owner));
62 63
......