Added nsc parameter to xmldb_get()
This commit is contained in:
parent
08b128f4d7
commit
46552066d1
5 changed files with 12 additions and 8 deletions
|
|
@ -49,9 +49,9 @@ int xmldb_validate_db(const char *db);
|
|||
int xmldb_connect(clicon_handle h);
|
||||
int xmldb_disconnect(clicon_handle h);
|
||||
/* in clixon_datastore_read.[ch] */
|
||||
int xmldb_get(clicon_handle h, const char *db, char *xpath, cxobj **xtop);
|
||||
int xmldb_get(clicon_handle h, const char *db, cvec *nsc, char *xpath, cxobj **xtop);
|
||||
int xmldb_get0(clicon_handle h, const char *db,
|
||||
cvec *nc, char *xpath,
|
||||
cvec *nsc, char *xpath,
|
||||
int copy, cxobj **xtop, modstate_diff_t *msd);
|
||||
int xmldb_get0_clear(clicon_handle h, cxobj *x);
|
||||
int xmldb_get0_free(clicon_handle h, cxobj **xp);
|
||||
|
|
|
|||
|
|
@ -647,12 +647,13 @@ xmldb_get_zerocopy(clicon_handle h,
|
|||
/*! Get content of datastore and return a copy of the XML tree
|
||||
* @param[in] h Clicon handle
|
||||
* @param[in] db Name of database to search in (filename including dir path
|
||||
* @param[in] nsc XML namespace context for XPATH
|
||||
* @param[in] xpath String with XPATH syntax. or NULL for all
|
||||
* @param[out] xret Single return XML tree. Free with xml_free()
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
* @code
|
||||
* if (xmldb_get(xh, "running", "/interfaces/interface[name="eth"]", &xt) < 0)
|
||||
* if (xmldb_get(xh, "running", NULL, "/interfaces/interface[name="eth"]", &xt) < 0)
|
||||
* err;
|
||||
* xml_free(xt);
|
||||
* @endcode
|
||||
|
|
@ -661,10 +662,11 @@ xmldb_get_zerocopy(clicon_handle h,
|
|||
int
|
||||
xmldb_get(clicon_handle h,
|
||||
const char *db,
|
||||
cvec *nsc,
|
||||
char *xpath,
|
||||
cxobj **xret)
|
||||
{
|
||||
return xmldb_get0(h, db, NULL, xpath, 1, xret, NULL);
|
||||
return xmldb_get0(h, db, nsc, xpath, 1, xret, NULL);
|
||||
}
|
||||
|
||||
/*! Zero-copy variant of get content of database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue