1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1
|
21 |
|
22 */ |
|
23 |
|
24 // Use the GNU readline library for command line editing and hisory. |
|
25 |
383
|
26 #if !defined (octave_input_h) |
|
27 #define octave_input_h 1 |
1
|
28 |
1342
|
29 #include <cstdio> |
1
|
30 |
1750
|
31 #include <string> |
|
32 |
3255
|
33 #include "oct-time.h" |
6208
|
34 #include "oct-obj.h" |
3770
|
35 #include "pager.h" |
3255
|
36 |
3707
|
37 class octave_value; |
|
38 |
1755
|
39 extern int octave_read (char *buf, unsigned max_size); |
3523
|
40 extern FILE *get_input_from_file (const std::string& name, int warn = 1); |
1
|
41 extern FILE *get_input_from_stdin (void); |
|
42 |
|
43 // Global pointer for eval(). |
3523
|
44 extern std::string current_eval_string; |
1
|
45 |
3019
|
46 // TRUE means get input from current_eval_string. |
|
47 extern bool get_input_from_eval_string; |
1
|
48 |
3877
|
49 // TRUE means we haven't been asked for the input from |
|
50 // current_eval_string yet. |
|
51 extern bool input_from_eval_string_pending; |
|
52 |
5189
|
53 // TRUE means that input is coming from a file that was named on |
|
54 // the command line. |
|
55 extern bool input_from_command_line_file; |
|
56 |
3019
|
57 // TRUE means we're parsing a function file. |
|
58 extern bool reading_fcn_file; |
1
|
59 |
1606
|
60 // Simple name of function file we are reading. |
3523
|
61 extern std::string curr_fcn_file_name; |
1606
|
62 |
|
63 // Full name of file we are reading. |
3523
|
64 extern std::string curr_fcn_file_full_name; |
1
|
65 |
3019
|
66 // TRUE means we're parsing a script file. |
|
67 extern bool reading_script_file; |
1
|
68 |
|
69 // If we are reading from an M-file, this is it. |
339
|
70 extern FILE *ff_instream; |
1
|
71 |
3019
|
72 // TRUE means this is an interactive shell. |
|
73 extern bool interactive; |
1
|
74 |
3019
|
75 // TRUE means the user forced this shell to be interactive (-i). |
|
76 extern bool forced_interactive; |
1
|
77 |
|
78 // Should we issue a prompt? |
|
79 extern int promptflag; |
|
80 |
|
81 // A line of input. |
3523
|
82 extern std::string current_input_line; |
1
|
83 |
3804
|
84 // TRUE after a call to completion_matches. |
2299
|
85 extern bool octave_completion_matches_called; |
|
86 |
3523
|
87 extern std::string gnu_readline (const std::string& s, bool force_readline = false); |
2927
|
88 |
|
89 extern void initialize_command_input (void); |
1
|
90 |
5640
|
91 extern bool octave_yes_or_no (const std::string& prompt); |
|
92 |
3770
|
93 extern octave_value do_keyboard (const octave_value_list& args = octave_value_list ()); |
3707
|
94 |
5794
|
95 extern std::string VPS4; |
2181
|
96 |
3019
|
97 enum echo_state |
|
98 { |
|
99 ECHO_OFF = 0, |
|
100 ECHO_SCRIPTS = 1, |
|
101 ECHO_FUNCTIONS = 2, |
|
102 ECHO_CMD_LINE = 4 |
|
103 }; |
|
104 |
|
105 extern int Vecho_executing_commands; |
|
106 |
3255
|
107 extern octave_time Vlast_prompt_time; |
3165
|
108 |
1
|
109 #endif |
|
110 |
|
111 /* |
|
112 ;;; Local Variables: *** |
|
113 ;;; mode: C++ *** |
|
114 ;;; End: *** |
|
115 */ |