2002-03-16 16:15:34 +00:00
|
|
|
#include "com.h"
|
2002-03-15 00:00:34 +00:00
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
/* protos */
|
2002-03-19 23:28:52 +00:00
|
|
|
static int com_hash(char *, zend_uint, char **, zend_uint *, int, char *, int);
|
2002-03-19 18:46:28 +00:00
|
|
|
static int com_ctor(char *, zend_uint, void **, int , zval ***);
|
|
|
|
static int com_dtor(void **);
|
|
|
|
static int com_call(char *, zend_uint, void **, zval **, int, zval ***);
|
|
|
|
static int com_get(char *, zend_uint, zval *, void **);
|
2002-04-22 14:25:46 +00:00
|
|
|
static int com_set(char *, zend_uint, zval *, void **);
|
2002-03-19 18:46:28 +00:00
|
|
|
static int com_compare(void **, void **);
|
|
|
|
static int com_get_classname(char **, zend_uint *, void **);
|
|
|
|
static int com_has_property(char *, zend_uint, void **);
|
|
|
|
static int com_unset_property(char *, zend_uint, void **);
|
|
|
|
static int com_get_properties(HashTable **, void **);
|
2002-03-15 23:28:10 +00:00
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
|
|
|
|
/* register rpc callback function */
|
2002-03-19 03:36:16 +00:00
|
|
|
RPC_REGISTER_HANDLERS_START(com)
|
|
|
|
POOL,
|
2002-03-19 23:28:52 +00:00
|
|
|
HASH_AS_INT_WITH_SIGNATURE,
|
2002-03-16 16:15:34 +00:00
|
|
|
com_hash,
|
|
|
|
com_ctor,
|
|
|
|
com_dtor,
|
|
|
|
com_call,
|
|
|
|
com_get,
|
|
|
|
com_set,
|
|
|
|
com_compare,
|
|
|
|
com_get_classname,
|
|
|
|
com_has_property,
|
|
|
|
com_unset_property,
|
|
|
|
com_get_properties
|
|
|
|
RPC_REGISTER_HANDLERS_END()
|
|
|
|
|
|
|
|
/* register userspace functions */
|
2002-03-15 23:28:10 +00:00
|
|
|
RPC_FUNCTION_ENTRY_START(com)
|
2002-03-16 16:15:34 +00:00
|
|
|
ZEND_FALIAS(com_invoke, rpc_call, NULL)
|
|
|
|
ZEND_FE(com_addref, NULL)
|
2002-03-15 23:28:10 +00:00
|
|
|
RPC_FUNCTION_ENTRY_END()
|
2002-03-15 00:00:34 +00:00
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
/* register class methods */
|
|
|
|
RPC_METHOD_ENTRY_START(com)
|
|
|
|
ZEND_FALIAS(addref, com_addref, NULL)
|
|
|
|
RPC_METHOD_ENTRY_END()
|
|
|
|
|
|
|
|
/* init function that is called before the class is registered
|
|
|
|
* so you can do any tricky stuff in here
|
|
|
|
*/
|
|
|
|
RPC_INIT_FUNCTION(com)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/* rpc handler functions */
|
|
|
|
|
2002-03-19 23:28:52 +00:00
|
|
|
static int com_hash(char *name, zend_uint name_len, char **hash, zend_uint *hash_len, int num_args, char *arg_types, int type)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
2002-03-19 03:36:16 +00:00
|
|
|
*hash = strdup(name);
|
|
|
|
*hash_len = name_len;
|
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-03-19 03:36:16 +00:00
|
|
|
static int com_ctor(char *class_name, zend_uint class_name_len, void **data, int num_args, zval **args[])
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_dtor(void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-03-19 18:46:28 +00:00
|
|
|
static int com_call(char *method_name, zend_uint method_name_len, void **data, zval **return_value, int num_args, zval **args[])
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_get(char *property_name, zend_uint property_name_len, zval *return_value, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
2002-03-15 00:00:34 +00:00
|
|
|
}
|
2002-03-16 16:15:34 +00:00
|
|
|
|
2002-04-22 14:25:46 +00:00
|
|
|
static int com_set(char *property_name, zend_uint property_name_len, zval *value, void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_compare(void **data1, void **data2)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_get_classname(char **class_name, zend_uint *class_name_length, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_has_property(char *property_name, zend_uint property_name_length, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_unset_property(char *property_name, zend_uint property_name_length, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_get_properties(HashTable **properties, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* custom functions */
|
|
|
|
ZEND_FUNCTION(com_addref)
|
|
|
|
{
|
|
|
|
}
|