diff options
author | Stefan Eissing <icing@apache.org> | 2015-08-17 14:45:57 +0200 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2015-08-17 14:45:57 +0200 |
commit | d0ca4ab131ef9c00d3c3e6515b309f12dd8e5359 (patch) | |
tree | dc1b12b5d4752d7d3102b5b37eb4edc71c6aa860 /server/util.c | |
parent | Rebuild. (diff) | |
download | apache2-d0ca4ab131ef9c00d3c3e6515b309f12dd8e5359.tar.xz apache2-d0ca4ab131ef9c00d3c3e6515b309f12dd8e5359.zip |
introducing ap_array_index in util, used in protocol and mod_h2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1696264 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | server/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/util.c b/server/util.c index c8932a2e77..6f764e6a67 100644 --- a/server/util.c +++ b/server/util.c @@ -3148,3 +3148,16 @@ AP_DECLARE(char *) ap_get_exec_line(apr_pool_t *p, return apr_pstrndup(p, buf, k); } + +AP_DECLARE(int) ap_array_index(apr_array_header_t *array, const char *s) +{ + int i; + for (i = 0; i < array->nelts; i++) { + const char *p = APR_ARRAY_IDX(array, i, const char *); + if (!strcmp(p, s)) { + return i; + } + } + return -1; +} + |