Reinstated the distinction of message sources, respected # in dialog

This commit is contained in:
Thomas Schmitt 2007-10-17 15:01:49 +00:00
parent b1f99e5174
commit 7f002928d2
3 changed files with 22 additions and 6 deletions

View File

@ -2963,6 +2963,12 @@ int Xorriso_set_problem_status(struct XorrisO *xorriso, char *severity,
/* flag: /* flag:
bit0= for Xorriso_info() : use pager (as with result) bit0= for Xorriso_info() : use pager (as with result)
bit1= for Xorriso_info() : permission to suppress output bit1= for Xorriso_info() : permission to suppress output
bit2..5= name prefix
0="xorriso"
1="libisofs"
2="libburn"
3="libisoburn"
else: ""
*/ */
int Xorriso_msgs_submit(struct XorrisO *xorriso, int Xorriso_msgs_submit(struct XorrisO *xorriso,
int error_code, char msg_text[], int os_errno, int error_code, char msg_text[], int os_errno,
@ -2970,6 +2976,9 @@ int Xorriso_msgs_submit(struct XorrisO *xorriso,
{ {
int ret, lt, li, sev, i; int ret, lt, li, sev, i;
char *sev_text= "FATAL", prefix[80]; char *sev_text= "FATAL", prefix[80];
static char pfx_list[20][16]= {
"xorriso : ", "libisofs: ", "libburn : ", "libisoburn: ",
"", "", "", "", "", "", "", "", "", "", "", "" };
/* Set problem status */ /* Set problem status */
ret= Xorriso__text_to_sev(severity, &sev, 0); ret= Xorriso__text_to_sev(severity, &sev, 0);
@ -2986,7 +2995,7 @@ int Xorriso_msgs_submit(struct XorrisO *xorriso,
/* >>> need option with threshhold for message reporting */ /* >>> need option with threshhold for message reporting */
sprintf(prefix,"xorriso : %s : ", sev_text); sprintf(prefix,"%s%s : ", pfx_list[(flag>>2)&15], sev_text);
li= strlen(prefix); li= strlen(prefix);
lt= strlen(msg_text); lt= strlen(msg_text);
if(lt>sizeof(xorriso->info_text)-li-2) if(lt>sizeof(xorriso->info_text)-li-2)
@ -3004,8 +3013,8 @@ int Xorriso_msgs_submit(struct XorrisO *xorriso,
xorriso->info_text[li+lt+1]= 0; xorriso->info_text[li+lt+1]= 0;
Xorriso_info(xorriso,flag&3); Xorriso_info(xorriso,flag&3);
if(os_errno>0) { if(os_errno>0) {
sprintf(xorriso->info_text, "xorriso : system: %s (%d)\n", sprintf(xorriso->info_text, "%ssys : %s\n",
strerror(os_errno), os_errno); pfx_list[(flag>>2)&15], strerror(os_errno));
Xorriso_info(xorriso,flag&3); Xorriso_info(xorriso,flag&3);
} }
return(1); return(1);
@ -4388,7 +4397,10 @@ next_command:;
xorriso->prepended_wd= 0; xorriso->prepended_wd= 0;
xorriso->request_to_abort= 0; xorriso->request_to_abort= 0;
Xorriso_set_problem_status(xorriso, "", 0); Xorriso_set_problem_status(xorriso, "", 0);
if((*idx)<argc)
cmd= argv[*idx]; cmd= argv[*idx];
else
cmd= "";
(*idx)++; (*idx)++;
if((*idx)<argc) if((*idx)<argc)
@ -4726,6 +4738,10 @@ int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag)
ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4); ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(argc<2)
{ret= 1; goto ex;}
if(argv[1][0]=='#')
{ret= 1; goto ex;}
ret= Xorriso_interpreter(xorriso, argc, argv, &idx, flag&0xffff); ret= Xorriso_interpreter(xorriso, argc, argv, &idx, flag&0xffff);
if(ret<0) if(ret<0)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.10.17.130311" #define Xorriso_timestamP "2007.10.17.150142"

View File

@ -488,7 +488,7 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
if(ret<=0) if(ret<=0)
break; break;
Xorriso_msgs_submit(xorriso, error_code, xorriso->info_text, os_errno, Xorriso_msgs_submit(xorriso, error_code, xorriso->info_text, os_errno,
severity, 0); severity, (pass+1)<<2);
count++; count++;
} }
} }