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 |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
|
23 // Use the GNU readline library for command line editing and hisory. |
|
24 |
383
|
25 #if !defined (octave_input_h) |
|
26 #define octave_input_h 1 |
1
|
27 |
1342
|
28 #include <cstdio> |
1
|
29 |
1750
|
30 #include <string> |
|
31 |
3255
|
32 #include "oct-time.h" |
3770
|
33 #include "ov-list.h" |
|
34 #include "pager.h" |
3255
|
35 |
3707
|
36 class octave_value; |
|
37 |
1755
|
38 extern int octave_read (char *buf, unsigned max_size); |
3523
|
39 extern FILE *get_input_from_file (const std::string& name, int warn = 1); |
1
|
40 extern FILE *get_input_from_stdin (void); |
|
41 |
|
42 // Global pointer for eval(). |
3523
|
43 extern std::string current_eval_string; |
1
|
44 |
3019
|
45 // TRUE means get input from current_eval_string. |
|
46 extern bool get_input_from_eval_string; |
1
|
47 |
3877
|
48 // TRUE means we haven't been asked for the input from |
|
49 // current_eval_string yet. |
|
50 extern bool input_from_eval_string_pending; |
|
51 |
5189
|
52 // TRUE means that input is coming from a file that was named on |
|
53 // the command line. |
|
54 extern bool input_from_command_line_file; |
|
55 |
3019
|
56 // TRUE means we're parsing a function file. |
|
57 extern bool reading_fcn_file; |
1
|
58 |
1606
|
59 // Simple name of function file we are reading. |
3523
|
60 extern std::string curr_fcn_file_name; |
1606
|
61 |
|
62 // Full name of file we are reading. |
3523
|
63 extern std::string curr_fcn_file_full_name; |
1
|
64 |
3019
|
65 // TRUE means we're parsing a script file. |
|
66 extern bool reading_script_file; |
1
|
67 |
|
68 // If we are reading from an M-file, this is it. |
339
|
69 extern FILE *ff_instream; |
1
|
70 |
3019
|
71 // TRUE means this is an interactive shell. |
|
72 extern bool interactive; |
1
|
73 |
3019
|
74 // TRUE means the user forced this shell to be interactive (-i). |
|
75 extern bool forced_interactive; |
1
|
76 |
|
77 // Should we issue a prompt? |
|
78 extern int promptflag; |
|
79 |
|
80 // A line of input. |
3523
|
81 extern std::string current_input_line; |
1
|
82 |
3804
|
83 // TRUE after a call to completion_matches. |
2299
|
84 extern bool octave_completion_matches_called; |
|
85 |
3523
|
86 extern std::string gnu_readline (const std::string& s, bool force_readline = false); |
2927
|
87 |
|
88 extern void initialize_command_input (void); |
1
|
89 |
3770
|
90 extern octave_value do_keyboard (const octave_value_list& args = octave_value_list ()); |
3707
|
91 |
3523
|
92 extern std::string Vps4; |
2181
|
93 |
3019
|
94 enum echo_state |
|
95 { |
|
96 ECHO_OFF = 0, |
|
97 ECHO_SCRIPTS = 1, |
|
98 ECHO_FUNCTIONS = 2, |
|
99 ECHO_CMD_LINE = 4 |
|
100 }; |
|
101 |
|
102 extern int Vecho_executing_commands; |
|
103 |
3255
|
104 extern octave_time Vlast_prompt_time; |
3165
|
105 |
1
|
106 #endif |
|
107 |
|
108 /* |
|
109 ;;; Local Variables: *** |
|
110 ;;; mode: C++ *** |
|
111 ;;; End: *** |
|
112 */ |