summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-05-18 04:12:28 +0000
committerjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-05-18 04:12:28 +0000
commit5802b1b07878b6c56a57b63a4b3035eaef521f13 (patch)
treec09c954b78e63bf2621b2510b44d6543a8664cc7 /include
parent0458204d55d51f96dfd39e58390d9094e756b300 (diff)
downloadlibapr-5802b1b07878b6c56a57b63a4b3035eaef521f13.tar.gz
Renames:
APR_XtOffset -> APR_OFFSET APR_XtOffsetOf -> APR_OFFSETOF git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr_general.h25
-rw-r--r--include/apr_ring.h2
2 files changed, 20 insertions, 7 deletions
diff --git a/include/apr_general.h b/include/apr_general.h
index ec9ff5fbb..92dbd44d8 100644
--- a/include/apr_general.h
+++ b/include/apr_general.h
@@ -112,35 +112,48 @@ typedef int apr_signum_t;
* Finding offsets of elements within structures.
* Taken from the X code... they've sweated portability of this stuff
* so we don't have to. Sigh...
+ * @param p_type pointer type name
+ * @param field data field within the structure pointed to
+ * @return offset
*/
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
#ifdef __STDC__
-#define APR_XtOffset(p_type,field) _Offsetof(p_type,field)
+#define APR_OFFSET(p_type,field) _Offsetof(p_type,field)
#else
#ifdef CRAY2
-#define APR_XtOffset(p_type,field) \
+#define APR_OFFSET(p_type,field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
#else /* !CRAY2 */
-#define APR_XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
+#define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
#endif /* !CRAY2 */
#endif /* __STDC__ */
#else /* ! (CRAY || __arm) */
-#define APR_XtOffset(p_type,field) \
+#define APR_OFFSET(p_type,field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#endif /* !CRAY */
+/**
+ * Finding offsets of elements within structures.
+ * @param s_type structure type name
+ * @param field data field within the structure
+ * @return offset
+ */
#ifdef offsetof
-#define APR_XtOffsetOf(s_type,field) offsetof(s_type,field)
+#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
#else
-#define APR_XtOffsetOf(s_type,field) APR_XtOffset(s_type*,field)
+#define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field)
#endif
+/** @deprecated */
+#define APR_XtOffset APR_OFFSET
+#define APR_XtOffsetOf APR_OFFSETOF
+
/**
* A couple of prototypes for functions in case some platform doesn't
diff --git a/include/apr_ring.h b/include/apr_ring.h
index 6d8f9bd9f..b10b778e2 100644
--- a/include/apr_ring.h
+++ b/include/apr_ring.h
@@ -145,7 +145,7 @@
* @param link The name of the APR_RING_ENTRY in the element struct
*/
#define APR_RING_SENTINEL(hp, elem, link) \
- (struct elem *)((char *)(hp) - APR_XtOffsetOf(struct elem, link))
+ (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))
/**
* The first element of the ring