]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
New compilation unit plural-count.c.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Aug 2003 18:07:58 +0000 (18:07 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:54 +0000 (12:10 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/Makefile.am
gettext-tools/src/Makefile.msvc
gettext-tools/src/Makefile.vms
gettext-tools/src/plural-count.c [new file with mode: 0644]
gettext-tools/src/plural-count.h [new file with mode: 0644]

index 54da418d5f246b6c20de8f851ed85f046f9b2494..63081f0b3ac1cb5ff7d0f01ada43645e22d1d9f9 100644 (file)
@@ -1,3 +1,14 @@
+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.
index 6bcadb0f281ec02df004bc74b7d4a3b05dd096e9..7ad4999f952155494f80991c07cee0afcd572f0e 100644 (file)
@@ -38,11 +38,11 @@ noinst_HEADERS = pos.h message.h po-gram.h po-hash.h po-charset.h po-lex.h \
 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
 
@@ -115,7 +115,7 @@ LIBUNINAME = ../libuniname/libuniname.a
 # 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 \
index 61adcd392179a738ae40c185a05a8be542ea57cb..139e491063a564c25a760f09ea836fbfbb73e0f4 100644 (file)
@@ -146,7 +146,7 @@ OBJECTS = \
 
 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
@@ -321,6 +321,9 @@ plural-eval.obj : plural-eval.c
 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
 
index 3668c7204f10708d4e7337bdd4a208a01fc41168..d23c871ea06076b0afcc817ea945d8d682666ce0 100644 (file)
@@ -92,7 +92,7 @@ OBJECTS = \
 
 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
@@ -251,6 +251,9 @@ plural-eval.obj : plural-eval.c
 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
 
diff --git a/gettext-tools/src/plural-count.c b/gettext-tools/src/plural-count.c
new file mode 100644 (file)
index 0000000..9b65a36
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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;
+}
diff --git a/gettext-tools/src/plural-count.h b/gettext-tools/src/plural-count.h
new file mode 100644 (file)
index 0000000..5f98d59
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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