[asterisk-bugs] [JIRA] (ASTERISK-22041) Move the ao2 string container to a more appropriate location

Matt Jordan (JIRA) noreply at issues.asterisk.org
Sun Jul 7 20:59:04 CDT 2013


Matt Jordan created ASTERISK-22041:
--------------------------------------

             Summary: Move the ao2 string container to a more appropriate location
                 Key: ASTERISK-22041
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22041
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/ManagerInterface
    Affects Versions: 12
            Reporter: Matt Jordan


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.

{noformat}
/* 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);
}
...
{noformat}



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list