20a876afd4571fa8e4d537e58b916a1f61b13b78
[idzebra-moved-to-github.git] / include / zebra_xpath.h
1 /* Moved from zrpn.c -pop */
2
3 #ifndef ZEBRA_XPATH_H
4 #define ZEBRA_XPATH_H
5
6 #include <yaz/nmem.h>
7
8 #define XPATH_STEP_COUNT 10
9 struct xpath_predicate {
10     int which;
11     union {
12 #define XPATH_PREDICATE_RELATION 1
13         struct {
14             char *name;
15             char *op;
16             char *value;
17         } relation;
18 #define XPATH_PREDICATE_BOOLEAN 2
19         struct {
20             const char *op;
21             struct xpath_predicate *left;
22             struct xpath_predicate *right;
23         } boolean;
24     } u;
25 };
26
27 struct xpath_location_step {
28     char *part;
29     struct xpath_predicate *predicate;
30 };
31
32 int zebra_parse_xpath_str(const char *xpath_string,
33                           struct xpath_location_step *xpath,
34                           int max, NMEM mem);
35
36 void dump_xp_steps (struct xpath_location_step *xpath, int no);
37
38
39 #endif