Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

Table and Array Functions


Data Structures

struct  apr_array_header_t
struct  apr_table_entry_t

Defines

#define APR_OVERLAP_TABLES_SET   (0)
#define APR_OVERLAP_TABLES_MERGE   (1)

Typedefs

typedef apr_table_t apr_table_t
typedef apr_array_header_t apr_array_header_t
typedef apr_table_entry_t apr_table_entry_t
typedef intapr_table_do_callback_fn_t )(void *rec, const char *key, const char *value)

Functions

 APR_DECLARE (const apr_array_header_t *) apr_table_elts(const apr_table_t *t)
 APR_DECLARE (int) apr_is_empty_table(const apr_table_t *t)
 APR_DECLARE (apr_array_header_t *) apr_array_make(apr_pool_t *p
 APR_DECLARE (void *) apr_array_push(apr_array_header_t *arr)
 APR_DECLARE (void) apr_array_cat(apr_array_header_t *dst
 APR_DECLARE (char *) apr_array_pstrcat(apr_pool_t *p
 APR_DECLARE (apr_table_t *) apr_table_make(apr_pool_t *p
 APR_DECLARE (const char *) apr_table_get(const apr_table_t *t
 APR_DECLARE_NONSTD (int) apr_table_do(apr_table_do_callback_fn_t *comp

Variables

int nelts
int int elt_size
const apr_array_header_tsrc
const apr_array_header_tarr
const apr_array_header_tfirst
const apr_array_header_t const
apr_array_header_t
second
const apr_array_header_t const
char 
sep
const apr_table_tt
const char * key
const char const char * val
const apr_table_toverlay
const apr_table_t const apr_table_tbase
void * rec
void const apr_table_t void
const apr_table_t va_list 
vp
const apr_table_tb
const apr_table_t unsigned flags
int nelts
const char int void * rec

Detailed Description

Tables are used to store entirely opaque structures for applications, while Arrays are usually used to deal with string lists.

Define Documentation

#define APR_OVERLAP_TABLES_MERGE   (1)
 

flag for overlap to use apr_table_mergen

Definition at line 365 of file apr_tables.h.

Referenced by AP_DECLARE().

#define APR_OVERLAP_TABLES_SET   (0)
 

flag for overlap to use apr_table_setn

Definition at line 363 of file apr_tables.h.

Referenced by accept_headers(), AP_DECLARE(), scan_meta_file(), and table_overlap().


Typedef Documentation

typedef struct apr_array_header_t apr_array_header_t
 

See also:
apr_array_header_t

Definition at line 49 of file apr_tables.h.

typedef int( apr_table_do_callback_fn_t)(void *rec, const char *key, const char *value)
 

Declaration prototype for the iterator callback function of apr_table_do() and apr_table_vdo().

Parameters:
rec The data passed as the first argument to apr_table_[v]do()
key The key from this iteration of the table
value The value from this iteration of the table
Remarks:
Iteration continues while this callback function returns non-zero. To export the callback function for apr_table_[v]do() it must be declared in the _NONSTD convention.

Definition at line 321 of file apr_tables.h.

typedef struct apr_table_entry_t apr_table_entry_t
 

The (opaque) structure for string-content tables.

Definition at line 68 of file apr_tables.h.

typedef struct apr_table_t apr_table_t
 

the table abstract data type

Definition at line 46 of file apr_tables.h.


Function Documentation

APR_DECLARE const char *   )  const
 

Get the value associated with a given key from the table. After this call, The data is still in the table

Parameters:
t The table to search for the key
key The key to search for
Returns:
The value associated with the key

APR_DECLARE apr_table_t  ) 
 

Make a new table

Parameters:
p The pool to allocate the pool out of
nelts The number of elements in the initial table.
Returns:
The new table.
Warning:
This table can only store text data

Definition at line 391 of file apr_tables.c.

References make_array_core(), and TABLE_HASH_SIZE.

Here is the call graph for this function:

APR_DECLARE char *   ) 
 

Generates a new string from the apr_pool_t containing the concatenated sequence of substrings referenced as elements within the array. The string will be empty if all substrings are empty or null, or if there are no elements in the array. If sep is non-NUL, it will be inserted between elements as a separator.

Parameters:
p The pool to allocate the string out of
arr The array to generate the string from
sep The separator to use
Returns:
A string containing all of the data in the array.

APR_DECLARE void   ) 
 

Concatenate two arrays together

Parameters:
dst The destination array, and the one to go first in the combined array
src The source array to add to the destination array

Definition at line 131 of file apr_pools.c.

APR_DECLARE void *   ) 
 

Duplicate a block of memory.

Parameters:
p The pool to allocate from
m The memory to duplicate
n The number of bytes to duplicate
Returns:
The new block of memory

Definition at line 665 of file apr_pools.c.

References APR_ALIGN_DEFAULT, mem, and NULL.

APR_DECLARE apr_array_header_t  ) 
 

