Removed argc/argv parameters from ca_start plugin API function. You may need to change signatures of your startup in your plugins

This commit is contained in:
Olof hagsand 2019-03-28 17:11:55 +01:00
parent cdbce7645e
commit 60cb87f998
12 changed files with 72 additions and 96 deletions

View file

@ -163,23 +163,6 @@ backend_server_socket(clicon_handle h)
return ss;
}
/*! Call plugin_start with -- user options */
static int
plugin_start_useroptions(clicon_handle h,
char *argv0,
int argc,
char **argv)
{
char *tmp;
tmp = *(argv-1);
*(argv-1) = argv0;
if (clixon_plugin_start(h, argc+1, argv-1) < 0)
return -1;
*(argv-1) = tmp;
return 0;
}
/*! Load external NACM file
*/
static int
@ -726,7 +709,7 @@ main(int argc,
clicon_log(LOG_NOTICE, "%s: %u %s", __PROGRAM__, getpid(), cbuf_get(cbret));
/* Call backend plugin_start with user -- options */
if (plugin_start_useroptions(h, argv0, argc, argv) <0)
if (clixon_plugin_start(h) < 0)
goto done;
if (once)
goto done;

View file

@ -540,12 +540,9 @@ main(int argc, char **argv)
cligen_match_cgvar_same(1);
/* Call start function in all plugins before we go interactive
Pass all args after the standard options to plugin_start
*/
tmp = *(argv-1);
*(argv-1) = argv0;
clixon_plugin_start(h, argc+1, argv-1);
*(argv-1) = tmp;
if (clixon_plugin_start(h) < 0)
goto done;
cligen_line_scrolling_set(cli_cligen(h), clicon_option_int(h,"CLICON_CLI_LINESCROLLING"));
/*! Start CLI history and load from file */

View file

@ -350,7 +350,6 @@ main(int argc,
char **argv)
{
int c;
char *tmp;
char *argv0 = argv[0];
int quiet = 0;
clicon_handle h;
@ -511,10 +510,8 @@ main(int argc,
goto done;
/* Call start function is all plugins before we go interactive */
tmp = *(argv-1);
*(argv-1) = argv0;
clixon_plugin_start(h, argc+1, argv-1);
*(argv-1) = tmp;
if (clixon_plugin_start(h) < 0)
goto done;
if (!quiet)
send_hello(h, 1);

View file

@ -520,7 +520,6 @@ main(int argc,
char *path;
clicon_handle h;
char *dir;
char *tmp;
int logdst = CLICON_LOG_SYSLOG;
yang_spec *yspec = NULL;
yang_spec *yspecfg = NULL; /* For config XXX clixon bug */
@ -677,12 +676,9 @@ main(int argc,
yang_spec_parse_module(h, "clixon-rfc5277", NULL, yspec)< 0)
goto done;
/* Call start function in all plugins before we go interactive
Pass all args after the standard options to plugin_start
*/
tmp = *(argv-1);
*(argv-1) = argv0;
clixon_plugin_start(h, argc+1, argv-1);
*(argv-1) = tmp;
if (clixon_plugin_start(h) < 0)
goto done;
if ((sockpath = clicon_option_str(h, "CLICON_RESTCONF_PATH")) == NULL){
clicon_err(OE_CFG, errno, "No CLICON_RESTCONF_PATH in clixon configure file");