提交 de2e89d9 编写于 作者: J jp9000

libobs: Add function to get module pointer

Useful for getting getting locale text associated with a specific module
上级 f5d6a695
......@@ -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};
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册