Made -msg_op "parse" obey -backslash_codes.

This commit is contained in:
Thomas Schmitt 2013-01-05 21:50:41 +00:00
parent 19cc61624f
commit da0bddeced
5 changed files with 59 additions and 37 deletions

View File

@ -3559,8 +3559,8 @@ int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line,
int max_words, int pflag, int input_lines,
int flag)
{
int ret, i, l, pargc= 0;
char *pline= NULL, **pargv= NULL, *parse_line;
int ret, i, l, pargc= 0, bsl_mem;
char *pline= NULL, **pargv= NULL, *parse_line, *text= NULL, *text_pt;
Xorriso_alloc_meM(pline, char, SfileadrL);
@ -3590,6 +3590,10 @@ int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line,
ret= Xorriso_parse_line(xorriso, parse_line, prefix, separators, max_words,
&pargc, &pargv, pflag);
/* Temporarily disable backslash encoding of result channel */
bsl_mem= xorriso->bsl_interpretation;
xorriso->bsl_interpretation&= ~32;
xorriso->msg_sieve_disabled= 1;
sprintf(xorriso->result_line, "%d\n", ret);
Xorriso_result(xorriso, 1);
@ -3597,10 +3601,16 @@ int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line,
sprintf(xorriso->result_line, "%d\n", pargc);
Xorriso_result(xorriso, 1);
for(i= 0; i < pargc; i++) {
ret= Sfile_count_char(pargv[i], '\n') + 1;
text_pt= pargv[i];
if (bsl_mem & 32) {
ret= Sfile_bsl_encoder(&text, pargv[i], strlen(pargv[i]), 4);
if(ret > 0)
text_pt= text;
}
ret= Sfile_count_char(text_pt, '\n') + 1;
sprintf(xorriso->result_line, "%d\n", ret);
Xorriso_result(xorriso, 1);
Sfile_str(xorriso->result_line, pargv[i], 0);
Sfile_str(xorriso->result_line, text_pt, 0);
strcat(xorriso->result_line, "\n");
Xorriso_result(xorriso, 1);
}
@ -3608,10 +3618,11 @@ int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line,
sprintf(xorriso->result_line, "0\n");
Xorriso_result(xorriso, 1);
}
xorriso->bsl_interpretation= bsl_mem;
ret= 1;
ex:;
Xorriso__dispose_words(&pargc, &pargv);
Xorriso_free_meM(text);
Xorriso_free_meM(pline);
return ret;
}

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, Jan 04, 2013"
.TH XORRISO 1 "Version 1.2.5, Jan 05, 2013"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -4560,6 +4560,10 @@ 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
If \-backslash_codes "encode_output" is enabled, then the strings undergo
encoding as if they were enclosed in quotes. Escpecially each string
will be put out as a single result line.
.br
\fBparse_bulk\fR
.br
Like "parse", but with the fifth parameter word being number_of_input_texts

View File

@ -3994,6 +3994,9 @@ 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.
If -backslash_codes "encode_output" is enabled, then the strings
undergo encoding as if they were enclosed in quotes. Escpecially
each string will be put out as a single result line.
*parse_bulk*
Like "parse", but with the fifth parameter word being
number_of_input_texts rather than number_of_input_lines. Each
@ -4763,7 +4766,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -jigdo clears JTE or or adds parameter to JTE: Jigdo. (line 33)
* -joliet enables production of Joliet tree: SetWrite. (line 10)
* -launch_frontend starts frontend program at pipes: Frontend.
(line 113)
(line 116)
* -list_arg_sorting prints sorting order of -x: ArgSort. (line 27)
* -list_delimiter replaces '--': Scripting. (line 60)
* -list_extras lists compile time extra features: Scripting.
@ -4816,8 +4819,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 91)
* -prog sets program name: Frontend. (line 148)
* -prog_help prints help text: Frontend. (line 151)
* -prog sets program name: Frontend. (line 151)
* -prog_help prints help text: Frontend. (line 154)
* -prompt prompts for enter key: Scripting. (line 110)
* -publisher sets publisher id: SetWrite. (line 186)
* -pvd_info shows image id strings: Inquiry. (line 104)
@ -4975,7 +4978,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Filter, unregister, -unregister_filter: Filter. (line 48)
* Filter, zisofs parameters, -zisofs: SetWrite. (line 272)
* Frontend program, start at pipes, -launch_frontend: Frontend.
(line 113)
(line 116)
* GPT, _definition: Extras. (line 38)
* Group, global in ISO image, -gid: SetWrite. (line 268)
* Group, in ISO image, -chgrp: Manip. (line 50)
@ -5089,7 +5092,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 151)
* Program, print help text, -prog_help: Frontend. (line 154)
* 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.
@ -5097,7 +5100,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 148)
* Program, set name, -prog: Frontend. (line 151)
* 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)
@ -5203,28 +5206,28 @@ Node: Restore174782
Node: Emulation181869
Node: Scripting191681
Node: Frontend198842
Node: Examples206719
Node: ExDevices207897
Node: ExCreate208556
Node: ExDialog209841
Node: ExGrowing211106
Node: ExModifying211911
Node: ExBootable212415
Node: ExCharset212967
Node: ExPseudo213788
Node: ExCdrecord214686
Node: ExMkisofs215003
Node: ExGrowisofs216343
Node: ExException217478
Node: ExTime217932
Node: ExIncBackup218391
Node: ExRestore222383
Node: ExRecovery223343
Node: Files223913
Node: Seealso225212
Node: Bugreport225935
Node: Legal226516
Node: CommandIdx227527
Node: ConceptIdx243756
Node: Examples206917
Node: ExDevices208095
Node: ExCreate208754
Node: ExDialog210039
Node: ExGrowing211304
Node: ExModifying212109
Node: ExBootable212613
Node: ExCharset213165
Node: ExPseudo213986
Node: ExCdrecord214884
Node: ExMkisofs215201
Node: ExGrowisofs216541
Node: ExException217676
Node: ExTime218130
Node: ExIncBackup218589
Node: ExRestore222581
Node: ExRecovery223541
Node: Files224111
Node: Seealso225410
Node: Bugreport226133
Node: Legal226714
Node: CommandIdx227725
Node: ConceptIdx243954

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, Jan 04, 2013"
@c man .TH XORRISO 1 "Version 1.2.5, Jan 05, 2013"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -5346,6 +5346,10 @@ 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.
@*
If -backslash_codes "encode_output" is enabled, then the strings undergo
encoding as if they were enclosed in quotes. Escpecially each string
will be put out as a single result line.
@*
@strong{parse_bulk}
@*
Like "parse", but with the fifth parameter word being number_of_input_texts

View File

@ -1 +1 @@
#define Xorriso_timestamP "2013.01.05.105029"
#define Xorriso_timestamP "2013.01.05.214951"