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 * @-
11 * The key action is to break an url into its constituents.
12 * Parsing is done for each individual request, because this way we
13 * secure concurrent use from different threads.
14 */
15#ifndef URL_H
16#define URL_H
17
18#include "gdk.h"
19#include <ctype.h>
20
21typedef str url;
22
23mal_export str escape_str(str *retval, str s);
24mal_export str unescape_str(str *retval, str s);
25mal_export str URLnoop(url *u, url *val);
26mal_export str URLnew(url *u, str *val);
27mal_export str URLgetAnchor(str *retval, url *val);
28mal_export str URLgetBasename(str *retval, url *t);
29mal_export str URLgetContent(str *retval, url *Str1);
30mal_export str URLgetContext(str *retval, url *val);
31mal_export str URLgetDomain(str *retval, url *tv);
32mal_export str URLgetExtension(str *retval, url *tv);
33mal_export str URLgetFile(str *retval, url *tv);
34mal_export str URLgetHost(str *retval, url *tv);
35mal_export str URLgetPort(str *retval, url *tv);
36mal_export str URLgetProtocol(str *retval, url *tv);
37mal_export str URLgetQuery(str *retval, url *tv);
38mal_export str URLgetUser(str *retval, url *tv);
39mal_export str URLgetRobotURL(str *retval, url *tv);
40mal_export str URLisaURL(bit *retval, url *tv);
41mal_export str URLnew4(url *u, str *protocol, str *server,
42 int *port, str *file);
43mal_export str URLnew3(url *u, str *protocol, str *server, str *file);
44mal_export ssize_t URLfromString(const char *src, size_t *len, str *u, bool external);
45mal_export ssize_t URLtoString(str *s, size_t *len, const char *src, bool external);
46
47#endif /* URL_H */
48