File: pgxml.h

package info (click to toggle)
postgresql 7.2.1-2woody8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 42,424 kB
  • ctags: 30,027
  • sloc: ansic: 290,568; java: 18,529; sh: 12,197; sql: 11,401; yacc: 11,189; tcl: 8,063; perl: 4,067; makefile: 3,332; xml: 2,874; lex: 2,799; python: 1,237; cpp: 845; pascal: 81; asm: 70; awk: 20; sed: 8
file content (42 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
/* Header for pg xml parser interface */

static void *pgxml_palloc(size_t size);
static void *pgxml_repalloc(void *ptr, size_t size);
static void pgxml_pfree(void *ptr);
static void pgxml_mhs_init();
static void pgxml_handler_init();
Datum		pgxml_parse(PG_FUNCTION_ARGS);
Datum		pgxml_xpath(PG_FUNCTION_ARGS);
static void pgxml_starthandler(void *userData, const XML_Char * name,
				   const XML_Char ** atts);
static void pgxml_endhandler(void *userData, const XML_Char * name);
static void pgxml_charhandler(void *userData, const XML_Char * s, int len);
static void pgxml_pathcompare(void *userData);
static void pgxml_finalisegrabbedtext(void *userData);

#define MAXPATHLENGTH 512
#define MAXRESULTS 100


typedef struct
{
	int			rescount;
	char	   *results[MAXRESULTS];
	int32		reslens[MAXRESULTS];
	char	   *resbuf;			/* pointer to the result buffer for pfree */
}	XPath_Results;



typedef struct
{
	char		currentpath[MAXPATHLENGTH];
	char	   *path;
	int			textgrab;
	char	   *resptr;
	int32		reslen;
	XPath_Results *xpres;
}	pgxml_udata;


#define UD ((pgxml_udata *) userData)