+/** Sort out command line options and evaluate them. Returns true if it
+ * succeeds and false otherwise. */
+bool evaloption(const std::string & option)
+{
+ if (option=="--version") {
+ std::cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION
+ << ", Cint V" << G__CINTVERSION << ")\n";
+ exit(0);
+ }
+ if (option=="--help") {
+ std::cout << "GiNaC-cint (" << PACKAGE << " V" << VERSION
+ << ", Cint V" << G__CINTVERSION << ")\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"
+ << " --version print GiNaC version and Cint version and exit\n";
+ exit(0);
+ }
+ if (option=="--silent") {
+ redirect("/dev/null",true);
+ silent = true;
+ return true;
+ }
+ return false;
+}
+
+bool is_command(std::string const & command,
+ std::string & preprocessed,
+ std::string const & comparevalue,
+ bool substr)
+{
+ bool single_quote = false;
+ bool double_quote = false;
+ bool comment = false;
+ unsigned open_braces = 0;
+ if ((preprocessed=="."+comparevalue)||
+ substr&&(preprocessed.substr(0,comparevalue.length()+1)==
+ "."+comparevalue)) {
+ return true;
+ }
+ if ((command=="//GiNaC-cint."+comparevalue+"\n")||
+ substr&&(command.substr(0,comparevalue.length()+13)==
+ "//GiNaC-cint."+comparevalue)) {
+ preprocessed = preprocess(command.substr(12).c_str(),comment,
+ single_quote,double_quote,open_braces);
+ return true;
+ }
+ return false;
+}
+
+bool readlines(istream * is,
+ std::string & allcommands)