* JSON parse and print improvements

* Integrated parsing with namespace translation and yang spec lookup
This commit is contained in:
Olof hagsand 2019-06-03 16:40:54 +02:00
parent 18ab5e7dfe
commit 2aeb925521
15 changed files with 396 additions and 258 deletions

View file

@ -42,9 +42,9 @@
int xml2json_cbuf(cbuf *cb, cxobj *x, int pretty);
int xml2json_cbuf_vec(cbuf *cb, cxobj **vec, size_t veclen, int pretty);
int xml2json(FILE *f, cxobj *x, int pretty);
int json_print(FILE *f, cxobj *x);
int xml2json_vec(FILE *f, cxobj **vec, size_t veclen, int pretty);
int json2xml_ns(yang_stmt *yspec, cxobj *x, cxobj **xerr);
int json_parse_str(char *str, cxobj **xt);
int json_parse_file(int fd, yang_stmt *yspec, cxobj **xt);
int json_parse_str(char *str, yang_stmt *yspec, cxobj **xt, cxobj **xret);
int json_parse_file(int fd, yang_stmt *yspec, cxobj **xt, cxobj **xret);
#endif /* _CLIXON_JSON_H */

View file

@ -186,6 +186,7 @@ int yang_print_cbuf(cbuf *cb, yang_stmt *yn, int marginal);
int if_feature(yang_stmt *yspec, char *module, char *feature);
int ys_populate(yang_stmt *ys, void *arg);
yang_stmt *yang_parse_file(int fd, const char *name, yang_stmt *ysp);
yang_stmt *yang_parse_filename(const char *filename, yang_stmt *ysp);
int yang_apply(yang_stmt *yn, enum rfc_6020 key, yang_applyfn_t fn,
void *arg);
int yang_datanode(yang_stmt *ys);

View file

@ -71,6 +71,7 @@ int yang_type_resolve(yang_stmt *yorig, yang_stmt *ys,
yang_stmt **restype, int *options,
cvec **cvv, cvec *patterns, cvec *regexps,
uint8_t *fraction);
enum cv_type yang_type2cv(yang_stmt *ys);
#endif /* _CLIXON_YANG_TYPE_H_ */