[asterisk-commits] dlee: trunk r383611 - in /trunk: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 22 14:26:39 CDT 2013


Author: dlee
Date: Fri Mar 22 14:26:37 2013
New Revision: 383611

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383611
Log:
Corrected some module issues introduced by r383579.

When I moved res_json.c to json.c, I left the MODULE_INFO stuff in there,
which was interesting if you ran module show. I also forgot to call what
was in module_load() from asterisk main().

Modified:
    trunk/include/asterisk/json.h
    trunk/main/asterisk.c
    trunk/main/json.c

Modified: trunk/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/json.h?view=diff&rev=383611&r1=383610&r2=383611
==============================================================================
--- trunk/include/asterisk/json.h (original)
+++ trunk/include/asterisk/json.h Fri Mar 22 14:26:37 2013
@@ -31,6 +31,11 @@
  */
 
 /*!@{*/
+
+/*!
+ * \brief Initialize the JSON library.
+ */
+void ast_json_init(void);
 
 /*!
  * \brief Set custom allocators instead of the standard ast_malloc() and ast_free().

Modified: trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.c?view=diff&rev=383611&r1=383610&r2=383611
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Fri Mar 22 14:26:37 2013
@@ -241,6 +241,7 @@
 #include "asterisk/uuid.h"
 #include "asterisk/sorcery.h"
 #include "asterisk/stasis.h"
+#include "asterisk/json.h"
 
 #include "../defaults.h"
 
@@ -4070,6 +4071,7 @@
 			ast_el_read_history(filename);
 	}
 
+	ast_json_init();
 	ast_ulaw_init();
 	ast_alaw_init();
 	tdd_init();

Modified: trunk/main/json.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/json.c?view=diff&rev=383611&r1=383610&r2=383611
==============================================================================
--- trunk/main/json.c (original)
+++ trunk/main/json.c Fri Mar 22 14:26:37 2013
@@ -502,19 +502,8 @@
 	return (struct ast_json *)json_deep_copy((json_t *)value);
 }
 
-static int unload_module(void)
-{
-	/* Nothing to do */
-	return 0;
-}
-
-static int load_module(void)
+void ast_json_init(void)
 {
 	/* Setup to use Asterisk custom allocators */
 	ast_json_reset_alloc_funcs();
-	return AST_MODULE_LOAD_SUCCESS;
-}
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "JSON library",
-		.load = load_module,
-		.unload = unload_module);
+}




More information about the asterisk-commits mailing list