Commit | Line | Data |
---|---|---|
02d1d628 AMH |
1 | #ifndef _IOLAYER_H_ |
2 | #define _IOLAYER_H_ | |
3 | ||
4 | ||
5 | /* How the IO layer works: | |
6 | * | |
7 | * Start by getting an io_glue object. Then define its | |
8 | * datasource via io_obj_setp_buffer or io_obj_setp_cb. Before | |
9 | * using the io_glue object be sure to call io_glue_commit_types(). | |
10 | * After that data can be read via the io_glue->readcb() method. | |
11 | * | |
12 | */ | |
13 | ||
14 | ||
0778adbf | 15 | #include "iolayert.h" |
02d1d628 AMH |
16 | |
17 | /* #define BBSIZ 1096 */ | |
3e27d469 | 18 | #define BBSIZ 16384 |
02d1d628 AMH |
19 | #define IO_FAKE_SEEK 1<<0L |
20 | #define IO_TEMP_SEEK 1<<1L | |
21 | ||
22 | ||
02d1d628 AMH |
23 | void io_glue_commit_types(io_glue *ig); |
24 | void io_glue_gettypes (io_glue *ig, int reqmeth); | |
25 | ||
02d1d628 AMH |
26 | /* XS functions */ |
27 | io_glue *io_new_fd(int fd); | |
faa9b3e7 | 28 | io_glue *io_new_bufchain(void); |
0778adbf TC |
29 | io_glue *io_new_buffer(char *data, size_t len, i_io_closebufp_t closecb, void *closedata); |
30 | io_glue *io_new_cb(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); | |
02d1d628 | 31 | size_t io_slurp(io_glue *ig, unsigned char **c); |
d16420e9 | 32 | void io_glue_destroy(io_glue *ig); |
02d1d628 AMH |
33 | |
34 | #endif /* _IOLAYER_H_ */ |