1.1--- a/lisp/ffi/readline/readline.lisp Fri Sep 20 22:18:48 2024 -0400
1.2+++ b/lisp/ffi/readline/readline.lisp Sat Sep 21 00:04:33 2024 -0400
1.3@@ -323,6 +323,10 @@
1.4 (define-alien-routine "rl_filename_completion_function" c-string (name c-string) (i int))
1.5 (define-alien-routine "rl_completion_mode" int (function (* rl-command-func)))
1.6
1.7+;; state
1.8+(define-alien-routine "rl_save_state" int (state (* readline-state)))
1.9+(define-alien-routine "rl_restore_state" int (state (* readline-state)))
1.10+
1.11 ;; history.h
1.12 (define-alien-routine "using_history" void)
1.13 (define-alien-routine "add_history" void (line c-string))
1.14@@ -331,26 +335,13 @@
1.15 (define-alien-routine "unstifle_history" int)
1.16 (define-alien-routine "history_is_stifled" int)
1.17 (define-alien-routine "history_list" (array (* rl-hist-entry)))
1.18-
1.19-(define-alien-routine "rl_save_state" int (state (* readline-state)))
1.20-(define-alien-routine "rl_restore_state" int (state (* readline-state)))
1.21+(define-alien-routine "previous_history" (* rl-hist-entry))
1.22+(define-alien-routine "next_history" (* rl-hist-entry))
1.23
1.24 (defvar +c-buffer-size+ 256
1.25 "How many bytes to allocate per Lisp string when converting list of
1.26 Lisp strings into array of C strings.")
1.27
1.28-(defun decode-version (version)
1.29- "Transform VERSION into two values representing major and minor numbers of
1.30-Readline library version."
1.31- (values (ldb (byte 8 8) version)
1.32- (ldb (byte 8 0) version)))
1.33-
1.34-;; (mapcan (lambda (index keyword)
1.35-;; (when (logbitp index state)
1.36-;; (list keyword)))
1.37-;; (iota (length +states+))
1.38-;; +states+))
1.39-
1.40 (defmacro produce-callback (function return-type &optional func-arg-list)
1.41 "Return pointer to callback that calls FUNCTION. RETURN-TYPE specifies
1.42 return type of the function and FUNC-ARG-LIST is list of argument types (it