📄 readline.h
字号:
if the only thing typed on an otherwise-blank line is something bound to rl_newline. */extern int rl_erase_empty_line;/* If non-zero, the application has already printed the prompt (rl_prompt) before calling readline, so readline should not output it the first time redisplay is done. */extern int rl_already_prompted;/* A non-zero value means to read only this many characters rather than up to a character bound to accept-line. */extern int rl_num_chars_to_read;/* The text of a currently-executing keyboard macro. */extern char *rl_executing_macro;/* Variables to control readline signal handling. *//* If non-zero, readline will install its own signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */extern int rl_catch_signals;/* If non-zero, readline will install a signal handler for SIGWINCH that also attempts to call any calling application's SIGWINCH signal handler. Note that the terminal is not cleaned up before the application's signal handler is called; use rl_cleanup_after_signal() to do that. */extern int rl_catch_sigwinch;/* Completion variables. *//* Pointer to the generator function for completion_matches (). NULL means to use rl_filename_completion_function (), the default filename completer. */extern rl_compentry_func_t *rl_completion_entry_function;/* If rl_ignore_some_completions_function is non-NULL it is the address of a function to call after all of the possible matches have been generated, but before the actual completion is done to the input line. The function is called with one argument; a NULL terminated array of (char *). If your function removes any of the elements, they must be free()'ed. */extern rl_compignore_func_t *rl_ignore_some_completions_function;/* Pointer to alternative function to create matches. Function is called with TEXT, START, and END. START and END are indices in RL_LINE_BUFFER saying what the boundaries of TEXT are. If this function exists and returns NULL then call the value of rl_completion_entry_function to try to match, otherwise use the array of strings returned. */extern rl_completion_func_t *rl_attempted_completion_function;/* The basic list of characters that signal a break between words for the completer routine. The initial contents of this variable is what breaks words in the shell, i.e. "n\"\\'`@$>". */extern const char *rl_basic_word_break_characters;/* The list of characters that signal a break between words for rl_complete_internal. The default list is the contents of rl_basic_word_break_characters. */extern /*const*/ char *rl_completer_word_break_characters;/* Hook function to allow an application to set the completion word break characters before readline breaks up the line. Allows position-dependent word break characters. */extern rl_cpvfunc_t *rl_completion_word_break_hook;/* List of characters which can be used to quote a substring of the line. Completion occurs on the entire substring, and within the substring rl_completer_word_break_characters are treated as any other character, unless they also appear within this list. */extern const char *rl_completer_quote_characters;/* List of quote characters which cause a word break. */extern const char *rl_basic_quote_characters;/* List of characters that need to be quoted in filenames by the completer. */extern const char *rl_filename_quote_characters;/* List of characters that are word break characters, but should be left in TEXT when it is passed to the completion function. The shell uses this to help determine what kind of completing to do. */extern const char *rl_special_prefixes;/* If non-zero, then this is the address of a function to call when completing on a directory name. The function is called with the address of a string (the current directory name) as an arg. It changes what is displayed when the possible completions are printed or inserted. */extern rl_icppfunc_t *rl_directory_completion_hook;/* If non-zero, this is the address of a function to call when completing a directory name. This function takes the address of the directory name to be modified as an argument. Unlike rl_directory_completion_hook, it only modifies the directory name used in opendir(2), not what is displayed when the possible completions are printed or inserted. It is called before rl_directory_completion_hook. I'm not happy with how this works yet, so it's undocumented. */extern rl_icppfunc_t *rl_directory_rewrite_hook;/* Backwards compatibility with previous versions of readline. */#define rl_symbolic_link_hook rl_directory_completion_hook/* If non-zero, then this is the address of a function to call when completing a word would normally display the list of possible matches. This function is called instead of actually doing the display. It takes three arguments: (char **matches, int num_matches, int max_length) where MATCHES is the array of strings that matched, NUM_MATCHES is the number of strings in that array, and MAX_LENGTH is the length of the longest string in that array. */extern rl_compdisp_func_t *rl_completion_display_matches_hook;/* Non-zero means that the results of the matches are to be treated as filenames. This is ALWAYS zero on entry, and can only be changed within a completion entry finder function. */extern int rl_filename_completion_desired;/* Non-zero means that the results of the matches are to be quoted using double quotes (or an application-specific quoting mechanism) if the filename contains any characters in rl_word_break_chars. This is ALWAYS non-zero on entry, and can only be changed within a completion entry finder function. */extern int rl_filename_quoting_desired;/* Set to a function to quote a filename in an application-specific fashion. Called with the text to quote, the type of match found (single or multiple) and a pointer to the quoting character to be used, which the function can reset if desired. */extern rl_quote_func_t *rl_filename_quoting_function;/* Function to call to remove quoting characters from a filename. Called before completion is attempted, so the embedded quotes do not interfere with matching names in the file system. */extern rl_dequote_func_t *rl_filename_dequoting_function;/* Function to call to decide whether or not a word break character is quoted. If a character is quoted, it does not break words for the completer. */extern rl_linebuf_func_t *rl_char_is_quoted_p;/* Non-zero means to suppress normal filename completion after the user-specified completion function has been called. */extern int rl_attempted_completion_over;/* Set to a character describing the type of completion being attempted by rl_complete_internal; available for use by application completion functions. */extern int rl_completion_type;/* Up to this many items will be displayed in response to a possible-completions call. After that, we ask the user if she is sure she wants to see them all. The default value is 100. */extern int rl_completion_query_items;/* Character appended to completed words when at the end of the line. The default is a space. Nothing is added if this is '\0'. */extern int rl_completion_append_character;/* If set to non-zero by an application completion function, rl_completion_append_character will not be appended. */extern int rl_completion_suppress_append;/* Set to any quote character readline thinks it finds before any application completion function is called. */extern int rl_completion_quote_character;/* Set to a non-zero value if readline found quoting anywhere in the word to be completed; set before any application completion function is called. */extern int rl_completion_found_quote;/* If non-zero, the completion functions don't append any closing quote. This is set to 0 by rl_complete_internal and may be changed by an application-specific completion function. */extern int rl_completion_suppress_quote;/* If non-zero, a slash will be appended to completed filenames that are symbolic links to directory names, subject to the value of the mark-directories variable (which is user-settable). This exists so that application completion functions can override the user's preference (set via the mark-symlinked-directories variable) if appropriate. It's set to the value of _rl_complete_mark_symlink_dirs in rl_complete_internal before any application-specific completion function is called, so without that function doing anything, the user's preferences are honored. */extern int rl_completion_mark_symlink_dirs;/* If non-zero, then disallow duplicates in the matches. */extern int rl_ignore_completion_duplicates;/* If this is non-zero, completion is (temporarily) inhibited, and the completion character will be inserted as any other. */extern int rl_inhibit_completion;/* Definitions available for use by readline clients. */#define RL_PROMPT_START_IGNORE '\001'#define RL_PROMPT_END_IGNORE '\002'/* Possible values for do_replace argument to rl_filename_quoting_function, called by rl_complete_internal. */#define NO_MATCH 0#define SINGLE_MATCH 1#define MULT_MATCH 2/* Possible state values for rl_readline_state */#define RL_STATE_NONE 0x00000 /* no state; before first call */#define RL_STATE_INITIALIZING 0x00001 /* initializing */#define RL_STATE_INITIALIZED 0x00002 /* initialization done */#define RL_STATE_TERMPREPPED 0x00004 /* terminal is prepped */#define RL_STATE_READCMD 0x00008 /* reading a command key */#define RL_STATE_METANEXT 0x00010 /* reading input after ESC */#define RL_STATE_DISPATCHING 0x00020 /* dispatching to a command */#define RL_STATE_MOREINPUT 0x00040 /* reading more input in a command function */#define RL_STATE_ISEARCH 0x00080 /* doing incremental search */#define RL_STATE_NSEARCH 0x00100 /* doing non-inc search */#define RL_STATE_SEARCH 0x00200 /* doing a history search */#define RL_STATE_NUMERICARG 0x00400 /* reading numeric argument */#define RL_STATE_MACROINPUT 0x00800 /* getting input from a macro */#define RL_STATE_MACRODEF 0x01000 /* defining keyboard macro */#define RL_STATE_OVERWRITE 0x02000 /* overwrite mode */#define RL_STATE_COMPLETING 0x04000 /* doing completion */#define RL_STATE_SIGHANDLER 0x08000 /* in readline sighandler */#define RL_STATE_UNDOING 0x10000 /* doing an undo */#define RL_STATE_INPUTPENDING 0x20000 /* rl_execute_next called */#define RL_STATE_TTYCSAVED 0x40000 /* tty special chars saved */#define RL_STATE_DONE 0x80000 /* done; accepted line */#define RL_SETSTATE(x) (rl_readline_state |= (x))#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))#define RL_ISSTATE(x) (rl_readline_state & (x))struct readline_state { /* line state */ int point; int end; int mark; char *buffer; int buflen; UNDO_LIST *ul; char *prompt; /* global state */ int rlstate; int done; Keymap kmap; /* input state */ rl_command_func_t *lastfunc; int insmode; int edmode; int kseqlen; FILE *inf; FILE *outf; int pendingin; char *macro; /* signal state */ int catchsigs; int catchsigwinch; /* search state */ /* completion state */ /* options state */ /* reserved for future expansion, so the struct size doesn't change */ char reserved[64];};extern int rl_save_state PARAMS((struct readline_state *));extern int rl_restore_state PARAMS((struct readline_state *));#ifdef __cplusplus}#endif#endif /* _READLINE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -