mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
add switch_core_session_sprintf which allocates from the session pool
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4319 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1465,6 +1465,22 @@ SWITCH_DECLARE(char *) switch_core_permanent_strdup(const char *todup)
|
||||
return duped;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_session_sprintf(switch_core_session_t *session, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *result = NULL;
|
||||
|
||||
assert(session != NULL);
|
||||
assert(session->pool != NULL);
|
||||
va_start(ap, fmt);
|
||||
|
||||
result = apr_pvsprintf(session->pool ,fmt, ap);
|
||||
|
||||
va_end(ap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, const char *todup)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user