File indexing completed on 2025-01-18 10:10:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined (_READLINE_H_)
0023 #define _READLINE_H_
0024
0025 #ifdef __cplusplus
0026 extern "C" {
0027 #endif
0028
0029 #if defined (READLINE_LIBRARY)
0030 # include "rlstdc.h"
0031 # include "rltypedefs.h"
0032 # include "keymaps.h"
0033 # include "tilde.h"
0034 #else
0035 # include <readline/rlstdc.h>
0036 # include <readline/rltypedefs.h>
0037 # include <readline/keymaps.h>
0038 # include <readline/tilde.h>
0039 #endif
0040
0041
0042 #define RL_READLINE_VERSION 0x0802
0043 #define RL_VERSION_MAJOR 8
0044 #define RL_VERSION_MINOR 2
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
0055
0056
0057 typedef struct undo_list {
0058 struct undo_list *next;
0059 int start, end;
0060 char *text;
0061 enum undo_code what;
0062 } UNDO_LIST;
0063
0064
0065 extern UNDO_LIST *rl_undo_list;
0066
0067
0068 typedef struct _funmap {
0069 const char *name;
0070 rl_command_func_t *function;
0071 } FUNMAP;
0072
0073 extern FUNMAP **funmap;
0074
0075
0076
0077
0078
0079
0080
0081
0082 extern int rl_digit_argument (int, int);
0083 extern int rl_universal_argument (int, int);
0084
0085
0086 extern int rl_forward_byte (int, int);
0087 extern int rl_forward_char (int, int);
0088 extern int rl_forward (int, int);
0089 extern int rl_backward_byte (int, int);
0090 extern int rl_backward_char (int, int);
0091 extern int rl_backward (int, int);
0092 extern int rl_beg_of_line (int, int);
0093 extern int rl_end_of_line (int, int);
0094 extern int rl_forward_word (int, int);
0095 extern int rl_backward_word (int, int);
0096 extern int rl_refresh_line (int, int);
0097 extern int rl_clear_screen (int, int);
0098 extern int rl_clear_display (int, int);
0099 extern int rl_skip_csi_sequence (int, int);
0100 extern int rl_arrow_keys (int, int);
0101
0102 extern int rl_previous_screen_line (int, int);
0103 extern int rl_next_screen_line (int, int);
0104
0105
0106 extern int rl_insert (int, int);
0107 extern int rl_quoted_insert (int, int);
0108 extern int rl_tab_insert (int, int);
0109 extern int rl_newline (int, int);
0110 extern int rl_do_lowercase_version (int, int);
0111 extern int rl_rubout (int, int);
0112 extern int rl_delete (int, int);
0113 extern int rl_rubout_or_delete (int, int);
0114 extern int rl_delete_horizontal_space (int, int);
0115 extern int rl_delete_or_show_completions (int, int);
0116 extern int rl_insert_comment (int, int);
0117
0118
0119 extern int rl_upcase_word (int, int);
0120 extern int rl_downcase_word (int, int);
0121 extern int rl_capitalize_word (int, int);
0122
0123
0124 extern int rl_transpose_words (int, int);
0125 extern int rl_transpose_chars (int, int);
0126
0127
0128 extern int rl_char_search (int, int);
0129 extern int rl_backward_char_search (int, int);
0130
0131
0132 extern int rl_beginning_of_history (int, int);
0133 extern int rl_end_of_history (int, int);
0134 extern int rl_get_next_history (int, int);
0135 extern int rl_get_previous_history (int, int);
0136 extern int rl_operate_and_get_next (int, int);
0137 extern int rl_fetch_history (int, int);
0138
0139
0140 extern int rl_set_mark (int, int);
0141 extern int rl_exchange_point_and_mark (int, int);
0142
0143
0144 extern int rl_vi_editing_mode (int, int);
0145 extern int rl_emacs_editing_mode (int, int);
0146
0147
0148 extern int rl_overwrite_mode (int, int);
0149
0150
0151 extern int rl_re_read_init_file (int, int);
0152 extern int rl_dump_functions (int, int);
0153 extern int rl_dump_macros (int, int);
0154 extern int rl_dump_variables (int, int);
0155
0156
0157 extern int rl_complete (int, int);
0158 extern int rl_possible_completions (int, int);
0159 extern int rl_insert_completions (int, int);
0160 extern int rl_old_menu_complete (int, int);
0161 extern int rl_menu_complete (int, int);
0162 extern int rl_backward_menu_complete (int, int);
0163
0164
0165 extern int rl_kill_word (int, int);
0166 extern int rl_backward_kill_word (int, int);
0167 extern int rl_kill_line (int, int);
0168 extern int rl_backward_kill_line (int, int);
0169 extern int rl_kill_full_line (int, int);
0170 extern int rl_unix_word_rubout (int, int);
0171 extern int rl_unix_filename_rubout (int, int);
0172 extern int rl_unix_line_discard (int, int);
0173 extern int rl_copy_region_to_kill (int, int);
0174 extern int rl_kill_region (int, int);
0175 extern int rl_copy_forward_word (int, int);
0176 extern int rl_copy_backward_word (int, int);
0177 extern int rl_yank (int, int);
0178 extern int rl_yank_pop (int, int);
0179 extern int rl_yank_nth_arg (int, int);
0180 extern int rl_yank_last_arg (int, int);
0181 extern int rl_bracketed_paste_begin (int, int);
0182
0183 #if defined (_WIN32)
0184 extern int rl_paste_from_clipboard (int, int);
0185 #endif
0186
0187
0188 extern int rl_reverse_search_history (int, int);
0189 extern int rl_forward_search_history (int, int);
0190
0191
0192 extern int rl_start_kbd_macro (int, int);
0193 extern int rl_end_kbd_macro (int, int);
0194 extern int rl_call_last_kbd_macro (int, int);
0195 extern int rl_print_last_kbd_macro (int, int);
0196
0197
0198 extern int rl_revert_line (int, int);
0199 extern int rl_undo_command (int, int);
0200
0201
0202 extern int rl_tilde_expand (int, int);
0203
0204
0205 extern int rl_restart_output (int, int);
0206 extern int rl_stop_output (int, int);
0207
0208
0209 extern int rl_abort (int, int);
0210 extern int rl_tty_status (int, int);
0211
0212
0213 extern int rl_history_search_forward (int, int);
0214 extern int rl_history_search_backward (int, int);
0215 extern int rl_history_substr_search_forward (int, int);
0216 extern int rl_history_substr_search_backward (int, int);
0217 extern int rl_noninc_forward_search (int, int);
0218 extern int rl_noninc_reverse_search (int, int);
0219 extern int rl_noninc_forward_search_again (int, int);
0220 extern int rl_noninc_reverse_search_again (int, int);
0221
0222
0223 extern int rl_insert_close (int, int);
0224
0225
0226 extern void rl_callback_handler_install (const char *, rl_vcpfunc_t *);
0227 extern void rl_callback_read_char (void);
0228 extern void rl_callback_handler_remove (void);
0229 extern void rl_callback_sigcleanup (void);
0230
0231
0232
0233 extern int rl_vi_redo (int, int);
0234 extern int rl_vi_undo (int, int);
0235 extern int rl_vi_yank_arg (int, int);
0236 extern int rl_vi_fetch_history (int, int);
0237 extern int rl_vi_search_again (int, int);
0238 extern int rl_vi_search (int, int);
0239 extern int rl_vi_complete (int, int);
0240 extern int rl_vi_tilde_expand (int, int);
0241 extern int rl_vi_prev_word (int, int);
0242 extern int rl_vi_next_word (int, int);
0243 extern int rl_vi_end_word (int, int);
0244 extern int rl_vi_insert_beg (int, int);
0245 extern int rl_vi_append_mode (int, int);
0246 extern int rl_vi_append_eol (int, int);
0247 extern int rl_vi_eof_maybe (int, int);
0248 extern int rl_vi_insertion_mode (int, int);
0249 extern int rl_vi_insert_mode (int, int);
0250 extern int rl_vi_movement_mode (int, int);
0251 extern int rl_vi_arg_digit (int, int);
0252 extern int rl_vi_change_case (int, int);
0253 extern int rl_vi_put (int, int);
0254 extern int rl_vi_column (int, int);
0255 extern int rl_vi_delete_to (int, int);
0256 extern int rl_vi_change_to (int, int);
0257 extern int rl_vi_yank_to (int, int);
0258 extern int rl_vi_yank_pop (int, int);
0259 extern int rl_vi_rubout (int, int);
0260 extern int rl_vi_delete (int, int);
0261 extern int rl_vi_back_to_indent (int, int);
0262 extern int rl_vi_unix_word_rubout (int, int);
0263 extern int rl_vi_first_print (int, int);
0264 extern int rl_vi_char_search (int, int);
0265 extern int rl_vi_match (int, int);
0266 extern int rl_vi_change_char (int, int);
0267 extern int rl_vi_subst (int, int);
0268 extern int rl_vi_overstrike (int, int);
0269 extern int rl_vi_overstrike_delete (int, int);
0270 extern int rl_vi_replace (int, int);
0271 extern int rl_vi_set_mark (int, int);
0272 extern int rl_vi_goto_mark (int, int);
0273
0274
0275 extern int rl_vi_check (void);
0276 extern int rl_vi_domove (int, int *);
0277 extern int rl_vi_bracktype (int);
0278
0279 extern void rl_vi_start_inserting (int, int, int);
0280
0281
0282 extern int rl_vi_fWord (int, int);
0283 extern int rl_vi_bWord (int, int);
0284 extern int rl_vi_eWord (int, int);
0285 extern int rl_vi_fword (int, int);
0286 extern int rl_vi_bword (int, int);
0287 extern int rl_vi_eword (int, int);
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297 extern char *readline (const char *);
0298
0299 extern int rl_set_prompt (const char *);
0300 extern int rl_expand_prompt (char *);
0301
0302 extern int rl_initialize (void);
0303
0304
0305 extern int rl_discard_argument (void);
0306
0307
0308 extern int rl_add_defun (const char *, rl_command_func_t *, int);
0309 extern int rl_bind_key (int, rl_command_func_t *);
0310 extern int rl_bind_key_in_map (int, rl_command_func_t *, Keymap);
0311 extern int rl_unbind_key (int);
0312 extern int rl_unbind_key_in_map (int, Keymap);
0313 extern int rl_bind_key_if_unbound (int, rl_command_func_t *);
0314 extern int rl_bind_key_if_unbound_in_map (int, rl_command_func_t *, Keymap);
0315 extern int rl_unbind_function_in_map (rl_command_func_t *, Keymap);
0316 extern int rl_unbind_command_in_map (const char *, Keymap);
0317 extern int rl_bind_keyseq (const char *, rl_command_func_t *);
0318 extern int rl_bind_keyseq_in_map (const char *, rl_command_func_t *, Keymap);
0319 extern int rl_bind_keyseq_if_unbound (const char *, rl_command_func_t *);
0320 extern int rl_bind_keyseq_if_unbound_in_map (const char *, rl_command_func_t *, Keymap);
0321 extern int rl_generic_bind (int, const char *, char *, Keymap);
0322
0323 extern char *rl_variable_value (const char *);
0324 extern int rl_variable_bind (const char *, const char *);
0325
0326
0327 extern int rl_set_key (const char *, rl_command_func_t *, Keymap);
0328
0329
0330 extern int rl_macro_bind (const char *, const char *, Keymap);
0331
0332
0333 extern int rl_translate_keyseq (const char *, char *, int *);
0334 extern char *rl_untranslate_keyseq (int);
0335
0336 extern rl_command_func_t *rl_named_function (const char *);
0337 extern rl_command_func_t *rl_function_of_keyseq (const char *, Keymap, int *);
0338 extern rl_command_func_t *rl_function_of_keyseq_len (const char *, size_t, Keymap, int *);
0339 extern int rl_trim_arg_from_keyseq (const char *, size_t, Keymap);
0340
0341 extern void rl_list_funmap_names (void);
0342 extern char **rl_invoking_keyseqs_in_map (rl_command_func_t *, Keymap);
0343 extern char **rl_invoking_keyseqs (rl_command_func_t *);
0344
0345 extern void rl_function_dumper (int);
0346 extern void rl_macro_dumper (int);
0347 extern void rl_variable_dumper (int);
0348
0349 extern int rl_read_init_file (const char *);
0350 extern int rl_parse_and_bind (char *);
0351
0352
0353 extern Keymap rl_make_bare_keymap (void);
0354 extern int rl_empty_keymap (Keymap);
0355 extern Keymap rl_copy_keymap (Keymap);
0356 extern Keymap rl_make_keymap (void);
0357 extern void rl_discard_keymap (Keymap);
0358 extern void rl_free_keymap (Keymap);
0359
0360 extern Keymap rl_get_keymap_by_name (const char *);
0361 extern char *rl_get_keymap_name (Keymap);
0362 extern void rl_set_keymap (Keymap);
0363 extern Keymap rl_get_keymap (void);
0364
0365 extern int rl_set_keymap_name (const char *, Keymap);
0366
0367
0368 extern void rl_set_keymap_from_edit_mode (void);
0369 extern char *rl_get_keymap_name_from_edit_mode (void);
0370
0371
0372 extern int rl_add_funmap_entry (const char *, rl_command_func_t *);
0373 extern const char **rl_funmap_names (void);
0374
0375
0376 extern void rl_initialize_funmap (void);
0377
0378
0379 extern void rl_push_macro_input (char *);
0380
0381
0382 extern void rl_add_undo (enum undo_code, int, int, char *);
0383 extern void rl_free_undo_list (void);
0384 extern int rl_do_undo (void);
0385 extern int rl_begin_undo_group (void);
0386 extern int rl_end_undo_group (void);
0387 extern int rl_modifying (int, int);
0388
0389
0390 extern void rl_redisplay (void);
0391 extern int rl_on_new_line (void);
0392 extern int rl_on_new_line_with_prompt (void);
0393 extern int rl_forced_update_display (void);
0394 extern int rl_clear_visible_line (void);
0395 extern int rl_clear_message (void);
0396 extern int rl_reset_line_state (void);
0397 extern int rl_crlf (void);
0398
0399
0400
0401 extern void rl_keep_mark_active (void);
0402
0403 extern void rl_activate_mark (void);
0404 extern void rl_deactivate_mark (void);
0405 extern int rl_mark_active_p (void);
0406
0407 #if defined (USE_VARARGS) && defined (PREFER_STDARG)
0408 extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
0409 #else
0410 extern int rl_message ();
0411 #endif
0412
0413 extern int rl_show_char (int);
0414
0415
0416 extern int rl_character_len (int, int);
0417 extern void rl_redraw_prompt_last_line (void);
0418
0419
0420 extern void rl_save_prompt (void);
0421 extern void rl_restore_prompt (void);
0422
0423
0424 extern void rl_replace_line (const char *, int);
0425 extern int rl_insert_text (const char *);
0426 extern int rl_delete_text (int, int);
0427 extern int rl_kill_text (int, int);
0428 extern char *rl_copy_text (int, int);
0429
0430
0431 extern void rl_prep_terminal (int);
0432 extern void rl_deprep_terminal (void);
0433 extern void rl_tty_set_default_bindings (Keymap);
0434 extern void rl_tty_unset_default_bindings (Keymap);
0435
0436 extern int rl_tty_set_echoing (int);
0437 extern int rl_reset_terminal (const char *);
0438 extern void rl_resize_terminal (void);
0439 extern void rl_set_screen_size (int, int);
0440 extern void rl_get_screen_size (int *, int *);
0441 extern void rl_reset_screen_size (void);
0442
0443 extern char *rl_get_termcap (const char *);
0444
0445
0446 extern int rl_stuff_char (int);
0447 extern int rl_execute_next (int);
0448 extern int rl_clear_pending_input (void);
0449 extern int rl_read_key (void);
0450 extern int rl_getc (FILE *);
0451 extern int rl_set_keyboard_input_timeout (int);
0452
0453
0454 extern int rl_set_timeout (unsigned int, unsigned int);
0455 extern int rl_timeout_remaining (unsigned int *, unsigned int *);
0456
0457 #undef rl_clear_timeout
0458 #define rl_clear_timeout() rl_set_timeout (0, 0)
0459
0460
0461 extern void rl_extend_line_buffer (int);
0462 extern int rl_ding (void);
0463 extern int rl_alphabetic (int);
0464 extern void rl_free (void *);
0465
0466
0467 extern int rl_set_signals (void);
0468 extern int rl_clear_signals (void);
0469 extern void rl_cleanup_after_signal (void);
0470 extern void rl_reset_after_signal (void);
0471 extern void rl_free_line_state (void);
0472
0473 extern int rl_pending_signal (void);
0474 extern void rl_check_signals (void);
0475
0476 extern void rl_echo_signal_char (int);
0477
0478 extern int rl_set_paren_blink_timeout (int);
0479
0480
0481
0482 extern void rl_clear_history (void);
0483
0484
0485 extern int rl_maybe_save_line (void);
0486 extern int rl_maybe_unsave_line (void);
0487 extern int rl_maybe_replace_line (void);
0488
0489
0490 extern int rl_complete_internal (int);
0491 extern void rl_display_match_list (char **, int, int);
0492
0493 extern char **rl_completion_matches (const char *, rl_compentry_func_t *);
0494 extern char *rl_username_completion_function (const char *, int);
0495 extern char *rl_filename_completion_function (const char *, int);
0496
0497 extern int rl_completion_mode (rl_command_func_t *);
0498
0499 #if 0
0500
0501 extern void free_undo_list (void);
0502 extern int maybe_save_line (void);
0503 extern int maybe_unsave_line (void);
0504 extern int maybe_replace_line (void);
0505
0506 extern int ding (void);
0507 extern int alphabetic (int);
0508 extern int crlf (void);
0509
0510 extern char **completion_matches (char *, rl_compentry_func_t *);
0511 extern char *username_completion_function (const char *, int);
0512 extern char *filename_completion_function (const char *, int);
0513 #endif
0514
0515
0516
0517
0518
0519
0520
0521
0522 extern const char *rl_library_version;
0523 extern int rl_readline_version;
0524
0525
0526 extern int rl_gnu_readline_p;
0527
0528
0529 extern unsigned long rl_readline_state;
0530
0531
0532
0533 extern int rl_editing_mode;
0534
0535
0536
0537 extern int rl_insert_mode;
0538
0539
0540
0541 extern const char *rl_readline_name;
0542
0543
0544
0545 extern char *rl_prompt;
0546
0547
0548
0549 extern char *rl_display_prompt;
0550
0551
0552 extern char *rl_line_buffer;
0553
0554
0555 extern int rl_point;
0556 extern int rl_end;
0557
0558
0559 extern int rl_mark;
0560
0561
0562
0563 extern int rl_done;
0564
0565
0566
0567 extern int rl_eof_found;
0568
0569
0570 extern int rl_pending_input;
0571
0572
0573
0574
0575 extern int rl_dispatching;
0576
0577
0578
0579 extern int rl_explicit_arg;
0580
0581
0582 extern int rl_numeric_arg;
0583
0584
0585 extern rl_command_func_t *rl_last_func;
0586
0587
0588 extern const char *rl_terminal_name;
0589
0590
0591 extern FILE *rl_instream;
0592 extern FILE *rl_outstream;
0593
0594
0595
0596
0597 extern int rl_prefer_env_winsize;
0598
0599
0600
0601 extern rl_hook_func_t *rl_startup_hook;
0602
0603
0604
0605
0606 extern rl_hook_func_t *rl_pre_input_hook;
0607
0608
0609
0610 extern rl_hook_func_t *rl_event_hook;
0611
0612
0613 extern rl_hook_func_t *rl_signal_event_hook;
0614
0615 extern rl_hook_func_t *rl_timeout_event_hook;
0616
0617
0618
0619 extern rl_hook_func_t *rl_input_available_hook;
0620
0621
0622
0623 extern rl_getc_func_t *rl_getc_function;
0624
0625 extern rl_voidfunc_t *rl_redisplay_function;
0626
0627 extern rl_vintfunc_t *rl_prep_term_function;
0628 extern rl_voidfunc_t *rl_deprep_term_function;
0629
0630
0631 extern Keymap rl_executing_keymap;
0632 extern Keymap rl_binding_keymap;
0633
0634 extern int rl_executing_key;
0635 extern char *rl_executing_keyseq;
0636 extern int rl_key_sequence_length;
0637
0638
0639
0640
0641
0642 extern int rl_erase_empty_line;
0643
0644
0645
0646
0647 extern int rl_already_prompted;
0648
0649
0650
0651 extern int rl_num_chars_to_read;
0652
0653
0654 extern char *rl_executing_macro;
0655
0656
0657
0658
0659 extern int rl_catch_signals;
0660
0661
0662
0663
0664
0665
0666 extern int rl_catch_sigwinch;
0667
0668
0669
0670 extern int rl_change_environment;
0671
0672
0673
0674
0675
0676 extern rl_compentry_func_t *rl_completion_entry_function;
0677
0678
0679
0680 extern rl_compentry_func_t *rl_menu_completion_entry_function;
0681
0682
0683
0684
0685
0686
0687
0688 extern rl_compignore_func_t *rl_ignore_some_completions_function;
0689
0690
0691
0692
0693
0694
0695
0696
0697 extern rl_completion_func_t *rl_attempted_completion_function;
0698
0699
0700
0701
0702 extern const char *rl_basic_word_break_characters;
0703
0704
0705
0706
0707 extern const char *rl_completer_word_break_characters;
0708
0709
0710
0711
0712 extern rl_cpvfunc_t *rl_completion_word_break_hook;
0713
0714
0715
0716
0717
0718 extern const char *rl_completer_quote_characters;
0719
0720
0721 extern const char *rl_basic_quote_characters;
0722
0723
0724 extern const char *rl_filename_quote_characters;
0725
0726
0727
0728
0729 extern const char *rl_special_prefixes;
0730
0731
0732
0733
0734
0735
0736
0737
0738
0739
0740 extern rl_icppfunc_t *rl_directory_completion_hook;
0741
0742
0743
0744
0745
0746
0747
0748
0749
0750
0751
0752
0753 extern rl_icppfunc_t *rl_directory_rewrite_hook;
0754
0755
0756
0757
0758
0759
0760 extern rl_icppfunc_t *rl_filename_stat_hook;
0761
0762
0763
0764
0765
0766
0767
0768
0769
0770
0771 extern rl_dequote_func_t *rl_filename_rewrite_hook;
0772
0773
0774 #define rl_symbolic_link_hook rl_directory_completion_hook
0775
0776
0777
0778
0779
0780
0781
0782
0783 extern rl_compdisp_func_t *rl_completion_display_matches_hook;
0784
0785
0786
0787
0788 extern int rl_filename_completion_desired;
0789
0790
0791
0792
0793
0794
0795 extern int rl_filename_quoting_desired;
0796
0797
0798
0799
0800
0801 extern rl_quote_func_t *rl_filename_quoting_function;
0802
0803
0804
0805
0806 extern rl_dequote_func_t *rl_filename_dequoting_function;
0807
0808
0809
0810
0811 extern rl_linebuf_func_t *rl_char_is_quoted_p;
0812
0813
0814
0815 extern int rl_attempted_completion_over;
0816
0817
0818
0819
0820 extern int rl_completion_type;
0821
0822
0823 extern int rl_completion_invoking_key;
0824
0825
0826
0827
0828 extern int rl_completion_query_items;
0829
0830
0831
0832 extern int rl_completion_append_character;
0833
0834
0835
0836 extern int rl_completion_suppress_append;
0837
0838
0839
0840 extern int rl_completion_quote_character;
0841
0842
0843
0844 extern int rl_completion_found_quote;
0845
0846
0847
0848
0849 extern int rl_completion_suppress_quote;
0850
0851
0852 extern int rl_sort_completion_matches;
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863 extern int rl_completion_mark_symlink_dirs;
0864
0865
0866 extern int rl_ignore_completion_duplicates;
0867
0868
0869
0870 extern int rl_inhibit_completion;
0871
0872
0873
0874
0875
0876
0877
0878 extern int rl_persistent_signal_handlers;
0879
0880
0881
0882 #define READERR (-2)
0883
0884
0885 #define RL_PROMPT_START_IGNORE '\001'
0886 #define RL_PROMPT_END_IGNORE '\002'
0887
0888
0889
0890 #define NO_MATCH 0
0891 #define SINGLE_MATCH 1
0892 #define MULT_MATCH 2
0893
0894
0895 #define RL_STATE_NONE 0x000000
0896
0897 #define RL_STATE_INITIALIZING 0x0000001
0898 #define RL_STATE_INITIALIZED 0x0000002
0899 #define RL_STATE_TERMPREPPED 0x0000004
0900 #define RL_STATE_READCMD 0x0000008
0901 #define RL_STATE_METANEXT 0x0000010
0902 #define RL_STATE_DISPATCHING 0x0000020
0903 #define RL_STATE_MOREINPUT 0x0000040
0904 #define RL_STATE_ISEARCH 0x0000080
0905 #define RL_STATE_NSEARCH 0x0000100
0906 #define RL_STATE_SEARCH 0x0000200
0907 #define RL_STATE_NUMERICARG 0x0000400
0908 #define RL_STATE_MACROINPUT 0x0000800
0909 #define RL_STATE_MACRODEF 0x0001000
0910 #define RL_STATE_OVERWRITE 0x0002000
0911 #define RL_STATE_COMPLETING 0x0004000
0912 #define RL_STATE_SIGHANDLER 0x0008000
0913 #define RL_STATE_UNDOING 0x0010000
0914 #define RL_STATE_INPUTPENDING 0x0020000
0915 #define RL_STATE_TTYCSAVED 0x0040000
0916 #define RL_STATE_CALLBACK 0x0080000
0917 #define RL_STATE_VIMOTION 0x0100000
0918 #define RL_STATE_MULTIKEY 0x0200000
0919 #define RL_STATE_VICMDONCE 0x0400000
0920 #define RL_STATE_CHARSEARCH 0x0800000
0921 #define RL_STATE_REDISPLAYING 0x1000000
0922
0923 #define RL_STATE_DONE 0x2000000
0924 #define RL_STATE_TIMEOUT 0x4000000
0925 #define RL_STATE_EOF 0x8000000
0926
0927 #define RL_SETSTATE(x) (rl_readline_state |= (x))
0928 #define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
0929 #define RL_ISSTATE(x) (rl_readline_state & (x))
0930
0931 struct readline_state {
0932
0933 int point;
0934 int end;
0935 int mark;
0936 int buflen;
0937 char *buffer;
0938 UNDO_LIST *ul;
0939 char *prompt;
0940
0941
0942 int rlstate;
0943 int done;
0944 Keymap kmap;
0945
0946
0947 rl_command_func_t *lastfunc;
0948 int insmode;
0949 int edmode;
0950 char *kseq;
0951 int kseqlen;
0952
0953 int pendingin;
0954 FILE *inf;
0955 FILE *outf;
0956 char *macro;
0957
0958
0959 int catchsigs;
0960 int catchsigwinch;
0961
0962
0963
0964
0965 rl_compentry_func_t *entryfunc;
0966 rl_compentry_func_t *menuentryfunc;
0967 rl_compignore_func_t *ignorefunc;
0968 rl_completion_func_t *attemptfunc;
0969 const char *wordbreakchars;
0970
0971
0972
0973
0974
0975
0976 char reserved[64];
0977 };
0978
0979 extern int rl_save_state (struct readline_state *);
0980 extern int rl_restore_state (struct readline_state *);
0981
0982 #ifdef __cplusplus
0983 }
0984 #endif
0985
0986 #endif