! See http://factorcode.org/license.txt for BSD license.
USING: alien.strings destructors io.encodings.utf8 kernel libc
sequences macros quotations words compiler.units fry
-alien.data ;
+alien.data alien.libraries ;
QUALIFIED: readline.ffi
IN: readline
] [ f ] if*
] with-destructors ;
+: current-line ( -- str )
+ readline.ffi:rl_line_buffer ;
+
+: has-readline ( -- ? )
+ "readline" dup load-library dlsym-raw >boolean ;
+
MACRO: set-completion ( quot -- )
[
'[ @ [ utf8 malloc-string ] [ f ] if* ]