you can add functions to your object:
you may declare global
static zend_function_entry
php_my_class_functions[] = {
ZEND_FE (func1, NULL)
ZEND_FE (func2, NULL)
{NULL, NULL, NULL}
};
you may declare local
zend_class_entry my_class_entry;
zend_class_entry *ce;
you should do something like this
INIT_CLASS_ENTRY(
func_class_entry,
"CLASSNAME",
php_my_class_functions);
ce = emalloc(sizeof(zend_class_entry));
ce = zend_register_internal_class (
&my_class_entry TSRMLS_CC);
object_init_ex(return_value, ce);
this should produce a returned object in your php_code:
$myobj = yourfunc(/*yourparams*/);
$myobj->func1();
$myobj->func2();