diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/gio/gqverify.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/gio/gqverify.x')
-rw-r--r-- | sys/gio/gqverify.x | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/gio/gqverify.x b/sys/gio/gqverify.x new file mode 100644 index 00000000..7f081f3b --- /dev/null +++ b/sys/gio/gqverify.x @@ -0,0 +1,32 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <fset.h> + +define QUERY "Type `q' to verify quit, `return' to return to cursor loop:" + +# GQVERIFY -- Print a message in the status line asking the user if they really +# want to quit, returning YES if they really want to quit, NO otherwise. + +int procedure gqverify() + +int ch +int getci() + +begin + call printf (QUERY) + call flush (STDOUT) + + call fseti (STDIN, F_RAW, YES) + while (getci (STDIN, ch) != EOF) + if (ch == 'q' || ch == '\r' || ch == '\n') + break + + call printf ("\n\n") + call flush (STDOUT) + call fseti (STDIN, F_RAW, NO) + + if (ch == 'q') + return (YES) + else + return (NO) +end |