+2001-11-27 Ulrich Drepper <drepper@redhat.com>
+
+ * plural-eval.c (plural_eval): Rename back from PLURAL_EVAL.
+ * plural-exp.h (PLURAL_EVAL): Remove declaration.
+ * dcigettext.c Include plural-eval.c.
+ (plural_lookup): Call plural_eval instead of PLURAL_EVAL.
+
2001-11-22 Bruno Haible <bruno@clisp.org>
* plural-exp.h (GERMANIC_PLURAL): New declaration.
}
#endif
+/* Get the function to evaluate the plural expression. */
+#include "plural-eval.c"
+
/* Look up MSGID in the DOMAINNAME message catalog for the current
CATEGORY locale and, if PLURAL is nonzero, search over string
depending on the plural form determined by N. */
unsigned long int index;
const char *p;
- index = PLURAL_EVAL (domaindata->plural, n);
+ index = plural_eval (domaindata->plural, n);
if (index >= domaindata->nplurals)
/* This should never happen. It means the plural expression and the
given maximum value do not match. */
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>
+#ifndef STATIC
+#define STATIC static
#endif
-#include "plural-exp.h"
+/* Evaluate the plural expression and return an index value. */
+STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp,
+ unsigned long int n))
+ internal_function;
+STATIC
unsigned long int
internal_function
-PLURAL_EVAL (pexp, n)
+plural_eval (pexp, n)
struct expression *pexp;
unsigned long int n;
{
case 1:
{
/* pexp->operation must be lnot. */
- unsigned long int arg = PLURAL_EVAL (pexp->val.args[0], n);
+ unsigned long int arg = plural_eval (pexp->val.args[0], n);
return ! arg;
}
case 2:
{
- unsigned long int leftarg = PLURAL_EVAL (pexp->val.args[0], n);
+ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
if (pexp->operation == lor)
- return leftarg || PLURAL_EVAL (pexp->val.args[1], n);
+ return leftarg || plural_eval (pexp->val.args[1], n);
else if (pexp->operation == land)
- return leftarg && PLURAL_EVAL (pexp->val.args[1], n);
+ return leftarg && plural_eval (pexp->val.args[1], n);
else
{
- unsigned long int rightarg = PLURAL_EVAL (pexp->val.args[1], n);
+ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
switch (pexp->operation)
{
case 3:
{
/* pexp->operation must be qmop. */
- unsigned long int boolarg = PLURAL_EVAL (pexp->val.args[0], n);
- return PLURAL_EVAL (pexp->val.args[boolarg ? 1 : 2], n);
+ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
+ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
}
}
/* NOTREACHED */
# define PLURAL_PARSE __gettextparse
# define GERMANIC_PLURAL __gettext_germanic_plural
# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
-# define PLURAL_EVAL __gettext_plural_eval
#elif defined (IN_LIBINTL)
# define FREE_EXPRESSION gettext_free_exp__
# define PLURAL_PARSE gettextparse__
# define GERMANIC_PLURAL gettext_germanic_plural__
# define EXTRACT_PLURAL_EXPRESSION gettext_extract_plural__
-# define PLURAL_EVAL gettext_plural_eval__
#else
# define FREE_EXPRESSION free_plural_expression
# define PLURAL_PARSE parse_plural_expression
# define GERMANIC_PLURAL germanic_plural
# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
-# define PLURAL_EVAL plural_eval
#endif
extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
unsigned long int *npluralsp))
internal_function;
-/* Evaluate the plural expression and return an index value. */
-extern unsigned long int PLURAL_EVAL PARAMS ((struct expression *pexp,
- unsigned long int n))
- internal_function;
-
#endif /* _PLURAL_EXP_H */
+2001-11-29 Bruno Haible <bruno@clisp.org>
+
+ * plural-eval.c: Include config.h and plural-exp.h.
+
2001-11-27 Bruno Haible <bruno@clisp.org>
* msgfmt.c (struct msgfmt_class_ty): New field
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-/* Include the expression evaluation code from libintl, with different function
- names. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "plural-exp.h"
+
+#define STATIC /*extern*/
+
+/* Include the expression evaluation code from libintl, this time with
+ 'extern' linkage. */
#include "../intl/plural-eval.c"