AARCH64: Replace regset_alloc() invocations by static regset structures.
[deliverable/binutils-gdb.git] / readline / rlprivate.h
CommitLineData
f9267e15
EZ
1/* rlprivate.h -- functions and variables global to the readline library,
2 but not intended for use by applications. */
3
cc88a640 4/* Copyright (C) 1999-2010 Free Software Foundation, Inc.
f9267e15 5
cc88a640
JK
6 This file is part of the GNU Readline Library (Readline), a library
7 for reading lines of text with interactive input and history editing.
f9267e15 8
cc88a640
JK
9 Readline is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
f9267e15
EZ
12 (at your option) any later version.
13
cc88a640
JK
14 Readline is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f9267e15
EZ
17 GNU General Public License for more details.
18
cc88a640
JK
19 You should have received a copy of the GNU General Public License
20 along with Readline. If not, see <http://www.gnu.org/licenses/>.
21*/
f9267e15
EZ
22
23#if !defined (_RL_PRIVATE_H_)
24#define _RL_PRIVATE_H_
25
26#include "rlconf.h" /* for VISIBLE_STATS */
27#include "rlstdc.h"
9255ee31 28#include "posixjmp.h" /* defines procenv_t */
f9267e15 29
cc88a640
JK
30/*************************************************************************
31 * *
32 * Convenience definitions *
33 * *
34 *************************************************************************/
35
36#define EMACS_MODE() (rl_editing_mode == emacs_mode)
37#define VI_COMMAND_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)
38#define VI_INSERT_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_insertion_keymap)
39
40#define RL_CHECK_SIGNALS() \
41 do { \
42 if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); \
43 } while (0)
44
5bdf8622
DJ
45/*************************************************************************
46 * *
47 * Global structs undocumented in texinfo manual and not in readline.h *
48 * *
49 *************************************************************************/
50/* search types */
51#define RL_SEARCH_ISEARCH 0x01 /* incremental search */
52#define RL_SEARCH_NSEARCH 0x02 /* non-incremental search */
53#define RL_SEARCH_CSEARCH 0x04 /* intra-line char search */
54
55/* search flags */
56#define SF_REVERSE 0x01
57#define SF_FOUND 0x02
58#define SF_FAILED 0x04
cc88a640 59#define SF_CHGKMAP 0x08
5bdf8622
DJ
60
61typedef struct __rl_search_context
62{
63 int type;
64 int sflags;
65
66 char *search_string;
67 int search_string_index;
68 int search_string_size;
69
70 char **lines;
71 char *allocated_line;
72 int hlen;
73 int hindex;
74
75 int save_point;
76 int save_mark;
77 int save_line;
78 int last_found_line;
79 char *prev_line_found;
80
81 UNDO_LIST *save_undo_list;
82
cc88a640
JK
83 Keymap keymap; /* used when dispatching commands in search string */
84 Keymap okeymap; /* original keymap */
85
5bdf8622
DJ
86 int history_pos;
87 int direction;
88
89 int lastc;
90#if defined (HANDLE_MULTIBYTE)
91 char mb[MB_LEN_MAX];
92#endif
93
94 char *sline;
95 int sline_len;
96 int sline_index;
97
98 char *search_terminators;
99} _rl_search_cxt;
100
101/* Callback data for reading numeric arguments */
102#define NUM_SAWMINUS 0x01
103#define NUM_SAWDIGITS 0x02
104#define NUM_READONE 0x04
105
106typedef int _rl_arg_cxt;
107
108/* A context for reading key sequences longer than a single character when
109 using the callback interface. */
110#define KSEQ_DISPATCHED 0x01
111#define KSEQ_SUBSEQ 0x02
112#define KSEQ_RECURSIVE 0x04
113
114typedef struct __rl_keyseq_context
115{
116 int flags;
117 int subseq_arg;
118 int subseq_retval; /* XXX */
119 Keymap dmap;
120
121 Keymap oldmap;
122 int okey;
123 struct __rl_keyseq_context *ocxt;
124 int childval;
125} _rl_keyseq_cxt;
126
cc88a640
JK
127/* vi-mode commands that use result of motion command to define boundaries */
128#define VIM_DELETE 0x01
129#define VIM_CHANGE 0x02
130#define VIM_YANK 0x04
131
132/* various states for vi-mode commands that use motion commands. reflects
133 RL_READLINE_STATE */
134#define VMSTATE_READ 0x01
135#define VMSTATE_NUMARG 0x02
136
137typedef struct __rl_vimotion_context
138{
139 int op;
140 int state;
141 int flags; /* reserved */
142 _rl_arg_cxt ncxt;
143 int numeric_arg;
144 int start, end; /* rl_point, rl_end */
145 int key, motion; /* initial key, motion command */
146} _rl_vimotion_cxt;
147
148/* fill in more as needed */
5bdf8622
DJ
149/* `Generic' callback data and functions */
150typedef struct __rl_callback_generic_arg
151{
152 int count;
153 int i1, i2;
154 /* add here as needed */
155} _rl_callback_generic_arg;
156
157typedef int _rl_callback_func_t PARAMS((_rl_callback_generic_arg *));
158
f9267e15
EZ
159/*************************************************************************
160 * *
161 * Global functions undocumented in texinfo manual and not in readline.h *
162 * *
163 *************************************************************************/
164
f9267e15
EZ
165/*************************************************************************
166 * *
167 * Global variables undocumented in texinfo manual and not in readline.h *
168 * *
169 *************************************************************************/
170
171/* complete.c */
172extern int rl_complete_with_tilde_expansion;
173#if defined (VISIBLE_STATS)
174extern int rl_visible_stats;
175#endif /* VISIBLE_STATS */
176
177/* readline.c */
178extern int rl_line_buffer_len;
f9267e15 179extern int rl_arg_sign;
f9267e15 180extern int rl_visible_prompt_length;
f9267e15 181extern int rl_key_sequence_length;
9255ee31 182extern int rl_byte_oriented;
f9267e15
EZ
183
184/* display.c */
185extern int rl_display_fixed;
186
187/* parens.c */
188extern int rl_blink_matching_paren;
189
190/*************************************************************************
191 * *
192 * Global functions and variables unsed and undocumented *
193 * *
194 *************************************************************************/
195
f9267e15 196/* kill.c */
9255ee31 197extern int rl_set_retained_kills PARAMS((int));
f9267e15
EZ
198
199/* terminal.c */
9255ee31 200extern void _rl_set_screen_size PARAMS((int, int));
f9267e15
EZ
201
202/* undo.c */
9255ee31 203extern int _rl_fix_last_undo_of_type PARAMS((int, int, int));
f9267e15
EZ
204
205/* util.c */
9255ee31 206extern char *_rl_savestring PARAMS((const char *));
f9267e15
EZ
207
208/*************************************************************************
209 * *
210 * Functions and variables private to the readline library *
211 * *
212 *************************************************************************/
213
214/* NOTE: Functions and variables prefixed with `_rl_' are
215 pseudo-global: they are global so they can be shared
216 between files in the readline library, but are not intended
217 to be visible to readline callers. */
218
219/*************************************************************************
220 * Undocumented private functions *
221 *************************************************************************/
222
223#if defined(READLINE_CALLBACKS)
224
225/* readline.c */
9255ee31
EZ
226extern void readline_internal_setup PARAMS((void));
227extern char *readline_internal_teardown PARAMS((int));
228extern int readline_internal_char PARAMS((void));
f9267e15 229
5bdf8622
DJ
230extern _rl_keyseq_cxt *_rl_keyseq_cxt_alloc PARAMS((void));
231extern void _rl_keyseq_cxt_dispose PARAMS((_rl_keyseq_cxt *));
232extern void _rl_keyseq_chain_dispose PARAMS((void));
233
234extern int _rl_dispatch_callback PARAMS((_rl_keyseq_cxt *));
235
236/* callback.c */
237extern _rl_callback_generic_arg *_rl_callback_data_alloc PARAMS((int));
238extern void _rl_callback_data_dispose PARAMS((_rl_callback_generic_arg *));
239
f9267e15
EZ
240#endif /* READLINE_CALLBACKS */
241
242/* bind.c */
9255ee31
EZ
243
244/* complete.c */
cc88a640 245extern void _rl_reset_completion_state PARAMS((void));
9255ee31
EZ
246extern char _rl_find_completion_word PARAMS((int *, int *));
247extern void _rl_free_match_list PARAMS((char **));
f9267e15
EZ
248
249/* display.c */
9255ee31
EZ
250extern char *_rl_strip_prompt PARAMS((char *));
251extern void _rl_move_cursor_relative PARAMS((int, const char *));
252extern void _rl_move_vert PARAMS((int));
253extern void _rl_save_prompt PARAMS((void));
254extern void _rl_restore_prompt PARAMS((void));
255extern char *_rl_make_prompt_for_search PARAMS((int));
256extern void _rl_erase_at_end_of_line PARAMS((int));
257extern void _rl_clear_to_eol PARAMS((int));
258extern void _rl_clear_screen PARAMS((void));
259extern void _rl_update_final PARAMS((void));
260extern void _rl_redisplay_after_sigwinch PARAMS((void));
261extern void _rl_clean_up_for_exit PARAMS((void));
262extern void _rl_erase_entire_line PARAMS((void));
263extern int _rl_current_display_line PARAMS((void));
f9267e15
EZ
264
265/* input.c */
9255ee31
EZ
266extern int _rl_any_typein PARAMS((void));
267extern int _rl_input_available PARAMS((void));
268extern int _rl_input_queued PARAMS((int));
269extern void _rl_insert_typein PARAMS((int));
270extern int _rl_unget_char PARAMS((int));
5bdf8622
DJ
271extern int _rl_pushed_input_available PARAMS((void));
272
273/* isearch.c */
274extern _rl_search_cxt *_rl_scxt_alloc PARAMS((int, int));
275extern void _rl_scxt_dispose PARAMS((_rl_search_cxt *, int));
276
277extern int _rl_isearch_dispatch PARAMS((_rl_search_cxt *, int));
278extern int _rl_isearch_callback PARAMS((_rl_search_cxt *));
279
280extern int _rl_search_getchar PARAMS((_rl_search_cxt *));
f9267e15
EZ
281
282/* macro.c */
9255ee31
EZ
283extern void _rl_with_macro_input PARAMS((char *));
284extern int _rl_next_macro_key PARAMS((void));
285extern void _rl_push_executing_macro PARAMS((void));
286extern void _rl_pop_executing_macro PARAMS((void));
287extern void _rl_add_macro_char PARAMS((int));
288extern void _rl_kill_kbd_macro PARAMS((void));
289
290/* misc.c */
5bdf8622
DJ
291extern int _rl_arg_overflow PARAMS((void));
292extern void _rl_arg_init PARAMS((void));
293extern int _rl_arg_getchar PARAMS((void));
294extern int _rl_arg_callback PARAMS((_rl_arg_cxt));
295extern void _rl_reset_argument PARAMS((void));
296
9255ee31
EZ
297extern void _rl_start_using_history PARAMS((void));
298extern int _rl_free_saved_history_line PARAMS((void));
299extern void _rl_set_insert_mode PARAMS((int, int));
f9267e15 300
cc88a640
JK
301extern void _rl_revert_all_lines PARAMS((void));
302
f9267e15 303/* nls.c */
9255ee31 304extern int _rl_init_eightbit PARAMS((void));
f9267e15
EZ
305
306/* parens.c */
9255ee31 307extern void _rl_enable_paren_matching PARAMS((int));
f9267e15
EZ
308
309/* readline.c */
9255ee31
EZ
310extern void _rl_init_line_state PARAMS((void));
311extern void _rl_set_the_line PARAMS((void));
312extern int _rl_dispatch PARAMS((int, Keymap));
313extern int _rl_dispatch_subseq PARAMS((int, Keymap, int));
5bdf8622 314extern void _rl_internal_char_cleanup PARAMS((void));
f9267e15
EZ
315
316/* rltty.c */
9255ee31
EZ
317extern int _rl_disable_tty_signals PARAMS((void));
318extern int _rl_restore_tty_signals PARAMS((void));
f9267e15 319
5bdf8622
DJ
320/* search.c */
321extern int _rl_nsearch_callback PARAMS((_rl_search_cxt *));
322
cc88a640
JK
323/* signals.c */
324extern void _rl_signal_handler PARAMS((int));
325
326extern void _rl_block_sigint PARAMS((void));
327extern void _rl_release_sigint PARAMS((void));
328extern void _rl_block_sigwinch PARAMS((void));
329extern void _rl_release_sigwinch PARAMS((void));
330
f9267e15 331/* terminal.c */
9255ee31
EZ
332extern void _rl_get_screen_size PARAMS((int, int));
333extern int _rl_init_terminal_io PARAMS((const char *));
f9267e15 334#ifdef _MINIX
9255ee31
EZ
335extern void _rl_output_character_function PARAMS((int));
336#else
337extern int _rl_output_character_function PARAMS((int));
338#endif
339extern void _rl_output_some_chars PARAMS((const char *, int));
340extern int _rl_backspace PARAMS((int));
341extern void _rl_enable_meta_key PARAMS((void));
342extern void _rl_control_keypad PARAMS((int));
343extern void _rl_set_cursor PARAMS((int, int));
344
345/* text.c */
346extern void _rl_fix_point PARAMS((int));
347extern int _rl_replace_text PARAMS((const char *, int, int));
cc88a640 348extern int _rl_forward_char_internal PARAMS((int));
9255ee31
EZ
349extern int _rl_insert_char PARAMS((int, int));
350extern int _rl_overwrite_char PARAMS((int, int));
351extern int _rl_overwrite_rubout PARAMS((int, int));
352extern int _rl_rubout_char PARAMS((int, int));
353#if defined (HANDLE_MULTIBYTE)
354extern int _rl_char_search_internal PARAMS((int, int, char *, int));
f9267e15 355#else
9255ee31 356extern int _rl_char_search_internal PARAMS((int, int, int));
f9267e15 357#endif
9255ee31 358extern int _rl_set_mark_at_pos PARAMS((int));
f9267e15 359
cc88a640
JK
360/* undo.c */
361extern UNDO_LIST *_rl_copy_undo_entry PARAMS((UNDO_LIST *));
362extern UNDO_LIST *_rl_copy_undo_list PARAMS((UNDO_LIST *));
363
f9267e15 364/* util.c */
cc88a640
JK
365#if defined (USE_VARARGS) && defined (PREFER_STDARG)
366extern void _rl_ttymsg (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
367extern void _rl_errmsg (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
368extern void _rl_trace (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
369#else
370extern void _rl_ttymsg ();
371extern void _rl_errmsg ();
372extern void _rl_trace ();
373#endif
374
375extern int _rl_tropen PARAMS((void));
376
9255ee31 377extern int _rl_abort_internal PARAMS((void));
cc88a640 378extern int _rl_null_function PARAMS((int, int));
9255ee31
EZ
379extern char *_rl_strindex PARAMS((const char *, const char *));
380extern int _rl_qsort_string_compare PARAMS((char **, char **));
381extern int (_rl_uppercase_p) PARAMS((int));
382extern int (_rl_lowercase_p) PARAMS((int));
383extern int (_rl_pure_alphabetic) PARAMS((int));
384extern int (_rl_digit_p) PARAMS((int));
385extern int (_rl_to_lower) PARAMS((int));
386extern int (_rl_to_upper) PARAMS((int));
387extern int (_rl_digit_value) PARAMS((int));
f9267e15
EZ
388
389/* vi_mode.c */
9255ee31
EZ
390extern void _rl_vi_initialize_line PARAMS((void));
391extern void _rl_vi_reset_last PARAMS((void));
392extern void _rl_vi_set_last PARAMS((int, int, int));
393extern int _rl_vi_textmod_command PARAMS((int));
394extern void _rl_vi_done_inserting PARAMS((void));
cc88a640 395extern int _rl_vi_domove_callback PARAMS((_rl_vimotion_cxt *));
f9267e15
EZ
396
397/*************************************************************************
398 * Undocumented private variables *
399 *************************************************************************/
400
9255ee31 401/* bind.c */
cc88a640
JK
402extern const char * const _rl_possible_control_prefixes[];
403extern const char * const _rl_possible_meta_prefixes[];
9255ee31 404
5bdf8622
DJ
405/* callback.c */
406extern _rl_callback_func_t *_rl_callback_func;
407extern _rl_callback_generic_arg *_rl_callback_data;
408
f9267e15
EZ
409/* complete.c */
410extern int _rl_complete_show_all;
5bdf8622 411extern int _rl_complete_show_unmodified;
f9267e15 412extern int _rl_complete_mark_directories;
9255ee31 413extern int _rl_complete_mark_symlink_dirs;
cc88a640
JK
414extern int _rl_completion_prefix_display_length;
415extern int _rl_completion_columns;
f9267e15
EZ
416extern int _rl_print_completions_horizontally;
417extern int _rl_completion_case_fold;
cc88a640 418extern int _rl_completion_case_map;
9255ee31
EZ
419extern int _rl_match_hidden_files;
420extern int _rl_page_completions;
cc88a640
JK
421extern int _rl_skip_completed_text;
422extern int _rl_menu_complete_prefix_first;
f9267e15
EZ
423
424/* display.c */
425extern int _rl_vis_botlin;
426extern int _rl_last_c_pos;
427extern int _rl_suppress_redisplay;
5bdf8622 428extern int _rl_want_redisplay;
f9267e15 429
f9267e15 430/* isearch.c */
9255ee31 431extern char *_rl_isearch_terminators;
f9267e15 432
5bdf8622
DJ
433extern _rl_search_cxt *_rl_iscxt;
434
f9267e15 435/* macro.c */
f9267e15
EZ
436extern char *_rl_executing_macro;
437
9255ee31
EZ
438/* misc.c */
439extern int _rl_history_preserve_point;
440extern int _rl_history_saved_point;
441
5bdf8622
DJ
442extern _rl_arg_cxt _rl_argcxt;
443
f9267e15 444/* readline.c */
cc88a640 445extern int _rl_echoing_p;
f9267e15
EZ
446extern int _rl_horizontal_scroll_mode;
447extern int _rl_mark_modified_lines;
448extern int _rl_bell_preference;
449extern int _rl_meta_flag;
450extern int _rl_convert_meta_chars_to_ascii;
451extern int _rl_output_meta_chars;
5bdf8622 452extern int _rl_bind_stty_chars;
cc88a640
JK
453extern int _rl_revert_all_at_newline;
454extern int _rl_echo_control_chars;
f9267e15
EZ
455extern char *_rl_comment_begin;
456extern unsigned char _rl_parsing_conditionalized_out;
457extern Keymap _rl_keymap;
458extern FILE *_rl_in_stream;
459extern FILE *_rl_out_stream;
460extern int _rl_last_command_was_kill;
461extern int _rl_eof_char;
cc88a640
JK
462extern procenv_t _rl_top_level;
463extern _rl_keyseq_cxt *_rl_kscxt;
f9267e15 464
5bdf8622
DJ
465/* search.c */
466extern _rl_search_cxt *_rl_nscxt;
467
cc88a640
JK
468/* signals.c */
469extern int _rl_interrupt_immediately;
470extern int volatile _rl_caught_signal;
471
472extern int _rl_echoctl;
473
474extern int _rl_intr_char;
475extern int _rl_quit_char;
476extern int _rl_susp_char;
477
f9267e15
EZ
478/* terminal.c */
479extern int _rl_enable_keypad;
480extern int _rl_enable_meta;
9255ee31
EZ
481extern char *_rl_term_clreol;
482extern char *_rl_term_clrpag;
483extern char *_rl_term_im;
484extern char *_rl_term_ic;
485extern char *_rl_term_ei;
486extern char *_rl_term_DC;
487extern char *_rl_term_up;
488extern char *_rl_term_dc;
489extern char *_rl_term_cr;
490extern char *_rl_term_IC;
cc88a640 491extern char *_rl_term_forward_char;
9255ee31
EZ
492extern int _rl_screenheight;
493extern int _rl_screenwidth;
494extern int _rl_screenchars;
495extern int _rl_terminal_can_insert;
f9267e15
EZ
496extern int _rl_term_autowrap;
497
498/* undo.c */
499extern int _rl_doing_an_undo;
500extern int _rl_undo_group_level;
501
5bdf8622
DJ
502/* vi_mode.c */
503extern int _rl_vi_last_command;
cc88a640 504extern _rl_vimotion_cxt *_rl_vimvcxt;
5bdf8622 505
f9267e15 506#endif /* _RL_PRIVATE_H_ */
This page took 0.544385 seconds and 4 git commands to generate.