summaryrefslogtreecommitdiff
path: root/include/apr_general.h
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-01-02 01:19:07 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-01-02 01:19:07 +0000
commit2366f03c8a0656d7afda3863b1e2636fe8dadd36 (patch)
treecac1cd636550c5257cc2aa8cd9bb95dec2c8f12e /include/apr_general.h
parent9b80d709f42ca4b3d382792f6b13f8e04ffe8e42 (diff)
downloadlibapr-2366f03c8a0656d7afda3863b1e2636fe8dadd36.tar.gz
Add an APR_GET_POOL macro to get a pool from any APR type that has
a pool. This requires that ALL apr types put the pool as the first field in their structure. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_general.h')
-rw-r--r--include/apr_general.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/apr_general.h b/include/apr_general.h
index ca56a38de..4eebdef61 100644
--- a/include/apr_general.h
+++ b/include/apr_general.h
@@ -210,6 +210,17 @@ typedef int apr_signum_t;
#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
#endif
+/* This is a general apr type that should only ever be used in the APR_GET_POOL
+ * macro. This is basically used to let us get the pool from any apr type
+ * that has one.
+ */
+struct apr_t {
+ apr_pool_t *pool;
+};
+
+#define APR_GET_POOL(foo) \
+ ((struct apr_t *)foo)->pool
+
/* A couple of prototypes for functions in case some platform doesn't
* have it
*/