[WIP] replace FILE* with my own FILE structure (pic_file *)
This commit is contained in:
parent
8ad90e8c17
commit
1cb9b0347d
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue