GNU Octave
6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
main-cli.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2012-2021 The Octave Project Developers
4
//
5
// See the file COPYRIGHT.md in the top-level directory of this
6
// distribution or <https://octave.org/copyright/>.
7
//
8
// This file is part of Octave.
9
//
10
// Octave is free software: you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// Octave is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Octave; see the file COPYING. If not, see
22
// <https://www.gnu.org/licenses/>.
23
//
24
////////////////////////////////////////////////////////////////////////
25
26
#if defined (HAVE_CONFIG_H)
27
# include "config.h"
28
#endif
29
30
#include <cstdlib>
31
32
#include <iostream>
33
#include <string>
34
35
#include "
liboctave-build-info.h
"
36
37
#include "
liboctinterp-build-info.h
"
38
39
#include "
oct-env.h
"
40
#include "
signal-wrappers.h
"
41
42
#include "
octave.h
"
43
#include "
octave-build-info.h
"
44
#include "
sysdep.h
"
45
46
static
void
47
check_hg_versions
(
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
60
if
(octave_id != liboctave_id)
61
{
62
std::cerr <<
"octave hg id ("
63
<< octave_id
64
<<
") does not match liboctave hg id ("
65
<< liboctave_id
66
<<
')'
<< std::endl;
67
ok =
false
;
68
}
69
70
if
(octave_id != liboctinterp_id)
71
{
72
std::cerr <<
"octave hg id ("
73
<< octave_id
74
<<
") does not match liboctinterp hg id ("
75
<< liboctinterp_id
76
<<
')'
<< std::endl;
77
ok =
false
;
78
}
79
80
if
(! ok)
81
exit (1);
82
}
83
84
int
85
main
(
int
argc,
char
**argv)
86
{
87
check_hg_versions
();
88
89
octave_block_async_signals
();
90
91
octave::sys::env::set_program_name
(argv[0]);
92
93
octave::cli_application
app (argc, argv);
94
95
return
app.
execute
();
96
}
octave::cli_application
Definition:
octave.h:351
octave::cli_application::execute
int execute(void)
Definition:
octave.cc:375
octave::sys::env::set_program_name
static void set_program_name(const std::string &s)
Definition:
oct-env.cc:182
liboctave-build-info.h
liboctave_hg_id
OCTAVE_API std::string liboctave_hg_id(void)
Definition:
liboctave-build-info.in.cc:35
liboctinterp-build-info.h
liboctinterp_hg_id
OCTAVE_API std::string liboctinterp_hg_id(void)
Definition:
liboctinterp-build-info.in.cc:35
main
int main(int argc, char **argv)
Definition:
main-cli.cc:85
check_hg_versions
static void check_hg_versions(void)
Definition:
main-cli.cc:47
oct-env.h
octave-build-info.h
octave_hg_id
std::string octave_hg_id(void)
Definition:
octave-build-info.in.cc:35
octave.h
octave_block_async_signals
void octave_block_async_signals(void)
Definition:
signal-wrappers.c:662
signal-wrappers.h
sysdep.h
src
main-cli.cc
Generated on Tue Apr 13 2021 15:27:51 for GNU Octave by
1.9.1