X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginsh%2Fginsh_parser.yy;h=e2913724de4b04ee03653db50f1ffbda5655ae16;hb=e80b7aac7fb140d9c333f13bb2fb5d46ef9b871d;hp=cdd5cb2a91b2c106aff3ea6139b5c496923e2c83;hpb=a0c5b050b17e581705810a92178cfb1d48a088c1;p=ginac.git diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index cdd5cb2a..e2913724 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -4,7 +4,7 @@ * This file must be processed with yacc/bison. */ /* - * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,6 +45,7 @@ #define YYERROR_VERBOSE 1 +#ifdef REALLY_HAVE_LIBREADLINE // Original readline settings static int orig_completion_append_character; #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) @@ -58,6 +59,7 @@ static const char *orig_basic_word_break_characters; #else #define GINAC_RL_COMPLETER_CAST(a) (a) #endif +#endif // REALLY_HAVE_LIBREADLINE // Expression stack for %, %% and %%% static void push(const ex &e); @@ -715,7 +717,8 @@ static ex f_ginac_function(const exprseq &es, int serial) } // All registered GiNaC functions -void GiNaC::ginsh_get_ginac_functions(void) +namespace GiNaC { +void ginsh_get_ginac_functions(void) { vector::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end(); unsigned serial = 0; @@ -725,6 +728,7 @@ void GiNaC::ginsh_get_ginac_functions(void) serial++; } } +} /* @@ -848,6 +852,7 @@ static char *fcn_generator(const char *text, int state) return NULL; } +#ifdef REALLY_HAVE_LIBREADLINE static char **fcn_completion(const char *text, int start, int end) { if (rl_line_buffer[0] == '!') { @@ -872,11 +877,12 @@ static char **fcn_completion(const char *text, int start, int end) #endif } } +#endif // REALLY_HAVE_LIBREADLINE void greeting(void) { cout << "ginsh - GiNaC Interactive Shell (" << PACKAGE << " V" << VERSION << ")" << endl; - cout << " __, _______ Copyright (C) 1999-2006 Johannes Gutenberg University Mainz,\n" + cout << " __, _______ Copyright (C) 1999-2008 Johannes Gutenberg University Mainz,\n" << " (__) * | Germany. This is free software with ABSOLUTELY NO WARRANTY.\n" << " ._) i N a C | You are welcome to redistribute it under certain conditions.\n" << "<-------------' For details type `warranty;'.\n" << endl; @@ -915,6 +921,7 @@ int main(int argc, char **argv) insert_help("print_latex", "print_latex(expression) - prints a LaTeX representation of the given expression"); insert_help("print_csrc", "print_csrc(expression) - prints a C source code representation of the given expression"); +#ifdef REALLY_HAVE_LIBREADLINE // Init readline completer rl_readline_name = argv[0]; #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) @@ -924,6 +931,7 @@ int main(int argc, char **argv) #endif orig_completion_append_character = rl_completion_append_character; orig_basic_word_break_characters = rl_basic_word_break_characters; +#endif // Init input file list, open first file num_files = argc - 1;