1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | /* |
10 | * @- Implementation |
11 | * The implementation of the XML atomary type is based |
12 | * on linking in a portable library, e.g. libxml2 ? |
13 | */ |
14 | #ifndef XML_H |
15 | #define XML_H |
16 | |
17 | #include "gdk.h" |
18 | #include "mal.h" |
19 | #include "mal_client.h" |
20 | #include "mal_instruction.h" |
21 | #include "mal_exception.h" |
22 | |
23 | typedef str xml; |
24 | |
25 | mal_export int TYPE_xml; |
26 | |
27 | mal_export ssize_t XMLfromString(const char *src, size_t *len, xml *x, bool external); |
28 | mal_export ssize_t XMLtoString(str *s, size_t *len, const char *src, bool external); |
29 | |
30 | mal_export str XMLxml2str(str *s, xml *x); |
31 | mal_export str XMLstr2xml(xml *x, const char **s); |
32 | mal_export str XMLxmltext(str *s, xml *x); |
33 | mal_export str XMLxml2xml(xml *x, xml *s); |
34 | mal_export str XMLdocument(xml *x, str *s); |
35 | mal_export str XMLcontent(xml *x, str *s); |
36 | mal_export str XMLisdocument(bit *x, str *s); |
37 | mal_export str (xml *x, str *s); |
38 | mal_export str XMLpi(xml *x, str *target, str *s); |
39 | mal_export str XMLroot(xml *x, xml *v, str *version, str *standalone); |
40 | mal_export str XMLparse(xml *x, str *doccont, str *s, str *option); |
41 | mal_export str XMLattribute(xml *ret, str *name, str *val); |
42 | mal_export str XMLelement(xml *ret, str *name, xml *nspace, xml *attr, xml *val); |
43 | mal_export str XMLelementSmall(xml *ret, str *name, xml *val); |
44 | mal_export str XMLconcat(xml *ret, xml *left, xml *right); |
45 | mal_export str XMLforest(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); |
46 | |
47 | mal_export size_t XMLquotestring(const char *s, char *buf, size_t len); |
48 | mal_export size_t XMLunquotestring(const char **p, char q, char *buf); |
49 | |
50 | mal_export str XMLprelude(void *ret); |
51 | |
52 | #endif /* XML_H */ |
53 | |