* gettext-tools/src/xg-formatstring.h: New file, extracted from xgettext.h.
* gettext-tools/src/xg-formatstring.c: New file, extracted from xgettext.c.
* gettext-tools/src/FILES: Mention them.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add xg-formatstring.h.
(xgettext_SOURCES): Add xg-formatstring.c.
* gettext-tools/src/xgettext.h (current_formatstring_parser1,
current_formatstring_parser2, current_formatstring_parser3,
current_formatstring_parser4): Remove declarations.
* gettext-tools/src/xgettext.c: Include xg-formatstring.h.
(current_formatstring_parser1, current_formatstring_parser2,
current_formatstring_parser3, current_formatstring_parser4): Remove variables.
* gettext-tools/src/xg-message.c: Include xg-formatstring.h.
| xg-mixed-string.c
| Handling strings that are given partially in the source
| encoding and partially in Unicode.
+| xg-formatstring.h
+| xg-formatstring.c
+| Recognizing language-dependent format strings.
| xg-arglist-context.h
| xg-arglist-context.c
| Keeping track of the flags that apply to a string extracted
po-time.h plural-table.h lang-table.h format.h filters.h \
xgettext.h \
if-error.h \
- rc-str-list.h xg-pos.h xg-encoding.h xg-mixed-string.h xg-arglist-context.h \
- xg-arglist-callshape.h xg-arglist-parser.h xg-message.h xg-check.h \
+ rc-str-list.h xg-pos.h xg-encoding.h xg-mixed-string.h xg-formatstring.h \
+ xg-arglist-context.h xg-arglist-callshape.h xg-arglist-parser.h xg-message.h \
+ xg-check.h \
x-po.h x-properties.h x-stringtable.h \
x-c.h \
x-python.h \
xg-pos.c \
xg-encoding.c \
xg-mixed-string.c \
+ xg-formatstring.c \
xg-arglist-context.c xg-arglist-callshape.c xg-arglist-parser.c \
xg-message.c \
xg-check.c \
--- /dev/null
+/* Language-dependent format strings.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include "xg-formatstring.h"
+
+
+/* Language dependent format string parser.
+ NULL if the language has no notion of format strings. */
+struct formatstring_parser *current_formatstring_parser1;
+struct formatstring_parser *current_formatstring_parser2;
+struct formatstring_parser *current_formatstring_parser3;
+struct formatstring_parser *current_formatstring_parser4;
--- /dev/null
+/* Language-dependent format strings.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _XGETTEXT_FORMATSTRING_H
+#define _XGETTEXT_FORMATSTRING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Language dependent format string parser.
+ NULL if the language has no notion of format strings. */
+extern struct formatstring_parser *current_formatstring_parser1;
+extern struct formatstring_parser *current_formatstring_parser2;
+extern struct formatstring_parser *current_formatstring_parser3;
+extern struct formatstring_parser *current_formatstring_parser4;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _XGETTEXT_FORMATSTRING_H */
#include "verify.h"
#include "xgettext.h"
+#include "xg-formatstring.h"
#include "gettext.h"
#define _(str) gettext (str)
#include "noreturn.h"
#include "rc-str-list.h"
#include "xg-encoding.h"
+#include "xg-formatstring.h"
#include "xg-arglist-context.h"
#include "xg-message.h"
#include "closeout.h"
}
-/* Language dependent format string parser.
- NULL if the language has no notion of format strings. */
-struct formatstring_parser *current_formatstring_parser1;
-struct formatstring_parser *current_formatstring_parser2;
-struct formatstring_parser *current_formatstring_parser3;
-struct formatstring_parser *current_formatstring_parser4;
-
-
static void
extract_from_file (const char *file_name, extractor_ty extractor,
msgdomain_list_ty *mdlp)
extern enum is_syntax_check default_syntax_check[NSYNTAXCHECKS];
-/* Language dependent format string parser.
- NULL if the language has no notion of format strings. */
-extern struct formatstring_parser *current_formatstring_parser1;
-extern struct formatstring_parser *current_formatstring_parser2;
-extern struct formatstring_parser *current_formatstring_parser3;
-extern struct formatstring_parser *current_formatstring_parser4;
-
/* Record a flag in the appropriate backend's table.
OPTIONSTRING has the syntax WORD:ARG:FLAG (as documented)