Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
cltest/main.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2011 johannes hanika.
4 Copyright (C) 2012 Richard Wonka.
5 Copyright (C) 2014 Jérémy Rosen.
6 Copyright (C) 2014-2017 Tobias Ellinghaus.
7 Copyright (C) 2015 Roman Lebedev.
8 Copyright (C) 2016, 2019 parafin.
9 Copyright (C) 2020 Hubert Kowalski.
10 Copyright (C) 2020 Pascal Obry.
11 Copyright (C) 2022 Martin Bařinka.
12
13 darktable is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 darktable is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with darktable. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#include "common/darktable.h"
28#include "common/opencl.h"
29
30#ifdef __APPLE__
31#include "osx/osx.h"
32#endif
33
34#ifdef _WIN32
35#include <conio.h>
36#include "win/main_wrapper.h"
37#endif
38
39int main(int argc, char *arg[])
40{
41#ifdef __APPLE__
43#endif
44 int result = 1;
45 // only used to force-init opencl, so we want these options:
46 char *m_arg[] = { "-d", "opencl", "--library", ":memory:"};
47 const int m_argc = sizeof(m_arg) / sizeof(m_arg[0]);
48 char **argv = malloc(sizeof(arg[0]) * argc + sizeof(m_arg));
49 if(IS_NULL_PTR(argv)) goto end;
50 for(int i = 0; i < argc; i++)
51 argv[i] = arg[i];
52 for(int i = 0; i < m_argc; i++)
53 argv[argc + i] = m_arg[i];
54 argc += m_argc;
55 if(dt_init(argc, argv, FALSE, FALSE)) goto end;
56 dt_cleanup();
57 dt_free(argv);
58
59 result = 0;
60end:
61
62#ifdef _WIN32
63 printf("\npress any key to exit\n");
64 FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
65 getch();
66#endif
67
68 exit(result);
69}
70
71// clang-format off
72// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
73// vim: shiftwidth=2 expandtab tabstop=2 cindent
74// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
75// clang-format on
76
#define FALSE
Definition ashift_lsd.c:158
void dt_cleanup()
Definition darktable.c:1311
int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
Definition darktable.c:451
#define dt_free(ptr)
Definition darktable.h:456
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition darktable.h:281
void dt_osx_prepare_environment()
Definition osx.mm:212
int main()
Definition prova.c:47