Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* 00002 00003 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 00004 2002, 2005, 2006, 2007, 2008, 2009 John W. Eaton 00005 00006 This file is part of Octave. 00007 00008 Octave is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License as published by the 00010 Free Software Foundation; either version 3 of the License, or (at your 00011 option) any later version. 00012 00013 Octave is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with Octave; see the file COPYING. If not, see 00020 <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 // Use the GNU readline library for command line editing and hisory. 00025 00026 #if !defined (octave_input_h) 00027 #define octave_input_h 1 00028 00029 #include <cstdio> 00030 00031 #include <string> 00032 00033 #include "oct-time.h" 00034 #include "oct-obj.h" 00035 #include "pager.h" 00036 00037 class octave_value; 00038 00039 extern OCTINTERP_API int octave_read (char *buf, unsigned max_size); 00040 extern OCTINTERP_API FILE *get_input_from_file (const std::string& name, int warn = 1); 00041 extern OCTINTERP_API FILE *get_input_from_stdin (void); 00042 00043 // Global pointer for eval(). 00044 extern std::string current_eval_string; 00045 00046 // TRUE means get input from current_eval_string. 00047 extern bool get_input_from_eval_string; 00048 00049 // TRUE means we haven't been asked for the input from 00050 // current_eval_string yet. 00051 extern bool input_from_eval_string_pending; 00052 00053 // TRUE means that input is coming from a file that was named on 00054 // the command line. 00055 extern bool input_from_command_line_file; 00056 00057 // TRUE means we're parsing a function file. 00058 extern bool reading_fcn_file; 00059 00060 // Simple name of function file we are reading. 00061 extern std::string curr_fcn_file_name; 00062 00063 // Full name of file we are reading. 00064 extern std::string curr_fcn_file_full_name; 00065 00066 // TRUE means we're parsing a script file. 00067 extern bool reading_script_file; 00068 00069 // TRUE means we're parsing a classdef file. 00070 extern bool reading_classdef_file; 00071 00072 // If we are reading from an M-file, this is it. 00073 extern FILE *ff_instream; 00074 00075 // TRUE means this is an interactive shell. 00076 extern bool interactive; 00077 00078 // TRUE means the user forced this shell to be interactive (-i). 00079 extern bool forced_interactive; 00080 00081 // Should we issue a prompt? 00082 extern int promptflag; 00083 00084 // A line of input. 00085 extern std::string current_input_line; 00086 00087 // TRUE after a call to completion_matches. 00088 extern bool octave_completion_matches_called; 00089 00090 // TRUE if the plotting system has requested a call to drawnow at 00091 // the next user prompt. 00092 extern OCTINTERP_API bool Vdrawnow_requested; 00093 00094 // TRUE if we are in debugging mode. 00095 extern OCTINTERP_API bool Vdebugging; 00096 00097 extern std::string gnu_readline (const std::string& s, bool force_readline = false); 00098 00099 extern void initialize_command_input (void); 00100 00101 extern bool octave_yes_or_no (const std::string& prompt); 00102 00103 extern octave_value do_keyboard (const octave_value_list& args = octave_value_list ()); 00104 00105 extern std::string VPS4; 00106 00107 extern char Vfilemarker; 00108 00109 enum echo_state 00110 { 00111 ECHO_OFF = 0, 00112 ECHO_SCRIPTS = 1, 00113 ECHO_FUNCTIONS = 2, 00114 ECHO_CMD_LINE = 4 00115 }; 00116 00117 extern int Vecho_executing_commands; 00118 00119 extern octave_time Vlast_prompt_time; 00120 00121 #endif 00122 00123 /* 00124 ;;; Local Variables: *** 00125 ;;; mode: C++ *** 00126 ;;; End: *** 00127 */