| 1 |
/* Readline.h -- the names of functions callable from within readline. */ |
| 2 |
|
| 3 |
/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
This file is part of the GNU Readline Library, a library for |
| 6 |
reading lines of text with interactive input and history editing. |
| 7 |
|
| 8 |
The GNU Readline Library is free software; you can redistribute it |
| 9 |
and/or modify it under the terms of the GNU General Public License |
| 10 |
as published by the Free Software Foundation; either version 1, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
The GNU Readline Library is distributed in the hope that it will be |
| 14 |
useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 15 |
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
The GNU General Public License is often shipped with GNU software, and |
| 19 |
is generally kept in a file called COPYING or LICENSE. If you do not |
| 20 |
have a copy of the license, write to the Free Software Foundation, |
| 21 |
675 Mass Ave, Cambridge, MA 02139, USA. */ |
| 22 |
|
| 23 |
#if !defined (_READLINE_H_) |
| 24 |
#define _READLINE_H_ |
| 25 |
|
| 26 |
#if defined (READLINE_LIBRARY) |
| 27 |
# include "keymaps.h" |
| 28 |
# include "tilde.h" |
| 29 |
#else |
| 30 |
# include <readline/keymaps.h> |
| 31 |
# include <readline/tilde.h> |
| 32 |
#endif |
| 33 |
|
| 34 |
/* The functions for manipulating the text of the line within readline. |
| 35 |
Most of these functions are bound to keys by default. */ |
| 36 |
extern int |
| 37 |
rl_tilde_expand (), |
| 38 |
rl_beg_of_line (), rl_backward (), rl_delete (), rl_end_of_line (), |
| 39 |
rl_forward (), ding (), rl_backward (), rl_newline (), rl_kill_line (), |
| 40 |
rl_clear_screen (), rl_get_next_history (), rl_get_previous_history (), |
| 41 |
rl_quoted_insert (), rl_reverse_search_history (), rl_transpose_chars (), |
| 42 |
rl_unix_line_discard (), rl_quoted_insert (), rl_unix_word_rubout (), |
| 43 |
rl_yank (), rl_rubout (), rl_backward_word (), rl_kill_word (), |
| 44 |
rl_forward_word (), rl_tab_insert (), rl_yank_pop (), rl_yank_nth_arg (), |
| 45 |
rl_backward_kill_word (), rl_backward_kill_line (), rl_transpose_words (), |
| 46 |
rl_complete (), rl_possible_completions (), rl_insert_completions (), |
| 47 |
rl_do_lowercase_version (), rl_kill_full_line (), |
| 48 |
rl_digit_argument (), rl_universal_argument (), rl_abort (), |
| 49 |
rl_undo_command (), rl_revert_line (), rl_beginning_of_history (), |
| 50 |
rl_end_of_history (), rl_forward_search_history (), rl_insert (), |
| 51 |
rl_upcase_word (), rl_downcase_word (), rl_capitalize_word (), |
| 52 |
rl_restart_output (), rl_re_read_init_file (), rl_dump_functions (), |
| 53 |
rl_delete_horizontal_space (), rl_history_search_forward (), |
| 54 |
rl_history_search_backward (), rl_tty_status (); |
| 55 |
|
| 56 |
/* `Public' utility functions. */ |
| 57 |
extern int rl_insert_text (), rl_delete_text (), rl_kill_text (); |
| 58 |
extern int rl_complete_internal (); |
| 59 |
extern int rl_expand_prompt (); |
| 60 |
extern int rl_initialize (); |
| 61 |
extern int rl_set_signals (), rl_clear_signals (); |
| 62 |
extern int rl_init_argument (), rl_digit_argument (); |
| 63 |
extern int rl_read_key (), rl_getc (), rl_stuff_char (); |
| 64 |
extern int maybe_save_line (), maybe_unsave_line (), maybe_replace_line (); |
| 65 |
extern int rl_modifying (); |
| 66 |
|
| 67 |
extern int rl_begin_undo_group (), rl_end_undo_group (); |
| 68 |
extern void rl_add_undo (), free_undo_list (); |
| 69 |
extern int rl_do_undo (); |
| 70 |
|
| 71 |
/* Not available unless readline is compiled -DPAREN_MATCHING. */ |
| 72 |
extern int rl_insert_close (); |
| 73 |
|
| 74 |
/* These are *both* defined even when VI_MODE is not. */ |
| 75 |
extern int rl_vi_editing_mode (), rl_emacs_editing_mode (); |
| 76 |
|
| 77 |
/* Non incremental history searching. */ |
| 78 |
extern int |
| 79 |
rl_noninc_forward_search (), rl_noninc_reverse_search (), |
| 80 |
rl_noninc_forward_search_again (), rl_noninc_reverse_search_again (); |
| 81 |
|
| 82 |
/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */ |
| 83 |
extern int rl_vi_check (), rl_vi_textmod_command (); |
| 84 |
extern int |
| 85 |
rl_vi_redo (), rl_vi_tilde_expand (), |
| 86 |
rl_vi_movement_mode (), rl_vi_insertion_mode (), rl_vi_arg_digit (), |
| 87 |
rl_vi_prev_word (), rl_vi_next_word (), rl_vi_char_search (), |
| 88 |
rl_vi_eof_maybe (), rl_vi_append_mode (), rl_vi_put (), |
| 89 |
rl_vi_append_eol (), rl_vi_insert_beg (), rl_vi_delete (), rl_vi_comment (), |
| 90 |
rl_vi_first_print (), rl_vi_fword (), rl_vi_fWord (), rl_vi_bword (), |
| 91 |
rl_vi_bWord (), rl_vi_eword (), rl_vi_eWord (), rl_vi_end_word (), |
| 92 |
rl_vi_change_case (), rl_vi_match (), rl_vi_bracktype (), |
| 93 |
rl_vi_change_char (), rl_vi_yank_arg (), rl_vi_search (), |
| 94 |
rl_vi_search_again (), rl_vi_subst (), rl_vi_overstrike (), |
| 95 |
rl_vi_overstrike_delete (), rl_vi_replace(), rl_vi_column (), |
| 96 |
rl_vi_delete_to (), rl_vi_change_to (), rl_vi_yank_to (), |
| 97 |
rl_vi_complete (), rl_vi_fetch_history (); |
| 98 |
|
| 99 |
/* Keyboard macro commands. */ |
| 100 |
extern int rl_start_kbd_macro (), rl_end_kbd_macro (); |
| 101 |
extern int rl_call_last_kbd_macro (); |
| 102 |
|
| 103 |
extern int rl_arrow_keys(), rl_refresh_line (); |
| 104 |
|
| 105 |
/* Maintaining the state of undo. We remember individual deletes and inserts |
| 106 |
on a chain of things to do. */ |
| 107 |
|
| 108 |
/* The actions that undo knows how to undo. Notice that UNDO_DELETE means |
| 109 |
to insert some text, and UNDO_INSERT means to delete some text. I.e., |
| 110 |
the code tells undo what to undo, not how to undo it. */ |
| 111 |
enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; |
| 112 |
|
| 113 |
/* What an element of THE_UNDO_LIST looks like. */ |
| 114 |
typedef struct undo_list { |
| 115 |
struct undo_list *next; |
| 116 |
int start, end; /* Where the change took place. */ |
| 117 |
char *text; /* The text to insert, if undoing a delete. */ |
| 118 |
enum undo_code what; /* Delete, Insert, Begin, End. */ |
| 119 |
} UNDO_LIST; |
| 120 |
|
| 121 |
/* The current undo list for RL_LINE_BUFFER. */ |
| 122 |
extern UNDO_LIST *rl_undo_list; |
| 123 |
|
| 124 |
/* The data structure for mapping textual names to code addresses. */ |
| 125 |
typedef struct { |
| 126 |
char *name; |
| 127 |
Function *function; |
| 128 |
} FUNMAP; |
| 129 |
|
| 130 |
extern FUNMAP **funmap; |
| 131 |
|
| 132 |
/* **************************************************************** */ |
| 133 |
/* */ |
| 134 |
/* Well Published Variables */ |
| 135 |
/* */ |
| 136 |
/* **************************************************************** */ |
| 137 |
|
| 138 |
/* The name of the calling program. You should initialize this to |
| 139 |
whatever was in argv[0]. It is used when parsing conditionals. */ |
| 140 |
extern char *rl_readline_name; |
| 141 |
|
| 142 |
/* The line buffer that is in use. */ |
| 143 |
extern char *rl_line_buffer; |
| 144 |
|
| 145 |
/* The location of point, and end. */ |
| 146 |
extern int rl_point, rl_end; |
| 147 |
|
| 148 |
/* The name of the terminal to use. */ |
| 149 |
extern char *rl_terminal_name; |
| 150 |
|
| 151 |
/* The input and output streams. */ |
| 152 |
extern FILE *rl_instream, *rl_outstream; |
| 153 |
|
| 154 |
/* The basic list of characters that signal a break between words for the |
| 155 |
completer routine. The initial contents of this variable is what |
| 156 |
breaks words in the shell, i.e. "n\"\\'`@$>". */ |
| 157 |
extern char *rl_basic_word_break_characters; |
| 158 |
|
| 159 |
/* The list of characters that signal a break between words for |
| 160 |
rl_complete_internal. The default list is the contents of |
| 161 |
rl_basic_word_break_characters. */ |
| 162 |
extern char *rl_completer_word_break_characters; |
| 163 |
|
| 164 |
/* List of characters which can be used to quote a substring of the line. |
| 165 |
Completion occurs on the entire substring, and within the substring |
| 166 |
rl_completer_word_break_characters are treated as any other character, |
| 167 |
unless they also appear within this list. */ |
| 168 |
extern char *rl_completer_quote_characters; |
| 169 |
|
| 170 |
/* List of characters that are word break characters, but should be left |
| 171 |
in TEXT when it is passed to the completion function. The shell uses |
| 172 |
this to help determine what kind of completing to do. */ |
| 173 |
extern char *rl_special_prefixes; |
| 174 |
|
| 175 |
/* Pointer to the generator function for completion_matches (). |
| 176 |
NULL means to use filename_entry_function (), the default filename |
| 177 |
completer. */ |
| 178 |
extern Function *rl_completion_entry_function; |
| 179 |
|
| 180 |
/* If rl_ignore_some_completions_function is non-NULL it is the address |
| 181 |
of a function to call after all of the possible matches have been |
| 182 |
generated, but before the actual completion is done to the input line. |
| 183 |
The function is called with one argument; a NULL terminated array |
| 184 |
of (char *). If your function removes any of the elements, they |
| 185 |
must be free()'ed. */ |
| 186 |
extern Function *rl_ignore_some_completions_function; |
| 187 |
|
| 188 |
/* Pointer to alternative function to create matches. |
| 189 |
Function is called with TEXT, START, and END. |
| 190 |
START and END are indices in RL_LINE_BUFFER saying what the boundaries |
| 191 |
of TEXT are. |
| 192 |
If this function exists and returns NULL then call the value of |
| 193 |
rl_completion_entry_function to try to match, otherwise use the |
| 194 |
array of strings returned. */ |
| 195 |
extern CPPFunction *rl_attempted_completion_function; |
| 196 |
|
| 197 |
/* If non-zero, then this is the address of a function to call just |
| 198 |
before readline_internal () prints the first prompt. */ |
| 199 |
extern Function *rl_startup_hook; |
| 200 |
|
| 201 |
/* If non-zero, then this is the address of a function to call when |
| 202 |
completing on a directory name. The function is called with |
| 203 |
the address of a string (the current directory name) as an arg. */ |
| 204 |
extern Function *rl_directory_completion_hook; |
| 205 |
|
| 206 |
/* Backwards compatibility with previous versions of readline. */ |
| 207 |
#define rl_symbolic_link_hook rl_directory_completion_hook |
| 208 |
|
| 209 |
/* The address of a function to call periodically while Readline is |
| 210 |
awaiting character input, or NULL, for no event handling. */ |
| 211 |
extern Function *rl_event_hook; |
| 212 |
|
| 213 |
/* Non-zero means that modified history lines are preceded |
| 214 |
with an asterisk. */ |
| 215 |
extern int rl_show_star; |
| 216 |
|
| 217 |
/* Non-zero means to suppress normal filename completion after the |
| 218 |
user-specified completion function has been called. */ |
| 219 |
extern int rl_attempted_completion_over; |
| 220 |
|
| 221 |
/* **************************************************************** */ |
| 222 |
/* */ |
| 223 |
/* Well Published Functions */ |
| 224 |
/* */ |
| 225 |
/* **************************************************************** */ |
| 226 |
|
| 227 |
/* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */ |
| 228 |
extern char *readline (); |
| 229 |
|
| 230 |
/* These functions are from complete.c. */ |
| 231 |
/* Return an array of strings which are the result of repeatadly calling |
| 232 |
FUNC with TEXT. */ |
| 233 |
extern char **completion_matches (); |
| 234 |
extern char *username_completion_function (); |
| 235 |
extern char *filename_completion_function (); |
| 236 |
|
| 237 |
/* These functions are from bind.c. */ |
| 238 |
/* rl_add_defun (char *name, Function *function, int key) |
| 239 |
Add NAME to the list of named functions. Make FUNCTION |
| 240 |
be the function that gets called. |
| 241 |
If KEY is not -1, then bind it. */ |
| 242 |
extern int rl_add_defun (); |
| 243 |
extern int rl_bind_key (), rl_bind_key_in_map (); |
| 244 |
extern int rl_unbind_key (), rl_unbind_key_in_map (); |
| 245 |
extern int rl_set_key (); |
| 246 |
extern int rl_macro_bind (), rl_generic_bind (), rl_variable_bind (); |
| 247 |
extern int rl_translate_keyseq (); |
| 248 |
extern Function *rl_named_function (), *rl_function_of_keyseq (); |
| 249 |
extern int rl_parse_and_bind (); |
| 250 |
extern Keymap rl_get_keymap (), rl_get_keymap_by_name (); |
| 251 |
extern void rl_set_keymap (); |
| 252 |
extern char **rl_invoking_keyseqs (), **rl_invoking_keyseqs_in_map (); |
| 253 |
extern void rl_function_dumper (); |
| 254 |
extern int rl_read_init_file (); |
| 255 |
|
| 256 |
/* Functions in funmap.c */ |
| 257 |
extern void rl_list_funmap_names (); |
| 258 |
extern void rl_initialize_funmap (); |
| 259 |
|
| 260 |
/* Functions in display.c */ |
| 261 |
extern void rl_redisplay (); |
| 262 |
extern int rl_message (), rl_clear_message (); |
| 263 |
extern int rl_reset_line_state (); |
| 264 |
extern int rl_character_len (); |
| 265 |
extern int rl_show_char (); |
| 266 |
extern int crlf (), rl_on_new_line (); |
| 267 |
extern int rl_forced_update_display (); |
| 268 |
|
| 269 |
/* Definitions available for use by readline clients. */ |
| 270 |
#define RL_PROMPT_START_IGNORE '\001' |
| 271 |
#define RL_PROMPT_END_IGNORE '\002' |
| 272 |
|
| 273 |
#endif /* _READLINE_H_ */ |