11/* Readline.h -- the names of functions callable from within readline. */
22
3- /* Copyright (C) 1987-2022 Free Software Foundation, Inc.
3+ /* Copyright (C) 1987-2024 Free Software Foundation, Inc.
44
55 This file is part of the GNU Readline Library (Readline), a library
66 for reading lines of text with interactive input and history editing.
@@ -39,9 +39,9 @@ extern "C" {
3939#endif
4040
4141/* Hex-encoded Readline version number. */
42- #define RL_READLINE_VERSION 0x0802 /* Readline 8.2 */
42+ #define RL_READLINE_VERSION 0x0803 /* Readline 8.3 */
4343#define RL_VERSION_MAJOR 8
44- #define RL_VERSION_MINOR 2
44+ #define RL_VERSION_MINOR 3
4545
4646/* Readline data structures. */
4747
@@ -160,6 +160,7 @@ extern int rl_insert_completions (int, int);
160160extern int rl_old_menu_complete (int , int );
161161extern int rl_menu_complete (int , int );
162162extern int rl_backward_menu_complete (int , int );
163+ extern int rl_export_completions (int , int );
163164
164165/* Bindable commands for killing and yanking text, and managing the kill ring. */
165166extern int rl_kill_word (int , int );
@@ -209,6 +210,8 @@ extern int rl_stop_output (int, int);
209210extern int rl_abort (int , int );
210211extern int rl_tty_status (int , int );
211212
213+ extern int rl_execute_named_command (int , int );
214+
212215/* Bindable commands for incremental and non-incremental history searching. */
213216extern int rl_history_search_forward (int , int );
214217extern int rl_history_search_backward (int , int );
@@ -341,7 +344,9 @@ extern int rl_trim_arg_from_keyseq (const char *, size_t, Keymap);
341344extern void rl_list_funmap_names (void );
342345extern char * * rl_invoking_keyseqs_in_map (rl_command_func_t * , Keymap );
343346extern char * * rl_invoking_keyseqs (rl_command_func_t * );
344-
347+
348+ extern void rl_print_keybinding (const char * , Keymap , int );
349+
345350extern void rl_function_dumper (int );
346351extern void rl_macro_dumper (int );
347352extern void rl_variable_dumper (int );
@@ -404,11 +409,7 @@ extern void rl_activate_mark (void);
404409extern void rl_deactivate_mark (void );
405410extern int rl_mark_active_p (void );
406411
407- #if defined (USE_VARARGS ) && defined (PREFER_STDARG )
408412extern int rl_message (const char * , ...) __attribute__((__format__ (printf , 1 , 2 )));
409- #else
410- extern int rl_message ();
411- #endif
412413
413414extern int rl_show_char (int );
414415
@@ -441,6 +442,7 @@ extern void rl_get_screen_size (int *, int *);
441442extern void rl_reset_screen_size (void );
442443
443444extern char * rl_get_termcap (const char * );
445+ extern void rl_reparse_colors (void );
444446
445447/* Functions for character input. */
446448extern int rl_stuff_char (int );
@@ -627,6 +629,8 @@ extern rl_voidfunc_t *rl_redisplay_function;
627629extern rl_vintfunc_t * rl_prep_term_function ;
628630extern rl_voidfunc_t * rl_deprep_term_function ;
629631
632+ extern rl_macro_print_func_t * rl_macro_display_hook ;
633+
630634/* Dispatch variables. */
631635extern Keymap rl_executing_keymap ;
632636extern Keymap rl_binding_keymap ;
@@ -770,6 +774,19 @@ extern rl_icppfunc_t *rl_filename_stat_hook;
770774 converted. */
771775extern rl_dequote_func_t * rl_filename_rewrite_hook ;
772776
777+ /* If non-zero, this is the address of a function to call before
778+ comparing the filename portion of a word to be completed with directory
779+ entries from the filesystem. This takes the address of the partial word
780+ to be completed, after any rl_filename_dequoting_function has been applied.
781+ The function should either return its first argument (if no conversion
782+ takes place) or newly-allocated memory. This can, for instance, convert
783+ the filename portion of the completion word to a character set suitable
784+ for comparison against directory entries read from the filesystem (after
785+ their potential modification by rl_filename_rewrite_hook).
786+ The returned value is what is added to the list of matches.
787+ The second argument is the length of the filename to be converted. */
788+ extern rl_dequote_func_t * rl_completion_rewrite_hook ;
789+
773790/* Backwards compatibility with previous versions of readline. */
774791#define rl_symbolic_link_hook rl_directory_completion_hook
775792
@@ -794,6 +811,12 @@ extern int rl_filename_completion_desired;
794811 entry finder function. */
795812extern int rl_filename_quoting_desired ;
796813
814+ /* Non-zero means we should apply filename-type quoting to all completions
815+ even if we are not otherwise treating the matches as filenames. This is
816+ ALWAYS zero on entry, and can only be changed within a completion entry
817+ finder function. */
818+ extern int rl_full_quoting_desired ;
819+
797820/* Set to a function to quote a filename in an application-specific fashion.
798821 Called with the text to quote, the type of match found (single or multiple)
799822 and a pointer to the quoting character to be used, which the function can
@@ -892,37 +915,40 @@ extern int rl_persistent_signal_handlers;
892915#define MULT_MATCH 2
893916
894917/* Possible state values for rl_readline_state */
895- #define RL_STATE_NONE 0x000000 /* no state; before first call */
896-
897- #define RL_STATE_INITIALIZING 0x0000001 /* initializing */
898- #define RL_STATE_INITIALIZED 0x0000002 /* initialization done */
899- #define RL_STATE_TERMPREPPED 0x0000004 /* terminal is prepped */
900- #define RL_STATE_READCMD 0x0000008 /* reading a command key */
901- #define RL_STATE_METANEXT 0x0000010 /* reading input after ESC */
902- #define RL_STATE_DISPATCHING 0x0000020 /* dispatching to a command */
903- #define RL_STATE_MOREINPUT 0x0000040 /* reading more input in a command function */
904- #define RL_STATE_ISEARCH 0x0000080 /* doing incremental search */
905- #define RL_STATE_NSEARCH 0x0000100 /* doing non-inc search */
906- #define RL_STATE_SEARCH 0x0000200 /* doing a history search */
907- #define RL_STATE_NUMERICARG 0x0000400 /* reading numeric argument */
908- #define RL_STATE_MACROINPUT 0x0000800 /* getting input from a macro */
909- #define RL_STATE_MACRODEF 0x0001000 /* defining keyboard macro */
910- #define RL_STATE_OVERWRITE 0x0002000 /* overwrite mode */
911- #define RL_STATE_COMPLETING 0x0004000 /* doing completion */
912- #define RL_STATE_SIGHANDLER 0x0008000 /* in readline sighandler */
913- #define RL_STATE_UNDOING 0x0010000 /* doing an undo */
914- #define RL_STATE_INPUTPENDING 0x0020000 /* rl_execute_next called */
915- #define RL_STATE_TTYCSAVED 0x0040000 /* tty special chars saved */
916- #define RL_STATE_CALLBACK 0x0080000 /* using the callback interface */
917- #define RL_STATE_VIMOTION 0x0100000 /* reading vi motion arg */
918- #define RL_STATE_MULTIKEY 0x0200000 /* reading multiple-key command */
919- #define RL_STATE_VICMDONCE 0x0400000 /* entered vi command mode at least once */
920- #define RL_STATE_CHARSEARCH 0x0800000 /* vi mode char search */
921- #define RL_STATE_REDISPLAYING 0x1000000 /* updating terminal display */
922-
923- #define RL_STATE_DONE 0x2000000 /* done; accepted line */
924- #define RL_STATE_TIMEOUT 0x4000000 /* done; timed out */
925- #define RL_STATE_EOF 0x8000000 /* done; got eof on read */
918+ #define RL_STATE_NONE 0x0000000 /* no state; before first call */
919+
920+ #define RL_STATE_INITIALIZING 0x00000001 /* initializing */
921+ #define RL_STATE_INITIALIZED 0x00000002 /* initialization done */
922+ #define RL_STATE_TERMPREPPED 0x00000004 /* terminal is prepped */
923+ #define RL_STATE_READCMD 0x00000008 /* reading a command key */
924+ #define RL_STATE_METANEXT 0x00000010 /* reading input after ESC */
925+ #define RL_STATE_DISPATCHING 0x00000020 /* dispatching to a command */
926+ #define RL_STATE_MOREINPUT 0x00000040 /* reading more input in a command function */
927+ #define RL_STATE_ISEARCH 0x00000080 /* doing incremental search */
928+ #define RL_STATE_NSEARCH 0x00000100 /* doing non-inc search */
929+ #define RL_STATE_SEARCH 0x00000200 /* doing a history search */
930+ #define RL_STATE_NUMERICARG 0x00000400 /* reading numeric argument */
931+ #define RL_STATE_MACROINPUT 0x00000800 /* getting input from a macro */
932+ #define RL_STATE_MACRODEF 0x00001000 /* defining keyboard macro */
933+ #define RL_STATE_OVERWRITE 0x00002000 /* overwrite mode */
934+ #define RL_STATE_COMPLETING 0x00004000 /* doing completion */
935+ #define RL_STATE_SIGHANDLER 0x00008000 /* in readline sighandler */
936+ #define RL_STATE_UNDOING 0x00010000 /* doing an undo */
937+ #define RL_STATE_INPUTPENDING 0x00020000 /* rl_execute_next called */
938+ #define RL_STATE_TTYCSAVED 0x00040000 /* tty special chars saved */
939+ #define RL_STATE_CALLBACK 0x00080000 /* using the callback interface */
940+ #define RL_STATE_VIMOTION 0x00100000 /* reading vi motion arg */
941+ #define RL_STATE_MULTIKEY 0x00200000 /* reading multiple-key command */
942+ #define RL_STATE_VICMDONCE 0x00400000 /* entered vi command mode at least once */
943+ #define RL_STATE_CHARSEARCH 0x00800000 /* vi mode char search */
944+ #define RL_STATE_REDISPLAYING 0x01000000 /* updating terminal display */
945+
946+ #define RL_STATE_DONE 0x02000000 /* done; accepted line */
947+ #define RL_STATE_TIMEOUT 0x04000000 /* done; timed out */
948+ #define RL_STATE_EOF 0x08000000 /* done; got eof on read */
949+
950+ /* Rearrange these for next major version */
951+ #define RL_STATE_READSTR 0x10000000 /* reading a string for M-x */
926952
927953#define RL_SETSTATE (x ) (rl_readline_state |= (x))
928954#define RL_UNSETSTATE (x ) (rl_readline_state &= ~(x))
@@ -939,7 +965,7 @@ struct readline_state {
939965 char * prompt ;
940966
941967 /* global state */
942- int rlstate ;
968+ int rlstate ; /* XXX -- needs to be unsigned long */
943969 int done ;
944970 Keymap kmap ;
945971
0 commit comments