url_scanner_ex.h 2.3 KB

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