renamed plugin_find/each to clixon_plugin_find/each

This commit is contained in:
Olof Hagsand 2018-04-08 14:10:06 +00:00
parent 2e00411621
commit 0907574acf
5 changed files with 41 additions and 31 deletions

View file

@ -106,7 +106,7 @@ clixon_plugin_reset(clicon_handle h,
plgreset_t *resetfn; /* Plugin auth */
int retval = 1;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((resetfn = cp->cp_api.ca_reset) == NULL)
continue;
if ((retval = resetfn(h, db)) < 0) {
@ -150,7 +150,7 @@ clixon_plugin_statedata(clicon_handle h,
clicon_err(OE_CFG, ENOENT, "XML tree expected");
goto done;
}
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_statedata) == NULL)
continue;
if ((x = xml_new("config", NULL, NULL)) == NULL)
@ -246,7 +246,7 @@ plugin_transaction_begin(clicon_handle h,
clixon_plugin *cp = NULL;
trans_cb_t *fn;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_trans_begin) == NULL)
continue;
if ((retval = fn(h, (transaction_data)td)) < 0){
@ -274,7 +274,7 @@ plugin_transaction_validate(clicon_handle h,
clixon_plugin *cp = NULL;
trans_cb_t *fn;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_trans_validate) == NULL)
continue;
if ((retval = fn(h, (transaction_data)td)) < 0){
@ -303,7 +303,7 @@ plugin_transaction_complete(clicon_handle h,
clixon_plugin *cp = NULL;
trans_cb_t *fn;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_trans_complete) == NULL)
continue;
if ((retval = fn(h, (transaction_data)td)) < 0){
@ -349,7 +349,7 @@ plugin_transaction_revert(clicon_handle h,
tr.td_scvec = td->td_tcvec;
tr.td_tcvec = td->td_scvec;
while ((cp = plugin_each_revert(h, cp, nr)) != NULL) {
while ((cp = clixon_plugin_each_revert(h, cp, nr)) != NULL) {
if ((fn = cp->cp_api.ca_trans_commit) == NULL)
continue;
if ((retval = fn(h, (transaction_data)td)) < 0){
@ -379,7 +379,7 @@ plugin_transaction_commit(clicon_handle h,
trans_cb_t *fn;
int i=0;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
i++;
if ((fn = cp->cp_api.ca_trans_commit) == NULL)
continue;
@ -409,7 +409,7 @@ plugin_transaction_end(clicon_handle h,
clixon_plugin *cp = NULL;
trans_cb_t *fn;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_trans_end) == NULL)
continue;
if ((retval = fn(h, (transaction_data)td)) < 0){
@ -436,7 +436,7 @@ plugin_transaction_abort(clicon_handle h,
clixon_plugin *cp = NULL;
trans_cb_t *fn;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_trans_abort) == NULL)
continue;
fn(h, (transaction_data)td); /* dont abort on error */

View file

@ -260,7 +260,7 @@ cli_load_syntax(clicon_handle h,
mode = cvec_find_str(cvv, "CLICON_MODE");
if (plgnam != NULL) { /* Find plugin for callback resolving */
if ((cp = plugin_find(h, plgnam)) != NULL)
if ((cp = clixon_plugin_find(h, plgnam)) != NULL)
handle = cp->cp_handle;
if (handle == NULL){
clicon_err(OE_PLUGIN, 0, "CLICON_PLUGIN set to '%s' in %s but plugin %s.so not found in %s\n",
@ -379,7 +379,7 @@ cli_syntax_load (clicon_handle h)
/* Set susp and interrupt callbacks into CLIgen */
cp = NULL;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (fns==NULL && (fns = cp->cp_api.ca_suspend) != NULL)
if (cli_susp_hook(h, fns) < 0)
goto done;
@ -589,7 +589,7 @@ clicon_cliread(clicon_handle h)
mode = stx->stx_active_mode;
/* Get prompt from plugin callback? */
cp = NULL;
while ((cp = plugin_each(h, cp)) != NULL) {
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((fn = cp->cp_api.ca_prompt) == NULL)
continue;
pfmt = fn(h, mode->csm_name);