27 #if defined (USE_READLINE)
32 #include <readline/readline.h>
36 #define OCTAVE_RL_SAVE_STRING(ss, s) \
37 static char *ss = 0; \
45 ss = malloc (strlen (s) + 1); \
59 rl_get_screen_size (&rows, &cols);
67 rl_get_screen_size (&rows, &cols);
74 rl_variable_bind (
"blink-matching-paren", val ?
"1" :
"0");
101 rl_voidfunc_t *saved_redisplay_function = rl_redisplay_function;
103 rl_redisplay_function = flush_stdout;
105 rl_clear_screen (ignore1, ignore2);
107 rl_redisplay_function = saved_redisplay_function;
110 rl_clear_screen (ignore1, ignore2);
116 rl_resize_terminal ();
122 if (rl_deprep_term_function)
123 rl_deprep_term_function ();
129 return rl_copy_text (0, rl_end);
135 rl_replace_line (s, clear_undo);
147 return rl_newline (count, key);
153 return rl_line_buffer;
159 return rl_do_undo ();
167 rl_free_undo_list ();
176 OCTAVE_RL_SAVE_STRING (nm, n);
178 rl_readline_name = nm;
184 rl_re_read_init_file (0, 0);
190 return readline (prompt);
220 rl_read_init_file (f);
226 rl_re_read_init_file (0, 0);
232 int retval = rl_filename_completion_desired;
233 rl_filename_completion_desired =
arg;
240 int retval = rl_filename_quoting_desired;
241 rl_filename_quoting_desired =
arg;
254 return rl_filename_completion_function (text, state);
260 OCTAVE_RL_SAVE_STRING (ss, s);
262 rl_basic_word_break_characters = ss;
268 OCTAVE_RL_SAVE_STRING (ss, s);
270 rl_completer_word_break_characters = ss;
276 OCTAVE_RL_SAVE_STRING (ss, s);
278 rl_basic_quote_characters = ss;
284 OCTAVE_RL_SAVE_STRING (ss, s);
286 rl_filename_quote_characters = ss;
292 OCTAVE_RL_SAVE_STRING (ss, s);
294 rl_completer_quote_characters = ss;
300 rl_completion_append_character = c;
306 rl_attempted_completion_function =
f;
312 rl_filename_quoting_function =
f;
318 rl_filename_dequoting_function =
f;
324 rl_char_is_quoted_p =
f;
336 return rl_startup_hook;
342 rl_pre_input_hook =
f;
348 return rl_pre_input_hook;
360 return rl_event_hook;
366 return rl_completion_matches (text, f);
372 return RL_PROMPT_START_IGNORE;
378 return RL_PROMPT_END_IGNORE;
384 rl_add_defun (name, f, key);
390 OCTAVE_RL_SAVE_STRING (saved_term, term);
392 rl_terminal_name = saved_term;
398 #if defined (__WIN32__) && ! defined (__CYGWIN__)
399 rl_catch_signals = 0;
408 return rl_history_search_forward (count, ignore);
414 return rl_history_search_backward (count, ignore);