Summary:ASTERISK-22041: Move the ao2 string container to a more appropriate location
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2013-07-07 20:58:13Date Closed:2013-08-02 09:12:01
Versions:12 Frequency of
Description:Currently, the ao2 container that contains only strings is directly defined in {{astobj2.h}}. This is an inappropriate location - a specialized container such as this should live in a higher layer of abstraction.

Unfortunately, it can't live in strings.h without work in the utils folder being done. That being said, it either needs to live in strings.h or somewhere else other than astobj2.

/* XXX TODO BUGBUG and all the other things...
* These functions should eventually be moved elsewhere, but the utils folder
* won't compile with them in strings.h
static int str_hash(const void *obj, const int flags)
return ast_str_hash(obj);

static int str_cmp(void *lhs, void *rhs, int flags)
return strcmp(lhs, rhs) ? 0 : CMP_MATCH;

struct ao2_container *ast_str_container_alloc_options(enum ao2_container_opts opts, int buckets)
return ao2_container_alloc_options(opts, buckets, str_hash, str_cmp);