#include "dict.h"#include "str.h"#include <apr_strings.h>#include <assert.h>Include dependency graph for dict.c:

Go to the source code of this file.
Functions | |
| bs_dict * | new_dict (apr_pool_t *mp) |
| void | delete_dict (bs_dict *dict) |
| void * | dict_get (const bs_dict *dict, const char *key) |
| bs_bool | dict_add (bs_dict *dict, const char *key, void *data) |
| void | dict_remove (bs_dict *dict, const char *key) |
| unsigned | dict_size (const bs_dict *dict) |
| void delete_dict | ( | bs_dict * | dict | ) |
Delete the dict object and its internal data structures. The data items it refers to is not deleted.
| dict | The dict to delete |
Definition at line 63 of file dict.c.
References bs_dict::pool.
Add a data item to the dict.
| dict | The dict to add the item to | |
| key | The key to use for the item | |
| data | The data to add |
Definition at line 89 of file dict.c.
References bs_dict::bucket, bs_dict_item::data, FALSE, bs_dict_item::key, list_index(), list_size(), new_list(), bs_dict::pool, bs_dict::size, streq(), and TRUE.
Here is the call graph for this function:

| void* dict_get | ( | const bs_dict * | dict, | |
| const char * | key | |||
| ) |
Retrieve the first data item from the dict that matches the given the key.
| dict | The dict to retrieve from | |
| key | The key to the data item |
Definition at line 71 of file dict.c.
References bs_dict::bucket, list_index(), list_size(), and streq().
Here is the call graph for this function:

| void dict_remove | ( | bs_dict * | dict, | |
| const char * | key | |||
| ) |
Remove the first data item in the dict that matches the key.
| dict | The dict to remove the item from | |
| key | The key to use |
Definition at line 113 of file dict.c.
References bs_dict::bucket, list_index(), list_remove(), list_size(), bs_dict::size, and streq().
Here is the call graph for this function:

| unsigned dict_size | ( | const bs_dict * | dict | ) | [inline] |
Returns the number of data items in the dict.
| dict | The dict to get the count for |
Definition at line 134 of file dict.c.
References bs_dict::size.
| bs_dict* new_dict | ( | apr_pool_t * | mp | ) |
Allocate a new dict object from the pool.
| mp | Memory pool to allocate from |
Definition at line 43 of file dict.c.
References pool, bs_dict::pool, runtestsuite::rv, and bs_dict::size.
1.5.1