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> |
3165
|
29 #include <ctime> |
1
|
30 |
1750
|
31 #include <string> |
|
32 |
1755
|
33 extern int octave_read (char *buf, unsigned max_size); |
1750
|
34 extern FILE *get_input_from_file (const string& name, int warn = 1); |
1
|
35 extern FILE *get_input_from_stdin (void); |
|
36 |
|
37 // Global pointer for eval(). |
1755
|
38 extern string current_eval_string; |
1
|
39 |
3019
|
40 // TRUE means get input from current_eval_string. |
|
41 extern bool get_input_from_eval_string; |
1
|
42 |
3019
|
43 // TRUE means we're parsing a function file. |
|
44 extern bool reading_fcn_file; |
1
|
45 |
1606
|
46 // Simple name of function file we are reading. |
1755
|
47 extern string curr_fcn_file_name; |
1606
|
48 |
|
49 // Full name of file we are reading. |
1755
|
50 extern string curr_fcn_file_full_name; |
1
|
51 |
3019
|
52 // TRUE means we're parsing a script file. |
|
53 extern bool reading_script_file; |
1
|
54 |
|
55 // If we are reading from an M-file, this is it. |
339
|
56 extern FILE *ff_instream; |
1
|
57 |
3019
|
58 // TRUE means this is an interactive shell. |
|
59 extern bool interactive; |
1
|
60 |
3019
|
61 // TRUE means the user forced this shell to be interactive (-i). |
|
62 extern bool forced_interactive; |
1
|
63 |
|
64 // Should we issue a prompt? |
|
65 extern int promptflag; |
|
66 |
|
67 // A line of input. |
1755
|
68 extern string current_input_line; |
1
|
69 |
2299
|
70 // TRUE after a call to completion_matches(). |
|
71 extern bool octave_completion_matches_called; |
|
72 |
2927
|
73 extern string gnu_readline (const string& s, bool force_readline = false); |
|
74 |
|
75 extern void initialize_command_input (void); |
1
|
76 |
2181
|
77 extern string Vps4; |
|
78 |
3019
|
79 enum echo_state |
|
80 { |
|
81 ECHO_OFF = 0, |
|
82 ECHO_SCRIPTS = 1, |
|
83 ECHO_FUNCTIONS = 2, |
|
84 ECHO_CMD_LINE = 4 |
|
85 }; |
|
86 |
|
87 extern int Vecho_executing_commands; |
|
88 |
3165
|
89 extern time_t Vlast_prompt_time; |
|
90 |
1
|
91 #endif |
|
92 |
|
93 /* |
|
94 ;;; Local Variables: *** |
|
95 ;;; mode: C++ *** |
|
96 ;;; End: *** |
|
97 */ |