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