Adding switch_mprintf (broken out from sqlite)

Adding new %w to mprintf to auto escape both single quote and backslashes
Improve the tab completion a tad and fix some sqlite/odbc compat with new mprintf opts
Change the default stream writer to use switch_vmprintf so %q/%w can be used there too



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15875 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2009-12-10 20:51:13 +00:00
1 parent 7803a752c9
commit cd1824e119
10 files changed
+1059 -44

No files matched your search

+7 -2
View File
@@ -3644,10 +3644,12 @@ void sofia_glue_release_profile__(const char *file, const char *func, int line,
switch_status_t sofia_glue_add_profile(char *key, sofia_profile_t *profile)
{
switch_status_t status = SWITCH_STATUS_FALSE;
char cbuf[512] = "";
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (!switch_core_hash_find(mod_sofia_globals.profile_hash, key)) {
status = switch_core_hash_insert(mod_sofia_globals.profile_hash, key, profile);
switch_snprintf(cbuf, sizeof(cbuf), "add sofia profile %s", key);
switch_console_set_complete(cbuf);
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
@@ -3716,13 +3718,16 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
const void *var;
void *val;
sofia_profile_t *pptr;
char cbuf[512] = "";
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
aliases[i++] = strdup((char *) var);
switch_snprintf(cbuf, sizeof(cbuf), "del sofia profile %s", var);
switch_console_set_complete(cbuf);
if (i == 512) {
abort();
}