This source file includes following definitions.
- spl_instantiate_arg_ex1
- spl_instantiate_arg_ex2
- spl_instantiate_arg_n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef SPL_ENGINE_H
22 #define SPL_ENGINE_H
23
24 #include "php.h"
25 #include "php_spl.h"
26 #include "zend_interfaces.h"
27
28 PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object);
29
30 PHPAPI zend_long spl_offset_convert_to_long(zval *offset);
31
32
33 static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1)
34 {
35 zend_function *func = pce->constructor;
36 spl_instantiate(pce, retval);
37
38 zend_call_method(retval, pce, &func, ZSTR_VAL(func->common.function_name), ZSTR_LEN(func->common.function_name), NULL, 1, arg1, NULL);
39 return 0;
40 }
41
42
43
44 static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2)
45 {
46 zend_function *func = pce->constructor;
47 spl_instantiate(pce, retval);
48
49 zend_call_method(retval, pce, &func, ZSTR_VAL(func->common.function_name), ZSTR_LEN(func->common.function_name), NULL, 2, arg1, arg2);
50 return 0;
51 }
52
53
54
55 static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv)
56 {
57 zend_function *func = pce->constructor;
58 zend_fcall_info fci;
59 zend_fcall_info_cache fcc;
60 zval dummy;
61
62 spl_instantiate(pce, retval);
63
64 fci.size = sizeof(zend_fcall_info);
65 fci.function_table = &pce->function_table;
66 ZVAL_STR(&fci.function_name, func->common.function_name);
67 fci.object = Z_OBJ_P(retval);
68 fci.symbol_table = NULL;
69 fci.retval = &dummy;
70 fci.param_count = argc;
71 fci.params = argv;
72 fci.no_separation = 1;
73
74 fcc.initialized = 1;
75 fcc.function_handler = func;
76 fcc.calling_scope = EG(scope);
77 fcc.called_scope = pce;
78 fcc.object = Z_OBJ_P(retval);
79
80 zend_call_function(&fci, &fcc);
81 }
82
83
84 #endif
85
86
87
88
89
90
91
92
93