/* Fake readline */ #ifndef READLINE_H #define READLINE_H #ifdef __cplusplus extern "C" { #endif #include char *readline(const char *prompt); typedef int rl_command_func_t(int, int); typedef char *rl_compentry_func_t(const char *, int); typedef char **rl_completion_func_t(const char *, int, int); typedef char *rl_quote_func_t(char *, int, char *); typedef char *rl_dequote_func_t(char *, int); typedef int rl_compignore_func_t(char **); typedef void rl_compdisp_func_t(char **, int, int); typedef int rl_hook_func_t(char **, int, int); typedef int rl_getc_func_t(FILE *); typedef int rl_linebuf_func_t(char *, int); typedef int rl_intfunc_t(int); typedef int rl_icpfunc_t(char *); typedef int rl_icppfunc_t(char **); typedef void rl_voidfunc_t(void); typedef void rl_vintfunc_t(int); typedef void rl_vcpfunc_t(char *); typedef void rl_vcppfunc_t(char **); typedef char *rl_cpvfunc_t(void); #define vl_ivoidfunct_t rl_hoot_func_t typedef void * Keymap; enum { RL_STATE_NONE = 0, RL_STATE_INITIALIZING, RL_STATE_INITIALIZED, RL_STATE_TERMPREPPED, RL_STATE_READCMD, RL_STATE_METANEXT, RL_STATE_DISPATCHING, RL_STATE_MOREINPUT, RL_STATE_ISEARCH, RL_STATE_NSEARCH, RL_STATE_SEARCH, RL_STATE_NUMERICARG, RL_STATE_MACROINPUT, RL_STATE_MACRODEF, RL_STATE_OVERWRITE, RL_STATE_COMPLETING, RL_STATE_SIGHANDLER, RL_STATE_UNDOING, RL_STATE_INPUTPENDING, RL_STATE_TTYCSAVED, RL_STATE_CALLBACK, RL_STATE_VIMOTION, RL_STATE_MULTIKEY, RL_STATE_VICMDONCE, RL_STATE_DONE }; extern char *rl_line_buffer; extern int rl_point; extern int rl_end; extern int rl_mark; extern int rl_done; extern int rl_num_chars_to_read; extern int rl_pending_input; extern int rl_dispatching; extern int rl_erase_empty_line; extern char *rl_prompt; extern char *rl_display_prompt; extern int rl_already_prompted; extern const char *rl_library_version; extern int rl_readline_version; extern int rl_gnu_readline_p; extern const char *rl_terminal_name; extern const char *rl_readline_name; extern FILE *rl_instream; extern FILE *rl_outstream; extern int rl_prefer_env_winsize; extern rl_command_func_t *rl_last_func; extern rl_hook_func_t *rl_startup_hook; extern rl_hook_func_t *rl_pre_input_hook; extern rl_hook_func_t *rl_event_hook; extern rl_getc_func_t *rl_getc_function; extern rl_voidfunc_t *rl_redisplay_function; extern rl_vintfunc_t *rl_prep_term_function; extern rl_voidfunc_t *rl_deprep_term_function; extern Keymap rl_executing_keymap; extern Keymap rl_binding_keymap; extern char *rl_executing_macro; extern int rl_readline_state; extern int rl_explicit_arg; extern int rl_numeric_arg; extern int rl_editing_mode; extern int rl_catch_signals; extern int rl_catch_sigwinch; Keymap rl_make_bare_keymap(void); Keymap rl_copy_keymap(void); Keymap rl_make_keymap(void); void rl_discard_keymap(Keymap keymap); void rl_free_keymap(Keymap keymap); Keymap rl_get_keymap(void); void rl_set_keymap(Keymap keymap); Keymap rl_get_keymap_by_name(const char *name); char *rl_get_keymap_name(Keymap keymap); int rl_bind_key(int key, rl_command_func_t *func); int rl_bind_key_in_map(int key, rl_command_func_t *func, Keymap keymap); int rl_bind_key_if_unbound(int key, rl_command_func_t *func); int rl_bind_key_if_unbound_in_map(int key, rl_command_func_t *func, Keymap keymap); int rl_unbind_key(int key); int rl_unbind_key_in_map(int key, Keymap keymap); int rl_unbind_function_in_map(rl_command_func_t *func, Keymap keymap); int rl_unbind_command_in_map(const char *com, Keymap keymap); int rl_bind_keyseq(const char *keys, rl_command_func_t *func); int rl_bind_keyseq_in_map(const char *keys, rl_command_func_t *func, Keymap keymap); int rl_set_key(const char *keys, rl_command_func_t *func, Keymap map); int rl_bind_keyseq_if_unbound(const char *keys, rl_command_func_t *func); int rl_bind_keyseq_if_unbound_in_map(const char *keys, rl_command_func_t *func, Keymap keymap); int rl_generic_bind(int type, const char *keys, char *d, Keymap keymap); int rl_parse_and_bind(char *line); int rl_read_init_file(const char *filename); rl_command_func_t *rl_named_function(const char *name); rl_command_func_t *rl_function_of_keyseq(const char *keys, Keymap keymap, int *type); char **rl_invoking_keyseqs(rl_command_func_t *func); char **rl_invoking_keyseqs_in_map(rl_command_func_t *func, Keymap keymap); void rl_function_dumper(int readable); void rl_list_funmap_names(void); const char **rl_funmap_names(void); int rl_add_funmap_entry(const char*name, rl_command_func_t *func); enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; int rl_begin_undo_group(void); int rl_end_undo_group(void); void rl_add_undo(enum undo_code c, int s, int e, char *t); void rl_free_undo_list(void); int rl_do_undo(void); int rl_modifying(int s, int e); void rl_redisplay(void); int rl_forced_update_display(void); int rl_on_new_line(void); int rl_on_new_line_with_prompt(void); int rl_reset_line_state(void); int rl_crlf(void); int rl_show_char(int c); int rl_message(const char *c, ...); int rl_clear_message(void); void rl_save_prompt(void); void rl_restore_prompt(void); int rl_expand_prompt(char *p); int rl_set_prompt(const char *p); int rl_insert_text(const char *t); int rl_delete_text(int s, int e); char *rl_copy_text(int s, int e); int rl_kill_text(int s, int e); int rl_push_macro_input(char *m); int rl_read_key(void); int rl_getc(FILE *s); int rl_stuff_char(int c); int rl_execute_next(int c); int rl_clear_pending_input(void); int rl_set_keyboard_input_timeout(int u); void rl_prep_terminal(int f); void rl_deprep_terminal(void); void rl_tty_set_default_bindings(Keymap keymap); void rl_tty_unset_default_bindings(Keymap keymap); int rl_reset_terminal(const char *t); struct readline_state; int rl_save_state(struct readline_state *s); int rl_restore_state(struct readline_state *s); void rl_free(void *p); void rl_replace_line(const char *t, int cu); void rl_extend_line_buffer(int z); int rl_initialise(void); int rl_ding(void); int rl_alphabetic(int c); void rl_display_match_list(char **ml, int z, int m); #define _rl_uppercase_p(c) isupper(c) #define _rl_lowercase_p(c) islower(c) #define _rl_digit_p(c) isdigit(c) #define _rl_to_upper(c) #define _rl_to_lower(c) #define _rl_digit_value(c) int rl_macro_bind(const char *keys, const char *macro, Keymap keymap); void rl_macro_dumper(int r); int rl_variable_bind(const char *v, const char *val); char *rl_variable_value(const char *v); void rl_variable_dumper(int r); int rl_set_paran_blink_timeout(int u); char *rl_get_termcap(const char *c); void rl_callback_handler_install(const char* p, rl_vcpfunc_t *h); void rl_callback_read_char(void); void rl_callback_handler_remove(void); void rl_cleanup_after_signal(void); void rl_free_line_state(void); void rl_reset_after_signal(void); void rl_echo_signal_char(int s); void rl_resize_terminal(void); void rl_set_screen_size(int r, int c); void rl_get_screen_size(int *r, int *c); void rl_reset_screen_size(void); int rl_set_signals(void); int rl_clear_signals(void); extern rl_compentry_func_t *rl_completion_entry_function; int rl_complete_internal(int w); int rl_complete(int i, int k); int rl_possible_completions(int c, int k); int rl_insert_completion(int c, int k); int rl_completion_mode(rl_command_func_t *func); char **rl_completion_matches(const char *t, rl_compentry_func_t *func); char *rl_filename_completion_function(const char *t, int s); char *rl_username_completion_function(const char *t, int s); extern rl_compentry_func_t *rl_completion_entry_function; extern rl_completion_func_t *rl_attempted_completion_function; extern rl_quote_func_t *rl_filename_quoting_function; extern rl_dequote_func_t *rl_filename_dequoting_function; extern rl_linebuf_func_t *rl_char_is_quoted_p; extern rl_compignore_func_t *rl_ignore_some_completions_function; extern rl_icppfunc_t *rl_directory_completion_hook; extern rl_dequote_func_t *rl_filename_rewrite_hook; extern rl_compdisp_func_t *rl_completion_display_matches_hook; extern const char *rl_basic_word_break_characters; extern const char *rl_basic_quote_characters; extern const char *rl_completer_word_break_characters; extern rl_cpvfunc_t *rl_completion_word_break_hook; extern const char *rl_completer_quote_characters; extern const char *rl_special_prefixes; extern const char *rl_filename_quote_characters; extern int rl_completion_query_items; extern int rl_completion_append_character; extern int rl_completion_suppress_append; extern int rl_completion_quote_character; extern int rl_completion_suppress_quote; extern int rl_completion_found_quote; extern int rl_completion_mark_symlink_dirs; extern int rl_ignore_completion_duplicates; extern int rl_filename_completion_desired; extern int rl_filename_quoting_desired; extern int rl_attempted_completion_over; extern int rl_sort_completion_matches; extern int rl_completion_type; extern int rl_completion_invoking_key; extern int rl_inhibit_completion; #ifdef __cplusplus } #endif #endif