GNU Octave  4.0.0
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
version.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2015 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 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include <string>
28 
29 #include "defaults.h"
30 #include "version.h"
31 
32 static std::string
33 octave_warranty_statement (const std::string& extra_info = std::string ())
34 {
35  return "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or\n\
36 FITNESS FOR A PARTICULAR PURPOSE."
37  + extra_info;
38 }
39 
40 static std::string
41 format_url (bool html, const std::string& url)
42 {
43  return html ? "<a href=\"" + url + "\">" + url + "</a>" : url;
44 }
45 
46 std::string
48 {
49  return "Additional information about Octave is available at "
50  + format_url (html, "http://www.octave.org.");
51 }
52 
53 std::string
55 {
56  return "Please contribute if you find this software useful.\n\
57 For more information, visit "
58  + format_url (html, "http://www.octave.org/get-involved.html");
59 }
60 
61 std::string
63 {
64  return "Read " + format_url (html, "http://www.octave.org/bugs.html")
65  + " to learn how to submit bug reports.";
66 }
67 
68 std::string
70 {
71  // The GNU coding standards say that on the first line printed by
72  // --version, the version number should follow the last space on the
73  // line.
74 
75  return "GNU Octave, version " OCTAVE_VERSION "\n" OCTAVE_COPYRIGHT;
76 }
77 
78 std::string
80  (bool html, const std::string& extra_info)
81 {
82  std::string br = html ? "<br>\n" : "\n";
83  std::string sep = html ? "\n</p>\n<p>\n" : "\n\n";
84 
86  + br
87  + "This is free software; see the source code for copying conditions."
88  + br
89  + octave_warranty_statement (extra_info)
90  + sep
91  + "Octave was configured for \"" OCTAVE_CANONICAL_HOST_TYPE "\".";
92 }
93 
94 std::string
96  (bool html, const std::string& extra_info)
97 {
98  std::string sep = html ? "\n</p>\n<p>\n" : "\n\n";
99 
100  std::string msg;
101 
102  if (html)
103  msg = "<p>\n";
104 
106  + sep
107  + octave_www_statement (html)
108  + sep
109  + octave_contrib_statement (html)
110  + sep
111  + octave_bugs_statement (html)
112  + (html ? "\n</p>" : "");
113 
114  return msg;
115 }
116 
117 std::string
119 {
120  std::string msg
122  (html, " For details, type 'warranty'.");
123 
124  msg += (html ? "<p>\n" : "\n");
125 
126  msg += "For information about changes from previous versions, type 'news'.";
127 
128  msg += (html ? "\n</p>" : "");
129 
130  return msg;
131 }
std::string octave_startup_message(bool html)
Definition: version.cc:118
static std::string format_url(bool html, const std::string &url)
Definition: version.cc:41
#define OCTAVE_CANONICAL_HOST_TYPE
Definition: defaults.h:32
static std::string octave_warranty_statement(const std::string &extra_info=std::string())
Definition: version.cc:33
std::string octave_bugs_statement(bool html)
Definition: version.cc:62
std::string octave_www_statement(bool html)
Definition: version.cc:47
std::string octave_contrib_statement(bool html)
Definition: version.cc:54
#define OCTAVE_VERSION
Definition: main.cc:46
std::string octave_name_version_copyright_copying_warranty_and_bugs(bool html, const std::string &extra_info)
Definition: version.cc:96
std::string octave_name_version_and_copyright(void)
Definition: version.cc:69
std::string octave_name_version_copyright_copying_and_warranty(bool html, const std::string &extra_info)
Definition: version.cc:80
#define OCTAVE_COPYRIGHT
Definition: version.h:47