4 * stream.c --manage stream
6 * Copyright(C) 2013(Heisei 25) ttwilb All rights reserved.
8 * This source code is released on the BSD licensing.
12 struct StreamInfo open_stream_file(char fname[FILENAME_MAX])
14 struct StreamInfo res;
15 strcpy(res.file.filename, fname);
16 res.file.fp = fopen(fname, "r");
17 res.type = STREAM_FILE;
21 void close_stream(struct StreamInfo info)
23 if(info.type == STREAM_FILE)
27 char stream_nextchar(struct StreamInfo info)
29 if(info.type == STREAM_FILE)
30 return (getc(info.file.fp));