1/* $FreeBSD: head/contrib/libreadline/readline.h 157188 2006-03-27 23:11:32Z ache $ */
2/* Readline.h -- the names of functions callable from within readline. */
3
4/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
5
6 This file is part of the GNU Readline Library, a library for
7 reading lines of text with interactive input and history editing.
8
9 The GNU Readline Library is free software; you can redistribute it
10 and/or modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2, or
12 (at your option) any later version.
13
14 The GNU Readline Library is distributed in the hope that it will be
15 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 The GNU General Public License is often shipped with GNU software, and
20 is generally kept in a file called COPYING or LICENSE. If you do not
21 have a copy of the license, write to the Free Software Foundation,
22 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
23
24#if !defined (_READLINE_H_)
25#define _READLINE_H_
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#if defined (READLINE_LIBRARY)
--- 4 unchanged lines hidden (view full) ---
36#else
37# include <readline/rlstdc.h>
38# include <readline/rltypedefs.h>
39# include <readline/keymaps.h>
40# include <readline/tilde.h>
41#endif
42
43/* Hex-encoded Readline version number. */
44#define RL_READLINE_VERSION 0x0501 /* Readline 5.1 */
45#define RL_VERSION_MAJOR 5
46#define RL_VERSION_MINOR 1
47
48/* Readline data structures. */
49
50/* Maintaining the state of undo. We remember individual deletes and inserts
51 on a chain of things to do. */
52
53/* The actions that undo knows how to undo. Notice that UNDO_DELETE means
54 to insert some text, and UNDO_INSERT means to delete some text. I.e.,
--- 182 unchanged lines hidden (view full) ---
237extern int rl_vi_movement_mode PARAMS((int, int));
238extern int rl_vi_arg_digit PARAMS((int, int));
239extern int rl_vi_change_case PARAMS((int, int));
240extern int rl_vi_put PARAMS((int, int));
241extern int rl_vi_column PARAMS((int, int));
242extern int rl_vi_delete_to PARAMS((int, int));
243extern int rl_vi_change_to PARAMS((int, int));
244extern int rl_vi_yank_to PARAMS((int, int));
245extern int rl_vi_rubout PARAMS((int, int));
246extern int rl_vi_delete PARAMS((int, int));
247extern int rl_vi_back_to_indent PARAMS((int, int));
248extern int rl_vi_first_print PARAMS((int, int));
249extern int rl_vi_char_search PARAMS((int, int));
250extern int rl_vi_match PARAMS((int, int));
251extern int rl_vi_change_char PARAMS((int, int));
252extern int rl_vi_subst PARAMS((int, int));
253extern int rl_vi_overstrike PARAMS((int, int));
--- 45 unchanged lines hidden (view full) ---
299extern int rl_bind_key_if_unbound_in_map PARAMS((int, rl_command_func_t *, Keymap));
300extern int rl_unbind_function_in_map PARAMS((rl_command_func_t *, Keymap));
301extern int rl_unbind_command_in_map PARAMS((const char *, Keymap));
302extern int rl_bind_keyseq PARAMS((const char *, rl_command_func_t *));
303extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
304extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));
305extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
306extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
307
308extern char *rl_variable_value PARAMS((const char *));
309extern int rl_variable_bind PARAMS((const char *, const char *));
310
311/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
312extern int rl_set_key PARAMS((const char *, rl_command_func_t *, Keymap));
313
314/* Backwards compatibility, use rl_generic_bind instead. */
315extern int rl_macro_bind PARAMS((const char *, const char *, Keymap));
316
--- 83 unchanged lines hidden (view full) ---
400extern void rl_deprep_terminal PARAMS((void));
401extern void rl_tty_set_default_bindings PARAMS((Keymap));
402extern void rl_tty_unset_default_bindings PARAMS((Keymap));
403
404extern int rl_reset_terminal PARAMS((const char *));
405extern void rl_resize_terminal PARAMS((void));
406extern void rl_set_screen_size PARAMS((int, int));
407extern void rl_get_screen_size PARAMS((int *, int *));
408extern void rl_reset_screen_size PARAMS((void));
409
410extern char *rl_get_termcap PARAMS((const char *));
411
412/* Functions for character input. */
413extern int rl_stuff_char PARAMS((int));
414extern int rl_execute_next PARAMS((int));
415extern int rl_clear_pending_input PARAMS((void));
416extern int rl_read_key PARAMS((void));
--- 111 unchanged lines hidden (view full) ---
528
529/* The name of the terminal to use. */
530extern const char *rl_terminal_name;
531
532/* The input and output streams. */
533extern FILE *rl_instream;
534extern FILE *rl_outstream;
535
536/* If non-zero, Readline gives values of LINES and COLUMNS from the environment
537 greater precedence than values fetched from the kernel when computing the
538 screen dimensions. */
539extern int rl_prefer_env_winsize;
540
541/* If non-zero, then this is the address of a function to call just
542 before readline_internal () prints the first prompt. */
543extern rl_hook_func_t *rl_startup_hook;
544
545/* If non-zero, this is the address of a function to call just before
546 readline_internal_setup () returns and readline_internal starts
547 reading input characters. */
548extern rl_hook_func_t *rl_pre_input_hook;
--- 215 unchanged lines hidden (view full) ---
764
765/* Possible values for do_replace argument to rl_filename_quoting_function,
766 called by rl_complete_internal. */
767#define NO_MATCH 0
768#define SINGLE_MATCH 1
769#define MULT_MATCH 2
770
771/* Possible state values for rl_readline_state */
772#define RL_STATE_NONE 0x000000 /* no state; before first call */
773
774#define RL_STATE_INITIALIZING 0x000001 /* initializing */
775#define RL_STATE_INITIALIZED 0x000002 /* initialization done */
776#define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */
777#define RL_STATE_READCMD 0x000008 /* reading a command key */
778#define RL_STATE_METANEXT 0x000010 /* reading input after ESC */
779#define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */
780#define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */
781#define RL_STATE_ISEARCH 0x000080 /* doing incremental search */
782#define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */
783#define RL_STATE_SEARCH 0x000200 /* doing a history search */
784#define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */
785#define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */
786#define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */
787#define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */
788#define RL_STATE_COMPLETING 0x004000 /* doing completion */
789#define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */
790#define RL_STATE_UNDOING 0x010000 /* doing an undo */
791#define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */
792#define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */
793#define RL_STATE_CALLBACK 0x080000 /* using the callback interface */
794#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */
795#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
796#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
797
798#define RL_STATE_DONE 0x800000 /* done; accepted line */
799
800#define RL_SETSTATE(x) (rl_readline_state |= (x))
801#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
802#define RL_ISSTATE(x) (rl_readline_state & (x))
803
804struct readline_state {
805 /* line state */
806 int point;
--- 51 unchanged lines hidden ---
2/* Readline.h -- the names of functions callable from within readline. */
3
4/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
5
6 This file is part of the GNU Readline Library, a library for
7 reading lines of text with interactive input and history editing.
8
9 The GNU Readline Library is free software; you can redistribute it
10 and/or modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2, or
12 (at your option) any later version.
13
14 The GNU Readline Library is distributed in the hope that it will be
15 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 The GNU General Public License is often shipped with GNU software, and
20 is generally kept in a file called COPYING or LICENSE. If you do not
21 have a copy of the license, write to the Free Software Foundation,
22 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
23
24#if !defined (_READLINE_H_)
25#define _READLINE_H_
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#if defined (READLINE_LIBRARY)
--- 4 unchanged lines hidden (view full) ---
36#else
37# include <readline/rlstdc.h>
38# include <readline/rltypedefs.h>
39# include <readline/keymaps.h>
40# include <readline/tilde.h>
41#endif
42
43/* Hex-encoded Readline version number. */
44#define RL_READLINE_VERSION 0x0501 /* Readline 5.1 */
45#define RL_VERSION_MAJOR 5
46#define RL_VERSION_MINOR 1
47
48/* Readline data structures. */
49
50/* Maintaining the state of undo. We remember individual deletes and inserts
51 on a chain of things to do. */
52
53/* The actions that undo knows how to undo. Notice that UNDO_DELETE means
54 to insert some text, and UNDO_INSERT means to delete some text. I.e.,
--- 182 unchanged lines hidden (view full) ---
237extern int rl_vi_movement_mode PARAMS((int, int));
238extern int rl_vi_arg_digit PARAMS((int, int));
239extern int rl_vi_change_case PARAMS((int, int));
240extern int rl_vi_put PARAMS((int, int));
241extern int rl_vi_column PARAMS((int, int));
242extern int rl_vi_delete_to PARAMS((int, int));
243extern int rl_vi_change_to PARAMS((int, int));
244extern int rl_vi_yank_to PARAMS((int, int));
245extern int rl_vi_rubout PARAMS((int, int));
246extern int rl_vi_delete PARAMS((int, int));
247extern int rl_vi_back_to_indent PARAMS((int, int));
248extern int rl_vi_first_print PARAMS((int, int));
249extern int rl_vi_char_search PARAMS((int, int));
250extern int rl_vi_match PARAMS((int, int));
251extern int rl_vi_change_char PARAMS((int, int));
252extern int rl_vi_subst PARAMS((int, int));
253extern int rl_vi_overstrike PARAMS((int, int));
--- 45 unchanged lines hidden (view full) ---
299extern int rl_bind_key_if_unbound_in_map PARAMS((int, rl_command_func_t *, Keymap));
300extern int rl_unbind_function_in_map PARAMS((rl_command_func_t *, Keymap));
301extern int rl_unbind_command_in_map PARAMS((const char *, Keymap));
302extern int rl_bind_keyseq PARAMS((const char *, rl_command_func_t *));
303extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
304extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));
305extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
306extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
307
308extern char *rl_variable_value PARAMS((const char *));
309extern int rl_variable_bind PARAMS((const char *, const char *));
310
311/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
312extern int rl_set_key PARAMS((const char *, rl_command_func_t *, Keymap));
313
314/* Backwards compatibility, use rl_generic_bind instead. */
315extern int rl_macro_bind PARAMS((const char *, const char *, Keymap));
316
--- 83 unchanged lines hidden (view full) ---
400extern void rl_deprep_terminal PARAMS((void));
401extern void rl_tty_set_default_bindings PARAMS((Keymap));
402extern void rl_tty_unset_default_bindings PARAMS((Keymap));
403
404extern int rl_reset_terminal PARAMS((const char *));
405extern void rl_resize_terminal PARAMS((void));
406extern void rl_set_screen_size PARAMS((int, int));
407extern void rl_get_screen_size PARAMS((int *, int *));
408extern void rl_reset_screen_size PARAMS((void));
409
410extern char *rl_get_termcap PARAMS((const char *));
411
412/* Functions for character input. */
413extern int rl_stuff_char PARAMS((int));
414extern int rl_execute_next PARAMS((int));
415extern int rl_clear_pending_input PARAMS((void));
416extern int rl_read_key PARAMS((void));
--- 111 unchanged lines hidden (view full) ---
528
529/* The name of the terminal to use. */
530extern const char *rl_terminal_name;
531
532/* The input and output streams. */
533extern FILE *rl_instream;
534extern FILE *rl_outstream;
535
536/* If non-zero, Readline gives values of LINES and COLUMNS from the environment
537 greater precedence than values fetched from the kernel when computing the
538 screen dimensions. */
539extern int rl_prefer_env_winsize;
540
541/* If non-zero, then this is the address of a function to call just
542 before readline_internal () prints the first prompt. */
543extern rl_hook_func_t *rl_startup_hook;
544
545/* If non-zero, this is the address of a function to call just before
546 readline_internal_setup () returns and readline_internal starts
547 reading input characters. */
548extern rl_hook_func_t *rl_pre_input_hook;
--- 215 unchanged lines hidden (view full) ---
764
765/* Possible values for do_replace argument to rl_filename_quoting_function,
766 called by rl_complete_internal. */
767#define NO_MATCH 0
768#define SINGLE_MATCH 1
769#define MULT_MATCH 2
770
771/* Possible state values for rl_readline_state */
772#define RL_STATE_NONE 0x000000 /* no state; before first call */
773
774#define RL_STATE_INITIALIZING 0x000001 /* initializing */
775#define RL_STATE_INITIALIZED 0x000002 /* initialization done */
776#define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */
777#define RL_STATE_READCMD 0x000008 /* reading a command key */
778#define RL_STATE_METANEXT 0x000010 /* reading input after ESC */
779#define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */
780#define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */
781#define RL_STATE_ISEARCH 0x000080 /* doing incremental search */
782#define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */
783#define RL_STATE_SEARCH 0x000200 /* doing a history search */
784#define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */
785#define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */
786#define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */
787#define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */
788#define RL_STATE_COMPLETING 0x004000 /* doing completion */
789#define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */
790#define RL_STATE_UNDOING 0x010000 /* doing an undo */
791#define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */
792#define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */
793#define RL_STATE_CALLBACK 0x080000 /* using the callback interface */
794#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */
795#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
796#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
797
798#define RL_STATE_DONE 0x800000 /* done; accepted line */
799
800#define RL_SETSTATE(x) (rl_readline_state |= (x))
801#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
802#define RL_ISSTATE(x) (rl_readline_state & (x))
803
804struct readline_state {
805 /* line state */
806 int point;
--- 51 unchanged lines hidden ---