httpd-2.0.59/srclib/apr/tables/apr_tables.c
/*////////////////////////////////////add by hunter */
APR_DECLARE(const char *) apr_table_get_all(const apr_table_t *t, const char *key, int *offset)
{
apr_table_entry_t *next_elt;
apr_table_entry_t *end_elt;
apr_uint32_t checksum;
int hash, tmp_offset = 0;
if (key == NULL) {
return NULL;
}
hash = TABLE_HASH(key);
if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
return NULL;
}
COMPUTE_KEY_CHECKSUM(key, checksum);
next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash] ;
end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
for (; next_elt < = end_elt; next_elt++) {
if ((checksum == next_elt->key_checksum) &&
!strcasecmp(next_elt->key, key)) {
if (tmp_offset >= *offset){
*offset = tmp_offset;
return next_elt->val;
}
tmp_offset++;
}
}
return NULL;
}