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 | http://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
24 PHPAPI zend_long spl_offset_convert_to_long(zval *offset);
25
spl_instantiate_arg_ex1(zend_class_entry * pce,zval * retval,zval * arg1)26 static inline void spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1)
27 {
28 object_init_ex(retval, pce);
29 zend_call_known_instance_method_with_1_params(pce->constructor, Z_OBJ_P(retval), NULL, arg1);
30 }
31
spl_instantiate_arg_ex2(zend_class_entry * pce,zval * retval,zval * arg1,zval * arg2)32 static inline void spl_instantiate_arg_ex2(
33 zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2)
34 {
35 object_init_ex(retval, pce);
36 zend_call_known_instance_method_with_2_params(
37 pce->constructor, Z_OBJ_P(retval), NULL, arg1, arg2);
38 }
39
spl_instantiate_arg_n(zend_class_entry * pce,zval * retval,uint32_t argc,zval * argv)40 static inline void spl_instantiate_arg_n(
41 zend_class_entry *pce, zval *retval, uint32_t argc, zval *argv)
42 {
43 object_init_ex(retval, pce);
44 zend_call_known_instance_method(pce->constructor, Z_OBJ_P(retval), NULL, argc, argv);
45 }
46
47 #endif /* SPL_ENGINE_H */
48