Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
module.h File Reference
#include <glib.h>
+ Include dependency graph for common/module.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DT_MODULE_MANIFEST_NAME   "modules.manifest"
 Name of the manifest each module directory must carry.
 

Functions

gchar ** dt_module_read_manifest (const char *subdir, char *moduledir)
 Read a module directory's manifest and return the module base names it lists.
 
GList * dt_module_load_modules (const char *subdir, size_t module_size, int(*load_module_so)(void *module, const char *libname, const char *plugin_name), void(*init_module)(void *module), gint(*sort_modules)(gconstpointer a, gconstpointer b))
 Load every module the given directory's manifest lists.
 

Macro Definition Documentation

◆ DT_MODULE_MANIFEST_NAME

#define DT_MODULE_MANIFEST_NAME   "modules.manifest"

Name of the manifest each module directory must carry.

It is generated at build time from the very list of targets CMake compiled, and installed beside them. See dt_module_read_manifest().

Definition at line 34 of file common/module.h.

Function Documentation

◆ dt_module_load_modules()

GList * dt_module_load_modules ( const char *  subdir,
size_t  module_size,
int(*)(void *module, const char *libname, const char *plugin_name)  load_module_so,
void(*)(void *module)  init_module,
gint(*)(gconstpointer a, gconstpointer b)  sort_modules 
)

Load every module the given directory's manifest lists.

See also
dt_module_read_manifest() for how the set of modules is decided.

Definition at line 106 of file module.c.

References dt_conf_get_bool(), dt_conf_key_exists(), dt_conf_set_bool(), dt_free, dt_module_read_manifest(), DT_PATH_MAX, IS_NULL_PTR, name, res, and TRUE.

Referenced by dt_lib_init(), and dt_view_manager_load_modules().

◆ dt_module_read_manifest()

gchar ** dt_module_read_manifest ( const char *  subdir,
char *  moduledir 
)

Read a module directory's manifest and return the module base names it lists.

Parameters
subdirdirectory under the module dir, e.g. "/views", leading separator included
moduledirfilled with the absolute directory the manifest was read from; must be at least DT_PATH_MAX bytes
Returns
a NULL-terminated array of base names, to be freed with g_strfreev(), or NULL when the manifest is absent or unreadable – in which case nothing loads.

The base names are what g_module_build_path() expects: no ‘lib’ prefix, no file extension, no directory component. Entries carrying a path separator, a ‘..’, or a leading dot are rejected and reported: a manifest names the modules shipped in ITS directory and nothing else.

Definition at line 56 of file module.c.

References _manifest_entry_is_sane(), DT_DEBUG_ALWAYS, dt_loc_get_moduledir(), DT_MODULE_MANIFEST_NAME, DT_PATH_MAX, dt_print(), error(), FALSE, IS_NULL_PTR, and names.

Referenced by dt_imageio_load_modules_format(), dt_imageio_load_modules_storage(), and dt_module_load_modules().