Enabled a pacifier for compare_r

This commit is contained in:
Thomas Schmitt 2008-05-15 09:20:05 +00:00
parent fe3e1cc9f0
commit e2e793ed4b
2 changed files with 18 additions and 8 deletions

View File

@ -3236,6 +3236,7 @@ int Xorriso_pacifier_reset(struct XorrisO *xorriso, int flag)
Ignored if "". Ignored if "".
@param flag bit0= report unconditionally, no time check @param flag bit0= report unconditionally, no time check
bit1= report count <=0 (no thank you for being patient then) bit1= report count <=0 (no thank you for being patient then)
bit6= report with carriage return rather than line feed
*/ */
int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done, int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
off_t count, off_t todo, char *current_object, off_t count, off_t todo, char *current_object,
@ -3260,8 +3261,8 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
sprintf(count_text, "%.f", (double) count); sprintf(count_text, "%.f", (double) count);
else else
Sfile_scale((double) count, count_text, 7, 1e5, 1); Sfile_scale((double) count, count_text, 7, 1e5, 1);
sprintf(xorriso->info_text, sprintf(xorriso->info_text, "%s %s in %.f %s",
"%s %s in %.f seconds", count_text, what_done, since); count_text, what_done, since, (flag&64) ? "s" : "seconds");
} else { } else {
sprintf(xorriso->info_text, "%.f of %.f %s in %.f seconds", sprintf(xorriso->info_text, "%.f of %.f %s in %.f seconds",
(double) count, (double) todo, what_done, since); (double) count, (double) todo, what_done, since);
@ -3269,7 +3270,7 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
if(current_object[0]!=0) if(current_object[0]!=0)
sprintf(xorriso->info_text+strlen(xorriso->info_text), sprintf(xorriso->info_text+strlen(xorriso->info_text),
", now at %s", current_object); ", now at %s", current_object);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", (flag&64));
return(1); return(1);
} }
@ -4305,8 +4306,12 @@ cannot_address:;
} }
if(!(flag&(1<<29))) { if(!(flag&(1<<29))) {
xorriso->pacifier_count+= r1; xorriso->pacifier_count+= r1;
Xorriso_pacifier_callback(xorriso, "content bytes read", if(flag&(1<<31))
xorriso->pacifier_count, 0, "", 0); Xorriso_pacifier_callback(xorriso, "content bytes read",
xorriso->pacifier_count, 0, "", 0);
else
Xorriso_pacifier_callback(xorriso, "bytes", xorriso->pacifier_count, 0,
"", 1<<6);
} }
} }
if(diffcount>0 || r1count!=r2count) { if(diffcount>0 || r1count!=r2count) {
@ -4623,7 +4628,8 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
follow_links= (xorriso->do_follow_links || follow_links= (xorriso->do_follow_links ||
(xorriso->do_follow_param && !(flag&2))) <<28; (xorriso->do_follow_param && !(flag&2))) <<28;
ret= Xorriso_compare_2_files(xorriso, disk_path, iso_path, adrc, &result, ret= Xorriso_compare_2_files(xorriso, disk_path, iso_path, adrc, &result,
2 | follow_links | ((!(flag&2))<<27) | ((!(flag&1))<<29) | ((flag&1)<<31)); 2 | follow_links | ((!(flag&2))<<27) | ((flag&1)<<31));
/* was once: | ((!(flag&1))<<29) */
if(ret<xorriso->find_compare_result) if(ret<xorriso->find_compare_result)
xorriso->find_compare_result= ret; xorriso->find_compare_result= ret;
if(flag&1) { if(flag&1) {
@ -5297,6 +5303,7 @@ int Xorriso_process_errfile(struct XorrisO *xorriso,
2="libburn" 2="libburn"
3="libisoburn" 3="libisoburn"
else: "" else: ""
bit6= append carriage return rather than line feed (if not os_errno)
*/ */
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,
@ -5343,7 +5350,10 @@ int Xorriso_msgs_submit(struct XorrisO *xorriso,
strcpy(xorriso->info_text, prefix); strcpy(xorriso->info_text, prefix);
strncpy(xorriso->info_text+li, msg_text, lt); strncpy(xorriso->info_text+li, msg_text, lt);
} }
xorriso->info_text[li+lt]= '\n'; if((flag&64) && os_errno<=0)
xorriso->info_text[li+lt]= '\r';
else
xorriso->info_text[li+lt]= '\n';
xorriso->info_text[li+lt+1]= 0; xorriso->info_text[li+lt+1]= 0;
Xorriso_info(xorriso,4|(flag&3)); Xorriso_info(xorriso,4|(flag&3));
if(os_errno>0) { if(os_errno>0) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.14.174846" #define Xorriso_timestamP "2008.05.15.092028"