]> www.ginac.de Git - ginac.git/blobdiff - cint/ginaccint.bin.cpp
building in separate directory didn't work
[ginac.git] / cint / ginaccint.bin.cpp
index 77ec26c793b6fcb8be8b2cf6713c01aa13ecb621..edb0e806a6cb816220e64d78c6e2513b91a083a3 100644 (file)
@@ -47,6 +47,7 @@ long ex::last_created_or_assigned_exp = 0;
 G__value exec_tempfile(std::string const & command);
 char * process_permanentfile(std::string const & command);
 void process_tempfile(std::string const & command);
 G__value exec_tempfile(std::string const & command);
 char * process_permanentfile(std::string const & command);
 void process_tempfile(std::string const & command);
+void printversionmessage(std::ostream & os);
 void greeting(void);
 void helpmessage(void);
 std::string preprocess(char const * const line, bool & comment, bool & single_quote,
 void greeting(void);
 void helpmessage(void);
 std::string preprocess(char const * const line, bool & comment, bool & single_quote,
@@ -163,12 +164,21 @@ void process_tempfile(std::string const & command)
        return;
 }
 
        return;
 }
 
+void printversionmessage(std::ostream & os)
+{
+       os << "GiNaC-cint (" << PACKAGE << " V" << VERSION
+          << ", Cint V" << G__CINTVERSION/1000000
+          << '.' << G__CINTVERSION/1000%1000
+          << '.' << G__CINTVERSION%1000 << ')' << endl;
+       return;
+}
+
 void greeting(void)
 {
 void greeting(void)
 {
-       std::cout << "Welcome to GiNaC-cint (" << PACKAGE << " V" << VERSION
-                 << ", Cint V" << G__CINTVERSION << ")\n";
-       std::cout << "  __,  _______  GiNaC: (C) 1999-2000 Johannes Gutenberg University Mainz,\n"
-                 << " (__) *       | Germany.  Cint C/C++ interpreter: (C) 1995-2000 Masaharu\n"
+       std::cout << "Welcome to ";
+       printversionmessage(std::cout);
+       std::cout << "  __,  _______  GiNaC: (C) 1999-2001 Johannes Gutenberg University Mainz,\n"
+                 << " (__) *       | Germany.  Cint C/C++ interpreter: (C) 1995-2001 Masaharu\n"
                  << "  ._) i N a C | Goto and Agilent Technologies, Japan.  This is free software\n"
                  << "<-------------' with ABSOLUTELY NO WARRANTY.  For details, type `.warranty'\n"
                  << "Type `.help' for help.\n\n";
                  << "  ._) i N a C | Goto and Agilent Technologies, Japan.  This is free software\n"
                  << "<-------------' with ABSOLUTELY NO WARRANTY.  For details, type `.warranty'\n"
                  << "Type `.help' for help.\n\n";
@@ -323,13 +333,14 @@ void cleanup(void)
 
 void sigterm_handler(int n)
 {
 
 void sigterm_handler(int n)
 {
+       G__scratch_all();
        exit(1);
 }
 
 void initialize(void)
 {
        atexit(cleanup);
        exit(1);
 }
 
 void initialize(void)
 {
        atexit(cleanup);
-       signal(SIGTERM,sigterm_handler);
+       signal(SIGTERM, sigterm_handler);
        initialize_cint();
 }    
 
        initialize_cint();
 }    
 
@@ -376,13 +387,11 @@ void redirect(std::string const & filename,
 bool evaloption(const std::string & option)
 {
        if (option=="--version") {
 bool evaloption(const std::string & option)
 {
        if (option=="--version") {
-               std::cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION
-                         << ", Cint V" << G__CINTVERSION << ")\n";
+               printversionmessage(std::cout);
                exit(0);
        }
        if (option=="--help") {
                exit(0);
        }
        if (option=="--help") {
-               std::cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION
-                         << ", Cint V" << G__CINTVERSION << ")\n";
+               printversionmessage(std::cout);
                std::cout << "usage: ginaccint [option] [file ...]\n";
                std::cout << " --help           print this help message and exit\n"
                          << " --silent         invoke ginaccint in silent mode\n"
                std::cout << "usage: ginaccint [option] [file ...]\n";
                std::cout << " --help           print this help message and exit\n"
                          << " --silent         invoke ginaccint in silent mode\n"