Table and Array Functions


データ構造

struct  apr_array_header_t
struct  apr_table_entry_t

マクロ定義

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

型定義

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 int( apr_table_do_callback_fn_t )(void *rec, const char *key, const char *value)

関数

const apr_array_header_tapr_table_elts (const apr_table_t *t)
int apr_is_empty_table (const apr_table_t *t)
int apr_is_empty_array (const apr_array_header_t *a)
apr_array_header_tapr_array_make (apr_pool_t *p, int nelts, int elt_size)
void * apr_array_push (apr_array_header_t *arr)
void * apr_array_pop (apr_array_header_t *arr)
void apr_array_cat (apr_array_header_t *dst, const apr_array_header_t *src)
apr_array_header_tapr_array_copy (apr_pool_t *p, const apr_array_header_t *arr)
apr_array_header_tapr_array_copy_hdr (apr_pool_t *p, const apr_array_header_t *arr)
apr_array_header_tapr_array_append (apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second)
char * apr_array_pstrcat (apr_pool_t *p, const apr_array_header_t *arr, const char sep)
apr_table_tapr_table_make (apr_pool_t *p, int nelts)
apr_table_tapr_table_copy (apr_pool_t *p, const apr_table_t *t)
void apr_table_clear (apr_table_t *t)
const char * apr_table_get (const apr_table_t *t, const char *key)
void apr_table_set (apr_table_t *t, const char *key, const char *val)
void apr_table_setn (apr_table_t *t, const char *key, const char *val)
void apr_table_unset (apr_table_t *t, const char *key)
void apr_table_merge (apr_table_t *t, const char *key, const char *val)
void apr_table_mergen (apr_table_t *t, const char *key, const char *val)
void apr_table_add (apr_table_t *t, const char *key, const char *val)
void apr_table_addn (apr_table_t *t, const char *key, const char *val)
apr_table_tapr_table_overlay (apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base)
int apr_table_do (apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t,...)
int apr_table_vdo (apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, va_list vp)

変数

int apr_array_header_t::elt_size
int apr_array_header_t::nelts
int apr_array_header_t::nalloc
char * apr_array_header_t::elts
char * apr_table_entry_t::val
apr_uint32_t apr_table_entry_t::key_checksum

説明

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

マクロ定義

#define APR_OVERLAP_TABLES_MERGE   (1)

flag for overlap to use apr_table_mergen

#define APR_OVERLAP_TABLES_SET   (0)

flag for overlap to use apr_table_setn


型定義

typedef struct apr_array_header_t apr_array_header_t

参照:
apr_array_header_t

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().

引数:
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
意見:
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.

typedef struct apr_table_entry_t apr_table_entry_t

The (opaque) structure for string-content tables.

typedef struct apr_table_t apr_table_t

the table abstract data type


関数

apr_array_header_t* apr_array_append ( apr_pool_t p,
const apr_array_header_t first,
const apr_array_header_t second 
)

Append one array to the end of another, creating a new array in the process.

引数:
p The pool to allocate the new array out of
first The array to put first in the new array.
second The array to put second in the new array.
戻り値:
A new array containing the data from the two arrays passed in.

void apr_array_cat ( apr_array_header_t dst,
const apr_array_header_t src 
)

Concatenate two arrays together

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

apr_array_header_t* apr_array_copy ( apr_pool_t p,
const apr_array_header_t arr 
)

Copy the entire array

引数:
p The pool to allocate the copy of the array out of
arr The array to copy
戻り値:
An exact copy of the array passed in
意見:
The alternate apr_array_copy_hdr copies only the header, and arranges for the elements to be copied if (and only if) the code subsequently does a push or arraycat.

apr_array_header_t* apr_array_copy_hdr ( apr_pool_t p,
const apr_array_header_t arr 
)

Copy the headers of the array, and arrange for the elements to be copied if and only if the code subsequently does a push or arraycat.

引数:
p The pool to allocate the copy of the array out of
arr The array to copy
戻り値:
An exact copy of the array passed in
意見:
The alternate apr_array_copy copies the *entire* array.

apr_array_header_t* apr_array_make ( apr_pool_t p,
int  nelts,
int  elt_size 
)

Create an array

引数:
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.
戻り値:
The new array

void* apr_array_pop ( apr_array_header_t arr  ) 

Remove an element from an array (as a first-in, last-out stack)

引数:
arr The array to remove an element from.
戻り値:
Location of the element in the array.
意見:
If there are no elements in the array, NULL is returned.

char* apr_array_pstrcat ( apr_pool_t p,
const apr_array_header_t arr,
const char  sep 
)

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.

引数:
p The pool to allocate the string out of
arr The array to generate the string from
sep The separator to use
戻り値:
A string containing all of the data in the array.

void* apr_array_push ( apr_array_header_t arr  ) 

