Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs: Add function to get module lib #3871

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/sphinx/reference-modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,12 @@ plugin modules.
:param module: The module associated with the path
:param file: The file to get a path to
:return: Path string, or NULL if not found. Use bfree to free string

---------------------

.. function:: void *obs_get_module_lib(obs_module_t *module)

Returns library file of specified module.

:param module: The module where to find library file.
:return: Pointer to module library.
5 changes: 5 additions & 0 deletions libobs/obs-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ obs_module_t *obs_get_module(const char *name)
return NULL;
}

void *obs_get_module_lib(obs_module_t *module)
{
return module ? module->module : NULL;
}

char *obs_find_module_file(obs_module_t *module, const char *file)
{
struct dstr output = {0};
Expand Down
3 changes: 3 additions & 0 deletions libobs/obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ 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);

/** Gets library of module */
EXPORT void *obs_get_module_lib(obs_module_t *module);

/** Returns locale text from a specific module */
EXPORT bool obs_module_get_locale_string(const obs_module_t *mod,
const char *lookup_string,
Expand Down