[Freeswitch-svn] [commit] r4021 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Mon Jan 22 16:59:07 EST 2007


Author: anthm
Date: Mon Jan 22 16:59:07 2007
New Revision: 4021

Modified:
   freeswitch/trunk/src/include/switch_core.h
   freeswitch/trunk/src/switch_core.c

Log:
tweak core for build err and add core_get_var

Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h	(original)
+++ freeswitch/trunk/src/include/switch_core.h	Mon Jan 22 16:59:07 2007
@@ -473,6 +473,13 @@
 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
   \param cause the hangup cause to apply to the hungup channels
 */

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon Jan 22 16:59:07 2007
@@ -610,6 +610,11 @@
 	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
 SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char *uuid_str,
@@ -2881,7 +2886,7 @@
 #endif
 
 
-static int handle_fatality(int sig)
+static void handle_fatality(int sig)
 {
 	switch_thread_id_t thread_id;
 	jmp_buf *env;
@@ -2909,10 +2914,10 @@
 	jmp_buf env;
 	int sig;
 
-	signal(SIGSEGV, (void *) handle_fatality);
-	signal(SIGFPE, (void *) handle_fatality);
+	signal(SIGSEGV, handle_fatality);
+	signal(SIGFPE, handle_fatality);
 #ifndef WIN32
-	signal(SIGBUS, (void *) handle_fatality);
+	signal(SIGBUS, handle_fatality);
 #endif
 
 	if ((sig = setjmp(env)) != 0) {



More information about the Freeswitch-svn mailing list