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
30#define DT_MODULE_VERSION 23 // version of dt's module interface
31
32
33// every module has to define this:
34#ifdef _DEBUG
35#define DT_MODULE(MODVER) \
36 int dt_module_dt_version() \
37 { \
38 return -DT_MODULE_VERSION; \
39 } \
40 int dt_module_mod_version() \
41 { \
42 return MODVER; \
43 }
44#else
45#define DT_MODULE(MODVER) \
46 int dt_module_dt_version() \
47 { \
48 return DT_MODULE_VERSION; \
49 } \
50 int dt_module_mod_version() \
51 { \
52 return MODVER; \
53 }
54#endif
55
56#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE) DT_MODULE(MODVER)
57
58// ..to be able to compare it against this:
59static inline int dt_version()
60{
61#ifdef _DEBUG
62 return -DT_MODULE_VERSION;
63#else
64 return DT_MODULE_VERSION;
65#endif
66}
67
68// returns the darktable version as <major>.<minor>
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif // DT_COMMON_MODULE_VERSIONING_H
76
77// clang-format off
78// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
79// vim: shiftwidth=2 expandtab tabstop=2 cindent
80// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
81// clang-format on
static int dt_version()
#define DT_MODULE_VERSION
char * dt_version_major_minor()
Definition darktable.c:315