26 #if defined (HAVE_CONFIG_H)
30 #if defined (USE_READLINE)
35 #include <readline/readline.h>
39 #define OCTAVE_RL_SAVE_STRING(ss, s) \
40 static char *ss = 0; \
48 ss = malloc (strlen (s) + 1); \
63 rl_get_screen_size (&rows, &cols);
71 rl_get_screen_size (&rows, &cols);
78 rl_variable_bind (
"blink-matching-paren", val ?
"1" :
"0");
84 int retval = rl_erase_empty_line;
85 rl_erase_empty_line = val;
112 rl_voidfunc_t *saved_redisplay_function = rl_redisplay_function;
116 rl_clear_screen (ignore1, ignore2);
118 rl_redisplay_function = saved_redisplay_function;
121 rl_clear_screen (ignore1, ignore2);
127 rl_resize_terminal ();
133 rl_set_screen_size (ht, wd);
139 if (rl_deprep_term_function)
140 rl_deprep_term_function ();
146 return rl_copy_text (0, rl_end);
152 rl_replace_line (s, clear_undo);
158 rl_kill_full_line (0, 0);
170 return rl_newline (count, key);
176 return rl_line_buffer;
188 return rl_do_undo ();
196 rl_free_undo_list ();
205 OCTAVE_RL_SAVE_STRING (nm,
n);
207 rl_readline_name = nm;
213 rl_re_read_init_file (0, 0);
219 return readline (prompt);
249 rl_read_init_file (
f);
255 rl_re_read_init_file (0, 0);
261 int retval = rl_filename_completion_desired;
262 rl_filename_completion_desired = arg;
269 int retval = rl_filename_quoting_desired;
270 rl_filename_quoting_desired = arg;
277 int retval = rl_prefer_env_winsize;
278 rl_prefer_env_winsize = arg;
291 return rl_filename_completion_function (
text, state);
297 OCTAVE_RL_SAVE_STRING (ss, s);
299 rl_basic_word_break_characters = ss;
305 OCTAVE_RL_SAVE_STRING (ss, s);
307 rl_completer_word_break_characters = ss;
313 return rl_completer_word_break_characters;
319 rl_completion_word_break_hook =
f;
325 OCTAVE_RL_SAVE_STRING (ss, s);
327 rl_basic_quote_characters = ss;
333 OCTAVE_RL_SAVE_STRING (ss, s);
335 rl_filename_quote_characters = ss;
341 OCTAVE_RL_SAVE_STRING (ss, s);
343 rl_completer_quote_characters = ss;
349 rl_completion_append_character = c;
355 rl_attempted_completion_function =
f;
361 rl_filename_quoting_function =
f;
367 rl_filename_dequoting_function =
f;
373 rl_char_is_quoted_p =
f;
385 return rl_startup_hook;
391 rl_pre_input_hook =
f;
397 return rl_pre_input_hook;
409 return rl_event_hook;
415 return rl_completion_matches (
text,
f);
421 return RL_PROMPT_START_IGNORE;
427 return RL_PROMPT_END_IGNORE;
433 rl_add_defun (name,
f, key);
439 OCTAVE_RL_SAVE_STRING (saved_term, term);
441 rl_terminal_name = saved_term;
447 #if defined (__WIN32__) && ! defined (__CYGWIN__)
448 rl_catch_signals = 0;
457 return rl_history_search_forward (count, ignore);
463 return rl_history_search_backward (count, ignore);
481 rl_free_line_state ();
482 rl_cleanup_after_signal ();
483 rl_reset_after_signal ();
F77_RET_T const F77_DBLE const F77_DBLE * f
const char * octave_rl_line_buffer(void)
int octave_rl_history_search_backward(int, int)
void octave_rl_set_startup_hook(rl_startup_hook_fcn_ptr)
void octave_rl_set_quoting_function(rl_quoting_fcn_ptr)
void octave_rl_re_read_init_file(void)
void octave_rl_set_completer_word_break_characters(const char *)
void octave_rl_set_pre_input_hook(rl_startup_hook_fcn_ptr)
char *(* rl_quoting_fcn_ptr)(char *, int, char *)
void octave_rl_kill_full_line(void)
char *(* rl_completer_fcn_ptr)(const char *, int)
char octave_rl_prompt_end_ignore(void)
char **(* rl_attempted_completion_fcn_ptr)(const char *, int, int)
void octave_rl_clear_undo_list(void)
void octave_rl_resize_terminal(void)
int octave_rl_history_search_forward(int, int)
void octave_rl_read_init_file(const char *)
int(* rl_fcn_ptr)(int, int)
void octave_rl_set_dequoting_function(rl_dequoting_fcn_ptr)
void octave_rl_set_basic_quote_characters(const char *)
void octave_rl_clear_screen(int skip_redisplay)
char *(* rl_dequoting_fcn_ptr)(char *, int)
int octave_rl_screen_width(void)
char * octave_rl_filename_completion_function(const char *, int)
char octave_rl_prompt_start_ignore(void)
const char * octave_rl_get_completer_word_break_characters(void)
char * octave_rl_copy_line(void)
void octave_rl_set_terminal_name(const char *)
void octave_rl_restore_terminal_state(void)
char * octave_rl_readline(const char *)
void octave_rl_set_name(const char *)
char ** octave_rl_completion_matches(const char *, rl_completer_fcn_ptr)
int octave_rl_do_undo(void)
int(* rl_pre_input_hook_fcn_ptr)(void)
int octave_rl_filename_completion_desired(int)
void octave_rl_set_output_stream(FILE *)
FILE * octave_rl_get_input_stream(void)
void octave_rl_set_completion_word_break_hook(rl_completion_hook_fcn_ptr)
void octave_rl_initialize(void)
void octave_rl_set_filename_quote_characters(const char *)
void octave_rl_enable_paren_matching(int)
void octave_rl_set_event_hook(rl_event_hook_fcn_ptr f)
void octave_rl_set_completion_append_character(char)
int octave_rl_screen_height(void)
rl_startup_hook_fcn_ptr octave_rl_get_startup_hook(void)
void octave_rl_set_completion_function(rl_attempted_completion_fcn_ptr)
int(* rl_event_hook_fcn_ptr)(void)
int octave_rl_point(void)
rl_event_hook_fcn_ptr octave_rl_get_event_hook(void)
rl_pre_input_hook_fcn_ptr octave_rl_get_pre_input_hook(void)
void octave_rl_insert_text(const char *)
int(* rl_char_is_quoted_fcn_ptr)(char *, int)
int octave_rl_erase_empty_line(int)
FILE * octave_rl_get_output_stream(void)
int octave_rl_filename_quoting_desired(int)
int(* rl_startup_hook_fcn_ptr)(void)
void octave_rl_recover_from_interrupt(void)
char *(* rl_completion_hook_fcn_ptr)(void)
void octave_rl_add_defun(const char *, rl_fcn_ptr, int)
void octave_rl_set_completer_quote_characters(const char *)
void octave_rl_set_screen_size(int ht, int wd)
void octave_rl_replace_line(const char *s, int clear_undo)
void octave_rl_set_char_is_quoted_function(rl_char_is_quoted_fcn_ptr)
int octave_rl_newline(int, int)
void octave_rl_set_input_stream(FILE *)
int octave_rl_prefer_env_winsize(int)
void octave_rl_redisplay(void)
void octave_rl_set_basic_word_break_characters(const char *)