Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / language / expressions / public.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #if !expr_h
18 #define expr_h 1
19
20 #include <stddef.h>
21
22 /* Expression parsing flags. */
23 enum expr_type
24   {
25     EXPR_NUMBER = 0xf000,       /* Number. */
26     EXPR_STRING,                /* String. */
27     EXPR_BOOLEAN,               /* Boolean (number limited to 0, 1, SYSMIS). */
28   };
29
30 struct dictionary;
31 struct expression;
32 struct ccase;
33 struct pool;
34 union value;
35 struct dataset ;
36 struct lexer ;
37
38 struct expression *expr_parse (struct lexer *lexer, struct dataset *, enum expr_type);
39 struct expression *expr_parse_pool (struct lexer *,
40                                     struct pool *,
41                                     struct dataset *,
42                                     enum expr_type);
43 void expr_free (struct expression *);
44
45 struct dataset;
46 double expr_evaluate_num (struct expression *, const struct ccase *,
47                           int case_idx);
48 void expr_evaluate_str (struct expression *, const struct ccase *,
49                         int case_idx, char *dst, size_t dst_size);
50
51 const struct operation *expr_get_function (size_t idx);
52 size_t expr_get_function_cnt (void);
53 const char *expr_operation_get_name (const struct operation *);
54 const char *expr_operation_get_prototype (const struct operation *);
55 int expr_operation_get_arg_cnt (const struct operation *);
56
57 #endif /* expr.h */