| 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 | |
| 21 | typedef str url; |
| 22 | |
| 23 | mal_export str escape_str(str *retval, str s); |
| 24 | mal_export str unescape_str(str *retval, str s); |
| 25 | mal_export str URLnoop(url *u, url *val); |
| 26 | mal_export str URLnew(url *u, str *val); |
| 27 | mal_export str URLgetAnchor(str *retval, url *val); |
| 28 | mal_export str URLgetBasename(str *retval, url *t); |
| 29 | mal_export str URLgetContent(str *retval, url *Str1); |
| 30 | mal_export str URLgetContext(str *retval, url *val); |
| 31 | mal_export str URLgetDomain(str *retval, url *tv); |
| 32 | mal_export str URLgetExtension(str *retval, url *tv); |
| 33 | mal_export str URLgetFile(str *retval, url *tv); |
| 34 | mal_export str URLgetHost(str *retval, url *tv); |
| 35 | mal_export str URLgetPort(str *retval, url *tv); |
| 36 | mal_export str URLgetProtocol(str *retval, url *tv); |
| 37 | mal_export str URLgetQuery(str *retval, url *tv); |
| 38 | mal_export str URLgetUser(str *retval, url *tv); |
| 39 | mal_export str URLgetRobotURL(str *retval, url *tv); |
| 40 | mal_export str URLisaURL(bit *retval, url *tv); |
| 41 | mal_export str URLnew4(url *u, str *protocol, str *server, |
| 42 | int *port, str *file); |
| 43 | mal_export str URLnew3(url *u, str *protocol, str *server, str *file); |
| 44 | mal_export ssize_t URLfromString(const char *src, size_t *len, str *u, bool external); |
| 45 | mal_export ssize_t URLtoString(str *s, size_t *len, const char *src, bool external); |
| 46 | |
| 47 | #endif /* URL_H */ |
| 48 | |