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 #ifndef attribute_hidden
00036 # define attribute_hidden
00037 #endif
00038
00039
00040
00041
00042 struct expression
00043 {
00044 int nargs;
00045 enum operator
00046 {
00047
00048 var,
00049 num,
00050
00051 lnot,
00052
00053 mult,
00054 divide,
00055 module,
00056 plus,
00057 minus,
00058 less_than,
00059 greater_than,
00060 less_or_equal,
00061 greater_or_equal,
00062 equal,
00063 not_equal,
00064 land,
00065 lor,
00066
00067 qmop
00068 } operation;
00069 union
00070 {
00071 unsigned long int num;
00072 struct expression *args[3];
00073 } val;
00074 };
00075
00076
00077
00078 struct parse_args
00079 {
00080 const char *cp;
00081 struct expression *res;
00082 };
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 #ifdef _LIBC
00096 # define FREE_EXPRESSION __gettext_free_exp
00097 # define PLURAL_PARSE __gettextparse
00098 # define GERMANIC_PLURAL __gettext_germanic_plural
00099 # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
00100 #elif defined (IN_LIBINTL)
00101 # define FREE_EXPRESSION libintl_gettext_free_exp
00102 # define PLURAL_PARSE libintl_gettextparse
00103 # define GERMANIC_PLURAL libintl_gettext_germanic_plural
00104 # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
00105 #else
00106 # define FREE_EXPRESSION free_plural_expression
00107 # define PLURAL_PARSE parse_plural_expression
00108 # define GERMANIC_PLURAL germanic_plural
00109 # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
00110 #endif
00111
00112 extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
00113 internal_function;
00114 extern int PLURAL_PARSE PARAMS ((void *arg));
00115 extern struct expression GERMANIC_PLURAL attribute_hidden;
00116 extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry,
00117 struct expression **pluralp,
00118 unsigned long int *npluralsp))
00119 internal_function;
00120
00121 #if !defined (_LIBC) && !defined (IN_LIBINTL)
00122 extern unsigned long int plural_eval PARAMS ((struct expression *pexp,
00123 unsigned long int n));
00124 #endif
00125
00126 #endif