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-06-09 14:52:50 +00:00
|
|
|
static int com_hash(rpc_string, rpc_string *, int, char *, int);
|
|
|
|
static int com_name(rpc_string, rpc_string *, int);
|
|
|
|
static int com_ctor(rpc_string, void **, int , zval ***);
|
2002-03-19 18:46:28 +00:00
|
|
|
static int com_dtor(void **);
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_call(rpc_string, void **, zval **, int, zval ***);
|
|
|
|
static int com_get(rpc_string, zval *, void **);
|
|
|
|
static int com_set(rpc_string, zval *, void **);
|
2002-03-19 18:46:28 +00:00
|
|
|
static int com_compare(void **, void **);
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_has_property(rpc_string, void **);
|
|
|
|
static int com_unset_property(rpc_string, void **);
|
2002-03-19 18:46:28 +00:00
|
|
|
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)
|
2002-06-09 14:52:50 +00:00
|
|
|
TRUE, /* poolable */
|
2002-03-19 23:28:52 +00:00
|
|
|
HASH_AS_INT_WITH_SIGNATURE,
|
2002-03-16 16:15:34 +00:00
|
|
|
com_hash,
|
2002-06-09 14:52:50 +00:00
|
|
|
com_name,
|
2002-03-16 16:15:34 +00:00
|
|
|
com_ctor,
|
|
|
|
com_dtor,
|
|
|
|
com_call,
|
|
|
|
com_get,
|
|
|
|
com_set,
|
|
|
|
com_compare,
|
|
|
|
com_has_property,
|
|
|
|
com_unset_property,
|
|
|
|
com_get_properties
|
|
|
|
RPC_REGISTER_HANDLERS_END()
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
/* register ini settings */
|
|
|
|
RPC_INI_START(com)
|
|
|
|
PHP_INI_ENTRY_EX("com.allow_dcom", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb)
|
|
|
|
PHP_INI_ENTRY_EX("com.autoregister_typelib", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb)
|
|
|
|
PHP_INI_ENTRY_EX("com.autoregister_verbose", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb)
|
|
|
|
PHP_INI_ENTRY_EX("com.autoregister_casesensitive", "1", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb)
|
|
|
|
RPC_INI_END()
|
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
/* 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-06-09 14:52:50 +00:00
|
|
|
ZEND_FE(com_release, 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)
|
2002-06-09 14:52:50 +00:00
|
|
|
ZEND_FALIAS(release, com_release, NULL)
|
2002-03-16 16:15:34 +00:00
|
|
|
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-06-09 14:52:50 +00:00
|
|
|
static int com_hash(rpc_string name, rpc_string *hash, int num_args, char *arg_types, int type)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
2002-06-09 14:52:50 +00:00
|
|
|
hash->str = strdup(name.str);
|
|
|
|
hash->len = name.len;
|
2002-03-19 03:36:16 +00:00
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_name(rpc_string hash, rpc_string *name, int type)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
2002-06-09 14:52:50 +00:00
|
|
|
name->str = strdup(hash.str);
|
|
|
|
name->len = hash.len;
|
|
|
|
|
2002-03-16 16:15:34 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_ctor(rpc_string class_name, void **data, int num_args, zval **args[])
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_dtor(void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_call(rpc_string method_name, void **data, zval **return_value, int num_args, zval **args[])
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
2002-03-15 00:00:34 +00:00
|
|
|
}
|
2002-03-16 16:15:34 +00:00
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_get(rpc_string property_name, zval *return_value, void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_set(rpc_string property_name, zval *value, void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_compare(void **data1, void **data2)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_has_property(rpc_string property_name, void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-06-09 14:52:50 +00:00
|
|
|
static int com_unset_property(rpc_string property_name, void **data)
|
2002-03-16 16:15:34 +00:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int com_get_properties(HashTable **properties, void **data)
|
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* custom functions */
|
|
|
|
ZEND_FUNCTION(com_addref)
|
|
|
|
{
|
2002-06-09 14:52:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ZEND_FUNCTION(com_release)
|
|
|
|
{
|
2002-03-16 16:15:34 +00:00
|
|
|
}
|