summaryrefslogtreecommitdiff
path: root/tables
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-09-02 09:27:57 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-09-02 09:27:57 +0000
commit8a3c9639c9f8f1541309f22ab67bf17ba3d9623d (patch)
tree0ec67f9d83da6509c013de05f962671dee8025d5 /tables
parentb6793bef385640821670959cc1979ae9b90ae5c3 (diff)
downloadapr-8a3c9639c9f8f1541309f22ab67bf17ba3d9623d.tar.gz
Add apr_array_pop() function to apr_array_header_t.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63848 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r--tables/apr_tables.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c
index 74d7d7770..24659f00a 100644
--- a/tables/apr_tables.c
+++ b/tables/apr_tables.c
@@ -124,6 +124,15 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
return res;
}
+APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr)
+{
+ if (apr_is_empty_array(arr)) {
+ return NULL;
+ }
+
+ return arr->elts + (arr->elt_size * (--arr->nelts));
+}
+
APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr)
{
if (arr->nelts == arr->nalloc) {