Lines 22-29
Link Here
|
22 |
static void basic_close(int *handle); |
22 |
static void basic_close(int *handle); |
23 |
static int basic_read(int *handle, char *buf, int len); |
23 |
static int basic_read(int *handle, char *buf, int len); |
24 |
|
24 |
|
25 |
static void file_close(struct file_handle *handle); |
25 |
static void file_close(struct afile_handle *handle); |
26 |
static int file_read(struct file_handle *handle, char *buf, int len); |
26 |
static int file_read(struct afile_handle *handle, char *buf, int len); |
27 |
|
27 |
|
28 |
static int str_read(Str handle, char *buf, int len); |
28 |
static int str_read(Str handle, char *buf, int len); |
29 |
|
29 |
|
Lines 114-120
Link Here
|
114 |
stream = New(union input_stream); |
114 |
stream = New(union input_stream); |
115 |
init_base_stream(&stream->base, STREAM_BUF_SIZE); |
115 |
init_base_stream(&stream->base, STREAM_BUF_SIZE); |
116 |
stream->file.type = IST_FILE; |
116 |
stream->file.type = IST_FILE; |
117 |
stream->file.handle = New(struct file_handle); |
117 |
stream->file.handle = New(struct afile_handle); |
118 |
stream->file.handle->f = f; |
118 |
stream->file.handle->f = f; |
119 |
if (closep) |
119 |
if (closep) |
120 |
stream->file.handle->close = closep; |
120 |
stream->file.handle->close = closep; |
Lines 658-670
Link Here
|
658 |
} |
658 |
} |
659 |
|
659 |
|
660 |
static void |
660 |
static void |
661 |
file_close(struct file_handle *handle) |
661 |
file_close(struct afile_handle *handle) |
662 |
{ |
662 |
{ |
663 |
handle->close(handle->f); |
663 |
handle->close(handle->f); |
664 |
} |
664 |
} |
665 |
|
665 |
|
666 |
static int |
666 |
static int |
667 |
file_read(struct file_handle *handle, char *buf, int len) |
667 |
file_read(struct afile_handle *handle, char *buf, int len) |
668 |
{ |
668 |
{ |
669 |
return fread(buf, 1, len, handle->f); |
669 |
return fread(buf, 1, len, handle->f); |
670 |
} |
670 |
} |