TheGNUGeneralPublicLicenseisoftenshippedwithGNUsoftware,and isgenerallykeptinafilecalledCOPYINGorLICENSE.Ifyoudonot haveacopyofthelicense,writetotheFreeSoftwareFoundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. */
#if !defined (_READLINE_H_) #define _READLINE_H_
#ifdef __cplusplus extern"C" { #endif
#ifdefined (READLINE_LIBRARY) # include "rlstdc.h" # include "rltypedefs.h" # include "keymaps.h" # include "tilde.h" #else # include <rlstdc.h> # include <rltypedefs.h> # include <keymaps.h> # include <tilde.h> #endif
/* Maintaining the state of undo. We remember individual deletes and inserts
on a chain of things to do. */
/* The actions that undo knows how to undo. Notice that UNDO_DELETE means toinsertsometext,andUNDO_INSERTmeanstodeletesometext.I.e.,
the code tells undo what to undo, not how to undo it. */ enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
/* What an element of THE_UNDO_LIST looks like. */ typedefstruct undo_list { struct undo_list *next; int start, end; /* Where the change took place. */ char *text; /* The text to insert, if undoing a delete. */ enum undo_code what; /* Delete, Insert, Begin, End. */
} UNDO_LIST;
/* The current undo list for RL_LINE_BUFFER. */ extern UNDO_LIST *rl_undo_list;
/* The data structure for mapping textual names to code addresses. */ typedefstruct _funmap { constchar *name;
rl_command_func_t *function;
} FUNMAP;
extern FUNMAP **funmap;
/* **************************************************************** */ /* */ /* Functions available to bind to key sequences */ /* */ /* **************************************************************** */
/* Bindable commands for transposing characters and words. */ externint rl_transpose_words PARAMS((int, int)); externint rl_transpose_chars PARAMS((int, int));
/* Bindable commands for searching within a line. */ externint rl_char_search PARAMS((int, int)); externint rl_backward_char_search PARAMS((int, int));
/* Bindable commands for readline's interface to the command history. */ externint rl_beginning_of_history PARAMS((int, int)); externint rl_end_of_history PARAMS((int, int)); externint rl_get_next_history PARAMS((int, int)); externint rl_get_previous_history PARAMS((int, int));
/* Bindable commands for managing the mark and region. */ externint rl_set_mark PARAMS((int, int)); externint rl_exchange_point_and_mark PARAMS((int, int));
/* Bindable commands to set the editing mode (emacs or vi). */ externint rl_vi_editing_mode PARAMS((int, int)); externint rl_emacs_editing_mode PARAMS((int, int));
/* Bindable commands to change the insert mode (insert or overwrite) */ externint rl_overwrite_mode PARAMS((int, int));
/* Undocumented in the texinfo manual; not really useful to programs. */ externint rl_translate_keyseq PARAMS((constchar *, char *, int *)); externchar *rl_untranslate_keyseq PARAMS((int));
/* Functions for manipulating the funmap, which maps command names to functions. */ externint rl_add_funmap_entry PARAMS((constchar *, rl_command_func_t *)); externconstchar **rl_funmap_names PARAMS((void)); /* Undocumented, only used internally -- there is only one funmap, and this
function may be called only once. */ externvoid rl_initialize_funmap PARAMS((void));
/* **************************************************************** */ /* */ /* Well Published Variables */ /* */ /* **************************************************************** */
/* The version of this incarnation of the readline library. */ externconstchar *rl_library_version; /* e.g., "4.2" */ externint rl_readline_version; /* e.g., 0x0402 */
/* True if this is real GNU readline. */ externint rl_gnu_readline_p;
/* Flags word encapsulating the current readline state. */ externint rl_readline_state;
/* Says which editing mode readline is currently using. 1 means emacs mode;
0 means vi mode. */ externint 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. */ externint 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. */ externconstchar *rl_readline_name;
/* The prompt readline uses. This is set from the argument to
readline (), and should not be assigned to directly. */ externchar *rl_prompt;
/* The line buffer that is in use. */ externchar *rl_line_buffer;
/* The location of point, and end. */ externint rl_point; externint rl_end;
/* The mark, or saved cursor position. */ externint rl_mark;
/* Flag to indicate that readline has finished with the current input
line and should return it. */ externint rl_done;
/* If set to a character value, that will be the next keystroke read. */ externint rl_pending_input;
/* Non-zero if we called this function from _rl_dispatch(). It's present sofunctionscanfindoutwhethertheywerecalledfromakeybinding
or directly from an application. */ externint rl_dispatching;
/* Non-zero if the user typed a numeric argument before executing the
current function. */ externint rl_explicit_arg;
/* The current value of the numeric argument specified by the user. */ externint 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. */ externconstchar *rl_terminal_name;
/* The input and output streams. */ extern FILE *rl_instream; extern FILE *rl_outstream;
/* If non-zero, Readline gives values of LINES and COLUMNS from the environment greaterprecedencethanvaluesfetchedfromthekernelwhencomputingthe
screen dimensions. */ externint rl_prefer_env_winsize;
/* 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()returnsandreadline_internalstarts
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;
/* Display variables. */ /* If non-zero, readline will erase the entire line, including any prompt, iftheonlythingtypedonanotherwise-blanklineissomethingboundto
rl_newline. */ externint rl_erase_empty_line;
/* If non-zero, the application has already printed the prompt (rl_prompt) beforecallingreadline,soreadlineshouldnotoutputitthefirsttime
redisplay is done. */ externint rl_already_prompted;
/* A non-zero value means to read only this many characters rather than
up to a character bound to accept-line. */ externint rl_num_chars_to_read;
/* The text of a currently-executing keyboard macro. */ externchar *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. */ externint rl_catch_signals;
/* If non-zero, readline will install a signal handler for SIGWINCH thatalsoattemptstocallanycallingapplication'sSIGWINCHsignal handler.Notethattheterminalisnotcleanedupbeforethe application'ssignalhandleriscalled;userl_cleanup_after_signal()
to do that. */ externint rl_catch_sigwinch;
/* Completion variables. */ /* Pointer to the generator function for completion_matches (). NULLmeanstouserl_filename_completion_function(),thedefault
filename completer. */ extern rl_compentry_func_t *rl_completion_entry_function;
/* If rl_ignore_some_completions_function is non-NULL it is the address ofafunctiontocallafterallofthepossiblematcheshavebeen generated,butbeforetheactualcompletionisdonetotheinputline. Thefunctioniscalledwithoneargument;aNULLterminatedarray of(char*).Ifyourfunctionremovesanyoftheelements,they
must be free()'ed. */ extern rl_compignore_func_t *rl_ignore_some_completions_function;
/* Pointer to alternative function to create matches. FunctioniscalledwithTEXT,START,andEND. STARTandENDareindicesinRL_LINE_BUFFERsayingwhattheboundaries ofTEXTare. IfthisfunctionexistsandreturnsNULLthencallthevalueof rl_completion_entry_functiontotrytomatch,otherwiseusethe
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 completerroutine.Theinitialcontentsofthisvariableiswhat
breaks words in the shell, i.e. "n\"\\'`@$>". */ externconstchar *rl_basic_word_break_characters;
/* The list of characters that signal a break between words for rl_complete_internal.Thedefaultlististhecontentsof
rl_basic_word_break_characters. */ extern/*const*/ char *rl_completer_word_break_characters;
/* Hook function to allow an application to set the completion word breakcharactersbeforereadlinebreaksuptheline.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. Completionoccursontheentiresubstring,andwithinthesubstring rl_completer_word_break_charactersaretreatedasanyothercharacter,
unless they also appear within this list. */ externconstchar *rl_completer_quote_characters;
/* List of quote characters which cause a word break. */ externconstchar *rl_basic_quote_characters;
/* List of characters that need to be quoted in filenames by the completer. */ externconstchar *rl_filename_quote_characters;
/* List of characters that are word break characters, but should be left inTEXTwhenitispassedtothecompletionfunction.Theshelluses
this to help determine what kind of completing to do. */ externconstchar *rl_special_prefixes;
/* If non-zero, then this is the address of a function to call when completingonadirectoryname.Thefunctioniscalledwith theaddressofastring(thecurrentdirectoryname)asanarg.It changeswhatisdisplayedwhenthepossiblecompletionsareprinted
or inserted. */ extern rl_icppfunc_t *rl_directory_completion_hook;
/* If non-zero, this is the address of a function to call when completing adirectoryname.Thisfunctiontakestheaddressofthedirectoryname tobemodifiedasanargument.Unlikerl_directory_completion_hook,it onlymodifiesthedirectorynameusedinopendir(2),notwhatisdisplayed whenthepossiblecompletionsareprintedorinserted.Itiscalled beforerl_directory_completion_hook.I'mnothappywithhowthisworks
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 completingawordwouldnormallydisplaythelistofpossiblematches. Thisfunctioniscalledinsteadofactuallydoingthedisplay. Ittakesthreearguments:(char**matches,intnum_matches,intmax_length) whereMATCHESisthearrayofstringsthatmatched,NUM_MATCHESisthe numberofstringsinthatarray,andMAX_LENGTHisthelengthofthe
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 asfilenames.ThisisALWAYSzeroonentry,andcanonlybechanged
within a completion entry finder function. */ externint rl_filename_completion_desired;
/* Non-zero means that the results of the matches are to be quoted using doublequotes(oranapplication-specificquotingmechanism)ifthe filenamecontainsanycharactersinrl_word_break_chars.Thisis ALWAYSnon-zeroonentry,andcanonlybechangedwithinacompletion
entry finder function. */ externint rl_filename_quoting_desired;
/* Set to a function to quote a filename in an application-specific fashion. Calledwiththetexttoquote,thetypeofmatchfound(singleormultiple) andapointertothequotingcharactertobeused,whichthefunctioncan
reset if desired. */ extern rl_quote_func_t *rl_filename_quoting_function;
/* Function to call to remove quoting characters from a filename. Called beforecompletionisattempted,sotheembeddedquotesdonotinterfere
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.Ifacharacterisquoted,itdoesnotbreakwordsforthe
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. */ externint rl_attempted_completion_over;
/* Set to a character describing the type of completion being attempted by rl_complete_internal;availableforusebyapplicationcompletion
functions. */ externint rl_completion_type;
/* Up to this many items will be displayed in response to a possible-completionscall.Afterthat,weasktheuserifshe
is sure she wants to see them all. The default value is 100. */ externint 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'. */ externint rl_completion_append_character;
/* If set to non-zero by an application completion function,
rl_completion_append_character will not be appended. */ externint rl_completion_suppress_append;
/* Set to any quote character readline thinks it finds before any application
completion function is called. */ externint 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. */ externint rl_completion_found_quote;
/* If non-zero, the completion functions don't append any closing quote. Thisissetto0byrl_complete_internalandmaybechangedbyan
application-specific completion function. */ externint rl_completion_suppress_quote;
/* If non-zero, a slash will be appended to completed filenames that are symboliclinkstodirectorynames,subjecttothevalueofthe mark-directoriesvariable(whichisuser-settable).Thisexistsso thatapplicationcompletionfunctionscanoverridetheuser'spreference (setviathemark-symlinked-directoriesvariable)ifappropriate. It'ssettothevalueof_rl_complete_mark_symlink_dirsin rl_complete_internalbeforeanyapplication-specificcompletion functioniscalled,sowithoutthatfunctiondoinganything,theuser's
preferences are honored. */ externint rl_completion_mark_symlink_dirs;
/* If non-zero, then disallow duplicates in the matches. */ externint rl_ignore_completion_duplicates;
/* If this is non-zero, completion is (temporarily) inhibited, and the
completion character will be inserted as any other. */ externint rl_inhibit_completion;
/* Input error; can be returned by (*rl_getc_function) if readline is reading
a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */ #define READERR (-2)
/* 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 0x000000 /* no state; before first call */
#define RL_STATE_INITIALIZING 0x000001 /* initializing */ #define RL_STATE_INITIALIZED 0x000002 /* initialization done */ #define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */ #define RL_STATE_READCMD 0x000008 /* reading a command key */ #define RL_STATE_METANEXT 0x000010 /* reading input after ESC */ #define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */ #define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */ #define RL_STATE_ISEARCH 0x000080 /* doing incremental search */ #define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */ #define RL_STATE_SEARCH 0x000200 /* doing a history search */ #define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */ #define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */ #define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */ #define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */ #define RL_STATE_COMPLETING 0x004000 /* doing completion */ #define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */ #define RL_STATE_UNDOING 0x010000 /* doing an undo */ #define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */ #define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */ #define RL_STATE_CALLBACK 0x080000 /* using the callback interface */ #define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */ #define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ #define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
#define RL_STATE_DONE 0x800000 /* done; accepted line */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.