summaryrefslogtreecommitdiff
path: root/tables
diff options
context:
space:
mode:
authorPaul Querna <pquerna@apache.org>2007-05-16 00:17:03 +0000
committerPaul Querna <pquerna@apache.org>2007-05-16 00:17:03 +0000
commit8dfc7444c4a80b47f16d41ad46478192787206a6 (patch)
treec26f0822cf1edc4a52cabcc8e8ee0178d3f2bfc1 /tables
parent3b8d0ab45411ac1cb2d76cb3e989744a2dc488da (diff)
downloadapr-8dfc7444c4a80b47f16d41ad46478192787206a6.tar.gz
Add apr_array_clear() API.
* include/apr_tables.h * tables/apr_tables.c (apr_array_clear): Declare and define new API. * test/testtable.c (a1): Static variable for use across array tests. (array_clear): New test for apr_array_clear(). (testtable): Add array_clear() to the test suite. Submitted By: Daniel Rall <dlr apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538391 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r--tables/apr_tables.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c
index 90fcaf887..43a0794b1 100644
--- a/tables/apr_tables.c
+++ b/tables/apr_tables.c
@@ -90,6 +90,11 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
return res;
}
+APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr)
+{
+ arr->nelts = 0;
+}
+
APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr)
{
if (apr_is_empty_array(arr)) {