spl_functions.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. | Authors: Marcus Boerger <helly@php.net> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef PHP_FUNCTIONS_H
  17. #define PHP_FUNCTIONS_H
  18. #include "php.h"
  19. typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type);
  20. #define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \
  21. zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value);
  22. /* sub: whether to allow subclasses/interfaces
  23. allow = 0: allow all classes and interfaces
  24. allow > 0: allow all that match and mask ce_flags
  25. allow < 0: disallow all that match and mask ce_flags
  26. */
  27. void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags);
  28. void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags);
  29. void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags);
  30. int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags);
  31. /* caller must efree(return) */
  32. zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len);
  33. #endif /* PHP_FUNCTIONS_H */