Add API functions to get information about modules
This commit is contained in:
parent
892fdea83e
commit
e87ed914f8
@ -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};
|
||||
|
12
libobs/obs.h
12
libobs/obs.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user