blob: 9c2760a1a96ea8de6d1338e8b1a93b3696e770c8 [file] [log] [blame]
Andi Kleen07516732017-03-20 13:17:05 -07001#ifndef PARSE_CTX_H
2#define PARSE_CTX_H 1
3
4#define EXPR_MAX_OTHER 8
5#define MAX_PARSE_ID EXPR_MAX_OTHER
6
7struct parse_id {
8 const char *name;
9 double val;
10};
11
12struct parse_ctx {
13 int num_ids;
14 struct parse_id ids[MAX_PARSE_ID];
15};
16
17void expr__ctx_init(struct parse_ctx *ctx);
18void expr__add_id(struct parse_ctx *ctx, const char *id, double val);
19#ifndef IN_EXPR_Y
20int expr__parse(double *final_val, struct parse_ctx *ctx, const char **pp);
21#endif
22int expr__find_other(const char *p, const char *one, const char ***other,
23 int *num_other);
24
25#endif