Extended new command -named_pipe_loop by mode parameter
This commit is contained in:
@ -1091,17 +1091,43 @@ ex:;
|
||||
|
||||
|
||||
/* Option -named_pipe_loop */
|
||||
int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *stdin_pipe,
|
||||
char *stdout_pipe, char *stderr_pipe,
|
||||
int flag)
|
||||
int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode,
|
||||
char *stdin_pipe, char *stdout_pipe,
|
||||
char *stderr_pipe, int flag)
|
||||
{
|
||||
char *pipe_paths[3];
|
||||
int ret;
|
||||
char *pipe_paths[3], *cpt, *npt;
|
||||
int ret, hflag= 0, l;
|
||||
|
||||
npt= mode;
|
||||
for(cpt= mode; npt != NULL; cpt= npt + 1) {
|
||||
npt= strchr(cpt, ':');
|
||||
if(npt==NULL)
|
||||
l= strlen(cpt);
|
||||
else
|
||||
l= npt-cpt;
|
||||
if(l==0) {
|
||||
;
|
||||
} else if(strncmp(cpt, "-", l) == 0) {
|
||||
;
|
||||
} else if(strncmp(cpt, "cleanup", l) == 0) {
|
||||
hflag|= 1;
|
||||
} else if(strncmp(cpt, "keep", l) == 0) {
|
||||
hflag&= ~1;
|
||||
} else if(strncmp(cpt, "buffered", l) == 0) {
|
||||
hflag|= 2;
|
||||
} else if(strncmp(cpt, "direct", l) == 0) {
|
||||
hflag&= ~2;
|
||||
} else {
|
||||
sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'",
|
||||
mode);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
pipe_paths[0]= stdin_pipe;
|
||||
pipe_paths[1]= stdout_pipe;
|
||||
pipe_paths[2]= stderr_pipe;
|
||||
ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, 0);
|
||||
ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user