mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
add module_exists api call
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8984 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -830,7 +830,24 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
|
||||
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_loadable_module_exists(const char *mod)
|
||||
{
|
||||
switch_status_t status;
|
||||
|
||||
if (switch_strlen_zero(mod)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
if (switch_core_hash_find(loadable_modules.module_hash, mod)) {
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
switch_mutex_unlock(loadable_modules.mutex);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err)
|
||||
{
|
||||
|
Reference in New Issue
Block a user