1 /* {{{ Class CairoPath */
3 static zend_class_entry
* CairoPath_ce_ptr
= NULL
;
4 static zend_object_handlers CairoPath_handlers
;
15 /* {{{ proto void construct()
17 PHP_METHOD(CairoPath
, __construct
)
19 zend_class_entry
* _this_ce
;
24 if (ZEND_NUM_ARGS()>0) {
29 php_error(E_WARNING
, "__construct: not yet implemented"); RETURN_FALSE
;
36 /* {{{ proto string str()
38 PHP_METHOD(CairoPath
, str
)
40 zend_class_entry
* _this_ce
;
42 zval
* _this_zval
= NULL
;
46 if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC
, getThis(), "O", &_this_zval
, CairoPath_ce_ptr
) == FAILURE
) {
50 _this_ce
= Z_OBJCE_P(_this_zval
);
53 php_error(E_WARNING
, "str: not yet implemented"); RETURN_FALSE
;
55 RETURN_STRINGL("", 0, 1);
60 static zend_function_entry CairoPath_methods
[] = {
61 PHP_ME(CairoPath
, __construct
, NULL
, /**/ZEND_ACC_PUBLIC
| ZEND_ACC_CTOR
)
62 PHP_ME(CairoPath
, str
, NULL
, /**/ZEND_ACC_PUBLIC
)
68 static void CairoPath_object_dtor(void *object
)
70 path_object
*path
= (path_object
*)object
;
71 zend_hash_destroy(path
->std
.properties
);
73 cairo_path_destroy(path
->path
);
78 static zend_object_value
CairoPath_object_new(zend_class_entry
*ce
)
80 zend_object_value retval
;
84 path
= emalloc(sizeof(path_object
));
85 memcpy(path
,0,sizeof(path_object
));
89 ALLOC_HASHTABLE(path
->std
.properties
);
90 zend_hash_init(path
->std
.properties
, 0, NULL
, ZVAL_PTR_DTOR
, 0);
91 zend_hash_copy(path
->std
.properties
, &ce
->default_properties
, (copy_ctor_func_t
) zval_add_ref
, (void *) &temp
, sizeof(zval
*));
92 retval
.handle
= zend_objects_store_put(path
, NULL
, (zend_objects_free_object_storage_t
)CairoPath_object_dtor
, NULL TSRMLS_CC
);
93 retval
.handlers
= &CairoPath_handlers
;
98 static void class_init_CairoPath(void)
102 INIT_CLASS_ENTRY(ce
, "CairoPath", CairoPath_methods
);
103 CairoPath_ce_ptr
= zend_register_internal_class(&ce
);
104 CairoPath_ce_ptr
->create_object
= CairoPath_object_new
;
105 memcpy(&CairoPath_handlers
, zend_get_std_object_handlers(), sizeof(zend_object_handlers
));
106 CairoPath_handlers
.clone_obj
= NULL
;
110 /* }}} Class CairoPath */