34 #include <sys/types.h>
40 typedef int Function(
const char *,
int);
41 typedef void VFunction(
void);
42 typedef void VCPFunction(
char *);
43 typedef char *CPFunction(
const char *,
int);
44 typedef char **CPPFunction(
const char *,
int,
int);
45 typedef char *rl_compentry_func_t(
const char *,
int);
46 typedef int rl_command_func_t(
int,
int);
53 typedef void *histdata_t;
68 #define KEYMAP_SIZE 256
73 #define control_character_threshold 0x20
74 #define control_character_bit 0x40
77 #include <sys/ioctl.h>
78 #if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__QNXNTO__) && !defined(__USLC__)
79 #include <sys/ttydefaults.h>
82 #define CTRL(c) ((c) & 037)
86 #define UNCTRL(c) (((c) - 'a' + 'A')|control_character_bit)
90 #define ABORT_CHAR CTRL('G')
91 #define RL_READLINE_VERSION 0x0402
92 #define RL_PROMPT_START_IGNORE '\1'
93 #define RL_PROMPT_END_IGNORE '\2'
99 extern const char *rl_library_version;
100 extern int rl_readline_version;
101 extern char *rl_readline_name;
102 extern FILE *rl_instream;
103 extern FILE *rl_outstream;
104 extern char *rl_line_buffer;
105 extern int rl_point, rl_end;
106 extern int history_base, history_length;
107 extern int max_input_history;
108 extern char *rl_basic_word_break_characters;
109 extern char *rl_completer_word_break_characters;
110 extern char *rl_completer_quote_characters;
111 extern Function *rl_completion_entry_function;
112 extern CPPFunction *rl_attempted_completion_function;
113 extern int rl_attempted_completion_over;
114 extern int rl_completion_type;
115 extern int rl_completion_query_items;
116 extern char *rl_special_prefixes;
117 extern int rl_completion_append_character;
118 extern int rl_inhibit_completion;
119 extern Function *rl_pre_input_hook;
120 extern Function *rl_startup_hook;
121 extern char *rl_terminal_name;
122 extern int rl_already_prompted;
123 extern char *rl_prompt;
127 extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
130 extern int rl_filename_completion_desired;
131 extern int rl_ignore_completion_duplicates;
132 extern int (*rl_getc_function)(FILE *);
133 extern VFunction *rl_redisplay_function;
134 extern VFunction *rl_completion_display_matches_hook;
135 extern VFunction *rl_prep_term_function;
136 extern VFunction *rl_deprep_term_function;
137 extern int readline_echoing_p;
138 extern int _rl_print_completions_horizontally;
141 char *readline(
const char *);
142 int rl_initialize(
void);
144 void using_history(
void);
145 int add_history(
const char *);
146 void clear_history(
void);
147 void stifle_history(
int);
148 int unstifle_history(
void);
149 int history_is_stifled(
void);
150 int where_history(
void);
154 HIST_ENTRY *replace_history_entry(
int,
const char *, histdata_t);
155 int history_total_bytes(
void);
156 int history_set_pos(
int);
159 int history_search(
const char *,
int);
160 int history_search_prefix(
const char *,
int);
161 int history_search_pos(
const char *,
int,
int);
162 int read_history(
const char *);
163 int write_history(
const char *);
164 int history_truncate_file (
const char *,
int);
165 int history_expand(
char *,
char **);
166 char **history_tokenize(
const char *);
167 const char *get_history_event(
const char *,
int *,
int);
168 char *history_arg_extract(
int,
int,
const char *);
170 char *tilde_expand(
char *);
171 char *filename_completion_function(
const char *,
int);
172 char *username_completion_function(
const char *,
int);
173 int rl_complete(
int,
int);
174 int rl_read_key(
void);
175 char **completion_matches(
const char *, CPFunction *);
176 void rl_display_match_list(
char **,
int,
int);
178 int rl_insert(
int,
int);
179 int rl_insert_text(
const char *);
180 void rl_reset_terminal(
const char *);
181 int rl_bind_key(
int, rl_command_func_t *);
182 int rl_newline(
int,
int);
183 void rl_callback_read_char(
void);
184 void rl_callback_handler_install(
const char *, VCPFunction *);
185 void rl_callback_handler_remove(
void);
186 void rl_redisplay(
void);
187 int rl_get_previous_history(
int,
int);
188 void rl_prep_terminal(
int);
189 void rl_deprep_terminal(
void);
190 int rl_read_init_file(
const char *);
191 int rl_parse_and_bind(
const char *);
192 int rl_variable_bind(
const char *,
const char *);
193 void rl_stuff_char(
int);
194 int rl_add_defun(
const char *, Function *,
int);
196 void rl_get_screen_size(
int *,
int *);
197 void rl_set_screen_size(
int,
int);
198 char *rl_filename_completion_function (
const char *,
int);
199 int _rl_abort_internal(
void);
200 int _rl_qsort_string_compare(
char **,
char **);
201 char **rl_completion_matches(
const char *, rl_compentry_func_t *);
202 void rl_forced_update_display(
void);
203 int rl_set_prompt(
const char *);
204 int rl_on_new_line(
void);
209 int rl_kill_text(
int,
int);
210 Keymap rl_get_keymap(
void);
211 void rl_set_keymap(
Keymap);
212 Keymap rl_make_bare_keymap(
void);
213 int rl_generic_bind(
int,
const char *,
const char *,
Keymap);
214 int rl_bind_key_in_map(
int, rl_command_func_t *,
Keymap);
215 void rl_cleanup_after_signal(
void);
216 void rl_free_line_state(
void);