xref: /PHP-8.1/ext/standard/url_scanner_ex.h (revision 01b3fc03)
1 /*
2   +----------------------------------------------------------------------+
3   | Copyright (c) The PHP Group                                          |
4   +----------------------------------------------------------------------+
5   | This source file is subject to version 3.01 of the PHP license,      |
6   | that is bundled with this package in the file LICENSE, and is        |
7   | available through the world-wide-web at the following url:           |
8   | https://www.php.net/license/3_01.txt                                 |
9   | If you did not receive a copy of the PHP license and are unable to   |
10   | obtain it through the world-wide-web, please send a note to          |
11   | license@php.net so we can mail you a copy immediately.               |
12   +----------------------------------------------------------------------+
13   | Author: Sascha Schumann <sascha@schumann.cx>                         |
14   +----------------------------------------------------------------------+
15 */
16 
17 #ifndef URL_SCANNER_EX_H
18 #define URL_SCANNER_EX_H
19 
20 PHP_MINIT_FUNCTION(url_scanner_ex);
21 PHP_MSHUTDOWN_FUNCTION(url_scanner_ex);
22 
23 PHP_RINIT_FUNCTION(url_scanner_ex);
24 PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
25 
26 PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen, int encode);
27 PHPAPI int php_url_scanner_add_session_var(const char *name, size_t name_len, const char *value, size_t value_len, int encode);
28 PHPAPI int php_url_scanner_reset_session_var(zend_string *name, int encode);
29 PHPAPI int php_url_scanner_reset_session_vars(void);
30 PHPAPI int php_url_scanner_add_var(const char *name, size_t name_len, const char *value, size_t value_len, int encode);
31 PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode);
32 PHPAPI int php_url_scanner_reset_vars(void);
33 
34 #include "zend_smart_str_public.h"
35 
36 typedef struct {
37 	/* Used by the mainloop of the scanner */
38 	smart_str tag; /* read only */
39 	smart_str arg; /* read only */
40 	smart_str val; /* read only */
41 	smart_str buf;
42 
43 	/* The result buffer */
44 	smart_str result;
45 
46 	/* The data which is appended to each relative URL/FORM */
47 	smart_str form_app, url_app;
48 
49 	int active;
50 
51 	char *lookup_data;
52 	int state;
53 
54 	int type;
55 	smart_str attr_val;
56 	int tag_type;
57 	int attr_type;
58 
59 	/* Everything above is zeroed in RINIT */
60 	HashTable *tags;
61 } url_adapt_state_ex_t;
62 
63 #endif
64