summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2015-03-07 00:55:16 +0000
committerYann Ylavic <ylavic@apache.org>2015-03-07 00:55:16 +0000
commit2913840c0c484d71e7df532569e0e1a3fdc3942e (patch)
tree61f0a6d523ae3a9c9cefce83260f22b6fd5eb6fd
parentc7c7aabca72b30b72c7a5194c7ccf5fe00819825 (diff)
downloadapr-2913840c0c484d71e7df532569e0e1a3fdc3942e.tar.gz
skiplist: provide apr_skiplist_element().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664770 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_skiplist.h6
-rw-r--r--tables/apr_skiplist.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h
index cf700e564..8ea17a9be 100644
--- a/include/apr_skiplist.h
+++ b/include/apr_skiplist.h
@@ -171,6 +171,12 @@ APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter)
APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter);
/**
+ * Return the element of the skip list node
+ * @param iter The skip list node
+ */
+APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *iter);
+
+/**
* Insert an element into the skip list using the specified comparison function
* allowing for duplicates.
* @param sl The skip list
diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c
index 1bc38e64f..8ce508ab8 100644
--- a/tables/apr_skiplist.c
+++ b/tables/apr_skiplist.c
@@ -379,6 +379,11 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i
return (*iter) ? ((*iter)->data) : NULL;
}
+APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *node)
+{
+ return node->data;
+}
+
static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data,
apr_skiplist_compare comp, int add)
{