1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21: #ifndef _PLURAL_EXP_H
22: #define _PLURAL_EXP_H
23:
24: #ifndef PARAMS
25: # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
26: # define PARAMS(args) args
27: # else
28: # define PARAMS(args) ()
29: # endif
30: #endif
31:
32: #ifndef internal_function
33: # define internal_function
34: #endif
35:
36: #ifndef attribute_hidden
37: # define attribute_hidden
38: #endif
39:
40:
41:
42:
43: struct expression
44: {
45: int nargs;
46: enum operator
47: {
48:
49: var,
50: num,
51:
52: lnot,
53:
54: mult,
55: divide,
56: module,
57: plus,
58: minus,
59: less_than,
60: greater_than,
61: less_or_equal,
62: greater_or_equal,
63: equal,
64: not_equal,
65: land,
66: lor,
67:
68: qmop
69: } operation;
70: union
71: {
72: unsigned long int num;
73: struct expression *args[3];
74: } val;
75: };
76:
77:
78:
79: struct parse_args
80: {
81: const char *cp;
82: struct expression *res;
83: };
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96: #ifdef _LIBC
97: # define FREE_EXPRESSION __gettext_free_exp
98: # define PLURAL_PARSE __gettextparse
99: # define GERMANIC_PLURAL __gettext_germanic_plural
100: # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
101: #elif defined (IN_LIBINTL)
102: # define FREE_EXPRESSION libintl_gettext_free_exp
103: # define PLURAL_PARSE libintl_gettextparse
104: # define GERMANIC_PLURAL libintl_gettext_germanic_plural
105: # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
106: #else
107: # define FREE_EXPRESSION free_plural_expression
108: # define PLURAL_PARSE parse_plural_expression
109: # define GERMANIC_PLURAL germanic_plural
110: # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
111: #endif
112:
113: extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
114: internal_function;
115: extern int PLURAL_PARSE PARAMS ((void *arg));
116: extern const struct expression GERMANIC_PLURAL attribute_hidden;
117: extern void EXTRACT_PLURAL_EXPRESSION PARAMS
118: ((const char *nullentry, const struct expression **pluralp,
119: unsigned long int *npluralsp)) internal_function;
120:
121: #if !defined (_LIBC) && !defined (IN_LIBINTL)
122: extern unsigned long int plural_eval PARAMS ((const struct expression *pexp,
123: unsigned long int n));
124: #endif
125:
126: #endif