New -msg_op opcodes "compare_sev" and "list_sev"

This commit is contained in:
Thomas Schmitt 2012-12-15 09:31:41 +00:00
parent d02501c16e
commit c4f476b1b4
6 changed files with 96 additions and 32 deletions

View File

@ -2078,9 +2078,10 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" packet payload. Example of a info message with newline:",
" I:1: enter option text :",
" -pkt_output:on is intended for use by frontend programs.",
" -msg_op \"start_sieve\"|\"read_sieve\"|\"clear_sieve\"|\"end_sieve\"|\"parse\"",
" -msg_op \"start_sieve\"|\"read_sieve\"|\"clear_sieve\"|\"end_sieve\"|",
" \"parse\"|\"compare_sev\"|\"list_sev\"",
" Enable, use, or disable message sieve. Or parse line into",
" words.",
" words. Or compare or list severity names.",
" -logfile channel fileaddress Copy output of a channel to the given file.",
" channel may be 'R','I','M' as with -pkt_output or '.'",
" for the consolidated -pkt_output stream.",

View File

@ -963,6 +963,21 @@ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg,
}
xorriso->msg_sieve_disabled= msd_mem;
Xorriso__dispose_words(&pargc, &pargv);
} else if(strcmp(what, "compare_sev") == 0) {
ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0);
if(argc < 2) {
sprintf(xorriso->info_text,
"-msg_op cmp_sev: malformed severity pair '%s'", arg);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
} else {
ret= Xorriso__severity_cmp(argv[0], argv[1]);
sprintf(xorriso->result_line, "%d\n", ret);
Xorriso_result(xorriso, 1);
}
Xorriso__dispose_words(&argc, &argv);
} else if(strcmp(what, "list_sev") == 0) {
sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0));
Xorriso_result(xorriso, 1);
} else {
sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.2.5, Dec 13, 2012"
.TH XORRISO 1 "Version 1.2.5, Dec 14, 2012"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -4552,6 +4552,24 @@ The next line tells the number of strings. Each string begins by a line that
tells the number of lines of the string. Then follow these lines. They are to
be concatenated with a newline character inbetween each of them.
.br
\fBcompare_sev\fR
.br
The parameter_text should contain two comma separated severity texts as
issued by this program. Like "SORRY,UPDATE". See also paragraph
"Exception processing".
.br
These two severity texts get compared and a number gets printed
to the result channel. This number is 0 if both severities are equal.
It is \-1 if the first severity is lower than the second one.
It is 1 is the first severity is higher than the second one.
.br
Above example "SORRY,UPDATE" will yield 1.
.br
\fBlist_sev\fR
.br
Print to the result channel a blank separated list of all severity names.
Sorted from low to high severity.
.br
.TP
\fB\-prog\fR text
Use text as name of this program in subsequent messages

View File

@ -3988,6 +3988,18 @@ File: xorriso.info, Node: Frontend, Next: ExDevices, Prev: Scripting, Up: Co
number of strings. Each string begins by a line that tells the
number of lines of the string. Then follow these lines. They are to
be concatenated with a newline character inbetween each of them.
*compare_sev*
The parameter_text should contain two comma separated severity
texts as issued by this program. Like "SORRY,UPDATE". See also
paragraph "Exception processing".
These two severity texts get compared and a number gets printed to
the result channel. This number is 0 if both severities are equal.
It is -1 if the first severity is lower than the second one. It
is 1 is the first severity is higher than the second one.
Above example "SORRY,UPDATE" will yield 1.
*list_sev*
Print to the result channel a blank separated list of all severity
names. Sorted from low to high severity.
-prog text
Use text as name of this program in subsequent messages
@ -4750,8 +4762,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -print_info prints message text line: Scripting. (line 102)
* -print_mark prints synchronizing text line: Scripting. (line 105)
* -print_size predicts image size: Inquiry. (line 89)
* -prog sets program name: Frontend. (line 89)
* -prog_help prints help text: Frontend. (line 92)
* -prog sets program name: Frontend. (line 101)
* -prog_help prints help text: Frontend. (line 104)
* -prompt prompts for enter key: Scripting. (line 110)
* -publisher sets publisher id: SetWrite. (line 186)
* -pvd_info shows image id strings: Inquiry. (line 102)
@ -5021,7 +5033,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Program, end without writing, -rollback_end: Scripting. (line 159)
* Program, list extra features, -list_extras: Scripting. (line 26)
* Program, print help text, -help: Scripting. (line 20)
* Program, print help text, -prog_help: Frontend. (line 92)
* Program, print help text, -prog_help: Frontend. (line 104)
* Program, print message text line, -print_info: Scripting. (line 102)
* Program, print result text line, -print: Scripting. (line 99)
* Program, print synchronizing text line, -print_mark: Scripting.
@ -5029,7 +5041,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Program, print version, -version: Scripting. (line 23)
* Program, prompt for enter key, -prompt: Scripting. (line 110)
* Program, replace --, -list_delimiter: Scripting. (line 60)
* Program, set name, -prog: Frontend. (line 89)
* Program, set name, -prog: Frontend. (line 101)
* Program, show current settings, -status: Scripting. (line 47)
* Program, status history, -status_history_max: Scripting. (line 56)
* Program, wait a time span, -sleep: Scripting. (line 114)
@ -5135,28 +5147,28 @@ Node: Restore174640
Node: Emulation181550
Node: Scripting191362
Node: Frontend198523
Node: Examples203117
Node: ExDevices204295
Node: ExCreate204954
Node: ExDialog206239
Node: ExGrowing207504
Node: ExModifying208309
Node: ExBootable208813
Node: ExCharset209365
Node: ExPseudo210186
Node: ExCdrecord211084
Node: ExMkisofs211401
Node: ExGrowisofs212741
Node: ExException213876
Node: ExTime214330
Node: ExIncBackup214789
Node: ExRestore218781
Node: ExRecovery219741
Node: Files220311
Node: Seealso221610
Node: Bugreport222333
Node: Legal222914
Node: CommandIdx223925
Node: ConceptIdx240016
Node: Examples203771
Node: ExDevices204949
Node: ExCreate205608
Node: ExDialog206893
Node: ExGrowing208158
Node: ExModifying208963
Node: ExBootable209467
Node: ExCharset210019
Node: ExPseudo210840
Node: ExCdrecord211738
Node: ExMkisofs212055
Node: ExGrowisofs213395
Node: ExException214530
Node: ExTime214984
Node: ExIncBackup215443
Node: ExRestore219435
Node: ExRecovery220395
Node: Files220965
Node: Seealso222264
Node: Bugreport222987
Node: Legal223568
Node: CommandIdx224579
Node: ConceptIdx240670

End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.2.5, Dec 13, 2012"
@c man .TH XORRISO 1 "Version 1.2.5, Dec 14, 2012"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -5338,6 +5338,24 @@ The next line tells the number of strings. Each string begins by a line that
tells the number of lines of the string. Then follow these lines. They are to
be concatenated with a newline character inbetween each of them.
@*
@strong{compare_sev}
@*
The parameter_text should contain two comma separated severity texts as
issued by this program. Like "SORRY,UPDATE". See also paragraph
"Exception processing".
@*
These two severity texts get compared and a number gets printed
to the result channel. This number is 0 if both severities are equal.
It is -1 if the first severity is lower than the second one.
It is 1 is the first severity is higher than the second one.
@*
Above example "SORRY,UPDATE" will yield 1.
@*
@strong{list_sev}
@*
Print to the result channel a blank separated list of all severity names.
Sorted from low to high severity.
@*
@c man .TP
@item -prog text
@kindex -prog sets program name

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.12.15.092821"
#define Xorriso_timestamP "2012.12.15.093055"