[WIP] replace FILE* with my own FILE structure (pic_file *)

This commit is contained in:
Yuichi Nishiwaki 2014-01-16 18:24:25 +09:00
parent 8ad90e8c17
commit 1cb9b0347d
1 changed files with 13 additions and 3 deletions

View File

@ -15,11 +15,21 @@ enum pic_port_status {
PIC_PORT_CLOSE, PIC_PORT_CLOSE,
}; };
typedef struct {
struct {
void *cookie;
int (*read)(void *, char *, int);
int (*write)(void *, const char *, int);
fpos_t (*seek)(void *, fpos_t, int);
int (*close)(void *);
} vtable;
} pic_file;
struct pic_port { struct pic_port {
PIC_OBJECT_HEADER PIC_OBJECT_HEADER
FILE *file; pic_file *file;
short flags; int flags;
enum pic_port_status status; int status;
}; };
#define pic_port_p(v) (pic_type(v) == PIC_TT_PORT) #define pic_port_p(v) (pic_type(v) == PIC_TT_PORT)