1 : /*
2 : +----------------------------------------------------------------------+
3 : | PHP Version 5 |
4 : +----------------------------------------------------------------------+
5 : | Copyright (c) 1997-2007 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: spl_engine.h,v 1.19.2.3.2.1 2007/01/01 09:36:07 sebastian Exp $ */
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 : /* {{{ zend_class_entry */
29 : static inline zend_class_entry *spl_get_class_entry(zval *obj TSRMLS_DC)
30 0 : {
31 0 : if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_class_entry) {
32 0 : return Z_OBJ_HT_P(obj)->get_class_entry(obj TSRMLS_CC);
33 : } else {
34 0 : return NULL;
35 : }
36 : }
37 : /* }}} */
38 :
39 : PHPAPI void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC);
40 :
41 : /* {{{ spl_instantiate_arg_ex1 */
42 : static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval **retval, int alloc, zval *arg1 TSRMLS_DC)
43 0 : {
44 0 : spl_instantiate(pce, retval, alloc TSRMLS_CC);
45 :
46 0 : zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC);
47 0 : return 0;
48 : }
49 : /* }}} */
50 :
51 : /* {{{ spl_instantiate_arg_ex2 */
52 : static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval, int alloc, zval *arg1, zval *arg2 TSRMLS_DC)
53 0 : {
54 0 : spl_instantiate(pce, retval, alloc TSRMLS_CC);
55 :
56 0 : zend_call_method(retval, pce, &pce->constructor, pce->constructor->common.function_name, strlen(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC);
57 0 : return 0;
58 : }
59 : /* }}} */
60 :
61 : #endif /* SPL_ENGINE_H */
62 :
63 : /*
64 : * Local Variables:
65 : * c-basic-offset: 4
66 : * tab-width: 4
67 : * End:
68 : * vim600: fdm=marker
69 : * vim: noet sw=4 ts=4
70 : */
|