00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_IO_PRV_H_
00012 #define _KLONE_IO_PRV_H_
00013
00014 #include "klone_conf.h"
00015 #ifdef HAVE_STDINT
00016 #include <stdint.h>
00017 #endif
00018 #include <klone/codec.h>
00019 #include <klone/utils.h>
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025
00026
00028 #define io_create(type, pio) io_prv_create(sizeof(type), pio)
00029 int io_prv_create(size_t dev_sz, io_t **pio);
00030
00031 typedef ssize_t (*io_read_op) (io_t*, char*, size_t);
00032 typedef ssize_t (*io_write_op) (io_t*, const char*, size_t);
00033 typedef ssize_t (*io_seek_op) (io_t*, size_t);
00034 typedef ssize_t (*io_tell_op) (io_t*);
00035 typedef int (*io_term_op) (io_t*);
00036
00037 struct io_s
00038 {
00039 char *name;
00040 codec_chain_t codec_chain;
00041 int eof;
00042 size_t size;
00043
00044
00045 unsigned int refcnt;
00046
00047
00048 int is_secure;
00049
00050
00051 io_read_op read;
00052 io_write_op write;
00053 io_seek_op seek;
00054 io_tell_op tell;
00055 io_term_op term;
00056
00057
00058
00059 char *rbuf;
00060 size_t rbsz;
00061 size_t rcount;
00062 size_t roff;
00063
00064
00065 char *ubuf;
00066 size_t ucount;
00067 size_t uoff;
00068
00069
00070
00071
00072 char *wbuf;
00073 size_t wbsz;
00074 size_t wcount;
00075 size_t woff;
00076
00077 };
00078
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082
00083 #endif