Create an array

Parameters:
p The pool to allocate the memory out of
nelts the number of elements in the initial array
elt_size The size of each element in the array.
Returns:
The new array

Definition at line 160 of file apr_tables.c.

References apr_array_header_t::elt_size, apr_array_header_t::elts, make_array_core(), apr_array_header_t::nalloc, and apr_array_header_t::nelts.

Here is the call graph for this function:

APR_DECLARE int   )  const
 

Do a natural order comparison of two strings.

Parameters:
a The first string to compare
b The second string to compare
Returns:
Either <0, 0, or >0. If the first string is less than the second this returns <0, if they are equivalent it returns 0, and if the first string is greater than second string it retuns >0.

Definition at line 950 of file unix/sockaddr.c.

APR_DECLARE const apr_array_header_t  )  const
 

Get the elements from a table

Parameters:
t The table
Returns:
An array containing the contents of the table

APR_DECLARE_NONSTD int   ) 
 

Iterate over a table running the provided function once for every element in the table. If there is data passed in as a vararg, then the function is only run on those elements whose key matches something in the vararg. If the vararg is NULL, then every element is run through the function. Iteration continues while the function returns non-zero.

Parameters:
comp The function to run
rec The data to pass as the first argument to the function
t The table to iterate over
... The vararg. If this is NULL, then all elements in the table are run through the function, otherwise only those whose key matches are run.
Returns:
FALSE if one of the comp() iterations returned zero; TRUE if all iterations returned non-zero
See also:
apr_table_do_callback_fn_t


Variable Documentation

const apr_array_header_t * arr
 

Definition at line 185 of file apr_tables.h.

Referenced by dav_gen_supported_methods(), dav_method_options(), GetServerVariable(), handle_printenv(), make_variant_list(), match_headers(), merge_env_dir_configs(), set_neg_headers(), and ssl_configure_env().

const apr_table_t* b
 

Definition at line 403 of file apr_tables.h.

const apr_table_t const apr_table_t* base
 

Definition at line 308 of file apr_tables.h.

int int elt_size
 

Definition at line 112 of file apr_tables.h.

Referenced by APR_DECLARE().

const apr_array_header_t* first
 

Definition at line 170 of file apr_tables.h.

Referenced by add_any_filter_handle(), anon_set_string_slots(), log_script(), original_uri(), set_etag_bits(), set_options(), ssl_cmd_SSLOptions(), test_rewind(), and worker_stack_awaken_next().

unsigned flags
 

Definition at line 414 of file apr_tables.h.

const char* key
 

Definition at line 297 of file apr_tables.h.

int nelts
 

Definition at line 195 of file apr_tables.h.

Referenced by ap_core_reorder_directories(), AP_DECLARE(), ap_proxy_http_request(), apply_rewrite_list(), apply_rewrite_rule(), apr_filepath_list_merge_impl(), apr_filepath_list_split_impl(), check_speling(), check_user_access(), config_log_transaction(), dav_gen_supported_methods(), dav_method_options(), dbm_check_auth(), digest_check_auth(), do_headers_fixup(), find_allowdeny(), find_item(), find_lang_index(), fix_encoding(), flush_all_logs(), GetServerVariable(), handle_printenv(), ignore_entry(), init_child(), list_split_multi(), log_script(), lookup_header(), lookup_map(), make_pollset(), match_headers(), matches_aliases(), merge_env_dir_configs(), module_find_hook(), process_resource_config_nofnmatch(), proxy_handler(), remove_items(), rename_original_env(), run_rewritemap_programs(), sort_hook(), ssl_configure_env(), ssl_hook_Access(), ssl_rand_seed(), store_table(), table_clear(), table_nelts(), table_overlap(), table_unset(), try_alias_list(), and uniq_field_values().

int nelts
 

Definition at line 195 of file apr_tables.h.

const apr_table_t* overlay
 

Definition at line 308 of file apr_tables.h.

void const apr_table_t void * rec
 

Definition at line 360 of file apr_tables.h.

Referenced by htdbm_list(), and htdbm_verify().

void const apr_table_t void* rec
 

Definition at line 360 of file apr_tables.h.

const apr_array_header_t const apr_array_header_t* second
 

Definition at line 170 of file apr_tables.h.

Referenced by test_rewind().

const apr_array_header_t const char sep
 

Definition at line 185 of file apr_tables.h.

const apr_array_header_t* src
 

Definition at line 138 of file apr_tables.h.

void const apr_table_t void const apr_table_t* t
 

Definition at line 360 of file apr_tables.h.

const char const char* val
 

Definition at line 297 of file apr_tables.h.

void const apr_table_t void const apr_table_t va_list vp
 

Definition at line 360 of file apr_tables.h.