1 // NOTICE.CPP
2
3 // Copyright (C) 2000 Tommi Hassinen.
4
5 // This package 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
8 // (at your option) any later version.
9
10 // This package is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // 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 package; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 /*################################################################################################*/
20
21 #include "libghemicalconfig2.h"
22 #include "notice.h"
23
24 #include "local_i18n.h"
25
26 #include <cstring>
27 #include <sstream>
28 #include <cstdlib>
29 using namespace std;
30
31 /*################################################################################################*/
32
get_lib_intro_notice_line(int line)33 const char * get_lib_intro_notice_line(int line)
34 {
35 ostringstream str;
36 switch (line)
37 {
38 case 0: str << _("libghemical-") << LIBVERSION << _(" released on ") << LIBRELEASEDATE << ends; break;
39 case 1: str << " " << ends; break;
40 case 2: str << _("For more information please visit ") << WEBSITE << ends; break;
41 case 3: str << " " << ends; break;
42
43 default: str << ends;
44 }
45
46 static char buffer[256];
47 strcpy(buffer, str.str().c_str());
48
49 return buffer;
50 };
51
get_copyright_notice_line(int line)52 const char * get_copyright_notice_line(int line)
53 {
54 ostringstream str;
55 switch (line)
56 {
57 case 0: str << _("Copyright (C) 1998 Tommi Hassinen and others.") << ends; break;
58 case 1: str << " " << ends; break;
59 case 2: str << _("OpenBabel Copyright (C) 1998 OpenEye Scientific and others.") << ends; break;
60 case 3: str << _("OpenBabel homepage is http://openbabel.sourceforge.net/") << ends; break;
61 case 4: str << " " << ends; break;
62 case 5: str << _("MOPAC7 by James J.P. Stewart and others is in Public Domain.") << ends; break;
63 case 6: str << _("The MOPAC7 based code (libmopac7) included in this program") << ends; break;
64 case 7: str << _("is also in Public Domain.") << ends; break;
65 case 8: str << " " << ends; break;
66 case 9: str << _("MPQC Copyright (C) 1997 Limit Point Systems, Inc. and others.") << ends; break;
67 case 10: str << _("MPQC homepage is http://www.mpqc.org/") << ends; break;
68 case 11: str << " " << ends; break;
69 case 12: str << _("This program is free software; you can redistribute it and/or") << ends; break;
70 case 13: str << _("modify it under the terms of the GNU General Public License") << ends; break;
71 case 14: str << _("as published by the Free Software Foundation; either version") << ends; break;
72 case 15: str << _("2 of the License, or any later version.") << ends; break;
73 case 16: str << " " << ends; break;
74 case 17: str << _("This program is distributed in the hope that it will be useful,") << ends; break;
75 case 18: str << _("but WITHOUT ANY WARRANTY; without even the implied warranty of") << ends; break;
76 case 19: str << _("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the") << ends; break;
77 case 20: str << _("GNU General Public License for more details.") << ends; break;
78
79 default: str << ends;
80 }
81
82 static char buffer[256];
83 strcpy(buffer, str.str().c_str());
84
85 return buffer;
86 }
87
print_lib_intro_notice(ostream & p1)88 void print_lib_intro_notice(ostream & p1)
89 {
90 for (int line = 0;line < LIB_INTRO_NOTICE_LINES;line++)
91 {
92 p1 << get_lib_intro_notice_line(line) << endl;
93 }
94 }
95
print_copyright_notice(ostream & p1)96 void print_copyright_notice(ostream & p1)
97 {
98 for (int line = 0;line < COPYRIGHT_NOTICE_LINES;line++)
99 {
100 p1 << get_copyright_notice_line(line) << endl;
101 }
102 }
103
104 /*################################################################################################*/
105
assertion_failed(const char * fn,int ln,const char * description)106 void assertion_failed(const char * fn, int ln, const char * description)
107 {
108 cout << _("FATAL ERROR : file ") << fn << _(" line ") << ln << _(" assertion failed : ");
109 cout << (description != NULL ? description : _("<no description>")) << endl;
110 cout << _("The program will now abort.") << endl;
111
112 exit(EXIT_FAILURE);
113 }
114
115 /*################################################################################################*/
116
117 // eof
118