Changed the parameter rules for new command -launch_frontend

This commit is contained in:
2012-12-25 17:56:24 +00:00
parent cbb658991b
commit 88b4584ab2
10 changed files with 82 additions and 141 deletions

View File

@ -75,23 +75,29 @@ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag)
/* Command -launch_frontend */
int Xorriso_option_launch_frontend(struct XorrisO *xorriso, char *cmd,
char *cmd_pipe_adr, char *reply_pipe_adr, int flag)
int Xorriso_option_launch_frontend(struct XorrisO *xorriso,
int argc, char **argv, int *idx, int flag)
{
int ret;
int ret, end_idx;
xorriso->dialog= 2;
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1);
if(xorriso->launch_frontend_banned) {
sprintf(xorriso->info_text,
"-launch_frontend was already executed in this xorriso run");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
ret= 0; goto ex;
}
xorriso->launch_frontend_banned= 1;
if(cmd[0] == 0 && (cmd_pipe_adr[0] == 0 || reply_pipe_adr[0] == 0))
return(1);
ret= Xorriso_launch_frontend(xorriso, cmd, cmd_pipe_adr, reply_pipe_adr, 0);
if(end_idx <= *idx)
{ret= 1; goto ex;}
if(argv[*idx][0] == 0)
{ret= 1; goto ex;}
xorriso->dialog= 2;
ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx,
"", "", 0);
ex:;
(*idx)= end_idx;
return(ret);
}