]> gitweb.factorcode.org Git - factor.git/blob - extra/readline/ffi/ffi.factor
use radix literals
[factor.git] / extra / readline / ffi / ffi.factor
1 ! Copyright (C) 2010 Erik Charlebois
2 ! See http:// factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types kernel alien.syntax classes.struct
4 accessors libc math make unix.types namespaces system
5 combinators alien.libraries ;
6 IN: readline.ffi
7
8 <<
9 "readline" {
10     { [ os windows? ] [ "readline.dll" ] }
11     { [ os macosx? ] [ "libreadline.dylib"  ] }
12     { [ os unix?  ] [ "libreadline.so" ] }
13 } cond cdecl add-library
14 >>
15 LIBRARY: readline
16
17 TYPEDEF: void* histdata_t
18
19 STRUCT: HIST_ENTRY
20     { line      c-string   }
21     { timestamp c-string   }
22     { data      histdata_t } ;
23
24 : HISTENT_BYTES ( hs -- n ) [ line>> strlen ] [ timestamp>> strlen ] bi + ; inline
25
26 STRUCT: HISTORY_STATE
27     { entries HIST_ENTRY** }
28     { offset  int          }
29     { length  int          }
30     { size    int          }
31     { flags   int          } ;
32
33 CONSTANT: HS_STIFLED 1
34
35 FUNCTION: void using_history ( ) ;
36 FUNCTION: HISTORY_STATE* history_get_history_state ( ) ;
37 FUNCTION: void history_set_history_state ( HISTORY_STATE* arg1 ) ;
38 FUNCTION: void add_history ( c-string arg1 ) ;
39 FUNCTION: void add_history_time ( c-string arg1 ) ;
40 FUNCTION: HIST_ENTRY* remove_history ( int arg1 ) ;
41 FUNCTION: histdata_t free_history_entry ( HIST_ENTRY* arg1 ) ;
42 FUNCTION: HIST_ENTRY* replace_history_entry ( int arg1, c-string
43                                              arg2, histdata_t
44                                              arg3 ) ;
45 FUNCTION: void clear_history ( ) ;
46 FUNCTION: void stifle_history ( int arg1 ) ;
47 FUNCTION: int unstifle_history ( ) ;
48 FUNCTION: int history_is_stifled ( ) ;
49 FUNCTION: HIST_ENTRY** history_list ( ) ;
50 FUNCTION: int where_history ( ) ;
51 FUNCTION: HIST_ENTRY* current_history ( ) ;
52 FUNCTION: HIST_ENTRY* history_get ( int arg1 ) ;
53 FUNCTION: time_t history_get_time ( HIST_ENTRY* arg1 ) ;
54 FUNCTION: int history_total_bytes ( ) ;
55 FUNCTION: int history_set_pos ( int arg1 ) ;
56 FUNCTION: HIST_ENTRY* previous_history ( ) ;
57 FUNCTION: HIST_ENTRY* next_history ( ) ;
58 FUNCTION: int history_search ( c-string arg1, int arg2 ) ;
59 FUNCTION: int history_search_prefix ( c-string arg1, int arg2 ) ;
60 FUNCTION: int history_search_pos ( c-string arg1, int arg2, int
61                                   arg3 ) ;
62 FUNCTION: int read_history ( c-string arg1 ) ;
63 FUNCTION: int read_history_range ( c-string arg1, int arg2, int
64                                   arg3 ) ;
65 FUNCTION: int write_history ( c-string arg1 ) ;
66 FUNCTION: int append_history ( int arg1, c-string arg2 ) ;
67 FUNCTION: int history_expand ( c-string arg1, char** arg2 ) ;
68 FUNCTION: c-string history_arg_extract ( int arg1, int arg2,
69                                         c-string arg3 ) ;
70 FUNCTION: c-string get_history_event ( c-string arg1, int* arg2,
71                                       int arg3 ) ;
72 FUNCTION: char** history_tokenize ( c-string arg1 ) ;
73
74 CALLBACK: int rl_command_func_t ( int arg1, int arg2 ) ;
75 CALLBACK: char* rl_compentry_func_t ( c-string arg1, int arg2 ) ;
76 CALLBACK: char** rl_completion_func_t ( c-string arg1, int arg2,
77                                        int arg3 ) ;
78
79 CALLBACK: c-string rl_quote_func_t ( c-string arg1, int arg2,
80                                     c-string arg3 ) ;
81 CALLBACK: c-string rl_dequote_func_t ( c-string arg1, int arg2 ) ;
82 CALLBACK: int rl_compignore_func_t ( char** arg1 ) ;
83 CALLBACK: void rl_compdisp_func_t ( char** arg1, int arg2, int
84                                    arg3 ) ;
85 CALLBACK: int rl_hook_func_t ( ) ;
86 CALLBACK: int rl_getc_func_t ( FILE* arg1 ) ;
87 CALLBACK: int rl_linebuf_func_t ( c-string arg1, int arg2 ) ;
88
89 STRUCT: KEYMAP_ENTRY
90     { type     char               }
91     { function rl_command_func_t* } ;
92
93 CONSTANT: KEYMAP_SIZE 257
94 CONSTANT: ANYOTHERKEY 256
95
96 TYPEDEF: KEYMAP_ENTRY[257] KEYMAP_ENTRY_ARRAY
97 TYPEDEF: KEYMAP_ENTRY*     Keymap
98
99 CONSTANT: ISFUNC 0
100 CONSTANT: ISKMAP 1
101 CONSTANT: ISMACR 2
102
103 C-GLOBAL: KEYMAP_ENTRY_ARRAY emacs_standard_keymap
104 C-GLOBAL: KEYMAP_ENTRY_ARRAY emacs_meta_keymap
105 C-GLOBAL: KEYMAP_ENTRY_ARRAY emacs_ctlx_keymap
106 C-GLOBAL: KEYMAP_ENTRY_ARRAY vi_insertion_keymap
107 C-GLOBAL: KEYMAP_ENTRY_ARRAY vi_movement_keymap
108
109 FUNCTION: Keymap rl_copy_keymap ( Keymap ) ;
110 FUNCTION: Keymap rl_make_keymap ( ) ;
111 FUNCTION: void rl_discard_keymap ( Keymap ) ;
112
113 CALLBACK: c-string tilde_hook_func_t ( c-string ) ;
114
115 C-GLOBAL: tilde_hook_func_t* tilde_expansion_preexpansion_hook
116 C-GLOBAL: tilde_hook_func_t* tilde_expansion_failure_hook
117 C-GLOBAL: char**             tilde_additional_prefixes
118 C-GLOBAL: char**             tilde_additional_suffixes
119
120 FUNCTION: c-string tilde_expand ( c-string ) ;
121 FUNCTION: c-string tilde_expand_word ( c-string ) ;
122 FUNCTION: c-string tilde_find_word ( c-string arg1, int arg2,
123                                     int* arg3 ) ;
124
125 C-GLOBAL: int history_base
126 C-GLOBAL: int history_length
127 C-GLOBAL: int history_max_entries
128 C-GLOBAL: char history_expansion_char
129 C-GLOBAL: char history_subst_char
130 C-GLOBAL: c-string history_word_delimiters
131 C-GLOBAL: char history_comment_char
132 C-GLOBAL: c-string history_no_expand_chars
133 C-GLOBAL: c-string history_search_delimiter_chars
134 C-GLOBAL: int history_quotes_inhibit_expansion
135 C-GLOBAL: int history_write_timestamps
136 C-GLOBAL: int max_input_history
137 C-GLOBAL: rl_linebuf_func_t* history_inhibit_expansion_function
138
139 CALLBACK: int rl_intfunc_t ( int ) ;
140 CALLBACK: int rl_icpfunc_t ( c-string ) ;
141 CALLBACK: int rl_icppfunc_t ( char** ) ;
142
143 CALLBACK: void rl_voidfunc_t ( ) ;
144 CALLBACK: void rl_vintfunc_t ( int ) ;
145 CALLBACK: void rl_vcpfunc_t ( c-string ) ;
146 CALLBACK: void rl_vcppfunc_t ( char** ) ;
147
148 CALLBACK: c-string rl_cpvfunc_t ( ) ;
149 CALLBACK: c-string rl_cpifunc_t ( int ) ;
150 CALLBACK: c-string rl_cpcpfunc_t ( c-string ) ;
151 CALLBACK: c-string rl_cpcppfunc_t ( char** ) ;
152
153 ENUM: undo_code UNDO_DELETE UNDO_INSERT UNDO_BEGIN UNDO_END ;
154
155 STRUCT: UNDO_LIST
156     { next      UNDO_LIST* }
157     { start     int        }
158     { end       int        }
159     { text      char*      }
160     { what      undo_code  } ;
161
162 C-GLOBAL: UNDO_LIST* rl_undo_list
163
164 STRUCT: FUNMAP
165     { name     c-string           }
166     { function rl_command_func_t* } ;
167
168 C-GLOBAL: FUNMAP** funmap
169
170 FUNCTION: int rl_digit_argument ( int arg1, int arg2 ) ;
171 FUNCTION: int rl_universal_argument ( int arg, int arg ) ;
172
173 FUNCTION: int rl_forward_byte ( int arg1, int arg2 ) ;
174 FUNCTION: int rl_forward_char ( int arg1, int arg2 ) ;
175 FUNCTION: int rl_forward ( int arg1, int arg2 ) ;
176 FUNCTION: int rl_backward_byte ( int arg1, int arg2 ) ;
177 FUNCTION: int rl_backward_char ( int arg1, int arg2 ) ;
178 FUNCTION: int rl_backward ( int arg1, int arg2 ) ;
179 FUNCTION: int rl_beg_of_line ( int arg1, int arg2 ) ;
180 FUNCTION: int rl_end_of_line ( int arg1, int arg2 ) ;
181 FUNCTION: int rl_forward_word ( int arg1, int arg2 ) ;
182 FUNCTION: int rl_backward_word ( int arg1, int arg2 ) ;
183 FUNCTION: int rl_refresh_line ( int arg1, int arg2 ) ;
184 FUNCTION: int rl_clear_screen ( int arg1, int arg2 ) ;
185 FUNCTION: int rl_skip_csi_sequence ( int arg1, int arg2 ) ;
186 FUNCTION: int rl_arrow_keys ( int arg1, int arg2 ) ;
187
188 FUNCTION: int rl_insert ( int arg1, int arg2 ) ;
189 FUNCTION: int rl_quoted_insert ( int arg1, int arg2 ) ;
190 FUNCTION: int rl_tab_insert ( int arg1, int arg2 ) ;
191 FUNCTION: int rl_newline ( int arg1, int arg2 ) ;
192 FUNCTION: int rl_do_lowercase_version ( int arg1, int arg2 ) ;
193 FUNCTION: int rl_rubout ( int arg1, int arg2 ) ;
194 FUNCTION: int rl_delete ( int arg1, int arg2 ) ;
195 FUNCTION: int rl_rubout_or_delete ( int arg1, int arg2 ) ;
196 FUNCTION: int rl_delete_horizontal_space ( int arg1, int arg2 ) ;
197 FUNCTION: int rl_delete_or_show_completions ( int arg1, int arg2 ) ;
198 FUNCTION: int rl_insert_comment ( int arg1, int arg2 ) ;
199
200 FUNCTION: int rl_upcase_word ( int arg1, int arg2 ) ;
201 FUNCTION: int rl_downcase_word ( int arg1, int arg2 ) ;
202 FUNCTION: int rl_capitalize_word ( int arg1, int arg2 ) ;
203
204 FUNCTION: int rl_transpose_words ( int arg1, int arg2 ) ;
205 FUNCTION: int rl_transpose_chars ( int arg1, int arg2 ) ;
206
207 FUNCTION: int rl_char_search ( int arg1, int arg2 ) ;
208 FUNCTION: int rl_backward_char_search ( int arg1, int arg2 ) ;
209
210 FUNCTION: int rl_beginning_of_history ( int arg1, int arg2 ) ;
211 FUNCTION: int rl_end_of_history ( int arg1, int arg2 ) ;
212 FUNCTION: int rl_get_next_history ( int arg1, int arg2 ) ;
213 FUNCTION: int rl_get_previous_history ( int arg1, int arg2 ) ;
214
215 FUNCTION: int rl_set_mark ( int arg1, int arg2 ) ;
216 FUNCTION: int rl_exchange_point_and_mark ( int arg1, int arg2 ) ;
217
218 FUNCTION: int rl_vi_editing_mode ( int arg1, int arg2 ) ;
219 FUNCTION: int rl_emacs_editing_mode ( int arg1, int arg2 ) ;
220
221 FUNCTION: int rl_overwrite_mode ( int arg1, int arg2 ) ;
222
223 FUNCTION: int rl_re_read_init_file ( int arg1, int arg2 ) ;
224 FUNCTION: int rl_dump_functions ( int arg1, int arg2 ) ;
225 FUNCTION: int rl_dump_macros ( int arg1, int arg2 ) ;
226 FUNCTION: int rl_dump_variables ( int arg1, int arg2 ) ;
227
228 FUNCTION: int rl_complete ( int arg1, int arg2 ) ;
229 FUNCTION: int rl_possible_completions ( int arg1, int arg2 ) ;
230 FUNCTION: int rl_insert_completions ( int arg1, int arg2 ) ;
231 FUNCTION: int rl_old_menu_complete ( int arg1, int arg2 ) ;
232 FUNCTION: int rl_menu_complete ( int arg1, int arg2 ) ;
233 FUNCTION: int rl_backward_menu_complete ( int arg1, int arg2 ) ;
234
235 FUNCTION: int rl_kill_word ( int arg1, int arg2 ) ;
236 FUNCTION: int rl_backward_kill_word ( int arg1, int arg2 ) ;
237 FUNCTION: int rl_kill_line ( int arg1, int arg2 ) ;
238 FUNCTION: int rl_backward_kill_line ( int arg1, int arg2 ) ;
239 FUNCTION: int rl_kill_full_line ( int arg1, int arg2 ) ;
240 FUNCTION: int rl_unix_word_rubout ( int arg1, int arg2 ) ;
241 FUNCTION: int rl_unix_filename_rubout ( int arg1, int arg2 ) ;
242 FUNCTION: int rl_unix_line_discard ( int arg1, int arg2 ) ;
243 FUNCTION: int rl_copy_region_to_kill ( int arg1, int arg2 ) ;
244 FUNCTION: int rl_kill_region ( int arg1, int arg2 ) ;
245 FUNCTION: int rl_copy_forward_word ( int arg1, int arg2 ) ;
246 FUNCTION: int rl_copy_backward_word ( int arg1, int arg2 ) ;
247 FUNCTION: int rl_yank ( int arg1, int arg2 ) ;
248 FUNCTION: int rl_yank_pop ( int arg1, int arg2 ) ;
249 FUNCTION: int rl_yank_nth_arg ( int arg1, int arg2 ) ;
250 FUNCTION: int rl_yank_last_arg ( int arg1, int arg2 ) ;
251
252 FUNCTION: int rl_reverse_search_history ( int arg1, int arg2 ) ;
253 FUNCTION: int rl_forward_search_history ( int arg1, int arg2 ) ;
254
255 FUNCTION: int rl_start_kbd_macro ( int arg1, int arg2 ) ;
256 FUNCTION: int rl_end_kbd_macro ( int arg1, int arg2 ) ;
257 FUNCTION: int rl_call_last_kbd_macro ( int arg1, int arg2 ) ;
258
259 FUNCTION: int rl_revert_line ( int arg1, int arg2 ) ;
260 FUNCTION: int rl_undo_command ( int arg1, int arg2 ) ;
261
262 FUNCTION: int rl_tilde_expand ( int arg1, int arg2 ) ;
263
264 FUNCTION: int rl_restart_output ( int arg1, int arg2 ) ;
265 FUNCTION: int rl_stop_output ( int arg1, int arg2 ) ;
266
267 FUNCTION: int rl_abort ( int arg1, int arg2 ) ;
268 FUNCTION: int rl_tty_status ( int arg1, int arg2 ) ;
269
270 FUNCTION: int rl_history_search_forward ( int arg1, int arg2 ) ;
271 FUNCTION: int rl_history_search_backward ( int arg1, int arg2 ) ;
272 FUNCTION: int rl_noninc_forward_search ( int arg1, int arg2 ) ;
273 FUNCTION: int rl_noninc_reverse_search ( int arg1, int arg2 ) ;
274 FUNCTION: int rl_noninc_forward_search_again ( int arg1, int arg2 ) ;
275 FUNCTION: int rl_noninc_reverse_search_again ( int arg1, int arg2 ) ;
276
277 FUNCTION: int rl_insert_close ( int arg1, int arg2 ) ;
278
279 FUNCTION: void rl_callback_handler_install ( c-string arg1,
280                                             rl_vcpfunc_t* arg2 ) ;
281 FUNCTION: void rl_callback_read_char ( ) ;
282 FUNCTION: void rl_callback_handler_remove ( ) ;
283
284 FUNCTION: int rl_vi_redo ( int arg1, int arg2 ) ;
285 FUNCTION: int rl_vi_undo ( int arg1, int arg2 ) ;
286 FUNCTION: int rl_vi_yank_arg ( int arg1, int arg2 ) ;
287 FUNCTION: int rl_vi_fetch_history ( int arg1, int arg2 ) ;
288 FUNCTION: int rl_vi_search_again ( int arg1, int arg2 ) ;
289 FUNCTION: int rl_vi_search ( int arg1, int arg2 ) ;
290 FUNCTION: int rl_vi_complete ( int arg1, int arg2 ) ;
291 FUNCTION: int rl_vi_tilde_expand ( int arg1, int arg2 ) ;
292 FUNCTION: int rl_vi_prev_word ( int arg1, int arg2 ) ;
293 FUNCTION: int rl_vi_next_word ( int arg1, int arg2 ) ;
294 FUNCTION: int rl_vi_end_word ( int arg1, int arg2 ) ;
295 FUNCTION: int rl_vi_insert_beg ( int arg1, int arg2 ) ;
296 FUNCTION: int rl_vi_append_mode ( int arg1, int arg2 ) ;
297 FUNCTION: int rl_vi_append_eol ( int arg1, int arg2 ) ;
298 FUNCTION: int rl_vi_eof_maybe ( int arg1, int arg2 ) ;
299 FUNCTION: int rl_vi_insertion_mode ( int arg1, int arg2 ) ;
300 FUNCTION: int rl_vi_insert_mode ( int arg1, int arg2 ) ;
301 FUNCTION: int rl_vi_movement_mode ( int arg1, int arg2 ) ;
302 FUNCTION: int rl_vi_arg_digit ( int arg1, int arg2 ) ;
303 FUNCTION: int rl_vi_change_case ( int arg1, int arg2 ) ;
304 FUNCTION: int rl_vi_put ( int arg1, int arg2 ) ;
305 FUNCTION: int rl_vi_column ( int arg1, int arg2 ) ;
306 FUNCTION: int rl_vi_delete_to ( int arg1, int arg2 ) ;
307 FUNCTION: int rl_vi_change_to ( int arg1, int arg2 ) ;
308 FUNCTION: int rl_vi_yank_to ( int arg1, int arg2 ) ;
309 FUNCTION: int rl_vi_rubout ( int arg1, int arg2 ) ;
310 FUNCTION: int rl_vi_delete ( int arg1, int arg2 ) ;
311 FUNCTION: int rl_vi_back_to_indent ( int arg1, int arg2 ) ;
312 FUNCTION: int rl_vi_first_print ( int arg1, int arg2 ) ;
313 FUNCTION: int rl_vi_char_search ( int arg1, int arg2 ) ;
314 FUNCTION: int rl_vi_match ( int arg1, int arg2 ) ;
315 FUNCTION: int rl_vi_change_char ( int arg1, int arg2 ) ;
316 FUNCTION: int rl_vi_subst ( int arg1, int arg2 ) ;
317 FUNCTION: int rl_vi_overstrike ( int arg1, int arg2 ) ;
318 FUNCTION: int rl_vi_overstrike_delete ( int arg1, int arg2 ) ;
319 FUNCTION: int rl_vi_replace ( int arg1, int arg2 ) ;
320 FUNCTION: int rl_vi_set_mark ( int arg1, int arg2 ) ;
321 FUNCTION: int rl_vi_goto_mark ( int arg1, int arg2 ) ;
322
323 FUNCTION: int rl_vi_check ( ) ;
324 FUNCTION: int rl_vi_domove ( int arg1, int* arg2 ) ;
325 FUNCTION: int rl_vi_bracktype ( int ) ;
326
327 FUNCTION: void rl_vi_start_inserting ( int arg1, int arg2, int
328                                       arg3 ) ;
329
330 FUNCTION: int rl_vi_fWord ( int arg1, int arg2 ) ;
331 FUNCTION: int rl_vi_bWord ( int arg1, int arg2 ) ;
332 FUNCTION: int rl_vi_eWord ( int arg1, int arg2 ) ;
333 FUNCTION: int rl_vi_fword ( int arg1, int arg2 ) ;
334 FUNCTION: int rl_vi_bword ( int arg1, int arg2 ) ;
335 FUNCTION: int rl_vi_eword ( int arg1, int arg2 ) ;
336
337 FUNCTION: char* readline ( c-string ) ;
338
339 FUNCTION: int rl_set_prompt ( c-string ) ;
340 FUNCTION: int rl_expand_prompt ( c-string ) ;
341
342 FUNCTION: int rl_initialize ( ) ;
343
344 FUNCTION: int rl_discard_argument ( ) ;
345
346 FUNCTION: int rl_add_defun ( c-string arg1, rl_command_func_t*
347                             arg2, int arg3 ) ;
348 FUNCTION: int rl_bind_key ( int arg1, rl_command_func_t* arg2 ) ;
349 FUNCTION: int rl_bind_key_in_map ( int arg1, rl_command_func_t*
350                                   arg2, Keymap arg3 ) ;
351 FUNCTION: int rl_unbind_key ( int ) ;
352 FUNCTION: int rl_unbind_key_in_map ( int arg1, Keymap arg2 ) ;
353 FUNCTION: int rl_bind_key_if_unbound ( int arg1,
354                                       rl_command_func_t* arg2 ) ;
355 FUNCTION: int rl_bind_key_if_unbound_in_map ( int arg1,
356                                              rl_command_func_t*
357                                              arg2, Keymap arg3 ) ;
358 FUNCTION: int rl_unbind_function_in_map ( rl_command_func_t*
359                                          arg1, Keymap arg2 ) ;
360 FUNCTION: int rl_unbind_command_in_map ( c-string arg1, Keymap
361                                         arg2 ) ;
362 FUNCTION: int rl_bind_keyseq ( c-string arg1, rl_command_func_t*
363                               arg2 ) ;
364 FUNCTION: int rl_bind_keyseq_in_map ( c-string arg1,
365                                      rl_command_func_t* arg2, Keymap
366                                      arg3 ) ;
367 FUNCTION: int rl_bind_keyseq_if_unbound ( c-string arg1,
368                                          rl_command_func_t* arg2 ) ;
369 FUNCTION: int rl_bind_keyseq_if_unbound_in_map ( c-string arg1,
370                                                 rl_command_func_t*
371                                                 arg2, Keymap
372                                                 arg3 ) ;
373 FUNCTION: int rl_generic_bind ( int arg1, c-string arg2,
374                                c-string arg3, Keymap arg4 ) ;
375
376 FUNCTION: c-string rl_variable_value ( c-string ) ;
377 FUNCTION: int rl_variable_bind ( c-string arg1, c-string arg2 ) ;
378
379 FUNCTION: int rl_set_key ( c-string arg1, rl_command_func_t*
380                           arg2, Keymap arg3 ) ;
381 FUNCTION: int rl_macro_bind ( c-string arg1, c-string arg2,
382                              Keymap arg3 ) ;
383 FUNCTION: int rl_translate_keyseq ( c-string arg1, c-string
384                                    arg2, int* arg3 ) ;
385 FUNCTION: c-string rl_untranslate_keyseq ( int ) ;
386 FUNCTION: rl_command_func_t* rl_named_function ( c-string ) ;
387 FUNCTION: rl_command_func_t* rl_function_of_keyseq ( c-string
388                                                     arg1, Keymap
389                                                     arg2, int*
390                                                     arg3 ) ;
391
392 FUNCTION: void rl_list_funmap_names ( ) ;
393 FUNCTION: char** rl_invoking_keyseqs_in_map ( rl_command_func_t*
394                                              arg1, Keymap arg2 ) ;
395 FUNCTION: char** rl_invoking_keyseqs ( rl_command_func_t* ) ;
396
397 FUNCTION: void rl_function_dumper ( int ) ;
398 FUNCTION: void rl_macro_dumper ( int ) ;
399 FUNCTION: void rl_variable_dumper ( int ) ;
400
401 FUNCTION: int rl_read_init_file ( c-string ) ;
402 FUNCTION: int rl_parse_and_bind ( c-string ) ;
403
404 FUNCTION: Keymap rl_make_bare_keymap ( ) ;
405
406 FUNCTION: Keymap rl_get_keymap_by_name ( c-string ) ;
407 FUNCTION: c-string rl_get_keymap_name ( Keymap ) ;
408 FUNCTION: void rl_set_keymap ( Keymap ) ;
409 FUNCTION: Keymap rl_get_keymap ( ) ;
410 FUNCTION: void rl_set_keymap_from_edit_mode ( ) ;
411 FUNCTION: c-string rl_get_keymap_name_from_edit_mode ( ) ;
412
413 FUNCTION: int rl_add_funmap_entry ( c-string arg1,
414                                    rl_command_func_t* arg2 ) ;
415 FUNCTION: char** rl_funmap_names ( ) ;
416 FUNCTION: void rl_initialize_funmap ( ) ;
417
418 FUNCTION: void rl_push_macro_input ( c-string ) ;
419
420 FUNCTION: void rl_add_undo ( undo_code arg1, int arg2, int
421                             arga3, c-string arg4 ) ;
422 FUNCTION: void rl_free_undo_list ( ) ;
423 FUNCTION: int rl_do_undo ( ) ;
424 FUNCTION: int rl_begin_undo_group ( ) ;
425 FUNCTION: int rl_end_undo_group ( ) ;
426 FUNCTION: int rl_modifying ( int arg1, int arg2 ) ;
427
428 FUNCTION: void rl_redisplay ( ) ;
429 FUNCTION: int rl_on_new_line ( ) ;
430 FUNCTION: int rl_on_new_line_with_prompt ( ) ;
431 FUNCTION: int rl_forced_update_display ( ) ;
432 FUNCTION: int rl_clear_message ( ) ;
433 FUNCTION: int rl_reset_line_state ( ) ;
434 FUNCTION: int rl_crlf ( ) ;
435
436 ! FUNCTION: int rl_message ( c-string arg1, ... ) ;
437 FUNCTION: int rl_show_char ( int ) ;
438
439 FUNCTION: int rl_character_len ( int arg1, int arg2 ) ;
440
441 FUNCTION: void rl_save_prompt ( ) ;
442 FUNCTION: void rl_restore_prompt ( ) ;
443
444 FUNCTION: void rl_replace_line ( c-string arg1, int arg2 ) ;
445 FUNCTION: int rl_insert_text ( c-string arg1 ) ;
446 FUNCTION: int rl_delete_text ( int arg1, int arg2 ) ;
447 FUNCTION: int rl_kill_text ( int arg1, int arg2 ) ;
448 FUNCTION: c-string rl_copy_text ( int arg1, int arg2 ) ;
449
450 FUNCTION: void rl_prep_terminal ( int ) ;
451 FUNCTION: void rl_deprep_terminal ( ) ;
452 FUNCTION: void rl_tty_set_default_bindings ( Keymap ) ;
453 FUNCTION: void rl_tty_unset_default_bindings ( Keymap ) ;
454
455 FUNCTION: int rl_reset_terminal ( c-string ) ;
456 FUNCTION: void rl_resize_terminal ( ) ;
457 FUNCTION: void rl_set_screen_size ( int arg1, int arg2 ) ;
458 FUNCTION: void rl_get_screen_size ( int* arg1, int* arg2 ) ;
459 FUNCTION: void rl_reset_screen_size ( ) ;
460
461 FUNCTION: c-string rl_get_termcap ( c-string ) ;
462
463 FUNCTION: int rl_stuff_char ( int ) ;
464 FUNCTION: int rl_execute_next ( int ) ;
465 FUNCTION: int rl_clear_pending_input ( ) ;
466 FUNCTION: int rl_read_key ( ) ;
467 FUNCTION: int rl_getc ( FILE* ) ;
468 FUNCTION: int rl_set_keyboard_input_timeout ( int ) ;
469
470 FUNCTION: void rl_extend_line_buffer ( int ) ;
471 FUNCTION: int rl_ding ( ) ;
472 FUNCTION: int rl_alphabetic ( int ) ;
473 FUNCTION: void rl_free ( void* ) ;
474
475 FUNCTION: int rl_set_signals ( ) ;
476 FUNCTION: int rl_clear_signals ( ) ;
477 FUNCTION: void rl_cleanup_after_signal ( ) ;
478 FUNCTION: void rl_reset_after_signal ( ) ;
479 FUNCTION: void rl_free_line_state ( ) ;
480
481 FUNCTION: void rl_echo_signal_char ( int ) ;
482
483 FUNCTION: int rl_set_paren_blink_timeout ( int ) ;
484
485 FUNCTION: int rl_maybe_save_line ( ) ;
486 FUNCTION: int rl_maybe_unsave_line ( ) ;
487 FUNCTION: int rl_maybe_replace_line ( ) ;
488
489 FUNCTION: int rl_complete_internal ( int ) ;
490 FUNCTION: void rl_display_match_list ( char** arg1, int arg2,
491                                       int arg3 ) ;
492
493 FUNCTION: char** rl_completion_matches ( c-string arg1,
494                                         rl_compentry_func_t*
495                                         arg2 ) ;
496 FUNCTION: c-string rl_username_completion_function ( c-string
497                                                     arg1, int
498                                                     arg2 ) ;
499 FUNCTION: c-string rl_filename_completion_function ( c-string
500                                                     arg1, int
501                                                     arg2 ) ;
502
503 FUNCTION: int rl_completion_mode ( rl_command_func_t* ) ;
504
505 C-GLOBAL: c-string rl_library_version
506 C-GLOBAL: int rl_readline_version
507 C-GLOBAL: int rl_gnu_readline_p
508 C-GLOBAL: int rl_readline_state
509 C-GLOBAL: int rl_editing_mode
510 C-GLOBAL: int rl_insert_mode
511 C-GLOBAL: c-string rl_readline_name
512 C-GLOBAL: c-string rl_prompt
513 C-GLOBAL: c-string rl_display_prompt
514 C-GLOBAL: c-string rl_line_buffer
515 C-GLOBAL: int rl_point
516 C-GLOBAL: int rl_end
517 C-GLOBAL: int rl_mark
518 C-GLOBAL: int rl_done
519 C-GLOBAL: int rl_pending_input
520 C-GLOBAL: int rl_dispatching
521 C-GLOBAL: int rl_explicit_arg
522 C-GLOBAL: int rl_numeric_arg
523 C-GLOBAL: rl_command_func_t* rl_last_func
524 C-GLOBAL: c-string rl_terminal_name
525
526 C-GLOBAL: FILE* rl_instream
527 C-GLOBAL: FILE* rl_outstream
528
529 C-GLOBAL: int rl_prefer_env_winsize
530
531 C-GLOBAL: rl_hook_func_t* rl_startup_hook
532 C-GLOBAL: rl_hook_func_t* rl_pre_input_hook
533 C-GLOBAL: rl_hook_func_t* rl_event_hook
534
535 C-GLOBAL: rl_getc_func_t* rl_getc_function
536 C-GLOBAL: rl_voidfunc_t* rl_redisplay_function
537 C-GLOBAL: rl_vintfunc_t* rl_prep_term_function
538 C-GLOBAL: rl_voidfunc_t* rl_deprep_term_function
539
540 C-GLOBAL: Keymap rl_executing_keymap
541 C-GLOBAL: Keymap rl_binding_keymap
542
543 C-GLOBAL: int rl_erase_empty_line
544 C-GLOBAL: int rl_already_prompted
545 C-GLOBAL: int rl_num_chars_to_read
546 C-GLOBAL: c-string rl_executing_macro
547
548 C-GLOBAL: int rl_catch_signals
549 C-GLOBAL: int rl_catch_sigwinch
550 C-GLOBAL: rl_compentry_func_t* rl_completion_entry_function
551 C-GLOBAL: rl_compentry_func_t* rl_menu_completion_entry_function
552 C-GLOBAL: rl_compignore_func_t* rl_ignore_some_completions_function
553 C-GLOBAL: rl_completion_func_t* rl_attempted_completion_function
554 C-GLOBAL: c-string rl_basic_word_break_characters
555 C-GLOBAL: c-string rl_completer_word_break_characters
556 C-GLOBAL: rl_cpvfunc_t* rl_completion_word_break_hook
557
558 C-GLOBAL: c-string rl_completer_quote_characters
559 C-GLOBAL: c-string rl_basic_quote_characters
560 C-GLOBAL: c-string rl_filename_quote_characters
561 C-GLOBAL: c-string rl_special_prefixes
562 C-GLOBAL: rl_icppfunc_t* rl_directory_completion_hook
563
564 C-GLOBAL: rl_icppfunc_t* rl_directory_rewrite_hook
565 C-GLOBAL: rl_dequote_func_t* rl_filename_rewrite_hook
566 C-GLOBAL: rl_compdisp_func_t* rl_completion_display_matches_hook
567 C-GLOBAL: int rl_filename_completion_desired
568 C-GLOBAL: int rl_filename_quoting_desired
569 C-GLOBAL: rl_quote_func_t* rl_filename_quoting_function
570 C-GLOBAL: rl_dequote_func_t* rl_filename_dequoting_function
571 C-GLOBAL: rl_linebuf_func_t* rl_char_is_quoted_p
572 C-GLOBAL: int rl_attempted_completion_over
573 C-GLOBAL: int rl_completion_type
574 C-GLOBAL: int rl_completion_invoking_key
575 C-GLOBAL: int rl_completion_query_items
576 C-GLOBAL: int rl_completion_append_character
577 C-GLOBAL: int rl_completion_suppress_append
578 C-GLOBAL: int rl_completion_quote_character
579 C-GLOBAL: int rl_completion_found_quote
580 C-GLOBAL: int rl_completion_suppress_quote
581 C-GLOBAL: int rl_sort_completion_matches
582 C-GLOBAL: int rl_completion_mark_symlink_dirs
583
584 C-GLOBAL: int rl_ignore_completion_duplicates
585 C-GLOBAL: int rl_inhibit_completion
586
587 CONSTANT: READERR -2
588
589 CONSTANT: RL_PROMPT_START_IGNORE 1
590 CONSTANT: RL_PROMPT_END_IGNORE   2
591
592 CONSTANT: NO_MATCH        0
593 CONSTANT: SINGLE_MATCH    1
594 CONSTANT: MULT_MATCH      2
595
596 CONSTANT: RL_STATE_NONE         0x0000000
597 CONSTANT: RL_STATE_INITIALIZING 0x0000001
598 CONSTANT: RL_STATE_INITIALIZED  0x0000002
599 CONSTANT: RL_STATE_TERMPREPPED  0x0000004
600 CONSTANT: RL_STATE_READCMD      0x0000008
601 CONSTANT: RL_STATE_METANEXT     0x0000010
602 CONSTANT: RL_STATE_DISPATCHING  0x0000020
603 CONSTANT: RL_STATE_MOREINPUT    0x0000040
604 CONSTANT: RL_STATE_ISEARCH      0x0000080
605 CONSTANT: RL_STATE_NSEARCH      0x0000100
606 CONSTANT: RL_STATE_SEARCH       0x0000200
607 CONSTANT: RL_STATE_NUMERICARG   0x0000400
608 CONSTANT: RL_STATE_MACROINPUT   0x0000800
609 CONSTANT: RL_STATE_MACRODEF     0x0001000
610 CONSTANT: RL_STATE_OVERWRITE    0x0002000
611 CONSTANT: RL_STATE_COMPLETING   0x0004000
612 CONSTANT: RL_STATE_SIGHANDLER   0x0008000
613 CONSTANT: RL_STATE_UNDOING      0x0010000
614 CONSTANT: RL_STATE_INPUTPENDING 0x0020000
615 CONSTANT: RL_STATE_TTYCSAVED    0x0040000
616 CONSTANT: RL_STATE_CALLBACK     0x0080000
617 CONSTANT: RL_STATE_VIMOTION     0x0100000
618 CONSTANT: RL_STATE_MULTIKEY     0x0200000
619 CONSTANT: RL_STATE_VICMDONCE    0x0400000
620 CONSTANT: RL_STATE_REDISPLAYING 0x0800000
621 CONSTANT: RL_STATE_DONE         0x1000000
622
623 : RL_SETSTATE   ( x -- ) rl_readline_state get bitor rl_readline_state set ; inline
624 : RL_UNSETSTATE ( x -- ) not rl_readline_state get bitand rl_readline_state set ; inline
625 : RL_ISSTATE    ( x -- ? ) rl_readline_state get bitand 0 = not ; inline
626
627 STRUCT: readline_state
628     { point         int                }
629     { end           int                }
630     { mark          int                }
631     { buffer        char*              }
632     { buflen        int                }
633     { ul            UNDO_LIST*         }
634     { prompt        char*              }
635     { rlstate       int                }
636     { done          int                }
637     { kmap          Keymap             }
638     { lastfunc      rl_command_func_t* }
639     { insmode       int                }
640     { edmode        int                }
641     { kseqlen       int                }
642     { inf           FILE*              }
643     { outf          FILE*              }
644     { pendingin     int                }
645     { macro         char*              }
646     { catchsigs     int                }
647     { catchsigwinch int                }
648     { reserved      char[64]           } ;
649
650 FUNCTION: int rl_save_state ( readline_state* ) ;
651 FUNCTION: int rl_restore_state ( readline_state* ) ;