diff options
Diffstat (limited to 'src/cparse')
-rw-r--r-- | src/cparse/cparse.hpp | 1 | ||||
-rw-r--r-- | src/cparse/cparse.ypp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/cparse/cparse.hpp b/src/cparse/cparse.hpp index 5751d64..d359deb 100644 --- a/src/cparse/cparse.hpp +++ b/src/cparse/cparse.hpp @@ -23,6 +23,7 @@ namespace cparse { cnode::CfgNode *parse_file(FILE *fin, Cstore& cs); +cnode::CfgNode *parse_file(const char *fname, Cstore& cs); } // namespace cparse diff --git a/src/cparse/cparse.ypp b/src/cparse/cparse.ypp index b1958e9..aeecaf3 100644 --- a/src/cparse/cparse.ypp +++ b/src/cparse/cparse.ypp @@ -215,3 +215,13 @@ cparse::parse_file(FILE *fin, Cstore& cs) return cur_parent; } +CfgNode * +cparse::parse_file(const char *fname, Cstore& cs) +{ + FILE *fin = fopen(fname, "r"); + if (!fin) { + return NULL; + } + return parse_file(fin, cs); +} + |