spl_engine.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 SPL_ENGINE_H
  17. #define SPL_ENGINE_H
  18. #include "php.h"
  19. #include "php_spl.h"
  20. #include "zend_interfaces.h"
  21. static inline void spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1)
  22. {
  23. object_init_ex(retval, pce);
  24. zend_call_known_instance_method_with_1_params(pce->constructor, Z_OBJ_P(retval), NULL, arg1);
  25. }
  26. static inline void spl_instantiate_arg_ex2(
  27. zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2)
  28. {
  29. object_init_ex(retval, pce);
  30. zend_call_known_instance_method_with_2_params(
  31. pce->constructor, Z_OBJ_P(retval), NULL, arg1, arg2);
  32. }
  33. static inline void spl_instantiate_arg_n(
  34. zend_class_entry *pce, zval *retval, uint32_t argc, zval *argv)
  35. {
  36. object_init_ex(retval, pce);
  37. zend_call_known_instance_method(pce->constructor, Z_OBJ_P(retval), NULL, argc, argv);
  38. }
  39. #endif /* SPL_ENGINE_H */