add IO buffering (setvbuf)

This commit is contained in:
Yuichi Nishiwaki
2014-01-16 18:36:47 +09:00
parent 4d0a448a44
commit eca456f875
2 changed files with 30 additions and 0 deletions
+4
View File
@@ -16,6 +16,9 @@ enum pic_port_status {
};
typedef struct {
char *buf;
int mode;
int bufsiz;
struct {
void *cookie;
int (*read)(void *, char *, int);
@@ -41,6 +44,7 @@ struct pic_port *pic_stdin(pic_state *);
struct pic_port *pic_stdout(pic_state *);
struct pic_port *pic_stderr(pic_state *);
int pic_setvbuf(pic_file *, char *, int, size_t);
int pic_fflush(pic_file *);
pic_file *pic_funopen(void *cookie, int (*read)(void *, char *, int), int (*write)(void *, const char *, int), fpos_t (*seek)(void *, fpos_t, int), int (*close)(void *));