1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 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: Sascha Schumann <sascha@schumann.cx> | 16 +----------------------------------------------------------------------+ 17 */ 18 19 #ifndef URL_SCANNER_EX_H 20 #define URL_SCANNER_EX_H 21 22 PHP_MINIT_FUNCTION(url_scanner_ex); 23 PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); 24 25 PHP_RINIT_FUNCTION(url_scanner_ex); 26 PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); 27 28 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); 29 PHPAPI int php_url_scanner_add_session_var(char *name, size_t name_len, char *value, size_t value_len, int encode); 30 PHPAPI int php_url_scanner_reset_session_var(zend_string *name, int encode); 31 PHPAPI int php_url_scanner_reset_session_vars(void); 32 PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int encode); 33 PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode); 34 PHPAPI int php_url_scanner_reset_vars(void); 35 36 #include "zend_smart_str_public.h" 37 38 typedef struct { 39 /* Used by the mainloop of the scanner */ 40 smart_str tag; /* read only */ 41 smart_str arg; /* read only */ 42 smart_str val; /* read only */ 43 smart_str buf; 44 45 /* The result buffer */ 46 smart_str result; 47 48 /* The data which is appended to each relative URL/FORM */ 49 smart_str form_app, url_app; 50 51 int active; 52 53 char *lookup_data; 54 int state; 55 56 int type; 57 smart_str attr_val; 58 int tag_type; 59 int attr_type; 60 61 /* Everything above is zeroed in RINIT */ 62 HashTable *tags; 63 } url_adapt_state_ex_t; 64 65 #endif 66