Add a new element to an array (as a first-in, last-out stack)

引数:
arr The array to add an element to.
戻り値:
Location for the new element in the array.
意見:
If there are no free spots in the array, then this function will allocate new space for the new element.

int apr_is_empty_array ( const apr_array_header_t a  ) 

Determine if the array is empty

引数:
a The array to check
戻り値:
True if empty, False otherwise

int apr_is_empty_table ( const apr_table_t t  ) 

Determine if the table is empty

引数:
t The table to check
戻り値:
True if empty, False otherwise

void apr_table_add ( apr_table_t t,
const char *  key,
const char *  val 
)

Add data to a table, regardless of whether there is another element with the same key.

引数:
t The table to add to
key The key to use
val The value to add.
意見:
When adding data, this function makes a copy of both the key and the value.

void apr_table_addn ( apr_table_t t,
const char *  key,
const char *  val 
)

Add data to a table, regardless of whether there is another element with the same key.

引数:
t The table to add to
key The key to use
val The value to add.
意見:
When adding data, this function does not make a copy of the key or the value, so care should be taken to ensure that the values will not change after they have been added..

void apr_table_clear ( apr_table_t t  ) 

Delete all of the elements from a table

引数:
t The table to clear

apr_table_t* apr_table_copy ( apr_pool_t p,
const apr_table_t t 
)

Create a new table and copy another table into it

引数:
p The pool to allocate the new table out of
t The table to copy
戻り値:
A copy of the table passed in

int apr_table_do ( apr_table_do_callback_fn_t comp,
void *  rec,
const apr_table_t t,
  ... 
)

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.

引数:
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.
戻り値:
FALSE if one of the comp() iterations returned zero; TRUE if all iterations returned non-zero
参照:
apr_table_do_callback_fn_t

const apr_array_header_t* apr_table_elts ( const apr_table_t t  ) 

Get the elements from a table

引数:
t The table
戻り値:
An array containing the contents of the table

const char* apr_table_get ( const apr_table_t t,
const char *  key 
)

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

引数:
t The table to search for the key
key The key to search for
戻り値:
The value associated with the key, or NULL if the key does not exist.

apr_table_t* apr_table_make ( apr_pool_t p,
int  nelts 
)

Make a new table

引数:
p The pool to allocate the pool out of
nelts The number of elements in the initial table.
戻り値:
The new table.
警告:
This table can only store text data

void apr_table_merge ( apr_table_t t,
const char *  key,
const char *  val 
)

Add data to a table by merging the value with data that has already been stored

引数:
t The table to search for the data
key The key to merge data for
val The data to add
意見:
If the key is not found, then this function acts like apr_table_add

void apr_table_mergen ( apr_table_t t,
const char *  key,
const char *  val 
)

Add data to a table by merging the value with data that has already been stored

引数:
t The table to search for the data
key The key to merge data for
val The data to add
意見:
If the key is not found, then this function acts like apr_table_addn

apr_table_t* apr_table_overlay ( apr_pool_t p,
const apr_table_t overlay,
const apr_table_t base 
)

Merge two tables into one new table

引数:
p The pool to use for the new table
overlay The first table to put in the new table
base The table to add at the end of the new table
戻り値:
A new table containing all of the data from the two passed in

void apr_table_set ( apr_table_t t,
const char *  key,
const char *  val 
)

Add a key/value pair to a table, if another element already exists with the same key, this will over-write the old data.

引数:
t The table to add the data to.
key The key fo use
val The value to add
意見:
When adding data, this function makes a copy of both the key and the value.

void apr_table_setn ( apr_table_t t,
const char *  key,
const char *  val 
)

Add a key/value pair to a table, if another element already exists with the same key, this will over-write the old data.

引数:
t The table to add the data to.
key The key to use
val The value to add
警告:
When adding data, this function does not make a copy of the key or the value, so care should be taken to ensure that the values will not change after they have been added..

void apr_table_unset ( apr_table_t t,
const char *  key 
)

Remove data from the table

引数:
t The table to remove data from
key The key of the data being removed

int apr_table_vdo ( apr_table_do_callback_fn_t comp,
void *  rec,
const apr_table_t t,
va_list  vp 
)

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 element's 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.

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


変数

int apr_array_header_t::elt_size [inherited]

The amount of memory allocated for each element of the array

char* apr_array_header_t::elts [inherited]

The elements in the array

apr_uint32_t apr_table_entry_t::key_checksum [inherited]

A checksum for the key, for use by the apr_table internals

int apr_array_header_t::nalloc [inherited]

The number of elements allocated in the array

int apr_array_header_t::nelts [inherited]

The number of active elements in the array

char* apr_table_entry_t::val [inherited]

The value for the current table entry


Apacheに対してSun Jul 19 22:05:31 2009に生成されました。  doxygen 1.4.7