common: add generic input-line interface, and an implementation of it for text files
This commit is contained in:
15
common/include/ivy/file.h
Normal file
15
common/include/ivy/file.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef IVY_COMMON_FILE_H_
|
||||
#define IVY_COMMON_FILE_H_
|
||||
|
||||
#include <ivy/line-source.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct ivy_file {
|
||||
struct ivy_line_source f_base;
|
||||
FILE *f_fp;
|
||||
};
|
||||
|
||||
extern struct ivy_file *ivy_file_from_fp(FILE *fp);
|
||||
extern void ivy_file_close(struct ivy_file *file);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user