tweak core for build err and add core_get_var

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4021 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-01-22 21:59:07 +00:00
parent 27ebcae63e
commit d3e1f400e5
2 changed files with 16 additions and 4 deletions

View File

@ -472,6 +472,13 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_st
*/ */
SWITCH_DECLARE(char *) switch_core_get_variable(char *varname); SWITCH_DECLARE(char *) switch_core_get_variable(char *varname);
/*!
\brief Add a global variable to the core
\param varname the name of the variable
\param value the value of the variable
*/
SWITCH_DECLARE(void) switch_core_set_variable(char *varname, char *value);
/*! /*!
\brief Hangup All Sessions \brief Hangup All Sessions
\param cause the hangup cause to apply to the hungup channels \param cause the hangup cause to apply to the hungup channels

View File

@ -610,6 +610,11 @@ SWITCH_DECLARE(char *) switch_core_get_variable(char *varname)
return (char *) switch_core_hash_find(runtime.global_vars, varname); return (char *) switch_core_hash_find(runtime.global_vars, varname);
} }
SWITCH_DECLARE(void) switch_core_set_variable(char *varname, char *value)
{
switch_core_hash_insert(runtime.global_vars, switch_core_strdup(runtime.memory_pool, varname), switch_core_strdup(runtime.memory_pool, value));
}
#ifdef SWITCH_DEBUG_RWLOCKS #ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char *uuid_str, SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char *uuid_str,
@ -2881,7 +2886,7 @@ static void print_trace (void)
#endif #endif
static int handle_fatality(int sig) static void handle_fatality(int sig)
{ {
switch_thread_id_t thread_id; switch_thread_id_t thread_id;
jmp_buf *env; jmp_buf *env;
@ -2909,10 +2914,10 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
jmp_buf env; jmp_buf env;
int sig; int sig;
signal(SIGSEGV, (void *) handle_fatality); signal(SIGSEGV, handle_fatality);
signal(SIGFPE, (void *) handle_fatality); signal(SIGFPE, handle_fatality);
#ifndef WIN32 #ifndef WIN32
signal(SIGBUS, (void *) handle_fatality); signal(SIGBUS, handle_fatality);
#endif #endif
if ((sig = setjmp(env)) != 0) { if ((sig = setjmp(env)) != 0) {