creator_intern.h 2.5 KB

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