~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/xml/pgxml.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Header for pg xml parser interface */
 
2
 
 
3
static void *pgxml_palloc(size_t size);
 
4
static void *pgxml_repalloc(void *ptr, size_t size);
 
5
static void pgxml_pfree(void *ptr);
 
6
static void pgxml_mhs_init();
 
7
static void pgxml_handler_init();
 
8
Datum           pgxml_parse(PG_FUNCTION_ARGS);
 
9
Datum           pgxml_xpath(PG_FUNCTION_ARGS);
 
10
static void pgxml_starthandler(void *userData, const XML_Char * name,
 
11
                                   const XML_Char ** atts);
 
12
static void pgxml_endhandler(void *userData, const XML_Char * name);
 
13
static void pgxml_charhandler(void *userData, const XML_Char * s, int len);
 
14
static void pgxml_pathcompare(void *userData);
 
15
static void pgxml_finalisegrabbedtext(void *userData);
 
16
 
 
17
#define MAXPATHLENGTH 512
 
18
#define MAXRESULTS 100
 
19
 
 
20
 
 
21
typedef struct
 
22
{
 
23
        int                     rescount;
 
24
        char       *results[MAXRESULTS];
 
25
        int32           reslens[MAXRESULTS];
 
26
        char       *resbuf;                     /* pointer to the result buffer for pfree */
 
27
}       XPath_Results;
 
28
 
 
29
 
 
30
 
 
31
typedef struct
 
32
{
 
33
        char            currentpath[MAXPATHLENGTH];
 
34
        char       *path;
 
35
        int                     textgrab;
 
36
        char       *resptr;
 
37
        int32           reslen;
 
38
        XPath_Results *xpres;
 
39
}       pgxml_udata;
 
40
 
 
41
 
 
42
#define UD ((pgxml_udata *) userData)