File: trparse.h

package info (click to toggle)
pcb-rnd 3.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 29,624 kB
  • sloc: ansic: 197,571; yacc: 6,153; sh: 5,808; awk: 2,708; makefile: 2,139; lex: 1,107; python: 519; xml: 261; lisp: 169; tcl: 67; perl: 34; javascript: 6; ruby: 5
file content (33 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef PCB_TRPARSE_H
#define PCB_TRPARSE_H

typedef void trnode_t;
typedef struct trparse_s trparse_t;

typedef struct trparse_calls_s {
	int (*load)(trparse_t *pst, const char *fn);
	int (*unload)(trparse_t *pst);

	trnode_t *(*parent)(trparse_t *pst, trnode_t *node);
	trnode_t *(*children)(trparse_t *pst, trnode_t *node);
	trnode_t *(*next)(trparse_t *pst, trnode_t *node);

	const char *(*nodename)(trnode_t *node);
	const char *(*prop)(trparse_t *pst, trnode_t *node, const char *key);
	const char *(*text)(trparse_t *pst, trnode_t *node);

	int (*str_cmp)(const char *s1, const char *s2);
	int (*is_text)(trparse_t *pst, trnode_t *node);

	void *(*get_user_data)(trnode_t *node);
	void (*set_user_data)(trnode_t *node, void *data);
} trparse_calls_t;


struct trparse_s {
	void *doc;
	trnode_t *root;
	const trparse_calls_t *calls;
};

#endif