From: Sascha Schumann Date: Sat, 30 Mar 2002 16:29:15 +0000 (+0000) Subject: - Proper use of underscores (s/createsid/create_sid/) X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~957 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a3acee3c9bc1c2d0c582e378bf92093059a44ba;p=php - Proper use of underscores (s/createsid/create_sid/) - Bump the API date and remove extra cpp macro - Pass TSRMLS appropiately to the create_sid function --- diff --git a/ext/session/php_session.h b/ext/session/php_session.h index ae26ba17fd..ed54dd4da5 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -21,7 +21,7 @@ #include "ext/standard/php_var.h" -#define PHP_SESSION_API 20020306 +#define PHP_SESSION_API 20020330 #define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name TSRMLS_DC #define PS_CLOSE_ARGS void **mod_data TSRMLS_DC @@ -29,12 +29,10 @@ #define PS_WRITE_ARGS void **mod_data, const char *key, const char *val, const int vallen TSRMLS_DC #define PS_DESTROY_ARGS void **mod_data, const char *key TSRMLS_DC #define PS_GC_ARGS void **mod_data, int maxlifetime, int *nrdels TSRMLS_DC - -#define HAVE_PHP_SESSION_CREATESID -#define PS_CREATESID_ARGS void **mod_data, int *newlen +#define PS_CREATE_SID_ARGS void **mod_data, int *newlen TSRMLS_DC /* default create id function */ -char *php_session_create_id(PS_CREATESID_ARGS); +char *php_session_create_id(PS_CREATE_SID_ARGS); typedef struct ps_module_struct { const char *name; @@ -44,7 +42,7 @@ typedef struct ps_module_struct { int (*write)(PS_WRITE_ARGS); int (*destroy)(PS_DESTROY_ARGS); int (*gc)(PS_GC_ARGS); - char *(*createsid)(PS_CREATESID_ARGS); + char *(*create_sid)(PS_CREATE_SID_ARGS); } ps_module; #define PS_GET_MOD_DATA() *mod_data @@ -56,7 +54,7 @@ typedef struct ps_module_struct { #define PS_WRITE_FUNC(x) int ps_write_##x(PS_WRITE_ARGS) #define PS_DESTROY_FUNC(x) int ps_delete_##x(PS_DESTROY_ARGS) #define PS_GC_FUNC(x) int ps_gc_##x(PS_GC_ARGS) -#define PS_CREATESID_FUNC(x) char *ps_createsid_##x(PS_CREATESID_ARGS) +#define PS_CREATE_SID_FUNC(x) char *ps_create_sid_##x(PS_CREATE_SID_ARGS) #define PS_FUNCS(x) \ PS_OPEN_FUNC(x); \ @@ -65,7 +63,7 @@ typedef struct ps_module_struct { PS_WRITE_FUNC(x); \ PS_DESTROY_FUNC(x); \ PS_GC_FUNC(x); \ - PS_CREATESID_FUNC(x) + PS_CREATE_SID_FUNC(x) #define PS_MOD(x) \ #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ @@ -79,11 +77,11 @@ typedef struct ps_module_struct { PS_WRITE_FUNC(x); \ PS_DESTROY_FUNC(x); \ PS_GC_FUNC(x); \ - PS_CREATESID_FUNC(x) + PS_CREATE_SID_FUNC(x) #define PS_MOD_SID(x) \ #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ - ps_delete_##x, ps_gc_##x, ps_createsid_##x + ps_delete_##x, ps_gc_##x, ps_create_sid_##x typedef enum { php_session_disabled, diff --git a/ext/session/session.c b/ext/session/session.c index 21480fc2b9..398f91a90b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -495,7 +495,7 @@ static void php_session_decode(const char *val, int vallen TSRMLS_DC) static char hexconvtab[] = "0123456789abcdef"; -char *php_session_create_id(PS_CREATESID_ARGS) +char *php_session_create_id(PS_CREATE_SID_ARGS) { PHP_MD5_CTX context; unsigned char digest[16]; @@ -557,7 +557,7 @@ static void php_session_initialize(TSRMLS_D) /* If there is no ID, use session module to create one */ if (!PS(id)) - PS(id) = PS(mod)->createsid(&PS(mod_data), NULL); + PS(id) = PS(mod)->create_sid(&PS(mod_data), NULL TSRMLS_CC); /* Read data */ /* Question: if you create a SID here, should you also try to read data?