enabled and removed USE_CLIGEN44

This commit is contained in:
Olof hagsand 2020-05-12 14:02:25 +02:00
parent ac1f36009f
commit 132122c937
8 changed files with 1 additions and 250 deletions

View file

@ -209,32 +209,6 @@ cli_signal_init (clicon_handle h)
* @retval -1
* @see cligen_loop
*/
#ifdef USE_CLIGEN44
static int
cli_interactive(clicon_handle h)
{
int retval = -1;
int res;
char *cmd;
char *new_mode;
int eval;
/* Loop through all commands */
while(!cligen_exiting(cli_cligen(h))) {
new_mode = cli_syntax_mode(h);
if ((cmd = clicon_cliread(h)) == NULL) {
cligen_exiting_set(cli_cligen(h), 1); /* EOF */
goto ok; /* EOF should not be -1 error? */
}
if ((res = clicon_parse(h, cmd, &new_mode, &eval)) < 0)
goto done;
}
ok:
retval = 0;
done:
return retval;
}
#else /* USE_CLIGEN44 */
static int
cli_interactive(clicon_handle h)
{
@ -261,7 +235,6 @@ cli_interactive(clicon_handle h)
done:
return retval;
}
#endif /* USE_CLIGEN44 */
static void
usage(clicon_handle h,
@ -633,15 +606,6 @@ main(int argc, char **argv)
/* Launch interfactive event loop, unless -1 */
if (restarg != NULL && strlen(restarg)){
char *mode = cli_syntax_mode(h);
#ifdef USE_CLIGEN44
int result;
/* */
if (clicon_parse(h, restarg, &mode, &result) != 1)
goto done;
if (result < 0)
goto done;
#else /* USE_CLIGEN44 */
cligen_result result; /* match result */
int evalresult = 0; /* if result == 1, calback result */
@ -651,7 +615,6 @@ main(int argc, char **argv)
goto done;
if (evalresult < 0)
goto done;
#endif /* USE_CLIGEN44 */
}
/* Go into event-loop unless -1 command-line */