New options -print_info and -print_mark

This commit is contained in:
Thomas Schmitt 2011-04-03 09:46:16 +00:00
parent 1764745ff3
commit 0280efe997
8 changed files with 128 additions and 53 deletions

View File

@ -1927,6 +1927,10 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" prevents reading and interpretation of startup files.",
" -print text",
" Print a text to result channel.",
" -print_info text",
" Print a text to info channel.",
" -print_mark text",
" Print a text to mark channel.",
" -prompt text",
" Wait for Enter key resp. for a line of input at stdin.",
" -errfile_log mode path|channel",

View File

@ -246,11 +246,38 @@ int Xorriso_option_preparer_id(struct XorrisO *xorriso, char *name, int flag)
}
/* Option -print */
/* Options -print , -print_info , -print_mark */
/* @param flag bit0-1= channel: 0=result, 1=info, 2=mark */
int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag)
{
sprintf(xorriso->result_line,"%s\n",text);
Xorriso_result(xorriso,1);
int maxl, l, mode;
l= strlen(text);
mode= flag & 3;
if(mode == 1)
maxl= sizeof(xorriso->info_text);
else if(mode == 2)
maxl= sizeof(xorriso->mark_text);
else
maxl= sizeof(xorriso->result_line);
if(l >= maxl) {
sprintf(xorriso->info_text, "Output text too long for -print%s(%d > %d)",
mode == 1 ? "_info" : mode == 2 ? "_mark" : "", l, maxl);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(0);
}
if(mode == 1) {
sprintf(xorriso->info_text,"%s\n", text);
Xorriso_info(xorriso,0);
} else if(mode == 2) {
strcpy(xorriso->info_text, xorriso->mark_text);
strcpy(xorriso->mark_text, text);
Xorriso_mark(xorriso,0);
strcpy(xorriso->mark_text, xorriso->info_text);
} else {
sprintf(xorriso->result_line,"%s\n",text);
Xorriso_result(xorriso,1);
}
return(1);
}

View File

