GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
main-gui.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2012-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <cstdlib>
28 
29 #include <iostream>
30 #include <string>
31 
32 #include "liboctave-build-info.h"
33 
35 
36 #include "liboctgui-build-info.h"
37 
38 #include "oct-env.h"
39 
40 #include "defaults.h"
41 #include "octave.h"
42 #include "octave-build-info.h"
43 #include "octave-gui.h"
44 #include "sysdep.h"
45 
46 static void
48 {
49  bool ok = true;
50 
51  // Each library and executable has its own definition of the hg
52  // id. They should always match but may be different because of a
53  // botched installation or incorrect LD_LIBRARY_PATH or some other
54  // unusual problem.
55 
56  std::string octave_id = octave_hg_id ();
57  std::string liboctave_id = liboctave_hg_id ();
58  std::string liboctinterp_id = liboctinterp_hg_id ();
59  std::string liboctgui_id = liboctgui_hg_id ();
60 
61  if (octave_id != liboctave_id)
62  {
63  std::cerr << "octave hg id ("
64  << octave_id
65  << ") does not match liboctave hg id ("
66  << liboctave_id
67  << ")" << std::endl;
68  ok = false;
69  }
70 
71  if (octave_id != liboctinterp_id)
72  {
73  std::cerr << "octave hg id ("
74  << octave_id
75  << ") does not match liboctinterp hg id ("
76  << liboctinterp_id
77  << ")" << std::endl;
78  ok = false;
79  }
80 
81  if (octave_id != liboctgui_id)
82  {
83  std::cerr << "octave hg id ("
84  << octave_id
85  << ") does not match liboctgui hg id ("
86  << liboctgui_id
87  << ")" << std::endl;
88  ok = false;
89  }
90 
91  if (! ok)
92  exit (1);
93 }
94 
95 int
96 main (int argc, char **argv)
97 {
99 
101 
102  octave::gui_application app (argc, argv);
103 
104  return app.execute ();
105 }
std::string liboctgui_hg_id(void)
std::string liboctinterp_hg_id(void)
int main(int argc, char **argv)
Definition: main-gui.cc:96
int argc
Definition: load-save.cc:633
string_vector argv
Definition: load-save.cc:635
static void check_hg_versions(void)
Definition: main-gui.cc:47
std::string octave_hg_id(void)
static void set_program_name(const std::string &s)
Definition: oct-env.cc:171
std::string liboctave_hg_id(void)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854