138 #ifndef ION_STREAM_H_
139 #define ION_STREAM_H_
149 #ifndef ION_STREAM_DECL
150 #define ION_STREAM_DECL
155 typedef struct _ion_stream ION_STREAM;
164 ION_STREAM_HANDLER handler;
169 typedef struct _ion_stream_user_paged ION_STREAM_USER_PAGED;
170 typedef struct _ion_stream_paged ION_STREAM_PAGED;
171 typedef struct _ion_page ION_PAGE;
172 typedef int32_t PAGE_ID;
173 typedef int64_t POSITION;
182 ION_API_EXPORT iERR ion_stream_open_buffer(BYTE *buffer
186 , ION_STREAM **pp_stream
188 ION_API_EXPORT iERR ion_stream_open_memory_only(ION_STREAM **pp_stream);
190 ION_API_EXPORT iERR ion_stream_open_stdin(ION_STREAM **pp_stream);
191 ION_API_EXPORT iERR ion_stream_open_stdout(ION_STREAM **pp_stream);
192 ION_API_EXPORT iERR ion_stream_open_stderr(ION_STREAM **pp_stream);
194 ION_API_EXPORT iERR ion_stream_open_file_in(FILE *in, ION_STREAM **pp_stream);
195 ION_API_EXPORT iERR ion_stream_open_file_out(FILE *out, ION_STREAM **pp_stream);
196 ION_API_EXPORT iERR ion_stream_open_file_rw(FILE *fp, BOOL cache_all, ION_STREAM **pp_stream);
198 ION_API_EXPORT iERR ion_stream_open_handler_in(ION_STREAM_HANDLER fn_input_handler,
void *handler_state, ION_STREAM **pp_stream);
199 ION_API_EXPORT iERR ion_stream_open_handler_out(ION_STREAM_HANDLER fn_output_handler,
void *handler_state, ION_STREAM **pp_stream);
201 ION_API_EXPORT iERR ion_stream_open_fd_in(
int fd_in, ION_STREAM **pp_stream);
202 ION_API_EXPORT iERR ion_stream_open_fd_out(
int fd_out, ION_STREAM **pp_stream);
203 ION_API_EXPORT iERR ion_stream_open_fd_rw(
int fd, BOOL cache_all, ION_STREAM **pp_stream);
205 ION_API_EXPORT iERR ion_stream_flush(ION_STREAM *stream);
206 ION_API_EXPORT iERR ion_stream_close(ION_STREAM *stream);
214 ION_API_EXPORT BOOL ion_stream_can_read (ION_STREAM *stream);
215 ION_API_EXPORT BOOL ion_stream_can_write (ION_STREAM *stream);
216 ION_API_EXPORT BOOL ion_stream_can_seek (ION_STREAM *stream);
217 ION_API_EXPORT BOOL ion_stream_can_mark (ION_STREAM *stream);
218 ION_API_EXPORT BOOL ion_stream_is_dirty (ION_STREAM *stream);
219 ION_API_EXPORT BOOL ion_stream_is_mark_open (ION_STREAM *stream);
220 ION_API_EXPORT POSITION ion_stream_get_position (ION_STREAM *stream);
221 ION_API_EXPORT FILE *ion_stream_get_file_stream (ION_STREAM *stream);
222 ION_API_EXPORT POSITION ion_stream_get_mark_start (ION_STREAM *stream);
223 ION_API_EXPORT POSITION ion_stream_get_marked_length (ION_STREAM *stream);
231 ION_API_EXPORT iERR ion_stream_read_byte (ION_STREAM *stream,
int *p_c);
232 ION_API_EXPORT iERR ion_stream_read (ION_STREAM *stream, BYTE *buf, SIZE len, SIZE *p_bytes_read);
233 ION_API_EXPORT iERR ion_stream_unread_byte (ION_STREAM *stream,
int c);
234 ION_API_EXPORT iERR ion_stream_write (ION_STREAM *stream, BYTE *buf, SIZE len, SIZE *p_bytes_written);
235 ION_API_EXPORT iERR ion_stream_write_byte (ION_STREAM *stream,
int byte);
236 ION_API_EXPORT iERR ion_stream_write_byte_no_checks(ION_STREAM *stream,
int byte);
237 ION_API_EXPORT iERR ion_stream_write_stream (ION_STREAM *stream, ION_STREAM *stream_input, SIZE len, SIZE *p_written);
238 ION_API_EXPORT iERR ion_stream_seek (ION_STREAM *stream, POSITION position);
239 ION_API_EXPORT iERR ion_stream_truncate (ION_STREAM *stream);
240 ION_API_EXPORT iERR ion_stream_skip (ION_STREAM *stream, SIZE distance, SIZE *p_skipped);
241 ION_API_EXPORT iERR ion_stream_mark (ION_STREAM *stream);
242 ION_API_EXPORT iERR ion_stream_mark_remark (ION_STREAM *stream, POSITION position);
243 ION_API_EXPORT iERR ion_stream_mark_rewind (ION_STREAM *stream);
244 ION_API_EXPORT iERR ion_stream_mark_clear (ION_STREAM *stream);
Definition: ion_types.h:159