00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _PLURAL_EXP_H
00021 #define _PLURAL_EXP_H
00022
00023 #ifndef PARAMS
00024 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
00025 # define PARAMS(args) args
00026 # else
00027 # define PARAMS(args) ()
00028 # endif
00029 #endif
00030
00031 #ifndef internal_function
00032 # define internal_function
00033 #endif
00034
00035
00036
00037
00038 struct expression
00039 {
00040 int nargs;
00041 enum operator
00042 {
00043
00044 var,
00045 num,
00046
00047 lnot,
00048
00049 mult,
00050 divide,
00051 module,
00052 plus,
00053 minus,
00054 less_than,
00055 greater_than,
00056 less_or_equal,
00057 greater_or_equal,
00058 equal,
00059 not_equal,
00060 land,
00061 lor,
00062
00063 qmop
00064 } operation;
00065 union
00066 {
00067 unsigned long int num;
00068 struct expression *args[3];
00069 } val;
00070 };
00071
00072
00073
00074 struct parse_args
00075 {
00076 const char *cp;
00077 struct expression *res;
00078 };
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 #ifdef _LIBC
00092 # define FREE_EXPRESSION __gettext_free_exp
00093 # define PLURAL_PARSE __gettextparse
00094 # define GERMANIC_PLURAL __gettext_germanic_plural
00095 # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
00096 #elif defined (IN_LIBINTL)
00097 # define FREE_EXPRESSION gettext_free_exp__
00098 # define PLURAL_PARSE gettextparse__
00099 # define GERMANIC_PLURAL gettext_germanic_plural__
00100 # define EXTRACT_PLURAL_EXPRESSION gettext_extract_plural__
00101 #else
00102 # define FREE_EXPRESSION free_plural_expression
00103 # define PLURAL_PARSE parse_plural_expression
00104 # define GERMANIC_PLURAL germanic_plural
00105 # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
00106 #endif
00107
00108 extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
00109 internal_function;
00110 extern int PLURAL_PARSE PARAMS ((void *arg));
00111 extern struct expression GERMANIC_PLURAL;
00112 extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry,
00113 struct expression **pluralp,
00114 unsigned long int *npluralsp))
00115 internal_function;
00116
00117 #if !defined (_LIBC) && !defined (IN_LIBINTL)
00118 extern unsigned long int plural_eval PARAMS ((struct expression *pexp,
00119 unsigned long int n));
00120 #endif
00121
00122 #endif