Unified -status filtering decision

master
Thomas Schmitt 14 years ago
parent 146cfddf78
commit 359333effa
  1. 44
      xorriso/xorriso.c
  2. 2
      xorriso/xorriso_timestamp.h

@ -5569,12 +5569,26 @@ too_many_hops:;
}
int Xorriso_status_filter(struct XorrisO *xorriso, char *filter, char *line,
int flag)
{
if(filter!=NULL)
if(filter[0]=='-')
if(strncmp(filter, line, strlen(filter))!=0)
return(0);
return(1);
}
int Xorriso_status_result(struct XorrisO *xorriso, char *filter, FILE *fp,
int flag)
/*
bit1= do only report to fp
*/
{
#ifdef NIX
int ret,l;
if(filter!=NULL)
@ -5583,6 +5597,18 @@ bit1= do only report to fp
if(strncmp(filter,xorriso->result_line,l)!=0)
return(2);
}
#else
int ret;
ret= Xorriso_status_filter(xorriso, filter, xorriso->result_line, 0);
if(ret <= 0)
return(2);
#endif /* NIX */
if(!(flag&2))
Xorriso_result(xorriso,0);
if(fp!=NULL) {
@ -6339,10 +6365,11 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(xorriso->out_charset != NULL)
out_pt= xorriso->out_charset;
do_single= 0;
if(filter != NULL)
if(strncmp(filter, "-in_charset", 11) == 0 ||
strncmp(filter, "-out_charset", 12) == 0)
do_single= 1;
ret= Xorriso_status_filter(xorriso, filter, "-in_charset", 0);
if(ret <= 0)
ret= Xorriso_status_filter(xorriso, filter, "-out_charset", 0);
if(ret > 0)
do_single= 1;
if(strcmp(in_pt, out_pt) == 0 && !do_single) {
sprintf(line, "-charset %s\n", Text_shellsafe(in_pt, sfe, 0));
if(!(is_default && no_defaults))
@ -6410,10 +6437,11 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
}
do_single= 0;
if(filter != NULL)
if(strncmp(filter, "-indev", 6) == 0 ||
strncmp(filter, "-outdev", 7) == 0)
do_single= 1;
ret= Xorriso_status_filter(xorriso, filter, "-indev", 0);
if(ret <= 0)
ret= Xorriso_status_filter(xorriso, filter, "-outdev", 0);
if(ret > 0)
do_single= 1;
if(strcmp(xorriso->indev, xorriso->outdev) == 0 && !do_single) {
sprintf(line,"-dev %s\n", Text_shellsafe(xorriso->indev,sfe,0));
Xorriso_status_result(xorriso,filter,fp,flag&2);

@ -1 +1 @@
#define Xorriso_timestamP "2009.03.18.104037"
#define Xorriso_timestamP "2009.03.19.172806"

Loading…
Cancel
Save