httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r664165 - in /httpd/httpd/trunk/modules/session: mod_session.c mod_session.h
Date Fri, 06 Jun 2008 22:29:58 GMT
Author: wrowe
Date: Fri Jun  6 15:29:58 2008
New Revision: 664165

URL: http://svn.apache.org/viewvc?rev=664165&view=rev
Log:
mod_session has a different scope than the core.
Replace the nonsense (see modules such as mod_dav,
mod_cache etc for similar examples).

Modified:
    httpd/httpd/trunk/modules/session/mod_session.c
    httpd/httpd/trunk/modules/session/mod_session.h

Modified: httpd/httpd/trunk/modules/session/mod_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.c?rev=664165&r1=664164&r2=664165&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session.c Fri Jun  6 15:29:58 2008
@@ -32,18 +32,18 @@
                 APR_HOOK_LINK(session_encode)
                 APR_HOOK_LINK(session_decode)
 )
-AP_IMPLEMENT_HOOK_RUN_FIRST(int, session_load,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(session, SESSION, int, session_load,
                       (request_rec * r, session_rec ** z), (r, z), DECLINED)
-AP_IMPLEMENT_HOOK_RUN_FIRST(int, session_save,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(session, SESSION, int, session_save,
                        (request_rec * r, session_rec * z), (r, z), DECLINED)
-AP_IMPLEMENT_HOOK_RUN_ALL(int, session_encode,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(session, SESSION, int, session_encode,
                    (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
-AP_IMPLEMENT_HOOK_RUN_ALL(int, session_decode,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(session, SESSION, int, session_decode,
                    (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
 
-AP_DECLARE(int) ap_session_identity_encode(request_rec * r, session_rec * z);
-AP_DECLARE(int) ap_session_identity_decode(request_rec * r, session_rec * z);
-AP_DECLARE(int) ap_session_fixups(request_rec * r);
+static int session_identity_encode(request_rec * r, session_rec * z);
+static int session_identity_decode(request_rec * r, session_rec * z);
+static int session_fixups(request_rec * r);
 
 /**
  * Should the session be included within this URL.
@@ -90,7 +90,7 @@
  * @param key The key to get.
  * @param value The buffer to write the value to.
  */
-AP_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value)
+SESSION_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value)
 {
     if (!z) {
         ap_session_load(r, &z);
@@ -112,7 +112,7 @@
  * @param key The key to set. The existing key value will be replaced.
  * @param value The value to set.
  */
-AP_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
+SESSION_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
                                 const char *key, const char *value)
 {
     if (!z) {
@@ -137,7 +137,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z)
+SESSION_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z)
 {
 
     session_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
@@ -216,7 +216,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_save(request_rec * r, session_rec * z)
+SESSION_DECLARE(int) ap_session_save(request_rec * r, session_rec * z)
 {
     if (z) {
         apr_time_t now = apr_time_now();
@@ -304,7 +304,7 @@
  * @param r The request pointer.
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_identity_encode(request_rec * r, session_rec * z)
+static int session_identity_encode(request_rec * r, session_rec * z)
 {
 
     char *buffer = NULL;
@@ -340,7 +340,7 @@
  * @param r The request pointer.
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_identity_decode(request_rec * r, session_rec * z)
+static int session_identity_decode(request_rec * r, session_rec * z)
 {
 
     char *last = NULL;
@@ -425,7 +425,7 @@
             }
             if (override) {
                 z->encoded = override;
-                ap_session_identity_decode(r, z);
+                session_identity_decode(r, z);
             }
         }
 
@@ -462,7 +462,7 @@
  * 
  * @param r The request
  */
-AP_DECLARE(int) ap_session_fixups(request_rec * r)
+static int session_fixups(request_rec * r)
 {
     session_dir_conf *conf = ap_get_module_config(r->per_dir_config,
                                                   &session_module);
@@ -471,7 +471,7 @@
     ap_session_load(r, &z);
 
     if (conf->env) {
-        ap_session_identity_encode(r, z);
+        session_identity_encode(r, z);
         if (z->encoded) {
             apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded);
             z->encoded = NULL;
@@ -604,9 +604,9 @@
     ap_hook_insert_filter(ap_session_insert_output_filter, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_insert_error_filter(ap_session_insert_output_filter,
                                 NULL, NULL, APR_HOOK_MIDDLE);
-    ap_hook_fixups(ap_session_fixups, NULL, NULL, APR_HOOK_MIDDLE);
-    ap_hook_session_encode(ap_session_identity_encode, NULL, NULL, APR_HOOK_REALLY_FIRST);
-    ap_hook_session_decode(ap_session_identity_decode, NULL, NULL, APR_HOOK_REALLY_LAST);
+    ap_hook_fixups(session_fixups, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_session_encode(session_identity_encode, NULL, NULL, APR_HOOK_REALLY_FIRST);
+    ap_hook_session_decode(session_identity_decode, NULL, NULL, APR_HOOK_REALLY_LAST);
     APR_REGISTER_OPTIONAL_FN(ap_session_get);
     APR_REGISTER_OPTIONAL_FN(ap_session_set);
     APR_REGISTER_OPTIONAL_FN(ap_session_load);

Modified: httpd/httpd/trunk/modules/session/mod_session.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.h?rev=664165&r1=664164&r2=664165&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.h (original)
+++ httpd/httpd/trunk/modules/session/mod_session.h Fri Jun  6 15:29:58 2008
@@ -17,6 +17,27 @@
 #ifndef MOD_SESSION_H
 #define MOD_SESSION_H
 
+/* Create a set of SESSION_DECLARE(type), SESSION_DECLARE_NONSTD(type) and 
+ * SESSION_DECLARE_DATA with appropriate export and import tags for the platform
+ */
+#if !defined(WIN32)
+#define SESSION_DECLARE(type)        type
+#define SESSION_DECLARE_NONSTD(type) type
+#define SESSION_DECLARE_DATA
+#elif defined(SESSION_DECLARE_STATIC)
+#define SESSION_DECLARE(type)        type __stdcall
+#define SESSION_DECLARE_NONSTD(type) type
+#define SESSION_DECLARE_DATA
+#elif defined(SESSION_DECLARE_EXPORT)
+#define SESSION_DECLARE(type)        __declspec(dllexport) type __stdcall
+#define SESSION_DECLARE_NONSTD(type) __declspec(dllexport) type
+#define SESSION_DECLARE_DATA         __declspec(dllexport)
+#else
+#define SESSION_DECLARE(type)        __declspec(dllimport) type __stdcall
+#define SESSION_DECLARE_NONSTD(type) __declspec(dllimport) type
+#define SESSION_DECLARE_DATA         __declspec(dllimport)
+#endif
+
 /**
  * @file  mod_session.h
  * @brief Session Module for Apache
@@ -105,7 +126,7 @@
  * @param key The key to get.
  * @param value The buffer to write the value to.
  */
-AP_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value);
+SESSION_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value);
 
 /**
  * Set a particular value to the session.
@@ -119,7 +140,7 @@
  * @param key The key to set. The existing key value will be replaced.
  * @param value The value to set.
  */
-AP_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
+SESSION_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
                                 const char *key, const char *value);
 
 /**
@@ -130,7 +151,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z);
+SESSION_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z);
 
 /**
  * Hook to load the session.
@@ -140,7 +161,8 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE_HOOK(int, session_load, (request_rec * r, session_rec ** z))
+APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_load,
+                          (request_rec * r, session_rec ** z))
 
 /**
  * Save the session.
@@ -151,7 +173,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE(int) ap_session_save(request_rec * r, session_rec * z);
+SESSION_DECLARE(int) ap_session_save(request_rec * r, session_rec * z);
 
 /**
  * Hook to save the session.
@@ -162,7 +184,8 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE_HOOK(int, session_save, (request_rec * r, session_rec * z))
+APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_save,
+                          (request_rec * r, session_rec * z))
 
 /**
  * Hook to encode the session.
@@ -174,7 +197,8 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE_HOOK(int, session_encode, (request_rec * r, session_rec * z))
+APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_encode,
+                          (request_rec * r, session_rec * z))
 
 /**
  * Hook to decode the session.
@@ -186,7 +210,8 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-AP_DECLARE_HOOK(int, session_decode, (request_rec * r, session_rec * z))
+APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_decode,
+                          (request_rec * r, session_rec * z))
 
 APR_DECLARE_OPTIONAL_FN(void, ap_session_get, (request_rec * r, session_rec * z,
                                                const char *key, const char **value));



Mime
View raw message