summaryrefslogtreecommitdiff
path: root/ext/session/php_session.h
diff options
context:
space:
mode:
authorMark L. Woodward <mlwmohawk@php.net>2002-03-29 16:00:27 +0000
committerMark L. Woodward <mlwmohawk@php.net>2002-03-29 16:00:27 +0000
commit346d74a1464ecfb6bc7b8f7a273774ecf913f45c (patch)
tree022c9a4adf9a8cf51a4d397657887693a17e18c2 /ext/session/php_session.h
parenteab1211ed1e8ac07b8995f6d62de0f285fa7f254 (diff)
downloadphp-git-346d74a1464ecfb6bc7b8f7a273774ecf913f45c.tar.gz
Added field to ps_module structure to hold function pointer for the creation
of the session ID string. Default PS_MOD() macro sets this to be the default creation routine. PS_MOD_SID() macro sets this to a handlers session ID creation routine.
Diffstat (limited to 'ext/session/php_session.h')
-rw-r--r--ext/session/php_session.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index c3e31d0570..ae26ba17fd 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -30,6 +30,12 @@
#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
+
+/* default create id function */
+char *php_session_create_id(PS_CREATESID_ARGS);
+
typedef struct ps_module_struct {
const char *name;
int (*open)(PS_OPEN_ARGS);
@@ -38,6 +44,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);
} ps_module;
#define PS_GET_MOD_DATA() *mod_data
@@ -49,6 +56,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_FUNCS(x) \
PS_OPEN_FUNC(x); \
@@ -56,12 +64,26 @@ typedef struct ps_module_struct {
PS_READ_FUNC(x); \
PS_WRITE_FUNC(x); \
PS_DESTROY_FUNC(x); \
- PS_GC_FUNC(x)
-
+ PS_GC_FUNC(x); \
+ PS_CREATESID_FUNC(x)
#define PS_MOD(x) \
#x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \
- ps_delete_##x, ps_gc_##x
+ ps_delete_##x, ps_gc_##x, php_session_create_id
+
+/* SID enabled module handler definitions */
+#define PS_FUNCS_SID(x) \
+ PS_OPEN_FUNC(x); \
+ PS_CLOSE_FUNC(x); \
+ PS_READ_FUNC(x); \
+ PS_WRITE_FUNC(x); \
+ PS_DESTROY_FUNC(x); \
+ PS_GC_FUNC(x); \
+ PS_CREATESID_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
typedef enum {
php_session_disabled,