Add API functions to get information about modules

This commit is contained in:
jp9000 2014-07-27 12:47:29 -07:00
parent 892fdea83e
commit e87ed914f8
2 changed files with 32 additions and 0 deletions

View File

@ -106,6 +106,26 @@ bool obs_init_module(obs_module_t module)
return module->loaded;
}
const char *obs_get_module_file_name(obs_module_t module)
{
return module ? module->file : NULL;
}
const char *obs_get_module_name(obs_module_t module)
{
return (module && module->name) ? module->name() : NULL;
}
const char *obs_get_module_author(obs_module_t module)
{
return (module && module->author) ? module->author() : NULL;
}
const char *obs_get_module_description(obs_module_t module)
{
return (module && module->description) ? module->description() : NULL;
}
char *obs_find_module_file(obs_module_t module, const char *file)
{
struct dstr output = {0};

View File

@ -289,6 +289,18 @@ EXPORT int obs_open_module(obs_module_t *module, const char *path,
*/
EXPORT bool obs_init_module(obs_module_t module);
/** Returns the module file name */
EXPORT const char *obs_get_module_file_name(obs_module_t module);
/** Returns the module full name */
EXPORT const char *obs_get_module_name(obs_module_t module);
/** Returns the module author(s) */
EXPORT const char *obs_get_module_author(obs_module_t module);
/** Returns the module description */
EXPORT const char *obs_get_module_description(obs_module_t module);
/**
* Adds a module search path to be used with obs_find_modules. If the search
* path strings contain %module%, that text will be replaced with the module