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
23typedef str xml;
24
25mal_export int TYPE_xml;
26
27mal_export ssize_t XMLfromString(const char *src, size_t *len, xml *x, bool external);
28mal_export ssize_t XMLtoString(str *s, size_t *len, const char *src, bool external);
29
30mal_export str XMLxml2str(str *s, xml *x);
31mal_export str XMLstr2xml(xml *x, const char **s);
32mal_export str XMLxmltext(str *s, xml *x);
33mal_export str XMLxml2xml(xml *x, xml *s);
34mal_export str XMLdocument(xml *x, str *s);
35mal_export str XMLcontent(xml *x, str *s);
36mal_export str XMLisdocument(bit *x, str *s);
37mal_export str XMLcomment(xml *x, str *s);
38mal_export str XMLpi(xml *x, str *target, str *s);
39mal_export str XMLroot(xml *x, xml *v, str *version, str *standalone);
40mal_export str XMLparse(xml *x, str *doccont, str *s, str *option);
41mal_export str XMLattribute(xml *ret, str *name, str *val);
42mal_export str XMLelement(xml *ret, str *name, xml *nspace, xml *attr, xml *val);
43mal_export str XMLelementSmall(xml *ret, str *name, xml *val);
44mal_export str XMLconcat(xml *ret, xml *left, xml *right);
45mal_export str XMLforest(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
46
47mal_export size_t XMLquotestring(const char *s, char *buf, size_t len);
48mal_export size_t XMLunquotestring(const char **p, char q, char *buf);
49
50mal_export str XMLprelude(void *ret);
51
52#endif /* XML_H */
53