1 /* {{{ Class CairoPath */
3 static zend_class_entry
* CairoPath_ce_ptr
= NULL
;
4 static zend_object_handlers CairoPath_handlers
;
14 /* {{{ proto void construct()
16 PHP_METHOD(CairoPath
, __construct
)
18 zend_class_entry
* _this_ce
;
23 if (ZEND_NUM_ARGS()>0) {
28 php_error(E_WARNING
, "__construct: not yet implemented"); RETURN_FALSE
;
35 /* {{{ proto string str()
37 PHP_METHOD(CairoPath
, str
)
39 zend_class_entry
* _this_ce
;
41 zval
* _this_zval
= NULL
;
45 if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC
, getThis(), "O", &_this_zval
, CairoPath_ce_ptr
) == FAILURE
) {
49 _this_ce
= Z_OBJCE_P(_this_zval
);
52 php_error(E_WARNING
, "str: not yet implemented"); RETURN_FALSE
;
54 RETURN_STRINGL("", 0, 1);
59 static zend_function_entry CairoPath_methods
[] = {
60 PHP_ME(CairoPath
, __construct
, NULL
, /**/ZEND_ACC_PUBLIC
| ZEND_ACC_CTOR
)
61 PHP_ME(CairoPath
, str
, NULL
, /**/ZEND_ACC_PUBLIC
)
67 static void CairoPath_object_dtor(void *object
)
69 path_object
*path
= (path_object
*)object
;
70 zend_hash_destroy(path
->std
.properties
);
72 cairo_path_destroy(path
->path
);
77 static zend_object_value
CairoPath_object_new(zend_class_entrt
*ce
)
79 zend_object_value retval
;
83 path
= emalloc(sizeof(path_object
));
84 memcpy(path
,0,sizeof(path_object
));
88 ALLOC_HASHTABLE(path
->std
.properties
);
89 zend_hash_init(path
->std
.properties
, 0, NULL
, ZVAL_PTR_DTOR
, 0);
90 zend_hash_copy(path
->std
.properties
, &ce
->default_properties
, copy_ctor_func_t zval_add_ref
, (void *) &temp
, sizeof(zval
*));
91 retval
.handle
= zend_objects_store_put(path
, NULL
, (zend_object_free_storage_t
)CairoPath_object_dtor
, NULL TSRMLS_CC
);
92 retval
.handlers
= &CairoPath_handlers
;
97 static void class_init_CairoPath(void)
101 INIT_CLASS_ENTRY(ce
, "CairoPath", CairoPath_methods
);
102 CairoPath_ce_ptr
= zend_register_internal_class(&ce
);
103 CairoPath_ce_ptr
->create_object
= CairoPath_object_new
;
104 memcpy(&CarioPath_handlers
, zend_get_std_object_handlers(),sizeof(zend_object_handlers
));
105 CairoPath_handlers
.clone_obj
= NULL
;
109 /* }}} Class CairoPath */