📄 rlprivate.h
字号:
/* rlprivate.h -- functions and variables global to the readline library, but not intended for use by applications. *//* Copyright (C) 1999-2010 Free Software Foundation, Inc. This file is part of the GNU Readline Library (Readline), a library for reading lines of text with interactive input and history editing. Readline is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Readline is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Readline. If not, see <http://www.gnu.org/licenses/>.*/#if !defined (_RL_PRIVATE_H_)#define _RL_PRIVATE_H_#include "rlconf.h" /* for VISIBLE_STATS */#include "rlstdc.h"#include "posixjmp.h" /* defines procenv_t *//************************************************************************* * * * Convenience definitions * * * *************************************************************************/#define EMACS_MODE() (rl_editing_mode == emacs_mode)#define VI_COMMAND_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)#define VI_INSERT_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_insertion_keymap)#define RL_CHECK_SIGNALS() \ do { \ if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); \ } while (0)/************************************************************************* * * * Global structs undocumented in texinfo manual and not in readline.h * * * *************************************************************************//* search types */#define RL_SEARCH_ISEARCH 0x01 /* incremental search */#define RL_SEARCH_NSEARCH 0x02 /* non-incremental search */#define RL_SEARCH_CSEARCH 0x04 /* intra-line char search *//* search flags */#define SF_REVERSE 0x01#define SF_FOUND 0x02#define SF_FAILED 0x04#define SF_CHGKMAP 0x08typedef struct __rl_search_context{ int type; int sflags; char *search_string; int search_string_index; int search_string_size; char **lines; char *allocated_line; int hlen; int hindex; int save_point; int save_mark; int save_line; int last_found_line; char *prev_line_found; UNDO_LIST *save_undo_list; Keymap keymap; /* used when dispatching commands in search string */ Keymap okeymap; /* original keymap */ int history_pos; int direction; int lastc;#if defined (HANDLE_MULTIBYTE) char mb[MB_LEN_MAX];#endif char *sline; int sline_len; int sline_index; char *search_terminators;} _rl_search_cxt;/* Callback data for reading numeric arguments */#define NUM_SAWMINUS 0x01#define NUM_SAWDIGITS 0x02#define NUM_READONE 0x04typedef int _rl_arg_cxt;/* A context for reading key sequences longer than a single character when using the callback interface. */#define KSEQ_DISPATCHED 0x01#define KSEQ_SUBSEQ 0x02#define KSEQ_RECURSIVE 0x04typedef struct __rl_keyseq_context{ int flags; int subseq_arg; int subseq_retval; /* XXX */ Keymap dmap; Keymap oldmap; int okey; struct __rl_keyseq_context *ocxt; int childval;} _rl_keyseq_cxt;/* vi-mode commands that use result of motion command to define boundaries */#define VIM_DELETE 0x01#define VIM_CHANGE 0x02#define VIM_YANK 0x04/* various states for vi-mode commands that use motion commands. reflects RL_READLINE_STATE */#define VMSTATE_READ 0x01#define VMSTATE_NUMARG 0x02typedef struct __rl_vimotion_context{ int op; int state; int flags; /* reserved */ _rl_arg_cxt ncxt; int numeric_arg; int start, end; /* rl_point, rl_end */ int key, motion; /* initial key, motion command */} _rl_vimotion_cxt;/* fill in more as needed *//* `Generic' callback data and functions */typedef struct __rl_callback_generic_arg { int count; int i1, i2; /* add here as needed */} _rl_callback_generic_arg;typedef int _rl_callback_func_t PARAMS((_rl_callback_generic_arg *));/************************************************************************* * * * Global functions undocumented in texinfo manual and not in readline.h * * * *************************************************************************//************************************************************************* * * * Global variables undocumented in texinfo manual and not in readline.h * * * *************************************************************************//* complete.c */extern int rl_complete_with_tilde_expansion;#if defined (VISIBLE_STATS)extern int rl_visible_stats;#endif /* VISIBLE_STATS *//* readline.c */extern int rl_line_buffer_len;extern int rl_arg_sign;extern int rl_visible_prompt_length;extern int rl_key_sequence_length;extern int rl_byte_oriented;/* display.c */extern int rl_display_fixed;/* parens.c */extern int rl_blink_matching_paren;/************************************************************************* * * * Global functions and variables unsed and undocumented * * * *************************************************************************//* kill.c */extern int rl_set_retained_kills PARAMS((int));/* terminal.c */extern void _rl_set_screen_size PARAMS((int, int));/* undo.c */extern int _rl_fix_last_undo_of_type PARAMS((int, int, int));/* util.c */extern char *_rl_savestring PARAMS((const char *));/************************************************************************* * * * Functions and variables private to the readline library * * * *************************************************************************//* NOTE: Functions and variables prefixed with `_rl_' are pseudo-global: they are global so they can be shared between files in the readline library, but are not intended to be visible to readline callers. *//************************************************************************* * Undocumented private functions * *************************************************************************/#if defined(READLINE_CALLBACKS)/* readline.c */extern void readline_internal_setup PARAMS((void));extern char *readline_internal_teardown PARAMS((int));extern int readline_internal_char PARAMS((void));extern _rl_keyseq_cxt *_rl_keyseq_cxt_alloc PARAMS((void));extern void _rl_keyseq_cxt_dispose PARAMS((_rl_keyseq_cxt *));extern void _rl_keyseq_chain_dispose PARAMS((void));extern int _rl_dispatch_callback PARAMS((_rl_keyseq_cxt *)); /* callback.c */extern _rl_callback_generic_arg *_rl_callback_data_alloc PARAMS((int));extern void _rl_callback_data_dispose PARAMS((_rl_callback_generic_arg *));#endif /* READLINE_CALLBACKS *//* bind.c *//* complete.c */extern void _rl_reset_completion_state PARAMS((void));extern char _rl_find_completion_word PARAMS((int *, int *));extern void _rl_free_match_list PARAMS((char **));/* display.c */extern char *_rl_strip_prompt PARAMS((char *));extern void _rl_move_cursor_relative PARAMS((int, const char *));extern void _rl_move_vert PARAMS((int));extern void _rl_save_prompt PARAMS((void));extern void _rl_restore_prompt PARAMS((void));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -