* Changed first parameter from int fd to FILE *f in the following functions:

* clixon_xml_parse_file(), clixon_json_parse_file(), yang_parse_file()
  * See [Bytewise read() of files is slow #146](https://github.com/clicon/clixon/issues/146)
This commit is contained in:
Olof hagsand 2020-11-04 22:21:42 +01:00
parent 7a0838da3a
commit c31b1c471b
21 changed files with 113 additions and 99 deletions

View file

@ -51,6 +51,6 @@ int xml2json_cb(FILE *f, cxobj *x, int pretty, clicon_output_cb *fn);
int json_print(FILE *f, cxobj *x);
int xml2json_vec(FILE *f, cxobj **vec, size_t veclen, int pretty);
int clixon_json_parse_string(char *str, yang_bind yb, yang_stmt *yspec, cxobj **xt, cxobj **xret);
int clixon_json_parse_file(int fd, yang_bind yb, yang_stmt *yspec, cxobj **xt, cxobj **xret);
int clixon_json_parse_file(FILE *fp, yang_bind yb, yang_stmt *yspec, cxobj **xt, cxobj **xret);
#endif /* _CLIXON_JSON_H */

View file

@ -50,7 +50,7 @@ int clicon_xml2cbuf(cbuf *cb, cxobj *x, int level, int prettyprint, int32_t dept
char *clicon_xml2str(cxobj *x);
int xmltree2cbuf(cbuf *cb, cxobj *x, int level);
int clixon_xml_parse_file(int fd, yang_bind yb, yang_stmt *yspec, char *endtag, cxobj **xt, cxobj **xerr);
int clixon_xml_parse_file(FILE *f, yang_bind yb, yang_stmt *yspec, char *endtag, cxobj **xt, cxobj **xerr);
int clixon_xml_parse_string(const char *str, yang_bind yb, yang_stmt *yspec, cxobj **xt, cxobj **xerr);
#if defined(__GNUC__) && __GNUC__ >= 3

View file

@ -51,7 +51,7 @@
/*
* Prototypes
*/
yang_stmt *yang_parse_file(int fd, const char *name, yang_stmt *ysp);
yang_stmt *yang_parse_file(FILE *fp, const char *name, yang_stmt *ysp);
yang_stmt *yang_parse_filename(const char *filename, yang_stmt *ysp);
int yang_spec_parse_module(clicon_handle h, const char *module,
const char *revision, yang_stmt *yspec);