ARTS  2.2.66
arts.cc
Go to the documentation of this file.
1 /* Copyright (C) 2003-2012 Stefan Buehler <sbuehler@ltu.se>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
27 #include <cstdlib>
28 #include <stdexcept>
29 #include "arts.h"
30 #include "file.h"
31 #include "messages.h"
32 
33 
42 void arts_exit(int status)
43 {
44  extern ofstream report_file;
45  extern String out_basename; // Basis for file name
46  ostringstream report_file_ext;
47 
48  report_file_ext << ".rep";
49  cleanup_output_file(report_file, add_basedir(out_basename + report_file_ext.str()));
50 
51  exit (status);
52 }
53 
55 
65 {
66  ostringstream os;
67  os << m << "\n"
68  << "Stopping ARTS execution.\n"
69  << "Goodbye.\n";
70  out << os.str();
71 
72  arts_exit(); // No argument means failure.
73 }
cleanup_output_file
void cleanup_output_file(ofstream &, const String &)
Closes the file.
Definition: file.cc:154
ArtsOut
Definition: messages.h:86
messages.h
Declarations having to do with the four output streams.
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:64
report_file
ofstream report_file
The report file.
Definition: messages.cc:45
out_basename
String out_basename
The basename for the report file and for all other output files.
Definition: messages.cc:42
add_basedir
String add_basedir(const String &path)
Definition: file.cc:530
file.h
This file contains basic functions to handle ASCII files.
arts_exit
void arts_exit(int status)
This is the exit function of ARTS.
Definition: arts.cc:42
arts_exit_with_error_message
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
Definition: arts.cc:64
arts.h
The global header file for ARTS.