about summary refs log tree commit diff
path: root/intl/gettextP.h
diff options
context:
space:
mode:
Diffstat (limited to 'intl/gettextP.h')
-rw-r--r--intl/gettextP.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/intl/gettextP.h b/intl/gettextP.h
index b3c8c18598..d210dc6c4e 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -1,5 +1,5 @@
 /* Header describing internals of gettext library
-   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -64,6 +64,51 @@ SWAP (i)
 #endif
 
 
+/* This is the representation of the expressions to determine the
+   plural form.  */
+struct expression
+{
+  enum operator
+  {
+    var,			/* The variable "n".  */
+    num,			/* Decimal number.  */
+    mult,			/* Multiplication.  */
+    divide,			/* Division.  */
+    module,			/* Module operation.  */
+    plus,			/* Addition.  */
+    minus,			/* Subtraction.  */
+    equal,			/* Comparision for equality.  */
+    not_equal,			/* Comparision for inequality.  */
+    land,			/* Logical AND.  */
+    lor,			/* Logical OR.  */
+    qmop			/* Question mark operator.  */
+  } operation;
+  union
+  {
+    unsigned long int num;	/* Number value for `num'.  */
+    struct
+    {
+      struct expression *left;	/* Left expression in binary operation.  */
+      struct expression *right;	/* Right expression in binary operation.  */
+    } args2;
+    struct
+    {
+      struct expression *bexp;	/* Boolean expression in ?: operation.  */
+      struct expression *tbranch; /* True-branch in ?: operation.  */
+      struct expression *fbranch; /* False-branch in ?: operation.  */
+    } args3;
+  } val;
+};
+
+/* This is the data structure to pass information to the parser and get
+   the result in a thread-safe way.  */
+struct parse_args
+{
+  const char *cp;
+  struct expression *res;
+};
+
+
 struct loaded_domain
 {
   const char *data;
@@ -83,6 +128,9 @@ struct loaded_domain
 # endif
 #endif
   char **conv_tab;
+
+  struct expression *plural;
+  unsigned long int nplurals;
 };
 
 struct binding
@@ -103,6 +151,34 @@ void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
      internal_function;
 
+#ifdef _LIBC
+extern char *__ngettext PARAMS ((const char *msgid1, const char *msgid2,
+				 unsigned long int n));
+extern char *__dngettext PARAMS ((const char *domainname, const char *msgid1,
+				  const char *msgid2, unsigned long int n));
+extern char *__dcngettext PARAMS ((const char *domainname, const char *msgid1,
+				   const char *msgid2, unsigned long int n,
+				   int category));
+extern char *__dcigettext PARAMS ((const char *domainname, const char *msgid1,
+				   const char *msgid2, int plural,
+				   unsigned long int n, int category));
+#else
+extern char *ngettext__ PARAMS ((const char *msgid1, const char *msgid2,
+				 unsigned long int n));
+extern char *dngettext__ PARAMS ((const char *domainname, const char *msgid1,
+				  const char *msgid2, unsigned long int n));
+extern char *dcngettext__ PARAMS ((const char *domainname, const char *msgid1,
+				   const char *msgid2, unsigned long int n,
+				   int category));
+extern char *dcigettext__ PARAMS ((const char *domainname, const char *msgid1,
+				   const char *msgid2, int plural,
+				   unsigned long int n, int category));
+#endif
+
+extern int __gettextdebug;
+extern void __gettext_free_exp (struct expression *exp) internal_function;
+extern int __gettextparse (void *arg);
+
 /* @@ begin of epilog @@ */
 
 #endif /* gettextP.h  */