+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * plural-count.h: New file.
+ * plural-count.c: New file, extracted from msgmerge.c.
+ * Makefile.am (noinst_HEADERS): Add plural-count.h.
+ (msgmerge_SOURCES): Add plural-count.c.
+ * Makefile.msvc (msgmerge_OBJECTS): Add plural-count.obj.
+ (plural-count.obj): New rule.
+ * Makefile.vms (msgmerge_OBJECTS): Add plural-count.obj.
+ (plural-count.obj): New rule.
+
2003-08-24 Bruno Haible <bruno@clisp.org>
Support for building DLLs on Windows.
open-po.h read-po-abstract.h read-po.h read-properties.h str-list.h \
write-po.h write-properties.h dir-list.h file-list.h po-gram-gen.h \
po-gram-gen2.h po-hash-gen.h msgl-charset.h msgl-equal.h msgl-iconv.h \
-msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h msgunfmt.h read-mo.h \
-write-mo.h read-java.h write-java.h read-tcl.h write-tcl.h po-time.h \
-plural-table.h format.h xgettext.h x-c.h x-po.h x-python.h x-lisp.h x-elisp.h \
-x-librep.h x-smalltalk.h x-java.h x-properties.h x-awk.h x-ycp.h x-tcl.h \
-x-perl.h x-php.h x-rst.h x-glade.h
+msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h msgunfmt.h plural-count.h \
+read-mo.h write-mo.h read-java.h write-java.h read-tcl.h write-tcl.h \
+po-time.h plural-table.h format.h xgettext.h x-c.h x-po.h x-python.h x-lisp.h \
+x-elisp.h x-librep.h x-smalltalk.h x-java.h x-properties.h x-awk.h x-ycp.h \
+x-tcl.h x-perl.h x-php.h x-rst.h x-glade.h
EXTRA_DIST += FILES project-id ChangeLog.0
# Source dependencies.
msgcmp_SOURCES = msgcmp.c
msgfmt_SOURCES = msgfmt.c write-mo.c write-java.c write-tcl.c plural-eval.c
-msgmerge_SOURCES = msgmerge.c
+msgmerge_SOURCES = msgmerge.c plural-count.c
msgunfmt_SOURCES = msgunfmt.c read-mo.c read-java.c read-tcl.c
xgettext_SOURCES = xgettext.c \
x-c.c x-po.c x-python.c x-lisp.c x-elisp.c x-librep.c x-smalltalk.c \
msgcmp_OBJECTS = msgcmp.obj
msgfmt_OBJECTS = msgfmt.obj write-mo.obj write-java.obj write-tcl.obj plural-eval.obj
-msgmerge_OBJECTS = msgmerge.obj
+msgmerge_OBJECTS = msgmerge.obj plural-count.obj
msgunfmt_OBJECTS = msgunfmt.obj read-mo.obj read-java.obj read-tcl.obj
xgettext_OBJECTS = xgettext.obj x-c.obj x-po.obj x-python.obj x-lisp.obj x-elisp.obj x-librep.obj x-smalltalk.obj x-java.obj x-awk.obj x-ycp.obj x-tcl.obj x-perl.obj x-php.obj x-rst.obj x-glade.obj
msgattrib_OBJECTS = msgattrib.obj
msgmerge.obj : msgmerge.c
$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgmerge.c
+plural-count.obj : plural-count.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c plural-count.c
+
msgunfmt.obj : msgunfmt.c
$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgunfmt.c
msgcmp_OBJECTS = msgcmp.obj
msgfmt_OBJECTS = msgfmt.obj, write-mo.obj, write-java.obj, write-tcl.obj, plural-eval.obj
-msgmerge_OBJECTS = msgmerge.obj
+msgmerge_OBJECTS = msgmerge.obj, plural-count.obj
msgunfmt_OBJECTS = msgunfmt.obj, read-mo.obj, read-java.obj, read-tcl.obj
xgettext_OBJECTS = xgettext.obj, x-c.obj, x-po.obj, x-python.obj, x-lisp.obj, x-elisp.obj, x-librep.obj, x-smalltalk.obj, x-java.obj, x-awk.obj, x-ycp.obj, x-tcl.obj, x-perl.obj, x-php.obj, x-rst.obj, x-glade.obj
msgattrib_OBJECTS = msgattrib.obj
msgmerge.obj : msgmerge.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS),"INSTALLPREFIX=""$(prefix)]""","INSTALLDIR=""$(bindir)]""") msgmerge.c
+plural-count.obj : plural-count.c
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) plural-count.c
+
msgunfmt.obj : msgunfmt.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS),"INSTALLPREFIX=""$(prefix)]""","INSTALLDIR=""$(bindir)]""") msgunfmt.c
--- /dev/null
+/* Plural form count.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ 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
+
+#include "plural-exp.h"
+
+
+/* Extract the number of plural forms from a header entry. */
+
+unsigned long int
+get_plural_count (const char *header)
+{
+ struct expression *plural;
+ unsigned long int nplurals;
+
+ extract_plural_expression (header, &plural, &nplurals);
+
+ return nplurals;
+}
--- /dev/null
+/* Plural form count.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ 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 __cplusplus
+extern "C" {
+#endif
+
+
+/* Extract the number of plural forms from a header entry. */
+extern unsigned long int get_plural_count (const char *header);
+
+
+#ifdef __cplusplus
+}
+#endif