diff options
author | jwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68> | 2003-08-13 01:51:29 +0000 |
---|---|---|
committer | jwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68> | 2003-08-13 01:51:29 +0000 |
commit | 7fd66e29ce63cb9f9a2a7d476485c442aa802b14 (patch) | |
tree | 5f460b5994f144080435f44bde8a9312810a18cf | |
parent | e590398ec4f94d78271805c79440f19017964fcc (diff) | |
download | libapr-7fd66e29ce63cb9f9a2a7d476485c442aa802b14.tar.gz |
ha, then i go to try to use the thing and find out what APR_RING_CHECK_ELEM()
was for in the first place.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64586 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/apr_ring.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/apr_ring.h b/include/apr_ring.h index 6bb935bc3..c449eaa76 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -517,8 +517,12 @@ fprintf(stderr, "*** ring check end\n"); \ } while (0) -#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) do { \ - struct elem *start = APR_RING_SENTINEL(hp, elem, link); \ +#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) \ + APR_RING_CHECK_ELEM_CONSISTENCY(APR_RING_SENTINEL(hp, elem, link),\ + elem, link) + +#define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) do { \ + struct elem *start = (ep); \ struct elem *here = start; \ do { \ assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \ @@ -567,6 +571,17 @@ * @param msg Descriptive message */ #define APR_RING_CHECK_ELEM(ep, elem, link, msg) +/** + * Loops around a ring, starting with the given element, and checks all + * the pointers for consistency. Pops an assertion if any inconsistency + * is found. Same idea as APR_RING_CHECK_ELEM() except that it's silent + * if all is well. + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param ep The element + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) #endif /** @} */ |