php_var.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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: Jani Lehtimäki <jkl@njet.net> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef PHP_VAR_H
  17. #define PHP_VAR_H
  18. #include "ext/standard/basic_functions.h"
  19. #include "zend_smart_str_public.h"
  20. PHP_MINIT_FUNCTION(var);
  21. PHPAPI void php_var_dump(zval *struc, int level);
  22. PHPAPI void php_var_export(zval *struc, int level);
  23. PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf);
  24. PHPAPI void php_debug_zval_dump(zval *struc, int level);
  25. typedef struct php_serialize_data *php_serialize_data_t;
  26. typedef struct php_unserialize_data *php_unserialize_data_t;
  27. PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data);
  28. PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
  29. PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
  30. PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
  31. PHPAPI php_serialize_data_t php_var_serialize_init(void);
  32. PHPAPI void php_var_serialize_destroy(php_serialize_data_t d);
  33. PHPAPI php_unserialize_data_t php_var_unserialize_init(void);
  34. PHPAPI void php_var_unserialize_destroy(php_unserialize_data_t d);
  35. PHPAPI HashTable *php_var_unserialize_get_allowed_classes(php_unserialize_data_t d);
  36. PHPAPI void php_var_unserialize_set_allowed_classes(php_unserialize_data_t d, HashTable *classes);
  37. PHPAPI void php_var_unserialize_set_max_depth(php_unserialize_data_t d, zend_long max_depth);
  38. PHPAPI zend_long php_var_unserialize_get_max_depth(php_unserialize_data_t d);
  39. PHPAPI void php_var_unserialize_set_cur_depth(php_unserialize_data_t d, zend_long cur_depth);
  40. PHPAPI zend_long php_var_unserialize_get_cur_depth(php_unserialize_data_t d);
  41. #define PHP_VAR_SERIALIZE_INIT(d) \
  42. (d) = php_var_serialize_init()
  43. #define PHP_VAR_SERIALIZE_DESTROY(d) \
  44. php_var_serialize_destroy(d)
  45. #define PHP_VAR_UNSERIALIZE_INIT(d) \
  46. (d) = php_var_unserialize_init()
  47. #define PHP_VAR_UNSERIALIZE_DESTROY(d) \
  48. php_var_unserialize_destroy(d)
  49. PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, const size_t buf_len, HashTable *options, const char* function_name);
  50. PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval *nzval);
  51. PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val);
  52. PHPAPI zval *var_tmp_var(php_unserialize_data_t *var_hashx);
  53. PHPAPI void var_destroy(php_unserialize_data_t *var_hash);
  54. #endif /* PHP_VAR_H */