1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 7 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2016 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: Jim Winstead <jimw@php.net> |
16 +----------------------------------------------------------------------+
17 */
18 /* $Id$ */
19
20 #ifndef URL_H
21 #define URL_H
22
23 typedef struct php_url {
24 char *scheme;
25 char *user;
26 char *pass;
27 char *host;
28 unsigned short port;
29 char *path;
30 char *query;
31 char *fragment;
32 } php_url;
33
34 PHPAPI void php_url_free(php_url *theurl);
35 PHPAPI php_url *php_url_parse(char const *str);
36 PHPAPI php_url *php_url_parse_ex(char const *str, size_t length);
37 PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */
38 PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */
39 PHPAPI zend_string *php_url_encode(char const *s, size_t len);
40 PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len);
41 PHPAPI char *php_replace_controlchars_ex(char *str, size_t len);
42
43 PHP_FUNCTION(parse_url);
44 PHP_FUNCTION(urlencode);
45 PHP_FUNCTION(urldecode);
46 PHP_FUNCTION(rawurlencode);
47 PHP_FUNCTION(rawurldecode);
48 PHP_FUNCTION(get_headers);
49
50 #define PHP_URL_SCHEME 0
51 #define PHP_URL_HOST 1
52 #define PHP_URL_PORT 2
53 #define PHP_URL_USER 3
54 #define PHP_URL_PASS 4
55 #define PHP_URL_PATH 5
56 #define PHP_URL_QUERY 6
57 #define PHP_URL_FRAGMENT 7
58
59 #define PHP_QUERY_RFC1738 1
60 #define PHP_QUERY_RFC3986 2
61
62 #endif /* URL_H */
63
64 /*
65 * Local variables:
66 * tab-width: 4
67 * c-basic-offset: 4
68 * End:
69 */