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");
80 int retval = rl_erase_empty_line;
81 rl_erase_empty_line = val;
109 rl_voidfunc_t *saved_redisplay_function = rl_redisplay_function;
111 rl_redisplay_function = flush_stdout;
113 rl_clear_screen (ignore1, ignore2);
115 rl_redisplay_function = saved_redisplay_function;
118 rl_clear_screen (ignore1, ignore2);
124 rl_resize_terminal ();
130 rl_set_screen_size (ht, wd);
136 if (rl_deprep_term_function)
137 rl_deprep_term_function ();
143 return rl_copy_text (0, rl_end);
149 rl_replace_line (s, clear_undo);
155 rl_kill_full_line (0, 0);
167 return rl_newline (count, key);
173 return rl_line_buffer;
179 return rl_do_undo ();
187 rl_free_undo_list ();
196 OCTAVE_RL_SAVE_STRING (nm, n);
198 rl_readline_name = nm;
204 rl_re_read_init_file (0, 0);
210 return readline (prompt);
240 rl_read_init_file (f);
246 rl_re_read_init_file (0, 0);
252 int retval = rl_filename_completion_desired;
253 rl_filename_completion_desired =
arg;
260 int retval = rl_filename_quoting_desired;
261 rl_filename_quoting_desired =
arg;
268 int retval = rl_prefer_env_winsize;
269 rl_prefer_env_winsize =
arg;
282 return rl_filename_completion_function (text, state);
288 OCTAVE_RL_SAVE_STRING (ss, s);
290 rl_basic_word_break_characters = ss;
296 OCTAVE_RL_SAVE_STRING (ss, s);
298 rl_completer_word_break_characters = ss;
304 OCTAVE_RL_SAVE_STRING (ss, s);
306 rl_basic_quote_characters = ss;
312 OCTAVE_RL_SAVE_STRING (ss, s);
314 rl_filename_quote_characters = ss;
320 OCTAVE_RL_SAVE_STRING (ss, s);
322 rl_completer_quote_characters = ss;
328 rl_completion_append_character = c;
334 rl_attempted_completion_function =
f;
340 rl_filename_quoting_function =
f;
346 rl_filename_dequoting_function =
f;
352 rl_char_is_quoted_p =
f;
364 return rl_startup_hook;
370 rl_pre_input_hook =
f;
376 return rl_pre_input_hook;
388 return rl_event_hook;
394 return rl_completion_matches (text, f);
400 return RL_PROMPT_START_IGNORE;
406 return RL_PROMPT_END_IGNORE;
412 rl_add_defun (name, f, key);
418 OCTAVE_RL_SAVE_STRING (saved_term, term);
420 rl_terminal_name = saved_term;
426 #if defined (__WIN32__) && ! defined (__CYGWIN__)
427 rl_catch_signals = 0;
436 return rl_history_search_forward (count, ignore);
442 return rl_history_search_backward (count, ignore);
char octave_rl_meta(char)
int octave_rl_do_undo(void)
int(* rl_fcn_ptr)(int, int)
int octave_rl_newline(int, int)
void octave_rl_set_dequoting_function(rl_dequoting_fcn_ptr)
char octave_rl_ctrl(char)
char * octave_rl_readline(const char *)
void octave_rl_set_terminal_name(const char *)
static uint32_t state[624]
void octave_rl_redisplay(void)
int octave_rl_filename_quoting_desired(int)
int octave_rl_screen_width(void)
int(* rl_event_hook_fcn_ptr)(void)
void octave_rl_set_event_hook(rl_event_hook_fcn_ptr f)
void octave_rl_clear_undo_list(void)
void octave_rl_set_completion_function(rl_attempted_completion_fcn_ptr)
int octave_rl_erase_empty_line(int)
void octave_rl_set_basic_word_break_characters(const char *)
void octave_rl_set_basic_quote_characters(const char *)
char octave_rl_prompt_end_ignore(void)
void octave_rl_set_completer_quote_characters(const char *)
char *(* rl_quoting_fcn_ptr)(char *, int, char *)
void octave_rl_resize_terminal(void)
char *(* rl_completer_fcn_ptr)(const char *, int)
char octave_rl_prompt_start_ignore(void)
void octave_rl_restore_terminal_state(void)
int octave_rl_filename_completion_desired(int)
int(* rl_pre_input_hook_fcn_ptr)(void)
void octave_rl_clear_screen(int skip_redisplay)
int octave_rl_history_search_forward(int, int)
void octave_rl_add_defun(const char *, rl_fcn_ptr, char)
F77_RET_T const double const double * f
void octave_rl_read_init_file(const char *)
char *(* rl_dequoting_fcn_ptr)(char *, int)
void octave_rl_set_completer_word_break_characters(const char *)
void octave_rl_set_filename_quote_characters(const char *)
void octave_rl_initialize(void)
int(* rl_startup_hook_fcn_ptr)(void)
void octave_rl_set_pre_input_hook(rl_startup_hook_fcn_ptr)
void octave_rl_enable_paren_matching(int)
char ** octave_rl_completion_matches(const char *, rl_completer_fcn_ptr)
void octave_rl_set_completion_append_character(char)
void octave_rl_set_screen_size(int ht, int wd)
char * octave_rl_filename_completion_function(const char *, int)
void octave_rl_set_name(const char *)
void octave_rl_insert_text(const char *)
char **(* rl_attempted_completion_fcn_ptr)(const char *, int, int)
int octave_rl_prefer_env_winsize(int)
char * octave_rl_copy_line(void)
void octave_rl_set_startup_hook(rl_startup_hook_fcn_ptr)
int(* rl_char_is_quoted_fcn_ptr)(char *, int)
rl_event_hook_fcn_ptr octave_rl_get_event_hook(void)
void octave_rl_kill_full_line(void)
rl_pre_input_hook_fcn_ptr octave_rl_get_pre_input_hook(void)
void octave_rl_re_read_init_file(void)
const char * octave_rl_line_buffer(void)
FILE * octave_rl_get_input_stream(void)
int octave_rl_screen_height(void)
void octave_rl_replace_line(const char *s, int clear_undo)
FILE * octave_rl_get_output_stream(void)
rl_startup_hook_fcn_ptr octave_rl_get_startup_hook(void)
void octave_rl_set_char_is_quoted_function(rl_char_is_quoted_fcn_ptr)
void octave_rl_set_quoting_function(rl_quoting_fcn_ptr)
int octave_rl_history_search_backward(int, int)
void octave_rl_set_input_stream(FILE *)
void octave_rl_set_output_stream(FILE *)