-#if ENABLE_NLS
-/* On Linux, gettext is optionally defined as a forwarding macro,
- which would cause syntax errors in our definition below. But on
- platforms that require -lintl, we cannot #undef gettext, since we
- want to provide the entry point libintl_gettext. So we disable
- optimizations to avoid the Linux macros. */
-# undef __OPTIMIZE__
-# include <libintl.h>
-
-/* These quotes are borrowed from a pt_PT.utf8 translation. */
-# define LQ "\302\253"
-# define RQ "\302\273"
-#endif
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
-
-struct result_strings {
- char const *str1; /* Translation of "". */
- char const *str2; /* Translation of "\0""1\0". */
- size_t len2; /* Length of str2. */
- char const *str3; /* Translation of "simple". */
- char const *str4; /* Translation of " \t\n'\"\033?""?/\\". */
- char const *str5; /* Translation of "a:b". */
- char const *str6; /* Translation of "a\\b". */
-};
-
-struct result_groups {
- struct result_strings group1; /* Via quotearg_buffer. */
- struct result_strings group2; /* Via quotearg{,_mem}. */
- struct result_strings group3; /* Via quotearg_colon{,_mem}. */
-};
-
-static struct result_strings inputs = {
- "", "\0001\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b"
-};
-
-static struct result_groups results_g[] = {
- /* literal_quoting_style */
- { { "", "\0""1\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" },
- { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" },
- { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" } },
-
- /* shell_quoting_style */
- { { "''", "\0""1\0", 3, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b",
- "'a\\b'" },
- { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "a:b",
- "'a\\b'" },
- { "''", "1", 1, "simple", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
- "'a\\b'" } },
-
- /* shell_always_quoting_style */
- { { "''", "'\0""1\0'", 5, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
- "'a\\b'" },
- { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
- "'a\\b'" },
- { "''", "'1'", 3, "'simple'", "' \t\n'\\''\"\033?""?/\\'", "'a:b'",
- "'a\\b'" } },
-
- /* c_quoting_style */
- { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"" } },
-
- /* c_maybe_quoting_style */
- { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "a:b", "a\\b" },
- { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "a:b", "a\\b" },
- { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "\"a:b\"", "a\\b" } },
-
- /* escape_quoting_style */
- { { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b",
- "a\\\\b" },
- { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a:b",
- "a\\\\b" },
- { "", "\\0001\\0", 7, "simple", " \\t\\n'\"\\033?""?/\\\\", "a\\:b",
- "a\\\\b" } },
-
- /* locale_quoting_style */
- { { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
- "`a:b'", "`a\\\\b'" },
- { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
- "`a:b'", "`a\\\\b'" },
- { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
- "`a\\:b'", "`a\\\\b'" } },
-
- /* clocale_quoting_style */
- { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?""?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"" } }
-};
-
-static struct result_groups flag_results[] = {
- /* literal_quoting_style and QA_ELIDE_NULL_BYTES */
- { { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" },
- { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" },
- { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b", "a\\b" } },
-
- /* c_quoting_style and QA_ELIDE_OUTER_QUOTES */
- { { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "a:b", "a\\b" },
- { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "a:b", "a\\b" },
- { "", "\"\\0001\\0\"", 9, "simple", "\" \\t\\n'\\\"\\033?""?/\\\\\"",
- "\"a:b\"", "a\\b" } },
-
- /* c_quoting_style and QA_SPLIT_TRIGRAPHS */
- { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a:b\"", "\"a\\\\b\"" },
- { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
- "\" \\t\\n'\\\"\\033?\"\"?/\\\\\"", "\"a\\:b\"", "\"a\\\\b\"" } }
-};