*/
SWITCH_DECLARE(char *) switch_core_session_sprintf(switch_core_session_t *session, const char *fmt, ...);
+/*!
+ \brief printf-style style printing routine. The data is output to a string allocated from the pool
+ \param pool a pool to use for allocation
+ \param fmt The format of the string
+ \param ... The arguments to use while printing the data
+ \return The new string
+*/
+SWITCH_DECLARE(char *) switch_core_sprintf(switch_memory_pool_t *pool, const char *fmt, ...);
+
/*!
\brief Retrieve the memory pool from a session
\param session the session to retrieve the pool from
return result;
}
+SWITCH_DECLARE(char *) switch_core_sprintf(switch_memory_pool_t *pool, const char *fmt, ...)
+{
+ va_list ap;
+ char *result = NULL;
+
+ assert(pool != NULL);
+ va_start(ap, fmt);
+
+ result = apr_pvsprintf(pool ,fmt, ap);
+
+ va_end(ap);
+
+ return result;
+}
+
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, const char *todup)
{