updated - not much text, but at least the args are correct.
Showing
1 changed file
with
40 additions
and
18 deletions
1 | @code{#include <mailutils/stream.h>} | 1 | @code{#include <mailutils/stream.h>} |
2 | 2 | ||
3 | @deftypefun int stream_create (stream_t *@var{pstream}, int @var{flags}, void *@var{owner}) | 3 | These generic flags are interpreted as appropriate to the specific |
4 | streams. | ||
5 | |||
4 | @table @code | 6 | @table @code |
5 | @item MU_STREAM_READ | 7 | @item MU_STREAM_READ |
6 | @findex MU_STREAM_READ | 8 | @findex MU_STREAM_READ |
... | @@ -16,25 +18,49 @@ The stream is open read and write. | ... | @@ -16,25 +18,49 @@ The stream is open read and write. |
16 | The stream is open in append mode for writing. | 18 | The stream is open in append mode for writing. |
17 | @item MU_STREAM_CREAT | 19 | @item MU_STREAM_CREAT |
18 | @findex MU_STREAM_CREAT | 20 | @findex MU_STREAM_CREAT |
19 | The stream is created. | 21 | The stream open will create the underlying resource (such as a file) |
22 | if it doesn't exist already. | ||
20 | @item MU_STREAM_NONBLOCK | 23 | @item MU_STREAM_NONBLOCK |
21 | @findex MU_STREAM_NONBLOCK | 24 | @findex MU_STREAM_NONBLOCK |
22 | The stream is set non blocking. | 25 | The stream is set non blocking. |
23 | @item MU_STREAM_NO_CHECK | 26 | @item MU_STREAM_NO_CHECK |
24 | @findex MU_STREAM_NO_CHECK | 27 | @findex MU_STREAM_NO_CHECK |
25 | Stream is destroyed without checking for the owner. | 28 | Stream is destroyed without checking for the owner. |
29 | @item MU_STREAM_NO_CLOSE | ||
30 | @findex MU_STREAM_NO_CLOSE | ||
31 | Stream doesn't close it's underlying resource when it is closed or destroyed. | ||
26 | @end table | 32 | @end table |
33 | |||
34 | @deftypefun int file_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags}) | ||
35 | @end deftypefun | ||
36 | |||
37 | @deftypefun int tcp_stream_create (stream_t *@var{pstream}, const char *@var{host}, int @var{port}, int @var{flags}) | ||
38 | @end deftypefun | ||
39 | |||
40 | @deftypefun int mapfile_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags}) | ||
41 | @end deftypefun | ||
42 | |||
43 | @deftypefun int memory_stream_create (stream_t *@var{pstream}, const char *@var{filename}, int @var{flags}) | ||
44 | @end deftypefun | ||
45 | |||
46 | @deftypefun int encoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding}) | ||
47 | @end deftypefun | ||
48 | |||
49 | @deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding}) | ||
27 | @end deftypefun | 50 | @end deftypefun |
28 | 51 | ||
29 | @deftypefun void stream_destroy (stream_t *@var{pstream}, void *@var{owner}) | 52 | @deftypefun void stream_destroy (stream_t *@var{pstream}, void *@var{owner}) |
30 | @end deftypefun | 53 | @end deftypefun |
31 | 54 | ||
32 | @deftypefun int stream_open (stream_t @var{stream}, const char *@var{name}, int@var{port}, int @var{flag}) | 55 | @deftypefun int stream_open (stream_t @var{stream}) |
33 | @end deftypefun | 56 | @end deftypefun |
34 | 57 | ||
35 | @deftypefun int stream_close (stream_t @var{stream}) | 58 | @deftypefun int stream_close (stream_t @var{stream}) |
36 | @end deftypefun | 59 | @end deftypefun |
37 | 60 | ||
61 | @deftypefun int stream_is_seekable (stream_t @var{stream}) | ||
62 | @end deftypefun | ||
63 | |||
38 | @deftypefun int stream_get_fd (stream_t @var{stream}, int *@var{pfd}) | 64 | @deftypefun int stream_get_fd (stream_t @var{stream}, int *@var{pfd}) |
39 | @end deftypefun | 65 | @end deftypefun |
40 | 66 | ||
... | @@ -53,9 +79,18 @@ Stream is destroyed without checking for the owner. | ... | @@ -53,9 +79,18 @@ Stream is destroyed without checking for the owner. |
53 | @deftypefun int stream_write (stream_t @var{stream}, const char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{pwriten}) | 79 | @deftypefun int stream_write (stream_t @var{stream}, const char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{pwriten}) |
54 | @end deftypefun | 80 | @end deftypefun |
55 | 81 | ||
82 | @deftypefun int stream_setbufsiz (stream_t @var{stream}, size_t @var{size}) | ||
83 | @end deftypefun | ||
84 | |||
56 | @deftypefun int stream_flush (stream_t @var{stream}) | 85 | @deftypefun int stream_flush (stream_t @var{stream}) |
57 | @end deftypefun | 86 | @end deftypefun |
58 | 87 | ||
88 | These functions will typically only be useful to implementors of streams. | ||
89 | |||
90 | @deftypefun int stream_create (stream_t *@var{pstream}, int @var{flags}, void *@var{owner}) | ||
91 | Used to implement a new kind of stream. | ||
92 | @end deftypefun | ||
93 | |||
59 | @deftypefun int stream_get_flags (stream_t @var{stream}, int *@var{pflags}) | 94 | @deftypefun int stream_get_flags (stream_t @var{stream}, int *@var{pflags}) |
60 | @end deftypefun | 95 | @end deftypefun |
61 | 96 | ||
... | @@ -72,23 +107,10 @@ Last action was @code{stream_close}. | ... | @@ -72,23 +107,10 @@ Last action was @code{stream_close}. |
72 | @end table | 107 | @end table |
73 | @end deftypefun | 108 | @end deftypefun |
74 | 109 | ||
75 | @deftypefun int file_stream_create (stream_t *@var{pstream}) | 110 | An example using @code{tcp_stream_create} to make a simple web client: |
76 | @end deftypefun | ||
77 | |||
78 | @deftypefun int mapfile_stream_create (stream_t *@var{pstream}) | ||
79 | @end deftypefun | ||
80 | |||
81 | @deftypefun int encoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding}) | ||
82 | @end deftypefun | ||
83 | |||
84 | @deftypefun int decoder_stream_create (stream_t *@var{pstream}, stream_t @var{iostream}, const char *@var{encoding}) | ||
85 | @end deftypefun | ||
86 | |||
87 | @deftypefun int tcp_stream_create (stream_t *@var{pstream}) | ||
88 | @end deftypefun | ||
89 | 111 | ||
112 | FIXME: this example won't build anymore. | ||
90 | 113 | ||
91 | An example using @code{tcp_stream_create} to make a simple web client: | ||
92 | @example | 114 | @example |
93 | #include <stdlib.h> | 115 | #include <stdlib.h> |
94 | #include <stdio.h> | 116 | #include <stdio.h> | ... | ... |
-
Please register or sign in to post a comment