ref: 4e09200f7e4bf8791c9c720922734e0759206b72
dir: /libxpath/dat.h/
typedef struct Name Name;
struct Name {
char *name;
int quoted;
Name *next;
};
Name* addname(char *);
typedef struct Func Func;
typedef struct Node Node;
enum {
Nroot = 0, /* ^/ */
Nstring, /* 'bla' */
Nnumber, /* 234 */
Nchild, /* child:: */
Nattribute, /* attribute:: */
Nfunction, /* name() */
Ndescself, /* descendant-or-self:: */
Nand,
Nor,
Nindex,
Neq,
Nneq,
Nlt,
Ngt,
Nle,
Nge,
NEND,
};
char* type2str(int);
struct Node {
Name *name; /* name of node */
int type; /* type of node */
int number;
Node *cond; /* conditions */
Func *func; /* function */
Node *anode; /* A node */
Node *bnode; /* B node */
Node *chain; /* next node in chain */
Node *next;
};
struct Func {
Name *name;
void (*f)(XpResult*, Elem*);
Func *next;
};
void debugprintnodes(Node*, int);
Node* parsexpath(char*);
Node* addcondcnode(int, Node*, Node*);
Node* addnode(Name*, int, Node*);
Node* addnoden(int, Node*);
Node* chainnode(Node*, Node*);
Func* findfunc(Name*);
Func* addfunc(Name*, void (*f)(XpResult*, Elem*));
void initfuncs(void);
void appendresult(XpResult*, XpResult);
void buildsinglestring(XpResult*, char*);
void buildsingleelem(XpResult*, Elem*);
void buildsinglenum(XpResult*, int);
typedef struct Mbuf Mbuf;
struct Mbuf {
void *ptr;
Mbuf *next;
};
void regmbuf(void*);
int position(Elem*);
int last(Elem*);