quotearg: implement custom_quoting_style
authorJoel E. Denny <jdenny@clemson.edu>
Sun, 23 Aug 2009 22:24:53 +0000 (18:24 -0400)
committerJoel E. Denny <jdenny@clemson.edu>
Sun, 23 Aug 2009 22:30:34 +0000 (18:30 -0400)
commit12247f770487cd389e515a51d6bfeb250f26e519
tree3d5905f2d46edec7c3b9d5f36f280b0f22ee69f4
parentf6fe750d033c40b403688dc3eee9dbff468aa8f3
quotearg: implement custom_quoting_style

* lib/quotearg.c: (struct quoting_options): Add left_quote and
right_quote fields.
(set_custom_quoting): New public function.
(quotearg_buffer_restyled): Add left_quote and right_quote
arguments, handle them very much like locale quoting, and update
all uses.
(quotearg_n_custom): New public function.
(quotearg_n_custom_mem): New public function.
(quotearg_custom): New public function.
(quotearg_custom_mem): New public function.
* lib/quotearg.h: Prototype and document new public functions.
(enum quoting_style): For escape_quoting_style and
clocale_quoting_style, comment that QA_SPLIT_TRIGRAPHS is
ignored even though they're otherwise like c_quoting_style.
Add custom_quoting_style member and document with comparison to
clocale_quoting_style.
* tests/test-quotearg.c (custom_quotes): New array.
(custom_results): New array.
(main): Extend to test custom quoting.
ChangeLog
lib/quotearg.c
lib/quotearg.h
tests/test-quotearg.c