diff options
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 |