xref: /PHP-5.4/ext/spl/spl_engine.h (revision c0d060f5)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2014 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Marcus Boerger <helly@php.net>                              |
16    +----------------------------------------------------------------------+
17  */
18 
19 /* $Id$ */
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, int alloc TSRMLS_DC);
29 
30 PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC);
31 
32 /* {{{ spl_instantiate_arg_ex1 */
spl_instantiate_arg_ex1(zend_class_entry * pce,zval ** retval,int alloc,zval * arg1 TSRMLS_DC)33 static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC)
34 {
35 	spl_instantiate(pce, retval, alloc TSRMLS_CC);
36 
37 	zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC);
38 	return 0;
39 }
40 /* }}} */
41 
42 /* {{{ spl_instantiate_arg_ex2 */
spl_instantiate_arg_ex2(zend_class_entry * pce,zval ** retval,int alloc,zval * arg1,zval * arg2 TSRMLS_DC)43 static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC)
44 {
45 	spl_instantiate(pce, retval, alloc TSRMLS_CC);
46 
47 	zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC);
48 	return 0;
49 }
50 /* }}} */
51 
52 #endif /* SPL_ENGINE_H */
53 
54 /*
55  * Local Variables:
56  * c-basic-offset: 4
57  * tab-width: 4
58  * End:
59  * vim600: fdm=marker
60  * vim: noet sw=4 ts=4
61  */
62