~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/include/utils/xml.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * xml.h
 
4
 *        Declarations for XML data type support.
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * src/include/utils/xml.h
 
11
 *
 
12
 *-------------------------------------------------------------------------
 
13
 */
 
14
 
 
15
#ifndef XML_H
 
16
#define XML_H
 
17
 
 
18
#include "fmgr.h"
 
19
#include "nodes/execnodes.h"
 
20
#include "nodes/primnodes.h"
 
21
 
 
22
typedef struct varlena xmltype;
 
23
 
 
24
#define DatumGetXmlP(X)         ((xmltype *) PG_DETOAST_DATUM(X))
 
25
#define XmlPGetDatum(X)         PointerGetDatum(X)
 
26
 
 
27
#define PG_GETARG_XML_P(n)      DatumGetXmlP(PG_GETARG_DATUM(n))
 
28
#define PG_RETURN_XML_P(x)      PG_RETURN_POINTER(x)
 
29
 
 
30
extern Datum xml_in(PG_FUNCTION_ARGS);
 
31
extern Datum xml_out(PG_FUNCTION_ARGS);
 
32
extern Datum xml_recv(PG_FUNCTION_ARGS);
 
33
extern Datum xml_send(PG_FUNCTION_ARGS);
 
34
extern Datum xmlcomment(PG_FUNCTION_ARGS);
 
35
extern Datum xmlconcat2(PG_FUNCTION_ARGS);
 
36
extern Datum texttoxml(PG_FUNCTION_ARGS);
 
37
extern Datum xmltotext(PG_FUNCTION_ARGS);
 
38
extern Datum xmlvalidate(PG_FUNCTION_ARGS);
 
39
extern Datum xpath(PG_FUNCTION_ARGS);
 
40
extern Datum xpath_exists(PG_FUNCTION_ARGS);
 
41
extern Datum xmlexists(PG_FUNCTION_ARGS);
 
42
extern Datum xml_is_well_formed(PG_FUNCTION_ARGS);
 
43
extern Datum xml_is_well_formed_document(PG_FUNCTION_ARGS);
 
44
extern Datum xml_is_well_formed_content(PG_FUNCTION_ARGS);
 
45
 
 
46
extern Datum table_to_xml(PG_FUNCTION_ARGS);
 
47
extern Datum query_to_xml(PG_FUNCTION_ARGS);
 
48
extern Datum cursor_to_xml(PG_FUNCTION_ARGS);
 
49
extern Datum table_to_xmlschema(PG_FUNCTION_ARGS);
 
50
extern Datum query_to_xmlschema(PG_FUNCTION_ARGS);
 
51
extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS);
 
52
extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
 
53
extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
 
54
 
 
55
extern Datum schema_to_xml(PG_FUNCTION_ARGS);
 
56
extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS);
 
57
extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
 
58
 
 
59
extern Datum database_to_xml(PG_FUNCTION_ARGS);
 
60
extern Datum database_to_xmlschema(PG_FUNCTION_ARGS);
 
61
extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS);
 
62
 
 
63
typedef enum
 
64
{
 
65
        XML_STANDALONE_YES,
 
66
        XML_STANDALONE_NO,
 
67
        XML_STANDALONE_NO_VALUE,
 
68
        XML_STANDALONE_OMITTED
 
69
}       XmlStandaloneType;
 
70
 
 
71
extern void pg_xml_init(void);
 
72
extern void xml_ereport(int level, int sqlcode, const char *msg);
 
73
extern xmltype *xmlconcat(List *args);
 
74
extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext);
 
75
extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
 
76
extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null);
 
77
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
 
78
extern bool xml_is_document(xmltype *arg);
 
79
extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg);
 
80
extern char *escape_xml(const char *str);
 
81
 
 
82
extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, bool escape_period);
 
83
extern char *map_xml_name_to_sql_identifier(char *name);
 
84
extern char *map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings);
 
85
 
 
86
typedef enum
 
87
{
 
88
        XMLBINARY_BASE64,
 
89
        XMLBINARY_HEX
 
90
}       XmlBinaryType;
 
91
 
 
92
extern int      xmlbinary;                      /* XmlBinaryType, but int for guc enum */
 
93
 
 
94
extern int      xmloption;                      /* XmlOptionType, but int for guc enum */
 
95
 
 
96
#endif   /* XML_H */