+(defun convert-and-free-foreign-string (foreign-string)
+ (let ((lisp-string (convert-from-foreign-string foreign-string)))
+ (free-foreign-object foreign-string)
+ lisp-string))
+
+(defmacro ignore-end-of-file (&body forms)
+ `(catch 'end-of-file
+ (handler-bind ((end-of-file (lambda (e)
+ (declare (ignore e))
+ (throw 'end-of-file nil))))
+ ,@forms)))
+
+(def-function ("readline" c-readline)
+ ((prompt :cstring))
+ :module "readline"
+ :returning (* :char))
+
+(def-function ("add_history" c-add-history)
+ ((str :cstring))
+ :module "readline"
+ :returning :void)
+
+(def-function ("add_completion" c-add-completion)
+ ((str :cstring))
+ :module "cl-readline"
+ :returning :int)
+
+(def-function ("clear_completions" c-clear-completions)
+ ()
+ :module "cl-readline"
+ :returning :void)
+
+(def-function "use_custom_complete"
+ ()
+ :module "cl-readline"
+ :returning :void)
+
+(def-function "use_filename_complete"
+ ()
+ :module "cl-readline"
+ :returning :void)
+
+(let (pkg)
+