Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
module_versioning.h
Go to the documentation of this file.
1/*
2 This file is part of Ansel,
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef DT_COMMON_MODULE_VERSIONING_H
19#define DT_COMMON_MODULE_VERSIONING_H
20
21/* Module-interface versioning: the DT_MODULE()/DT_MODULE_INTROSPECTION() macros every
22 * dynamically-loaded module (iop, lib, view, imageio) must instantiate, and the version
23 * they are checked against at dlopen time. Application-free on purpose: module-interface
24 * headers include this instead of darktable.h. */
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
39#define DT_MODULE_VERSION 23 // version of dt's module interface
40
41
60// every module has to define this:
61#ifdef _DEBUG
62#define DT_MODULE(MODVER) \
63 int dt_module_dt_version() \
64 { \
65 return -DT_MODULE_VERSION; \
66 } \
67 int dt_module_mod_version() \
68 { \
69 return MODVER; \
70 }
71#else
72#define DT_MODULE(MODVER) \
73 int dt_module_dt_version() \
74 { \
75 return DT_MODULE_VERSION; \
76 } \
77 int dt_module_mod_version() \
78 { \
79 return MODVER; \
80 }
81#endif
82
95#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE) DT_MODULE(MODVER)
96
100// ..to be able to compare it against this:
101static inline int dt_version()
102{
103#ifdef _DEBUG
104 return -DT_MODULE_VERSION;
105#else
106 return DT_MODULE_VERSION;
107#endif
108}
109
113
114#ifdef __cplusplus
115}
116#endif
117
118#endif // DT_COMMON_MODULE_VERSIONING_H
119
120// clang-format off
121// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
122// vim: shiftwidth=2 expandtab tabstop=2 cindent
123// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
124// clang-format on
static int dt_version()
The interface version the HOST expects, in the host's own build configuration.
#define DT_MODULE_VERSION
Version of the module interface every dynamically-loaded module is checked against at load time.
char * dt_version_major_minor()
The application version, truncated to <major>.<minor>.
Definition darktable.c:314