summaryrefslogtreecommitdiff
path: root/tables
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2010-04-08 15:37:17 +0000
committerJeff Trawick <trawick@apache.org>2010-04-08 15:37:17 +0000
commitf2b89b2061ced969bec465f622667275cc49b857 (patch)
tree5d2dec5d71f54edc0ea4cb341ffea94e243829c1 /tables
parentf70638cb6cc6d9925ef00aeda48bed3ddb2b1e89 (diff)
downloadapr-f2b89b2061ced969bec465f622667275cc49b857.tar.gz
Add apr_hash_this_key(), apr_hash_this_key_len(), and
apr_hash_this_val() for easier access to those attributes from a hash iterator. PR: 49065 Submitted by: Hyrum K. Wright <hyrum_wright mail.utexas.edu> Reviewed by: trawick, wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931973 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r--tables/apr_hash.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tables/apr_hash.c b/tables/apr_hash.c
index 05ee42f46..d64e77941 100644
--- a/tables/apr_hash.c
+++ b/tables/apr_hash.c
@@ -156,6 +156,29 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi,
if (val) *val = (void *)hi->this->val;
}
+APR_DECLARE(const void *) apr_hash_this_key(apr_hash_index_t *hi)
+{
+ const void *key;
+
+ apr_hash_this(hi, &key, NULL, NULL);
+ return key;
+}
+
+APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi)
+{
+ apr_ssize_t klen;
+
+ apr_hash_this(hi, NULL, &klen, NULL);
+ return klen;
+}
+
+APR_DECLARE(void *) apr_hash_this_val(apr_hash_index_t *hi)
+{
+ void *val;
+
+ apr_hash_this(hi, NULL, NULL, &val);
+ return val;
+}
/*
* Expanding a hash table