1 // url.h -- Object representing uniform resource locators
2 // Copyright (C) 2008-2009 Markus Gutschke <markus@shellinabox.com>
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License version 2 as
6 // published by the Free Software Foundation.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License along
14 // with this program; if not, write to the Free Software Foundation, Inc.,
15 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 // In addition to these license terms, the author grants the following
20 // If you modify this program, or any covered work, by linking or
21 // combining it with the OpenSSL project's OpenSSL library (or a
22 // modified version of that library), containing parts covered by the
23 // terms of the OpenSSL or SSLeay licenses, the author
24 // grants you additional permission to convey the resulting work.
25 // Corresponding Source for a non-source form of such a combination
26 // shall include the source code for the parts of OpenSSL used as well
27 // as that of the covered work.
29 // You may at your option choose to remove this additional permission from
30 // the work, or from any part of it.
32 // It is possible to build this program in a way that it loads OpenSSL
33 // libraries at run-time. If doing so, the following notices are required
34 // by the OpenSSL and SSLeay licenses:
36 // This product includes software developed by the OpenSSL Project
37 // for use in the OpenSSL Toolkit. (http://www.openssl.org/)
39 // This product includes cryptographic software written by Eric Young
40 // (eay@cryptsoft.com)
43 // The most up-to-date version of this program is always available from
44 // http://shellinabox.com
49 #include "libhttp/http.h"
51 #include "libhttp/hashmap.h"
52 #include "libhttp/httpconnection.h"
68 struct URL *newURL(const struct HttpConnection *http,
69 const char *buf, int len);
70 void initURL(struct URL *url, const struct HttpConnection *http,
71 const char *buf, int len);
72 void destroyURL(struct URL *url);
73 void deleteURL(struct URL *url);
74 const char *urlGetProtocol(struct URL *url);
75 const char *urlGetUser(struct URL *url);
76 const char *urlGetPassword(struct URL *url);
77 const char *urlGetHost(struct URL *url);
78 int urlGetPort(struct URL *url);
79 const char *urlGetPath(struct URL *url);
80 const char *urlGetPathInfo(struct URL *url);
81 const char *urlGetQuery(struct URL *url);
82 const char *urlGetAnchor(struct URL *url);
83 const char *urlGetURL(struct URL *url);
84 const struct HashMap *urlGetArgs(struct URL *url);