+2001-10-08 Bruno Haible <haible@clisp.cons.org>
+
+ * msgl-english.h: New file.
+ * msgl-english.c: New file, extracted from msgen.c.
+ * msgen.c: Include msgl-english.h.
+ (english): Move to msgl-english.c.
+ (main): Update accordingly.
+ * Makefile.am (noinst_HEADERS): Add msgl-english.h.
+ (msgen_SOURCES): Add msgl-english.c.
+
2001-10-08 Bruno Haible <haible@clisp.cons.org>
* po-time.h: New file.
noinst_HEADERS = pos.h message.h po-gram.h po-hash.h po-charset.h po-lex.h \
po.h open-po.h read-po.h str-list.h write-po.h dir-list.h file-list.h \
po-gram-gen.h po-hash-gen.h msgl-charset.h msgl-equal.h msgl-iconv.h \
-msgl-ascii.h msgl-cat.h msgfmt.h read-mo.h write-mo.h po-time.h xgettext.h \
-x-c.h x-po.h x-java.h x-ycp.h x-rst.h
+msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h read-mo.h write-mo.h \
+po-time.h xgettext.h x-c.h x-po.h x-java.h x-ycp.h x-rst.h
EXTRA_DIST = FILES
msgcat_SOURCES = msgcat.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-iconv.c msgl-cat.c file-list.c
msgcomm_SOURCES = msgcomm.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-iconv.c msgl-cat.c file-list.c
msgconv_SOURCES = msgconv.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-iconv.c
-msgen_SOURCES = msgen.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c
+msgen_SOURCES = msgen.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-english.c
msgexec_SOURCES = msgexec.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-charset.c
msggrep_SOURCES = msggrep.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-charset.c
msguniq_SOURCES = msguniq.c $(COMMON_SOURCE) msgl-ascii.c write-po.c read-po.c msgl-iconv.c msgl-cat.c
#include "basename.h"
#include "message.h"
#include "read-po.h"
+#include "msgl-english.h"
#include "write-po.h"
#include "xmalloc.h"
#include "system.h"
/* Prototypes for local functions. Needed to ensure compiler checking of
function argument counts despite of K&R C function definition syntax. */
static void usage PARAMS ((int status));
-static msgdomain_list_ty *english PARAMS ((msgdomain_list_ty *mdlp));
int
"--sort-output", "--sort-by-file");
/* Read input file and add English translations. */
- result = english (read_po_file (argv[optind]));
+ result = msgdomain_list_english (read_po_file (argv[optind]));
/* Sort the results. */
if (sort_by_filepos)
exit (status);
}
-
-
-static msgdomain_list_ty *
-english (mdlp)
- msgdomain_list_ty *mdlp;
-{
- size_t j, k;
-
- for (k = 0; k < mdlp->nitems; k++)
- {
- message_list_ty *mlp = mdlp->item[k]->messages;
-
- for (j = 0; j < mlp->nitems; j++)
- {
- message_ty *mp = mlp->item[j];
-
- if (mp->msgid_plural == NULL)
- {
- if (mp->msgstr_len == 1 && mp->msgstr[0] == '\0')
- {
- mp->msgstr = mp->msgid; /* no need for xstrdup */
- mp->msgstr_len = strlen (mp->msgid) + 1;
- }
- }
- else
- {
- if (mp->msgstr_len == 2
- && mp->msgstr[0] == '\0' && mp->msgstr[1] == '\0')
- {
- size_t len0 = strlen (mp->msgid) + 1;
- size_t len1 = strlen (mp->msgid_plural) + 1;
- char *cp = (char *) xmalloc (len0 + len1);
- memcpy (cp, mp->msgid, len0);
- memcpy (cp + len0, mp->msgid_plural, len1);
- mp->msgstr = cp;
- mp->msgstr_len = len0 + len1;
- }
- }
- }
- }
-
- return mdlp;
-}
--- /dev/null
+/* Message translation initialization for English.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+/* Specification. */
+#include "msgl-english.h"
+
+#include <string.h>
+
+#include "xmalloc.h"
+
+
+msgdomain_list_ty *
+msgdomain_list_english (mdlp)
+ msgdomain_list_ty *mdlp;
+{
+ size_t j, k;
+
+ for (k = 0; k < mdlp->nitems; k++)
+ {
+ message_list_ty *mlp = mdlp->item[k]->messages;
+
+ for (j = 0; j < mlp->nitems; j++)
+ {
+ message_ty *mp = mlp->item[j];
+
+ if (mp->msgid_plural == NULL)
+ {
+ if (mp->msgstr_len == 1 && mp->msgstr[0] == '\0')
+ {
+ mp->msgstr = mp->msgid; /* no need for xstrdup */
+ mp->msgstr_len = strlen (mp->msgid) + 1;
+ }
+ }
+ else
+ {
+ if (mp->msgstr_len == 2
+ && mp->msgstr[0] == '\0' && mp->msgstr[1] == '\0')
+ {
+ size_t len0 = strlen (mp->msgid) + 1;
+ size_t len1 = strlen (mp->msgid_plural) + 1;
+ char *cp = (char *) xmalloc (len0 + len1);
+ memcpy (cp, mp->msgid, len0);
+ memcpy (cp + len0, mp->msgid_plural, len1);
+ mp->msgstr = cp;
+ mp->msgstr_len = len0 + len1;
+ }
+ }
+ }
+ }
+
+ return mdlp;
+}
--- /dev/null
+/* Message translation initialization for English.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _MSGL_ENGLISH_H
+#define _MSGL_ENGLISH_H
+
+#include "message.h"
+
+extern msgdomain_list_ty *
+ msgdomain_list_english PARAMS ((msgdomain_list_ty *mdlp));
+
+#endif /* _MSGL_ENGLISH_H */