apr  1.7.0
About: APR (Apache Portable Runtime) project offers software libraries that provide a predictable and consistent interface to underlying platform-specific implementations (APR core library).
  Fossies Dox: apr-1.7.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

apr_tables.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef APR_TABLES_H
18 #define APR_TABLES_H
19 
25 #include "apr.h"
26 #include "apr_pools.h"
27 
28 #if APR_HAVE_STDARG_H
29 #include <stdarg.h> /* for va_list */
30 #endif
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 
56 typedef struct apr_table_t apr_table_t;
57 
60 
66  int elt_size;
68  int nelts;
70  int nalloc;
72  char *elts;
73 };
74 
79 
83  char *key; /* maybe NULL in future;
84  * check when iterating thru table_elts
85  */
87  char *val;
88 
90  apr_uint32_t key_checksum;
91 };
92 
98 APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t);
99 
105 APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t);
106 
112 APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a);
113 
121 APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p,
122  int nelts, int elt_size);
123 
131 APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr);
132 
141 #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
142 
150 #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
151 
158 APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr);
159 
166 APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr);
167 
174 APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst,
176 
186 APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p,
197  const apr_array_header_t *arr);
198 
208  const apr_array_header_t *second);
209 
221 APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p,
223  const char sep);
224 
232 APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts);
233 
241 APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p,
242  const apr_table_t *t);
243 
252 APR_DECLARE(apr_table_t *) apr_table_clone(apr_pool_t *p,
253  const apr_table_t *t);
254 
259 APR_DECLARE(void) apr_table_clear(apr_table_t *t);
260 
268 APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
269 
279 APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t,
280  const char *key);
281 
291 APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key,
292  const char *val);
293 
304 APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key,
305  const char *val);
306 
312 APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key);
313 
323 APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
324  const char *val);
325 
335 APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
336  const char *val);
337 
347 APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key,
348  const char *val);
349 
360 APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key,
361  const char *val);
362 
370 APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p,
372  const apr_table_t *base);
373 
385 typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key,
386  const char *value);
387 
408  void *rec, const apr_table_t *t, ...)
409 #if defined(__GNUC__) && __GNUC__ >= 4
410  __attribute__((sentinel))
411 #endif
412  ;
413 
433 APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
434  void *rec, const apr_table_t *t, va_list vp);
435 
437 #define APR_OVERLAP_TABLES_SET (0)
438 
439 #define APR_OVERLAP_TABLES_MERGE (1)
440 
441 #define APR_OVERLAP_TABLES_ADD (2)
442 
485 APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b,
486  unsigned flags);
487 
499 APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags);
500 
503 #ifdef __cplusplus
504 }
505 #endif
506 
507 #endif /* ! APR_TABLES_H */
overlay
const apr_table_t * overlay
Definition: apr_tables.h:371
apr_table_entry_t::val
char * val
Definition: apr_tables.h:87
APR_DECLARE
APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t)
p
const char apr_int32_t apr_pool_t * p
Definition: apr_file_info.h:337
comp
void apr_skiplistnode apr_skiplist_compare comp
Definition: apr_skiplist.h:164
apr_array_header_t::elt_size
int elt_size
Definition: apr_tables.h:66
b
const apr_table_t * b
Definition: apr_tables.h:485
apr_table_entry_t::key
char * key
Definition: apr_tables.h:83
key
const char * key
Definition: apr_tables.h:268
apr_array_header_t
Definition: apr_tables.h:62
value
const char * value
Definition: apr_env.h:51
vp
void const apr_table_t void const apr_table_t va_list vp
Definition: apr_tables.h:434
first
const apr_array_header_t * first
Definition: apr_tables.h:207
apr_table_do_callback_fn_t
int() apr_table_do_callback_fn_t(void *rec, const char *key, const char *value)
Definition: apr_tables.h:385
val
const char const char * val
Definition: apr_tables.h:291
apr_array_header_t::pool
apr_pool_t * pool
Definition: apr_tables.h:64
APR_DECLARE_NONSTD
APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp
Definition: readwrite.c:353
int
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray
apr_array_header_t::elts
char * elts
Definition: apr_tables.h:72
src
const apr_array_header_t * src
Definition: apr_tables.h:175
sep
const apr_array_header_t const char sep
Definition: apr_tables.h:222
apr_array_copy_hdr
apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr)
Definition: apr_tables.c:197
__attribute__
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
Definition: apr_pools.h:567
elt_size
int int elt_size
Definition: apr_tables.h:122
t
const apr_table_t * t
Definition: apr_tables.h:242
apr_pool_t
Definition: apr_pools.c:577
second
const apr_array_header_t const apr_array_header_t * second
Definition: apr_tables.h:207
apr_array_header_t::nelts
int nelts
Definition: apr_tables.h:68
apr_table_entry_t
Definition: apr_tables.h:81
rec
void * rec
Definition: apr_tables.h:408
apr_array_header_t::nalloc
int nalloc
Definition: apr_tables.h:70
apr_array_append
apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second)
Definition: apr_tables.c:211
nelts
int nelts
Definition: apr_tables.h:122
apr_pools.h
APR memory allocation.
base
const apr_table_t const apr_table_t * base
Definition: apr_tables.h:371
apr_table_t
Definition: apr_tables.c:329
flags
const apr_table_t unsigned flags
Definition: apr_tables.h:485
arr
const apr_array_header_t * arr
Definition: apr_tables.h:187
apr_table_entry_t::key_checksum
apr_uint32_t key_checksum
Definition: apr_tables.h:90