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