Datastore cache introduced; Added yang to XML API

This commit is contained in:
Olof hagsand 2017-12-02 14:49:49 +01:00
parent c1cb3a2b6c
commit e169485985
34 changed files with 884 additions and 389 deletions

View file

@ -32,6 +32,8 @@
***** END LICENSE BLOCK *****
* XML support functions.
* @see https://www.w3.org/TR/2008/REC-xml-20081126
* https://www.w3.org/TR/2009/REC-xml-names-20091208/
*/
#ifndef _CLIXON_XML_H
#define _CLIXON_XML_H
@ -74,6 +76,11 @@ typedef int (xml_applyfn_t)(cxobj *yn, void *arg);
#define XML_FLAG_CHANGE 0x08 /* Node is changed (commits) or child changed rec */
#define XML_FLAG_NONE 0x10 /* Node is added as NONE */
/* Hash for XML trees list entries
* Experimental
*/
extern int xml_child_hash;
/*
* Prototypes
*/
@ -106,8 +113,7 @@ cxobj *xml_child_each(cxobj *xparent, cxobj *xprev, enum cxobj_type type);
cxobj **xml_childvec_get(cxobj *x);
int xml_childvec_set(cxobj *x, int len);
cxobj *xml_new(char *name, cxobj *xn_parent);
cxobj *xml_new_spec(char *name, cxobj *xn_parent, void *spec);
cxobj *xml_new(char *name, cxobj *xn_parent, void *spec);
void *xml_spec(cxobj *x);
void *xml_spec_set(cxobj *x, void *spec);
cxobj *xml_find(cxobj *xn_parent, char *name);
@ -130,14 +136,15 @@ int xml_free(cxobj *xn);
int xml_print(FILE *f, cxobj *xn);
int clicon_xml2file(FILE *f, cxobj *xn, int level, int prettyprint);
int clicon_xml2cbuf(cbuf *xf, cxobj *xn, int level, int prettyprint);
int clicon_xml_parse_file(int fd, cxobj **xml_top, char *endtag);
int clicon_xml_parse_file(int fd, char *endtag, yang_spec *yspec, cxobj **xt);
int clicon_xml_parse_str(char *str, yang_spec *yspec, cxobj **xml_top);
/* XXX obsolete */
#define clicon_xml_parse_string(str, x) clicon_xml_parse_str((*str), x)
int clicon_xml_parse_str(char *str, cxobj **xml_top);
int clicon_xml_parse(cxobj **cxtop, char *format, ...);
int xml_parse(char *str, cxobj *x_up);
#define clicon_xml_parse_string(str, x) clicon_xml_parse_str((*str), NULL, x)
int clicon_xml_parse(cxobj **cxtop, yang_spec *yspec, char *format, ...);
int xml_parse(char *str, yang_spec *yspec, cxobj *xt);
int xmltree2cbuf(cbuf *cb, cxobj *x, int level);
int xml_copy_one(cxobj *xn0, cxobj *xn1);
int xml_copy(cxobj *x0, cxobj *x1);
cxobj *xml_dup(cxobj *x0);
@ -152,12 +159,13 @@ int xml_body_int32(cxobj *xb, int32_t *val);
int xml_body_uint32(cxobj *xb, uint32_t *val);
int xml_operation(char *opstr, enum operation_type *op);
char *xml_operation2str(enum operation_type op);
#if (XML_CHILD_HASH==1)
int xml_child_spec(char *name, cxobj *xp, yang_spec *yspec, yang_stmt **yp);
clicon_hash_t *xml_hash(cxobj *x);
int xml_hash_init(cxobj *x);
int xml_hash_rm(cxobj *x);
int xml_hash_key(cxobj *x, yang_stmt *y, cbuf *key);
int xml_hash_op(cxobj *x, void *arg);
#endif
int xml_hash_add(cxobj *x);
int xml_hash_rm_only(cxobj *x);
int xml_hash_rm_entry(cxobj *x);
#endif /* _CLIXON_XML_H */