]> granicus.if.org Git - php/commitdiff
- Proper use of underscores (s/createsid/create_sid/)
authorSascha Schumann <sas@php.net>
Sat, 30 Mar 2002 16:29:15 +0000 (16:29 +0000)
committerSascha Schumann <sas@php.net>
Sat, 30 Mar 2002 16:29:15 +0000 (16:29 +0000)
- Bump the API date and remove extra cpp macro
- Pass TSRMLS appropiately to the create_sid function

ext/session/php_session.h
ext/session/session.c

index ae26ba17fdb4ec59271fc252d4d36746accfe040..ed54dd4da5996558846e4444ed59cab83b905bd8 100644 (file)
@@ -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
 #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,
index 21480fc2b9ffa576bb05aeaff2269c0f74b39d40..398f91a90bb3293a9bfe290a327359f5ee322bb3 100644 (file)
@@ -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?