url_scanner_ex.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef URL_SCANNER_EX_H
  19. #define URL_SCANNER_EX_H
  20. PHP_MINIT_FUNCTION(url_scanner_ex);
  21. PHP_MSHUTDOWN_FUNCTION(url_scanner_ex);
  22. PHP_RINIT_FUNCTION(url_scanner_ex);
  23. PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
  24. 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);
  25. PHPAPI int php_url_scanner_add_session_var(char *name, size_t name_len, char *value, size_t value_len, int encode);
  26. PHPAPI int php_url_scanner_reset_session_var(zend_string *name, int encode);
  27. PHPAPI int php_url_scanner_reset_session_vars(void);
  28. PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int encode);
  29. PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode);
  30. PHPAPI int php_url_scanner_reset_vars(void);
  31. #include "zend_smart_str_public.h"
  32. typedef struct {
  33. /* Used by the mainloop of the scanner */
  34. smart_str tag; /* read only */
  35. smart_str arg; /* read only */
  36. smart_str val; /* read only */
  37. smart_str buf;
  38. /* The result buffer */
  39. smart_str result;
  40. /* The data which is appended to each relative URL/FORM */
  41. smart_str form_app, url_app;
  42. int active;
  43. char *lookup_data;
  44. int state;
  45. int type;
  46. smart_str attr_val;
  47. int tag_type;
  48. int attr_type;
  49. /* Everything above is zeroed in RINIT */
  50. HashTable *tags;
  51. } url_adapt_state_ex_t;
  52. #endif