xref: /PHP-5.5/ext/standard/url.h (revision 73c1be26)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2015 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, int length);
37 PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */
38 PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */
39 PHPAPI char *php_url_encode(char const *s, int len, int *new_length);
40 PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length);
41 
42 PHP_FUNCTION(parse_url);
43 PHP_FUNCTION(urlencode);
44 PHP_FUNCTION(urldecode);
45 PHP_FUNCTION(rawurlencode);
46 PHP_FUNCTION(rawurldecode);
47 PHP_FUNCTION(get_headers);
48 
49 #define PHP_URL_SCHEME 0
50 #define PHP_URL_HOST 1
51 #define PHP_URL_PORT 2
52 #define PHP_URL_USER 3
53 #define PHP_URL_PASS 4
54 #define PHP_URL_PATH 5
55 #define PHP_URL_QUERY 6
56 #define PHP_URL_FRAGMENT 7
57 
58 #define PHP_QUERY_RFC1738 1
59 #define PHP_QUERY_RFC3986 2
60 
61 #endif /* URL_H */
62 
63 /*
64  * Local variables:
65  * tab-width: 4
66  * c-basic-offset: 4
67  * End:
68  */
69