Added nsc parameter to xmldb_get()

This commit is contained in:
Olof hagsand 2019-12-02 20:55:28 +01:00
parent 08b128f4d7
commit 46552066d1
5 changed files with 12 additions and 8 deletions

View file

@ -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