File indexing completed on 2025-02-21 09:58:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef _READLINE_H_
0032 #define _READLINE_H_
0033
0034 #include <sys/types.h>
0035 #include <stdio.h>
0036
0037
0038
0039
0040 typedef int rl_linebuf_func_t(const char *, int);
0041 typedef void rl_voidfunc_t(void);
0042 typedef void rl_vintfunc_t(int);
0043 typedef void rl_vcpfunc_t(char *);
0044 typedef char **rl_completion_func_t(const char *, int, int);
0045 typedef char *rl_compentry_func_t(const char *, int);
0046 typedef void rl_compdisp_func_t(char **, int, int);
0047 typedef int rl_command_func_t(int, int);
0048 typedef int rl_hook_func_t(void);
0049 typedef int rl_icppfunc_t(char **);
0050
0051
0052 typedef struct {
0053 int length;
0054 } HISTORY_STATE;
0055
0056 typedef void *histdata_t;
0057
0058 typedef struct _hist_entry {
0059 const char *line;
0060 histdata_t data;
0061 } HIST_ENTRY;
0062
0063 typedef struct _keymap_entry {
0064 char type;
0065 #define ISFUNC 0
0066 #define ISKMAP 1
0067 #define ISMACR 2
0068 rl_linebuf_func_t *function;
0069 } KEYMAP_ENTRY;
0070
0071 #define KEYMAP_SIZE 256
0072
0073 typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
0074 typedef KEYMAP_ENTRY *Keymap;
0075
0076 #define control_character_threshold 0x20
0077 #define control_character_bit 0x40
0078
0079 #ifndef CTRL
0080 #include <sys/ioctl.h>
0081 #if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
0082 #include <sys/ttydefaults.h>
0083 #endif
0084 #ifndef CTRL
0085 #define CTRL(c) ((c) & 037)
0086 #endif
0087 #endif
0088 #ifndef UNCTRL
0089 #define UNCTRL(c) (((c) - 'a' + 'A')|control_character_bit)
0090 #endif
0091
0092 #define RUBOUT 0x7f
0093 #define ABORT_CHAR CTRL('G')
0094 #define RL_READLINE_VERSION 0x0402
0095 #define RL_PROMPT_START_IGNORE '\1'
0096 #define RL_PROMPT_END_IGNORE '\2'
0097
0098 #define RL_STATE_NONE 0x000000
0099 #define RL_STATE_DONE 0x000001
0100
0101 #define RL_SETSTATE(x) (rl_readline_state |= ((unsigned long) x))
0102 #define RL_UNSETSTATE(x) (rl_readline_state &= ~((unsigned long) x))
0103 #define RL_ISSTATE(x) (rl_readline_state & ((unsigned long) x))
0104
0105
0106 #ifdef __cplusplus
0107 extern "C" {
0108 #endif
0109 extern const char *rl_library_version;
0110 extern int rl_readline_version;
0111 extern const char *rl_readline_name;
0112 extern FILE *rl_instream;
0113 extern FILE *rl_outstream;
0114 extern char *rl_line_buffer;
0115 extern int rl_point, rl_end;
0116 extern const char *rl_basic_quote_characters;
0117 extern const char *rl_basic_word_break_characters;
0118 extern char *rl_completer_word_break_characters;
0119 extern const char *rl_completer_quote_characters;
0120 extern rl_compentry_func_t *rl_completion_entry_function;
0121 extern char *(*rl_completion_word_break_hook)(void);
0122 extern rl_completion_func_t *rl_attempted_completion_function;
0123 extern int rl_attempted_completion_over;
0124 extern int rl_completion_type;
0125 extern int rl_completion_query_items;
0126 extern const char *rl_special_prefixes;
0127 extern int rl_completion_append_character;
0128 extern int rl_inhibit_completion;
0129 extern rl_hook_func_t *rl_pre_input_hook;
0130 extern rl_hook_func_t *rl_startup_hook;
0131 extern char *rl_terminal_name;
0132 extern int rl_already_prompted;
0133 extern char *rl_prompt;
0134 extern int rl_done;
0135 extern rl_vcpfunc_t *rl_linefunc;
0136 extern rl_hook_func_t *rl_startup1_hook;
0137 extern char *rl_prompt_saved;
0138 extern int history_base, history_length;
0139 extern int history_offset;
0140 extern char history_expansion_char;
0141 extern char history_subst_char;
0142 extern char *history_no_expand_chars;
0143 extern rl_linebuf_func_t *history_inhibit_expansion_function;
0144 extern int max_input_history;
0145
0146
0147
0148
0149 extern unsigned long rl_readline_state;
0150 extern int rl_catch_signals;
0151 extern int rl_catch_sigwinch;
0152 extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
0153 emacs_meta_keymap,
0154 emacs_ctlx_keymap;
0155 extern int rl_filename_completion_desired;
0156 extern int rl_ignore_completion_duplicates;
0157 extern int (*rl_getc_function)(FILE *);
0158 extern rl_voidfunc_t *rl_redisplay_function;
0159 extern rl_compdisp_func_t *rl_completion_display_matches_hook;
0160 extern rl_vintfunc_t *rl_prep_term_function;
0161 extern rl_voidfunc_t *rl_deprep_term_function;
0162 extern rl_hook_func_t *rl_event_hook;
0163 extern int readline_echoing_p;
0164 extern int _rl_print_completions_horizontally;
0165 extern int _rl_complete_mark_directories;
0166 extern rl_icppfunc_t *rl_directory_completion_hook;
0167 extern int rl_completion_suppress_append;
0168 extern int rl_sort_completion_matches;
0169 extern int _rl_completion_prefix_display_length;
0170 extern int _rl_echoing_p;
0171 extern int history_max_entries;
0172 extern char *rl_display_prompt;
0173 extern int rl_erase_empty_line;
0174
0175
0176 char *readline(const char *);
0177 int rl_initialize(void);
0178
0179 void using_history(void);
0180 int add_history(const char *);
0181 void clear_history(void);
0182 int append_history(int, const char *);
0183 void stifle_history(int);
0184 int unstifle_history(void);
0185 int history_is_stifled(void);
0186 int where_history(void);
0187 HIST_ENTRY *current_history(void);
0188 HIST_ENTRY *history_get(int);
0189 HIST_ENTRY *remove_history(int);
0190 HIST_ENTRY *replace_history_entry(int, const char *, histdata_t);
0191 int history_total_bytes(void);
0192 int history_set_pos(int);
0193 HIST_ENTRY *previous_history(void);
0194 HIST_ENTRY *next_history(void);
0195 HIST_ENTRY **history_list(void);
0196 int history_search(const char *, int);
0197 int history_search_prefix(const char *, int);
0198 int history_search_pos(const char *, int, int);
0199 int read_history(const char *);
0200 int write_history(const char *);
0201 int history_truncate_file(const char *, int);
0202 int history_expand(char *, char **);
0203 char **history_tokenize(const char *);
0204 const char *get_history_event(const char *, int *, int);
0205 char *history_arg_extract(int, int, const char *);
0206
0207 char *tilde_expand(char *);
0208 char *filename_completion_function(const char *, int);
0209 char *username_completion_function(const char *, int);
0210 int rl_complete(int, int);
0211 int rl_read_key(void);
0212 char **completion_matches( char *, rl_compentry_func_t *);
0213 void rl_display_match_list(char **, int, int);
0214
0215 int rl_insert(int, int);
0216 int rl_insert_text(const char *);
0217 int rl_reset_terminal(const char *);
0218 void rl_resize_terminal(void);
0219 int rl_bind_key(int, rl_command_func_t *);
0220 int rl_newline(int, int);
0221 void rl_callback_read_char(void);
0222 void rl_callback_handler_install(const char *, rl_vcpfunc_t *);
0223 void rl_callback_handler_remove(void);
0224 void rl_redisplay(void);
0225 int rl_get_previous_history(int, int);
0226 void rl_prep_terminal(int);
0227 void rl_deprep_terminal(void);
0228 int rl_read_init_file(const char *);
0229 int rl_parse_and_bind(const char *);
0230 int rl_variable_bind(const char *, const char *);
0231 int rl_stuff_char(int);
0232 int rl_add_defun(const char *, rl_command_func_t *, int);
0233 HISTORY_STATE *history_get_history_state(void);
0234 void rl_get_screen_size(int *, int *);
0235 void rl_set_screen_size(int, int);
0236 char *rl_filename_completion_function(const char *, int);
0237 int _rl_abort_internal(void);
0238 int _rl_qsort_string_compare(char **, char **);
0239 char **rl_completion_matches(const char *, rl_compentry_func_t *);
0240 void rl_forced_update_display(void);
0241 int rl_set_prompt(const char *);
0242 int rl_on_new_line(void);
0243 void rl_reset_after_signal(void);
0244 void rl_echo_signal_char(int);
0245 int rl_crlf(void);
0246 int rl_ding(void);
0247 char *rl_copy_text(int, int);
0248 void rl_replace_line(const char *, int);
0249 int rl_delete_text(int, int);
0250 void rl_message(const char *format, ...)
0251 __attribute__((__format__(__printf__, 1, 2)));
0252 void rl_save_prompt(void);
0253 void rl_restore_prompt(void);
0254
0255
0256
0257
0258 int rl_kill_text(int, int);
0259 Keymap rl_get_keymap(void);
0260 void rl_set_keymap(Keymap);
0261 Keymap rl_make_bare_keymap(void);
0262 int rl_generic_bind(int, const char *, const char *, Keymap);
0263 int rl_bind_key_in_map(int, rl_command_func_t *, Keymap);
0264 int rl_set_key(const char *, rl_command_func_t *, Keymap);
0265 void rl_cleanup_after_signal(void);
0266 void rl_free_line_state(void);
0267 int rl_set_keyboard_input_timeout(int);
0268 int rl_abort(int, int);
0269 int rl_set_keymap_name(const char *, Keymap);
0270 histdata_t free_history_entry(HIST_ENTRY *);
0271 void _rl_erase_entire_line(void);
0272
0273 #ifdef __cplusplus
0274 }
0275 #endif
0276
0277 #endif