xgettext: Delay calls to from_current_source_encoding, part 1.
* xg-mixed-string.h (enum segment_type, struct mixed_string_segment,
struct mixed_string, mixed_string_ty): New types.
(mixed_string_alloc_simple, mixed_string_alloc_utf8, mixed_string_clone,
mixed_string_contents, mixed_string_free, mixed_string_contents_free1,
mixed_string_concat, mixed_string_concat_free1): New declarations.
(struct mixed_string_buffer): Change internal representation to use segments.
(mixed_string_buffer_result): Change return type to 'mixed_string_ty *'.
* xg-mixed-string.c: Include flexmember.h, msgl-ascii.h, po-charset.h.
(segment_alloc, segment_clone, mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_contents,
mixed_string_free, mixed_string_contents_free1, mixed_string_concat,
mixed_string_concat_free1): New functions.
(mixed_string_buffer_init, mixed_string_buffer_is_empty): Change to match new
internal representation.
(mixed_string_buffer_grow_curr_buffer): New function.
(mixed_string_buffer_grow_utf8_buffer): Remove function.
(mixed_string_buffer_append_to_utf8_buffer): Update accordingly.
(mixed_string_buffer_flush_curr_buffer): Remove function.
(mixed_string_buffer_add_segment, mixed_string_buffer_flush_curr): New
functions.
(mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_destroy, mixed_string_buffer_result): Change to match new
internal representation.
* x-c.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get, phase6_get, phase8a_get): For tokens of type
token_type_string_literal, use a mixed_string.
(phase8_get): Use mixed_string_concat_free1.
(struct xgettext_token_ty): New field 'mixed_string'.
(x_c_lex, extract_parenthesized): For tokens of type
xgettext_token_type_string_literal, use a mixed_string.
* x-csharp.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase6_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase7_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-java.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase6_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-javascript.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_javascript_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-python.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_python_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-rst.c (extract_rsj): Update.
* x-vala.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase3_get): For tokens of type token_type_string_literal, use a mixed_string.
For tokens of type token_type_string_template, fix a memory leak.
(x_vala_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string_literal, use a
mixed_string.