This commit is contained in:
Ian Keane 2020-02-18 14:21:14 -05:00
parent 276853ba84
commit 1cb167b597
361 changed files with 77302 additions and 4 deletions

View file

@ -0,0 +1,19 @@
(in-package :de.anvi.croatoan)
(defun get-string (window n &key y x)
"Read a string from the keyboard and return it.
Reading is performed until a newline or carriage return is received.
The terminating character is not included in the returned string.
If n is given, read at most n chars, to prevent a possible input
buffer overflow.
If the destination coordinates y and x are given, move the cursor
there first."
(let ((winptr (winptr window)))
(with-foreign-pointer-as-string (string n)
(cond ((and y x)
(%mvwgetnstr winptr y x string n))
(t
(%wgetnstr winptr string n))))))