1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup creator
*
* Functionality for main() initialization.
*/
struct bArgs;
struct bContext;
#ifndef WITH_PYTHON_MODULE
/* creator_args.c */
void main_args_setup(struct bContext *C, struct bArgs *ba);
void main_args_setup_post(struct bContext *C, struct bArgs *ba);
/* creator_signals.c */
void main_signal_setup(void);
void main_signal_setup_background(void);
void main_signal_setup_fpe(void);
#endif /* WITH_PYTHON_MODULE */
/* Shared data for argument handlers to store state in */
struct ApplicationState {
struct {
bool use_crash_handler;
bool use_abort_handler;
} signal;
/* we may want to set different exit codes for other kinds of errors */
struct {
unsigned char python;
} exit_code_on_error;
};
extern struct ApplicationState app_state; /* creator.c */
/**
* Passes for use by #main_args_setup.
* Keep in order of execution.
*/
enum {
ARG_PASS_ENVIRONMENT = 1,
ARG_PASS_SETTINGS = 2,
/** Windowing & graphical settings, ignored in background mode. */
ARG_PASS_SETTINGS_GUI = 3,
ARG_PASS_SETTINGS_FORCE = 4,
/** Actions & fall back to loading blend file. */
ARG_PASS_FINAL = 5,
};
/* for the callbacks: */
#ifndef WITH_PYTHON_MODULE
# define BLEND_VERSION_FMT "Blender %d.%02d.%d"
# define BLEND_VERSION_ARG BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_VERSION_PATCH
#endif
#ifdef WITH_BUILDINFO_HEADER
# define BUILD_DATE
#endif
/* from buildinfo.c */
#ifdef BUILD_DATE
extern char build_date[];
extern char build_time[];
extern char build_hash[];
extern unsigned long build_commit_timestamp;
/* TODO(sergey): ideally size need to be in sync with buildinfo.c */
extern char build_commit_date[16];
extern char build_commit_time[16];
extern char build_branch[];
extern char build_platform[];
extern char build_type[];
extern char build_cflags[];
extern char build_cxxflags[];
extern char build_linkflags[];
extern char build_system[];
#endif
|