curl resource engine More...
#include "asterisk.h"#include <curl/curl.h>#include "asterisk/module.h"
Go to the source code of this file.
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | load_module (void) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "cURL Resource Module" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
| static struct ast_module_info * | ast_module_info = &__mod_info |
curl resource engine
Definition in file res_curl.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 73 of file res_curl.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 73 of file res_curl.c.
| static int load_module | ( | void | ) | [static] |
Definition at line 61 of file res_curl.c.
References ast_log(), AST_MODULE_LOAD_DECLINE, and LOG_ERROR.
{
int res = 0;
if (curl_global_init(CURL_GLOBAL_ALL)) {
ast_log(LOG_ERROR, "Unable to initialize the CURL library. Cannot load res_curl\n");
return AST_MODULE_LOAD_DECLINE;
}
return res;
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 41 of file res_curl.c.
References ast_log(), ast_module_check(), and LOG_ERROR.
{
int res = 0;
/* If the dependent modules are still in memory, forbid unload */
if (ast_module_check("func_curl.so")) {
ast_log(LOG_ERROR, "func_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
return -1;
}
if (ast_module_check("res_config_curl.so")) {
ast_log(LOG_ERROR, "res_config_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
return -1;
}
curl_global_cleanup();
return res;
}
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "cURL Resource Module" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 73 of file res_curl.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 73 of file res_curl.c.