Go to the source code of this file.
Functions | |
MAP | _stp_map_new (unsigned max_entries, enum valtype type) |
Create a new map. | |
void | _stp_map_key_del (MAP map) |
Deletes the current element. | |
map_node * | _stp_map_start (MAP map) |
Get the first element in a map. | |
map_node * | _stp_map_iter (MAP map, struct map_node *m) |
Get the next element in a map. | |
void | _stp_map_del (MAP map) |
Deletes a map. | |
void | _stp_map_key_long_long (MAP map, long key1, long key2) |
Set the map's key to two longs. | |
void | _stp_map_key_str_str (MAP map, char *key1, char *key2) |
Set the map's key to two strings. | |
void | _stp_map_key_str_long (MAP map, char *key1, long key2) |
Set the map's key to a string and a long. | |
void | _stp_map_key_long_str (MAP map, long key1, char *key2) |
Set the map's key to a long and a string. | |
void | _stp_map_key_str (MAP map, char *key) |
Set the map's key to a string. | |
void | _stp_map_key_long (MAP map, long key) |
Set the map's key to a long. | |
void | _stp_map_set_int64 (MAP map, int64_t val) |
Set the current element's value to an int64. | |
void | _stp_map_add_int64 (MAP map, int64_t val) |
Adds an int64 to the current element's value. | |
int64_t | _stp_map_get_int64 (MAP map) |
Gets the current element's value. | |
void | _stp_map_set_str (MAP map, char *val) |
Set the current element's value to a string. | |
char * | _stp_map_get_str (MAP map) |
Gets the current element's value. | |
void | _stp_map_set_stat (MAP map, stat *stats) |
Set the current element's value to a stat. | |
stat * | _stp_map_get_stat (MAP map) |
Gets the current element's value. | |
void | _stp_map_stat_add (MAP map, int64_t val) |
Add to the current element's statistics. | |
MAP | _stp_list_new (unsigned max_entries, enum valtype type) |
Create a new list. | |
void | _stp_list_clear (MAP map) |
Clears a list. | |
void | _stp_list_add_str (MAP map, char *str) |
Adds a string to a list. | |
void | _stp_list_add_int64 (MAP map, int64_t val) |
Adds an int64 to a list. | |
int | _stp_list_size (MAP map) |
Get the number of elements in a list. |
Definition in file map.c.
|
Adds an int64 to a list.
Definition at line 846 of file map.c. References _stp_map_key_long(), _stp_map_set_int64(), and map_root::num. |
|
Adds a string to a list.
Definition at line 835 of file map.c. References _stp_map_key_long(), _stp_map_set_str(), and map_root::num. |
|
Clears a list. All elements in the list are deleted.
Definition at line 795 of file map.c. References map_root::head, map_node::hnode, map_node::lnode, map_root::maxnum, map_root::num, and map_root::pool. |
|
Create a new list. A list is a map that internally has an incrementing long key for each member. Lists do not wrap if elements are added to exceed their maximum size.
Definition at line 783 of file map.c. References _stp_map_new(), and map_root::no_wrap. |
|
Get the number of elements in a list.
Definition at line 857 of file map.c. References map_root::num. |
|
Adds an int64 to the current element's value. This adds an int64 to the current element's value. The map must have been created to hold int64s using _stp_map_new() If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.
|
|
Deletes a map. Deletes a map, freeing all memory in all elements. Normally done only when the module exits.
Definition at line 195 of file map.c. References map_root::head, map_node::lnode, and map_root::membuf. |
|
Gets the current element's value.
Definition at line 558 of file map.c. References map_root::create, and map_root::key. |
|
Gets the current element's value.
Definition at line 722 of file map.c. References map_root::create, and map_root::key. |
|
Gets the current element's value.
Definition at line 639 of file map.c. References map_root::create, and map_root::key. |
|
Get the next element in a map.
Definition at line 176 of file map.c. References map_root::head, and map_node::lnode. |
|
Deletes the current element. If no current element (key) for this map is set, this function does nothing.
Definition at line 108 of file map.c. References map_root::create, map_node::hnode, map_root::key, and map_node::lnode. Referenced by _stp_map_set_stat(), and _stp_map_set_str(). |
|
Set the map's key to a long. This sets the current element based on a long key. If the key is not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 420 of file map.c. References _stp_map_key_long_long(), and map_root::c_key2type. Referenced by _stp_list_add_int64(), and _stp_list_add_str(). |
|
Set the map's key to two longs. This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 223 of file map.c. References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, map_root::hashes, map_root::key, map_node::key1, and key_data::val. Referenced by _stp_map_key_long(). |
|
Set the map's key to a long and a string. This sets the current element based on a key of a long and a string. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 363 of file map.c. References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, map_root::hashes, map_root::key, map_node::key1, map_node::key2, key_data::str, and key_data::val. |
|
Set the map's key to a string. This sets the current element based on a string key. If the key is not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 404 of file map.c. References _stp_map_key_str_str(), and map_root::c_key2type. |
|
Set the map's key to a string and a long. This sets the current element based on a key of a string and a long. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 315 of file map.c. References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, map_root::hashes, map_root::key, map_node::key1, map_node::key2, key_data::str, and key_data::val. |
|
Set the map's key to two strings. This sets the current element based on a key of two strings. If the keys are not found, a new element will not be created until a _stp_map_set_xxx call.
Definition at line 266 of file map.c. References map_root::c_key1, map_root::c_key1type, map_root::c_key2, map_root::c_key2type, map_root::c_keyhead, map_root::create, map_root::hashes, map_root::key, map_node::key1, map_node::key2, and key_data::str. Referenced by _stp_map_key_str(). |
|
Create a new map. Maps must be created at module initialization time.
Definition at line 47 of file map.c. References map_root::head, map_root::maxnum, map_root::membuf, map_root::pool, and map_root::type. Referenced by _stp_list_new(). |
|
Set the current element's value to an int64. This sets the current element's value to an int64. The map must have been created to hold int64s using _stp_map_new() If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.
Definition at line 531 of file map.c. Referenced by _stp_list_add_int64(). |
|
Set the current element's value to a stat. This sets the current element's value to an stat struct. The map must have been created to hold stats using _stp_map_new(xxx, STAT). This function would only be used if we wanted to set stats to something other than the normal initial values (count = 0, sum = 0, etc). It may be deleted if it doesn't turn out to be useful.
Definition at line 663 of file map.c. References _stp_map_key_del(), map_root::create, map_root::head, map_root::key, map_root::maxnum, map_root::no_wrap, and map_root::pool. Referenced by _stp_map_stat_add(). |
|
Set the current element's value to a string. This sets the current element's value to an string. The map must have been created to hold int64s using _stp_map_new(xxx, STRING) If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.
Definition at line 578 of file map.c. References _stp_map_key_del(), map_root::create, map_root::head, map_root::key, map_root::maxnum, map_root::no_wrap, and map_root::pool. Referenced by _stp_list_add_str(). |
|
Get the first element in a map.
Definition at line 153 of file map.c. References map_root::head. |
|
Add to the current element's statistics. Increments the statistics counter by one and the sum by val. Adjusts minimum, maximum, and histogram. If the element doesn't exist, it is created. If no current element (key) is set for the map, this function does nothing.
Definition at line 743 of file map.c. References _stp_map_set_stat(), map_root::create, and map_root::key. |