📄 readline.h
字号:
extern char *readline PARAMS((const char *));extern int rl_set_prompt PARAMS((const char *));extern int rl_expand_prompt PARAMS((char *));extern int rl_initialize PARAMS((void));/* Undocumented; unused by readline */extern int rl_discard_argument PARAMS((void));/* Utility functions to bind keys to readline commands. */extern int rl_add_defun PARAMS((const char *, rl_command_func_t *, int));extern int rl_bind_key PARAMS((int, rl_command_func_t *));extern int rl_bind_key_in_map PARAMS((int, rl_command_func_t *, Keymap));extern int rl_unbind_key PARAMS((int));extern int rl_unbind_key_in_map PARAMS((int, Keymap));extern int rl_bind_key_if_unbound PARAMS((int, rl_command_func_t *));extern int rl_bind_key_if_unbound_in_map PARAMS((int, rl_command_func_t *, Keymap));extern int rl_unbind_function_in_map PARAMS((rl_command_func_t *, Keymap));extern int rl_unbind_command_in_map PARAMS((const char *, Keymap));extern int rl_bind_keyseq PARAMS((const char *, rl_command_func_t *));extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keymap));extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));extern int rl_variable_bind PARAMS((const char *, const char *));/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */extern int rl_set_key PARAMS((const char *, rl_command_func_t *, Keymap));/* Backwards compatibility, use rl_generic_bind instead. */extern int rl_macro_bind PARAMS((const char *, const char *, Keymap));/* Undocumented in the texinfo manual; not really useful to programs. */extern int rl_translate_keyseq PARAMS((const char *, char *, int *));extern char *rl_untranslate_keyseq PARAMS((int));extern rl_command_func_t *rl_named_function PARAMS((const char *));extern rl_command_func_t *rl_function_of_keyseq PARAMS((const char *, Keymap, int *));extern void rl_list_funmap_names PARAMS((void));extern char **rl_invoking_keyseqs_in_map PARAMS((rl_command_func_t *, Keymap));extern char **rl_invoking_keyseqs PARAMS((rl_command_func_t *)); extern void rl_function_dumper PARAMS((int));extern void rl_macro_dumper PARAMS((int));extern void rl_variable_dumper PARAMS((int));extern int rl_read_init_file PARAMS((const char *));extern int rl_parse_and_bind PARAMS((char *));/* Functions for manipulating keymaps. */extern Keymap rl_make_bare_keymap PARAMS((void));extern Keymap rl_copy_keymap PARAMS((Keymap));extern Keymap rl_make_keymap PARAMS((void));extern void rl_discard_keymap PARAMS((Keymap));extern Keymap rl_get_keymap_by_name PARAMS((const char *));extern char *rl_get_keymap_name PARAMS((Keymap));extern void rl_set_keymap PARAMS((Keymap));extern Keymap rl_get_keymap PARAMS((void));/* Undocumented; used internally only. */extern void rl_set_keymap_from_edit_mode PARAMS((void));extern char *rl_get_keymap_name_from_edit_mode PARAMS((void));/* Functions for manipulating the funmap, which maps command names to functions. */extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *));extern const char **rl_funmap_names PARAMS((void));/* Undocumented, only used internally -- there is only one funmap, and this function may be called only once. */extern void rl_initialize_funmap PARAMS((void));/* Utility functions for managing keyboard macros. */extern void rl_push_macro_input PARAMS((char *));/* Functions for undoing, from undo.c */extern void rl_add_undo PARAMS((enum undo_code, int, int, char *));extern void rl_free_undo_list PARAMS((void));extern int rl_do_undo PARAMS((void));extern int rl_begin_undo_group PARAMS((void));extern int rl_end_undo_group PARAMS((void));extern int rl_modifying PARAMS((int, int));/* Functions for redisplay. */extern void rl_redisplay PARAMS((void));extern int rl_on_new_line PARAMS((void));extern int rl_on_new_line_with_prompt PARAMS((void));extern int rl_forced_update_display PARAMS((void));extern int rl_clear_message PARAMS((void));extern int rl_reset_line_state PARAMS((void));extern int rl_crlf PARAMS((void));#if defined (USE_VARARGS) && defined (PREFER_STDARG)extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2)));#elseextern int rl_message ();#endifextern int rl_show_char PARAMS((int));/* Undocumented in texinfo manual. */extern int rl_character_len PARAMS((int, int));/* Save and restore internal prompt redisplay information. */extern void rl_save_prompt PARAMS((void));extern void rl_restore_prompt PARAMS((void));/* Modifying text. */extern void rl_replace_line PARAMS((const char *, int));extern int rl_insert_text PARAMS((const char *));extern int rl_delete_text PARAMS((int, int));extern int rl_kill_text PARAMS((int, int));extern char *rl_copy_text PARAMS((int, int));/* Terminal and tty mode management. */extern void rl_prep_terminal PARAMS((int));extern void rl_deprep_terminal PARAMS((void));extern void rl_tty_set_default_bindings PARAMS((Keymap));extern void rl_tty_unset_default_bindings PARAMS((Keymap));extern int rl_reset_terminal PARAMS((const char *));extern void rl_resize_terminal PARAMS((void));extern void rl_set_screen_size PARAMS((int, int));extern void rl_get_screen_size PARAMS((int *, int *));extern char *rl_get_termcap PARAMS((const char *));/* Functions for character input. */extern int rl_stuff_char PARAMS((int));extern int rl_execute_next PARAMS((int));extern int rl_clear_pending_input PARAMS((void));extern int rl_read_key PARAMS((void));extern int rl_getc PARAMS((FILE *));extern int rl_set_keyboard_input_timeout PARAMS((int));/* `Public' utility functions . */extern void rl_extend_line_buffer PARAMS((int));extern int rl_ding PARAMS((void));extern int rl_alphabetic PARAMS((int));/* Readline signal handling, from signals.c */extern int rl_set_signals PARAMS((void));extern int rl_clear_signals PARAMS((void));extern void rl_cleanup_after_signal PARAMS((void));extern void rl_reset_after_signal PARAMS((void));extern void rl_free_line_state PARAMS((void)); extern int rl_set_paren_blink_timeout PARAMS((int));/* Undocumented. */extern int rl_maybe_save_line PARAMS((void));extern int rl_maybe_unsave_line PARAMS((void));extern int rl_maybe_replace_line PARAMS((void));/* Completion functions. */extern int rl_complete_internal PARAMS((int));extern void rl_display_match_list PARAMS((char **, int, int));extern char **rl_completion_matches PARAMS((const char *, rl_compentry_func_t *));extern char *rl_username_completion_function PARAMS((const char *, int));extern char *rl_filename_completion_function PARAMS((const char *, int));extern int rl_completion_mode PARAMS((rl_command_func_t *));#if 0/* Backwards compatibility (compat.c). These will go away sometime. */extern void free_undo_list PARAMS((void));extern int maybe_save_line PARAMS((void));extern int maybe_unsave_line PARAMS((void));extern int maybe_replace_line PARAMS((void));extern int ding PARAMS((void));extern int alphabetic PARAMS((int));extern int crlf PARAMS((void));extern char **completion_matches PARAMS((char *, rl_compentry_func_t *));extern char *username_completion_function PARAMS((const char *, int));extern char *filename_completion_function PARAMS((const char *, int));#endif/* **************************************************************** *//* *//* Well Published Variables *//* *//* **************************************************************** *//* The version of this incarnation of the readline library. */extern const char *rl_library_version; /* e.g., "4.2" */extern int rl_readline_version; /* e.g., 0x0402 *//* True if this is real GNU readline. */extern int rl_gnu_readline_p;/* Flags word encapsulating the current readline state. */extern int rl_readline_state;/* Says which editing mode readline is currently using. 1 means emacs mode; 0 means vi mode. */extern int rl_editing_mode;/* Insert or overwrite mode for emacs mode. 1 means insert mode; 0 means overwrite mode. Reset to insert mode on each input line. */extern int rl_insert_mode;/* The name of the calling program. You should initialize this to whatever was in argv[0]. It is used when parsing conditionals. */extern const char *rl_readline_name;/* The prompt readline uses. This is set from the argument to readline (), and should not be assigned to directly. */extern char *rl_prompt;/* The line buffer that is in use. */extern char *rl_line_buffer;/* The location of point, and end. */extern int rl_point;extern int rl_end;/* The mark, or saved cursor position. */extern int rl_mark;/* Flag to indicate that readline has finished with the current input line and should return it. */extern int rl_done;/* If set to a character value, that will be the next keystroke read. */extern int rl_pending_input;/* Non-zero if we called this function from _rl_dispatch(). It's present so functions can find out whether they were called from a key binding or directly from an application. */extern int rl_dispatching;/* Non-zero if the user typed a numeric argument before executing the current function. */extern int rl_explicit_arg;/* The current value of the numeric argument specified by the user. */extern int rl_numeric_arg;/* The address of the last command function Readline executed. */extern rl_command_func_t *rl_last_func;/* The name of the terminal to use. */extern const char *rl_terminal_name;/* The input and output streams. */extern FILE *rl_instream;extern FILE *rl_outstream;/* If non-zero, then this is the address of a function to call just before readline_internal () prints the first prompt. */extern rl_hook_func_t *rl_startup_hook;/* If non-zero, this is the address of a function to call just before readline_internal_setup () returns and readline_internal starts reading input characters. */extern rl_hook_func_t *rl_pre_input_hook; /* The address of a function to call periodically while Readline is awaiting character input, or NULL, for no event handling. */extern rl_hook_func_t *rl_event_hook;/* The address of the function to call to fetch a character from the current Readline input stream */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;/* Dispatch variables. */extern Keymap rl_executing_keymap;extern Keymap rl_binding_keymap;/* Display variables. *//* If non-zero, readline will erase the entire line, including any prompt,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -