Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (36 sloc) 1.525 kb
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
1 #ifndef _IOLAYER_H_
2 #define _IOLAYER_H_
3
4
5 /* How the IO layer works:
6 *
6d5c85a @tonycoz Merge the I/O buffering branch
authored
7 * Start by getting an io_glue object by calling the appropriate
8 * io_new...() function. After that data can be read via the
9 * io_glue->readcb() method.
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
10 *
11 */
12
13
0778adb More iolayers work:
Tony Cook authored
14 #include "iolayert.h"
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
15
16 /* #define BBSIZ 1096 */
3e27d46 Increased buffersize for iolayer buffer chains.
Arnar Mar Hrafnkelsson authored
17 #define BBSIZ 16384
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
18 #define IO_FAKE_SEEK 1<<0L
19 #define IO_TEMP_SEEK 1<<1L
20
21
22 void io_glue_gettypes (io_glue *ig, int reqmeth);
23
24 /* XS functions */
f670385 @tonycoz update I/O layers to accept a context on creation
authored
25 io_glue *im_io_new_fd(pIMCTX, int fd);
26 io_glue *im_io_new_bufchain(pIMCTX);
27 io_glue *im_io_new_buffer(pIMCTX, const char *data, size_t len, i_io_closebufp_t closecb, void *closedata);
28 io_glue *im_io_new_cb(pIMCTX, void *p, i_io_readl_t readcb, i_io_writel_t writecb, i_io_seekl_t seekcb, i_io_closel_t closecb, i_io_destroyl_t destroycb);
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
29 size_t io_slurp(io_glue *ig, unsigned char **c);
d16420e io_glue_destroy() now uses an extra callback to handle type specific
Tony Cook authored
30 void io_glue_destroy(io_glue *ig);
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
31
6d5c85a @tonycoz Merge the I/O buffering branch
authored
32 void i_io_dump(io_glue *ig, int flags);
33
34 /* Buffered I/O */
35 extern int i_io_getc_imp(io_glue *ig);
36 extern int i_io_peekc_imp(io_glue *ig);
37 extern ssize_t i_io_peekn(io_glue *ig, void *buf, size_t size);
38 extern int i_io_putc_imp(io_glue *ig, int c);
39 extern ssize_t i_io_read(io_glue *ig, void *buf, size_t size);
40 extern ssize_t i_io_write(io_glue *ig, const void *buf, size_t size);
41 extern off_t i_io_seek(io_glue *ig, off_t offset, int whence);
42 extern int i_io_flush(io_glue *ig);
43 extern int i_io_close(io_glue *ig);
44 extern int i_io_set_buffered(io_glue *ig, int buffered);
45 extern ssize_t i_io_gets(io_glue *ig, char *, size_t, int);
46
02d1d62 Initial revision
Arnar Mar Hrafnkelsson authored
47 #endif /* _IOLAYER_H_ */
Something went wrong with that request. Please try again.