cvs: php4 /ext/msession msession.c
| From: | Hartmut Holzgraefe | Date: | Thu, 06 Dec 2001 21:55:34 +0000 |
| Subject: | cvs: php4 /ext/msession msession.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8489@lists.php.net to get a copy of this message | ||
hholzgra Thu Dec 6 16:55:34 2001 EDT
Modified files:
/php4/ext/msession msession.c
Log:
some cleanup of ext_skel stuff
Index: php4/ext/msession/msession.c
diff -u php4/ext/msession/msession.c:1.8 php4/ext/msession/msession.c:1.9
--- php4/ext/msession/msession.c:1.8 Thu Dec 6 16:51:51 2001
+++ php4/ext/msession/msession.c Thu Dec 6 16:55:33 2001
@@ -53,11 +53,6 @@
// #define ERR_DEBUG
-/* If you declare any globals in php_msession.h uncomment this:
-
-ZEND_DECLARE_MODULE_GLOBALS(msession)
-*/
-
/* True global resources - no need for thread safety here */
static char g_defhost[]="localhost";
static char * g_host=g_defhost;
@@ -70,10 +65,7 @@
#define GET_REQB \
if(!g_reqb) { RETURN_NULL(); }
-/* Every user visible function must have an entry in msession_functions[].
- */
function_entry msession_functions[] = {
- PHP_FE(confirm_msession_compiled, NULL) /* For testing, remove later. */
PHP_FE(msession_connect,NULL)
PHP_FE(msession_disconnect,NULL)
PHP_FE(msession_lock,NULL)
@@ -103,9 +95,9 @@
"msession",
msession_functions,
PHP_MINIT(msession),
- PHP_MSHUTDOWN(msession),
- PHP_RINIT(msession), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(msession),/* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
+ PHP_RSHUTDOWN(msession),
PHP_MINFO(msession),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
@@ -115,16 +107,8 @@
ZEND_GET_MODULE(msession)
#endif
- /* Remove comments and fill if you need to have entries in php.ini
- PHP_INI_BEGIN()
- PHP_INI_END()
- */
-
- PHP_MINIT_FUNCTION(msession)
-{
- /* Remove comments if you have entries in php.ini
- REGISTER_INI_ENTRIES();
- */
+PHP_MINIT_FUNCTION(msession)
+{
g_conn = NULL;
g_host = g_defhost;
@@ -135,21 +119,6 @@
return SUCCESS;
}
-PHP_MSHUTDOWN_FUNCTION(msession)
-{
- /* Remove comments if you have entries in php.ini
- UNREGISTER_INI_ENTRIES();
- */
- return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request start */
-PHP_RINIT_FUNCTION(msession)
-{
- return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request end */
PHP_RSHUTDOWN_FUNCTION(msession)
{
if(g_conn)
@@ -171,29 +140,6 @@
php_info_print_table_start();
php_info_print_table_header(2, "msession support", "enabled");
php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
-}
-
-PHP_FUNCTION(confirm_msession_compiled)
-{
- zval **arg;
- int len;
- char string[256];
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(arg);
-
- len = sprintf(string, "(%s) Module %s is compiled into PHP, g_host:%s, g_port:%d",
- __TIME__,
- Z_STRVAL_PP(arg),
- g_host,
- g_port);
- RETURN_STRINGL(string, len, 1);
}
int PHPMsessionConnect(const char *szhost, int nport)
@@ -268,6 +214,7 @@
ret = safe_estrdup(g_reqb->req.datum);
return ret;
}
+
int PHPMsessionSetData(const char *session, const char *data)
{
int ret=0;
@@ -398,6 +345,7 @@
RETURN_TRUE;
}
+
PHP_FUNCTION(msession_lock)
{
long key;
@@ -421,6 +369,7 @@
RETURN_LONG( key);
}
+
PHP_FUNCTION(msession_unlock)
{
long lkey;
@@ -477,8 +426,8 @@
{
RETURN_FALSE;
}
-
}
+
PHP_FUNCTION(msession_get)
{
char *val;
@@ -508,8 +457,9 @@
if(g_reqb->req.stat==REQ_OK)
val = safe_estrdup(g_reqb->req.datum);
- RETURN_STRING(val, 0)
- }
+ RETURN_STRING(val, 0);
+}
+
PHP_FUNCTION(msession_uniq)
{
long val;
@@ -541,6 +491,7 @@
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_randstr)
{
long val;
@@ -572,6 +523,7 @@
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_find)
{
zval **name;
@@ -612,6 +564,7 @@
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_list)
{
GET_REQB
@@ -689,6 +642,7 @@
}
}
}
+
PHP_FUNCTION(msession_set_array)
{
zval **session;
@@ -854,6 +808,7 @@
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_inc)
{
char *val;
@@ -886,6 +841,7 @@
RETURN_FALSE;
}
}
+
PHP_FUNCTION(msession_getdata)
{
char *val;
@@ -940,6 +896,7 @@
RETURN_FALSE;
}
}
+
PHP_FUNCTION(msession_plugin)
{
int ret;