Commit 311f1c1f 311f1c1f406f9dd900739109b24d66056bf842fd by Sergey Poznyakoff

(stream_set_strerror)

(stream_sequential_read,stream_sequential_readline)
(stream_sequential_write,stream_strerror): New functions.
1 parent 0cac1b11
...@@ -40,13 +40,20 @@ extern "C" { /*}*/ ...@@ -40,13 +40,20 @@ extern "C" { /*}*/
40 40
41 /* Functions useful to users of the pre-defined stream types. */ 41 /* Functions useful to users of the pre-defined stream types. */
42 42
43 extern int file_stream_create __P ((stream_t *stream, const char* filename, int flags)); 43 extern int file_stream_create __P ((stream_t *stream, const char* filename,
44 extern int tcp_stream_create __P ((stream_t *stream, const char* host, int port, int flags)); 44 int flags));
45 extern int mapfile_stream_create __P ((stream_t *stream, const char* filename, int flags)); 45 extern int tcp_stream_create __P ((stream_t *stream, const char* host,
46 extern int memory_stream_create __P ((stream_t *stream, const char* filename, int flags)); 46 int port, int flags));
47 extern int encoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding)); 47 extern int mapfile_stream_create __P ((stream_t *stream, const char* filename,
48 extern int decoder_stream_create __P ((stream_t *stream, stream_t iostream, const char *encoding)); 48 int flags));
49 extern int stdio_stream_create __P ((stream_t *stream, FILE* stdio, int flags)); 49 extern int memory_stream_create __P ((stream_t *stream, const char* filename,
50 int flags));
51 extern int encoder_stream_create __P ((stream_t *stream, stream_t iostream,
52 const char *encoding));
53 extern int decoder_stream_create __P ((stream_t *stream, stream_t iostream,
54 const char *encoding));
55 extern int stdio_stream_create __P ((stream_t *stream, FILE* stdio,
56 int flags));
50 57
51 extern void stream_destroy __P ((stream_t *, void *owner)); 58 extern void stream_destroy __P ((stream_t *, void *owner));
52 59
...@@ -54,18 +61,22 @@ extern int stream_open __P ((stream_t)); ...@@ -54,18 +61,22 @@ extern int stream_open __P ((stream_t));
54 extern int stream_close __P ((stream_t)); 61 extern int stream_close __P ((stream_t));
55 extern int stream_is_seekable __P ((stream_t)); 62 extern int stream_is_seekable __P ((stream_t));
56 extern int stream_get_fd __P ((stream_t , int *)); 63 extern int stream_get_fd __P ((stream_t , int *));
57 extern int stream_read __P ((stream_t, char *, size_t, off_t, size_t *)); 64 extern int stream_read __P ((stream_t, char *, size_t, off_t,
58 extern int stream_readline __P ((stream_t, char *, size_t, off_t, size_t *)); 65 size_t *));
66 extern int stream_readline __P ((stream_t, char *, size_t, off_t,
67 size_t *));
59 extern int stream_size __P ((stream_t, off_t *)); 68 extern int stream_size __P ((stream_t, off_t *));
60 extern int stream_truncate __P ((stream_t, off_t)); 69 extern int stream_truncate __P ((stream_t, off_t));
61 extern int stream_write __P ((stream_t, const char *, size_t, off_t, size_t *)); 70 extern int stream_write __P ((stream_t, const char *, size_t, off_t,
71 size_t *));
62 extern int stream_setbufsiz __P ((stream_t stream, size_t size)); 72 extern int stream_setbufsiz __P ((stream_t stream, size_t size));
63 extern int stream_flush __P ((stream_t)); 73 extern int stream_flush __P ((stream_t));
64 74
65 75
66 /* Functions useful to implementors of new stream types. */ 76 /* Functions useful to implementors of new stream types. */
67 77
68 extern int stream_create __P ((stream_t *stream, int flags, void* owner)); 78 extern int stream_create __P ((stream_t *stream, int flags,
79 void* owner));
69 80
70 extern void* stream_get_owner __P ((stream_t)); 81 extern void* stream_get_owner __P ((stream_t));
71 extern void stream_set_owner __P ((stream_t, void* owner)); 82 extern void stream_set_owner __P ((stream_t, void* owner));
...@@ -95,10 +106,12 @@ extern int stream_set_fd __P ((stream_t, ...@@ -95,10 +106,12 @@ extern int stream_set_fd __P ((stream_t,
95 int (*_get_fd) __PMT ((stream_t, int *)), void *owner)); 106 int (*_get_fd) __PMT ((stream_t, int *)), void *owner));
96 107
97 extern int stream_set_read __P ((stream_t, 108 extern int stream_set_read __P ((stream_t,
98 int (*_read) __PMT ((stream_t, char *, size_t, off_t, size_t *)), void *owner)); 109 int (*_read) __PMT ((stream_t, char *, size_t, off_t, size_t *)),
110 void *owner));
99 111
100 extern int stream_set_readline __P ((stream_t, 112 extern int stream_set_readline __P ((stream_t,
101 int (*_readline) __PMT ((stream_t, char *, size_t, off_t, size_t *)), void *owner)); 113 int (*_readline) __PMT ((stream_t, char *, size_t, off_t, size_t *)),
114 void *owner));
102 115
103 extern int stream_set_size __P ((stream_t, 116 extern int stream_set_size __P ((stream_t,
104 int (*_size) __PMT ((stream_t, off_t *)), void *owner)); 117 int (*_size) __PMT ((stream_t, off_t *)), void *owner));
...@@ -107,11 +120,26 @@ extern int stream_set_truncate __P ((stream_t, ...@@ -107,11 +120,26 @@ extern int stream_set_truncate __P ((stream_t,
107 int (*_truncate) __PMT ((stream_t, off_t)), void *owner)); 120 int (*_truncate) __PMT ((stream_t, off_t)), void *owner));
108 121
109 extern int stream_set_write __P ((stream_t, 122 extern int stream_set_write __P ((stream_t,
110 int (*_write) __PMT ((stream_t, const char *, size_t, off_t, size_t *)), void *owner)); 123 int (*_write) __PMT ((stream_t, const char *, size_t, off_t, size_t *)),
124 void *owner));
111 125
112 extern int stream_set_flush __P ((stream_t, 126 extern int stream_set_flush __P ((stream_t,
113 int (*_flush) __PMT ((stream_t)), void *owner)); 127 int (*_flush) __PMT ((stream_t)), void *owner));
114 128
129 extern int stream_set_strerror __P ((stream_t stream,
130 int (*fp) (stream_t, const char **), void *owner));
131
132 extern int stream_sequential_read __P((stream_t stream,
133 char *buf, size_t size, size_t *nbytes));
134
135 extern int stream_sequential_readline __P((stream_t stream,
136 char *buf, size_t size, size_t *nbytes));
137
138 extern int stream_sequential_write __P((stream_t stream,
139 char *buf, size_t size));
140
141 extern int stream_strerror __P((stream_t stream, const char **p));
142
115 #ifdef __cplusplus 143 #ifdef __cplusplus
116 } 144 }
117 #endif 145 #endif
......