diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/gio/gqverify.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
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 |