From cfd2b244f7afbe828a2d6b80d680009d7cfbd05c Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Fri, 22 Mar 2013 19:26:37 +0000 Subject: [PATCH] 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(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383611 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/json.h | 5 +++++ main/asterisk.c | 2 ++ main/json.c | 13 +------------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/asterisk/json.h b/include/asterisk/json.h index d287bd6123..d8cf98ece1 100644 --- a/include/asterisk/json.h +++ b/include/asterisk/json.h @@ -32,6 +32,11 @@ /*!@{*/ +/*! + * \brief Initialize the JSON library. + */ +void ast_json_init(void); + /*! * \brief Set custom allocators instead of the standard ast_malloc() and ast_free(). * \since 12.0.0 diff --git a/main/asterisk.c b/main/asterisk.c index 3a0e87c412..d7eb8d9534 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -241,6 +241,7 @@ int daemon(int, int); /* defined in libresolv of all places */ #include "asterisk/uuid.h" #include "asterisk/sorcery.h" #include "asterisk/stasis.h" +#include "asterisk/json.h" #include "../defaults.h" @@ -4070,6 +4071,7 @@ int main(int argc, char *argv[]) ast_el_read_history(filename); } + ast_json_init(); ast_ulaw_init(); ast_alaw_init(); tdd_init(); diff --git a/main/json.c b/main/json.c index f1ebaef60c..b91707a8a6 100644 --- a/main/json.c +++ b/main/json.c @@ -502,19 +502,8 @@ struct ast_json *ast_json_deep_copy(const struct ast_json *value) 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); -- 2.47.2