libobs: Add function to get module pointer

Useful for getting getting locale text associated with a specific module
master
jp9000 2020-08-08 10:00:25 -07:00
parent f5d6a695be
commit de2e89d972
2 changed files with 17 additions and 0 deletions

View File

@ -189,6 +189,20 @@ const char *obs_get_module_data_path(obs_module_t *module)
return module ? module->data_path : NULL;
}
obs_module_t *obs_get_module(const char *name)
{
obs_module_t *module = obs->first_module;
while (module) {
if (strcmp(module->mod_name, name) == 0) {
return module;
}
module = module->next;
}
return NULL;
}
char *obs_find_module_file(obs_module_t *module, const char *file)
{
struct dstr output = {0};

View File

@ -420,6 +420,9 @@ EXPORT int obs_open_module(obs_module_t **module, const char *path,
*/
EXPORT bool obs_init_module(obs_module_t *module);
/** Returns a module based upon its name, or NULL if not found */
EXPORT obs_module_t *obs_get_module(const char *name);
/** Logs loaded modules */
EXPORT void obs_log_loaded_modules(void);