@ -468,7 +468,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"mark","md5","mount_opts","not_leaf","not_list","not_mgt",
"options_from_file","osirrox","outdev","out_charset","overwrite",
"pacifier","padding","path_list","pathspecs","pkt_output",
"preparer_id","print","prompt",
"preparer_id","print","print_info","print_mark","prompt",
"prog","prog_help","publisher","quoted_not_list","quoted_path_list",
"reassure","report_about","rom_toc_scan","scsi_log",
"session_log","speed","split_size","status","status_history_max",
@ -1157,6 +1157,14 @@ next_command:;
(*idx)++;
ret= Xorriso_option_print(xorriso, arg1, 0);
} else if(strcmp(cmd,"print_info")==0) {
(*idx)++;
ret= Xorriso_option_print(xorriso, arg1, 1);
} else if(strcmp(cmd,"print_mark")==0) {
(*idx)++;
ret= Xorriso_option_print(xorriso, arg1, 2);
} else if(strcmp(cmd,"print_size")==0) {
Xorriso_option_print_size(xorriso, 0);

View File

@ -3884,7 +3884,14 @@ restoring of hard links.
Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB.
.TP
\fB\-print\fR text
Print a text to result channel.
Print a text line to the result channel which is by default stdout.
.TP
\fB\-print_info\fR text
Print a text line to the info channel which is by default stderr.
.TP
\fB\-print_mark\fR text
Print a text line to the mark channel which is by default directed to both,
result and info channel. An empty text will cause no output at all.
.TP
\fB\-prompt\fR text
Show text at beginning of output line and

View File

@ -1048,7 +1048,12 @@ int Xorriso_option_pkt_output(struct XorrisO *xorriso, char *mode, int flag);
/* @since 0.6.2 */
int Xorriso_option_preparer_id(struct XorrisO *xorriso, char *name, int flag);
/* Option -print */
/* Options -print, -print_info , -print_mark */
/* @param flag bit0-1= output channel:
0= result channel
1= info channel @since 1.0.6
2= mark channel @since 1.0.6
*/
int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag);
/* Option -print_size

View File

@ -3431,7 +3431,15 @@ File: xorriso.info, Node: Scripting, Next: Frontend, Prev: Emulation, Up: Op
GiB.
-print text
Print a text to result channel.
Print a text line to the result channel which is by default stdout.
-print_info text
Print a text line to the info channel which is by default stderr.
-print_mark text
Print a text line to the mark channel which is by default directed
to both, result and info channel. An empty text will cause no
output at all.
-prompt text
Show text at beginning of output line and wait for the user to hit
@ -4098,7 +4106,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
[index]
* Menu:
* # starts a comment line: Scripting. (line 132)
* # starts a comment line: Scripting. (line 140)
* -abort_on controls abort on error: Exception. (line 27)
* -abstract_file sets abstract file name: SetWrite. (line 160)
* -acl controls handling of ACLs: Loading. (line 142)
@ -4163,8 +4171,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -dvd_obs set write block size: SetWrite. (line 238)
* -early_stdio_test classifies stdio drives: Loading. (line 251)
* -eject ejects drive tray: Writing. (line 36)
* -end writes pending session and ends program: Scripting. (line 126)
* -errfile_log logs problematic disk files: Scripting. (line 88)
* -end writes pending session and ends program: Scripting. (line 134)
* -errfile_log logs problematic disk files: Scripting. (line 96)
* -error_behavior controls error workarounds: Exception. (line 69)
* -external_filter registers data filter: Filter. (line 20)
* -external_filter unregisters data filter: Filter. (line 48)
@ -4236,11 +4244,13 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -pathspecs sets meaning of = with -add: SetInsert. (line 118)
* -pkt_output consolidates text output: Frontend. (line 7)
* -preparer_id sets preparer id: SetWrite. (line 173)
* -print prints text line: Scripting. (line 81)
* -print prints result text line: Scripting. (line 81)
* -print_info prints message text line: Scripting. (line 84)
* -print_mark prints synchronizing text line: Scripting. (line 87)
* -print_size predicts image size: Inquiry. (line 69)
* -prog sets program name: Frontend. (line 30)
* -prog_help prints help text: Frontend. (line 33)
* -prompt prompts for enter key: Scripting. (line 84)
* -prompt prompts for enter key: Scripting. (line 92)
* -publisher sets publisher id: SetWrite. (line 113)
* -pvd_info shows image id strings: Inquiry. (line 82)
* -pwd tells working directory in ISO: Navigate. (line 20)
@ -4256,11 +4266,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -rm_r deletes trees from ISO image: Manip. (line 28)
* -rmdir deletes ISO directory: Manip. (line 32)
* -rollback discards pending changes: Writing. (line 9)
* -rollback_end ends program without writing: Scripting. (line 129)
* -rollback_end ends program without writing: Scripting. (line 137)
* -rom_toc_scan searches for sessions: Loading. (line 210)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 168)
* -scsi_log reports SCSI commands: Scripting. (line 117)
* -session_log logs written sessions: Scripting. (line 108)
* -scsi_log reports SCSI commands: Scripting. (line 125)
* -session_log logs written sessions: Scripting. (line 116)
* -session_string composes session info line: Inquiry. (line 56)
* -set_filter applies filter to file: Filter. (line 59)
* -set_filter_r applies filter to file tree: Filter. (line 84)
@ -4327,7 +4337,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Character set, learn from image, -auto_charset: Loading. (line 99)
* Character Set, of terminal, -local_charset: Charset. (line 47)
* Closed media, _definition: Media. (line 43)
* Comment, #: Scripting. (line 132)
* Comment, #: Scripting. (line 140)
* Create, new ISO image, _definiton: Methods. (line 6)
* Cylinder alignment, _definiton: Bootable. (line 169)
* Cylinder size, _definiton: Bootable. (line 158)
@ -4355,7 +4365,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, get drive list, -devices: Inquiry. (line 7)
* Drive, list supported media, -list_profiles: Writing. (line 119)
* Drive, reduce activity, -calm_drive: Loading. (line 235)
* Drive, report SCSI commands, -scsi_log: Scripting. (line 117)
* Drive, report SCSI commands, -scsi_log: Scripting. (line 125)
* Drive, write and eject, -commit_eject: Writing. (line 40)
* El Torito, _definiton: Extras. (line 19)
* Emulation, -as: Emulation. (line 13)
@ -4464,21 +4474,24 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Process, control exit value, -return_with: Exception. (line 39)
* Process, control verbosity, -report_about: Exception. (line 55)
* Process, disable startup files, -no_rc: Scripting. (line 7)
* Process, end program and write, -end: Scripting. (line 126)
* Process, end program, no writing, -rollback_end: Scripting. (line 129)
* Process, end program and write, -end: Scripting. (line 134)
* Process, end program, no writing, -rollback_end: Scripting. (line 137)
* Process, error workarounds, -error_behavior: Exception. (line 69)
* Process, log output channels to file, -logfile: Frontend. (line 20)
* Process, read command file, -options_from_file: Scripting. (line 12)
* Process, set synchronizing message, -mark: Frontend. (line 25)
* Program, backslash conversion, -backslash_codes: Scripting. (line 49)
* Program, curb memory, -temp_mem_limit: Scripting. (line 74)
* Program, end and write, -end: Scripting. (line 126)
* Program, end without writing, -rollback_end: Scripting. (line 129)
* Program, end and write, -end: Scripting. (line 134)
* Program, end without writing, -rollback_end: Scripting. (line 137)
* Program, print help text, -help: Scripting. (line 20)
* Program, print help text, -prog_help: Frontend. (line 33)
* Program, print text line, -print: Scripting. (line 81)
* Program, print message text line, -print_info: Scripting. (line 84)
* Program, print result text line, -print: Scripting. (line 81)
* Program, print synchronizing text line, -print_mark: Scripting.
(line 87)
* Program, print version, -version: Scripting. (line 23)
* Program, prompt for enter key, -prompt: Scripting. (line 84)
* Program, prompt for enter key, -prompt: Scripting. (line 92)
* Program, replace --, -list_delimiter: Scripting. (line 42)
* Program, set name, -prog: Frontend. (line 30)
* Program, show current settings, -status: Scripting. (line 29)
@ -4500,7 +4513,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Session, altered start address, -displacement: Loading. (line 35)
* Session, info string, -session_string: Inquiry. (line 56)
* Session, issue mount command, -mount: Restore. (line 122)
* Session, log when written, -session_log: Scripting. (line 108)
* Session, log when written, -session_log: Scripting. (line 116)
* Session, mount command line, -mount_cmd: Inquiry. (line 31)
* Session, mount parameters, -mount_opts: Inquiry. (line 47)
* Session, select as input, -load: Loading. (line 11)
@ -4529,8 +4542,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Write, enable Joliet, -joliet: SetWrite. (line 10)
* Write, fifo size, -fs: SetWrite. (line 255)
* Write, free space, -tell_media_space: Inquiry. (line 78)
* Write, log problematic disk files, -errfile_log: Scripting. (line 88)
* Write, log written sessions, -session_log: Scripting. (line 108)
* Write, log problematic disk files, -errfile_log: Scripting. (line 96)
* Write, log written sessions, -session_log: Scripting. (line 116)
* Write, padding image, -padding: SetWrite. (line 268)
* Write, pending ISO image, -commit: Writing. (line 13)
* Write, predict image size, -print_size: Inquiry. (line 69)
@ -4577,28 +4590,28 @@ Node: Verify144640
Node: Restore153229
Node: Emulation159885
Node: Scripting169721
Node: Frontend175557
Node: Examples176852
Node: ExDevices178021
Node: ExCreate178655
Node: ExDialog179929
Node: ExGrowing181191
Node: ExModifying181993
Node: ExBootable182494
Node: ExCharset183041
Node: ExPseudo183869
Node: ExCdrecord184763
Node: ExMkisofs185078
Node: ExGrowisofs186414
Node: ExException187538
Node: ExTime187992
Node: ExIncBackup188451
Node: ExRestore192372
Node: ExRecovery193341
Node: Files193907
Node: Seealso195197
Node: Legal195777
Node: CommandIdx196699
Node: ConceptIdx211079
Node: Frontend175861
Node: Examples177156
Node: ExDevices178325
Node: ExCreate178959
Node: ExDialog180233
Node: ExGrowing181495
Node: ExModifying182297
Node: ExBootable182798
Node: ExCharset183345
Node: ExPseudo184173
Node: ExCdrecord185067
Node: ExMkisofs185382
Node: ExGrowisofs186718
Node: ExException187842
Node: ExTime188296
Node: ExIncBackup188755
Node: ExRestore192676
Node: ExRecovery193645
Node: Files194211
Node: Seealso195501
Node: Legal196081
Node: CommandIdx197003
Node: ConceptIdx211529

End Tag Table

View File

@ -4577,9 +4577,20 @@ restoring of hard links.
Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB.
@c man .TP
@item -print text
@kindex -print prints text line
@cindex Program, print text line, -print
Print a text to result channel.
@kindex -print prints result text line
@cindex Program, print result text line, -print
Print a text line to the result channel which is by default stdout.
@c man .TP
@item -print_info text
@kindex -print_info prints message text line
@cindex Program, print message text line, -print_info
Print a text line to the info channel which is by default stderr.
@c man .TP
@item -print_mark text
@kindex -print_mark prints synchronizing text line
@cindex Program, print synchronizing text line, -print_mark
Print a text line to the mark channel which is by default directed to both,
result and info channel. An empty text will cause no output at all.
@c man .TP
@item -prompt text
@kindex -prompt prompts for enter key

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.04.01.133116"
#define Xorriso_timestamP "2011.04.03.094634"