melder.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* melder.cpp
  2. *
  3. * Copyright (C) 1992-2018 Paul Boersma
  4. *
  5. * This code 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 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "melder.h"
  19. #include "enums_getText.h"
  20. #include "melder_enums.h"
  21. #include "enums_getValue.h"
  22. #include "melder_enums.h"
  23. #include "../dwsys/NUMmachar.h"
  24. #include "../external/gsl/gsl_errno.h"
  25. #ifdef macintosh
  26. #include <Carbon/Carbon.h> // Gestalt
  27. #endif
  28. /********** Exported variables. **********/
  29. bool Melder_batch; // don't we have a GUI?- Set once at application start-up
  30. bool Melder_backgrounding; // are we running a script?- Set and unset dynamically
  31. int32 Melder_systemVersion;
  32. void Melder_init () {
  33. NUMmachar ();
  34. gsl_set_error_handler_off ();
  35. NUMrandom_init ();
  36. Melder_alloc_init ();
  37. Melder_message_init ();
  38. #ifdef macintosh
  39. SInt32 sys1, sys2, sys3;
  40. Gestalt ('sys1', & sys1);
  41. Gestalt ('sys2', & sys2);
  42. Gestalt ('sys3', & sys3);
  43. Melder_systemVersion = sys1 * 10000 + sys2 * 100 + sys3;
  44. #endif
  45. }
  46. /* End of file melder.cpp */