Commit fe6f7d3c fe6f7d3cf6dad6a1d17a33889ca5a3b4ec6a74c4 by Sam Roberts

updated - not much text, but at least the args are correct.

1 parent d216457b
@code{#include <mailutils/stream.h>}
@deftypefun int stream_create (stream_t *@var{pstream}, int @var{flags}, void *@var{owner})
These generic flags are interpreted as appropriate to the specific
streams.
@table @code
@item MU_STREAM_READ
@findex MU_STREAM_READ
......@@ -16,25 +18,49 @@ The stream is open read and write.
The stream is open in append mode for writing.
@item MU_STREAM_CREAT
@findex MU_STREAM_CREAT
The stream is created.
The stream open will create the underlying resource (such as a file)
if it doesn't exist already.
@item MU_STREAM_NONBLOCK
@findex MU_STREAM_NONBLOCK
The stream is set non blocking.
@item MU_STREAM_NO_CHECK
@findex MU_STREAM_NO_CHECK
Stream is destroyed without checking for the owner.
@item MU_STREAM_NO_CLOSE
@findex MU_STREAM_NO_CLOSE
Stream doesn't close it's underlying resource when it is closed or destroyed.
@end table
@deftypefun int file_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int tcp_stream_create (stream_t *@var{pstream}, const char *@var{host}, int @var{port}, int @var{flags})
@end deftypefun
@deftypefun int mapfile_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int memory_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int encoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun void stream_destroy (stream_t *@var{pstream}, void *@var{owner})
@end deftypefun
@deftypefun int stream_open (stream_t @var{stream}, const char *@var{name}, int@var{port}, int @var{flag})
@deftypefun int stream_open (stream_t @var{stream})
@end deftypefun
@deftypefun int stream_close (stream_t @var{stream})
@end deftypefun
@deftypefun int stream_is_seekable (stream_t @var{stream})
@end deftypefun
@deftypefun int stream_get_fd (stream_t @var{stream}, int *@var{pfd})
@end deftypefun
......@@ -53,9 +79,18 @@ Stream is destroyed without checking for the owner.
@deftypefun int stream_write (stream_t @var{stream}, const char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{pwriten})
@end deftypefun
@deftypefun int stream_setbufsiz (stream_t @var{stream}, size_t @var{size})
@end deftypefun
@deftypefun int stream_flush (stream_t @var{stream})
@end deftypefun
These functions will typically only be useful to implementors of streams.
@deftypefun int stream_create (stream_t *@var{pstream}, int @var{flags}, void *@var{owner})
Used to implement a new kind of stream.
@end deftypefun
@deftypefun int stream_get_flags (stream_t @var{stream}, int *@var{pflags})
@end deftypefun
......@@ -72,23 +107,10 @@ Last action was @code{stream_close}.
@end table
@end deftypefun
@deftypefun int file_stream_create (stream_t *@var{pstream})
@end deftypefun
@deftypefun int mapfile_stream_create (stream_t *@var{pstream})
@end deftypefun
@deftypefun int encoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun int tcp_stream_create (stream_t *@var{pstream})
@end deftypefun
An example using @code{tcp_stream_create} to make a simple web client:
FIXME: this example won't build anymore.
An example using @code{tcp_stream_create} to make a simple web client:
@example
#include <stdlib.h>
#include <stdio.h>
......