Generic map_str2int generic mapping tables; Removed vector return values from xmldb_get()
This commit is contained in:
parent
bf30e6f66a
commit
abd3eee17d
29 changed files with 381 additions and 280 deletions
|
|
@ -655,9 +655,9 @@ compare_dbs(clicon_handle h,
|
|||
astext = cv_int32_get(cvec_i(argv, 0));
|
||||
else
|
||||
astext = 0;
|
||||
if (clicon_rpc_get_config(h, "running", "/", &xc1) < 0)
|
||||
if (clicon_rpc_get_config(h, "running", "/", 0, &xc1) < 0)
|
||||
goto done;
|
||||
if (clicon_rpc_get_config(h, "candidate", "/", &xc2) < 0)
|
||||
if (clicon_rpc_get_config(h, "candidate", "/", 0, &xc2) < 0)
|
||||
goto done;
|
||||
if (compare_xmls(xc1, xc2, astext) < 0) /* astext? */
|
||||
goto done;
|
||||
|
|
@ -823,7 +823,7 @@ save_config_file(clicon_handle h,
|
|||
goto done;
|
||||
}
|
||||
filename = cv_string_get(cv);
|
||||
if (clicon_rpc_get_config(h, dbstr,"/", &xt) < 0)
|
||||
if (clicon_rpc_get_config(h, dbstr,"/", 0, &xt) < 0)
|
||||
goto done;
|
||||
if ((f = fopen(filename, "wb")) == NULL){
|
||||
clicon_err(OE_CFG, errno, "Creating file %s", filename);
|
||||
|
|
@ -1162,7 +1162,7 @@ cli_copy_config(clicon_handle h,
|
|||
cprintf(cb, xpath, keyname, fromname);
|
||||
|
||||
/* Get from object configuration and store in x1 */
|
||||
if (clicon_rpc_get_config(h, db, cbuf_get(cb), &x1) < 0)
|
||||
if (clicon_rpc_get_config(h, db, cbuf_get(cb), 0, &x1) < 0)
|
||||
goto done;
|
||||
|
||||
/* Get to variable -> cv -> to name */
|
||||
|
|
|
|||
|
|
@ -657,7 +657,7 @@ clicon_parse(clicon_handle h,
|
|||
}
|
||||
res = cliread_parse(cli_cligen(h), cmd, pt, &match_obj, cvv);
|
||||
if (res != CG_MATCH)
|
||||
pt_expand_cleanup_1(pt);
|
||||
pt_expand_cleanup_1(pt); /* XXX change to pt_expand_treeref_cleanup */
|
||||
if (msav){
|
||||
cli_tree_active_set(h, msav);
|
||||
free(msav);
|
||||
|
|
@ -689,7 +689,7 @@ clicon_parse(clicon_handle h,
|
|||
}
|
||||
if ((r = clicon_eval(h, cmd, match_obj, cvv)) < 0)
|
||||
cli_handler_err(stdout);
|
||||
pt_expand_cleanup_1(pt);
|
||||
pt_expand_cleanup_1(pt); /* XXX change to pt_expand_treeref_cleanup */
|
||||
if (result)
|
||||
*result = r;
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ expand_dbvar(void *h,
|
|||
if (api_path_fmt2xpath(api_path, cvv, &xpath) < 0)
|
||||
goto done;
|
||||
/* XXX read whole configuration, why not send xpath? */
|
||||
if (clicon_rpc_get_config(h, dbstr, "/", &xt) < 0)
|
||||
if (clicon_rpc_get_config(h, dbstr, "/", 0, &xt) < 0)
|
||||
goto done;
|
||||
/* One round to detect duplicates
|
||||
* XXX The code below would benefit from some cleanup
|
||||
|
|
@ -426,7 +426,7 @@ cli_show_config(clicon_handle h,
|
|||
else
|
||||
cprintf(cbxpath, "%s", xpath);
|
||||
/* Get configuration from database */
|
||||
if (clicon_rpc_get_config(h, db, cbuf_get(cbxpath), &xt) < 0)
|
||||
if (clicon_rpc_get_config(h, db, cbuf_get(cbxpath), 0, &xt) < 0)
|
||||
goto done;
|
||||
/* Print configuration according to format */
|
||||
switch (format){
|
||||
|
|
@ -505,7 +505,7 @@ show_conf_xpath(clicon_handle h,
|
|||
}
|
||||
cv = cvec_find_var(cvv, "xpath");
|
||||
xpath = cv_string_get(cv);
|
||||
if (clicon_rpc_get_config(h, str, xpath, &xt) < 0)
|
||||
if (clicon_rpc_get_config(h, str, xpath, 0, &xt) < 0)
|
||||
goto done;
|
||||
if (xpath_vec(xt, xpath, &xv, &xlen) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue