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/tty/ttyclear.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/tty/ttyclear.x')
-rw-r--r-- | sys/tty/ttyclear.x | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/tty/ttyclear.x b/sys/tty/ttyclear.x new file mode 100644 index 00000000..86dac6ff --- /dev/null +++ b/sys/tty/ttyclear.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <chars.h> +include "tty.h" + +# TTYCLEAR -- Clear the terminal screen. + +procedure ttyclear (fd, tty) + +int fd +pointer tty + +int status +bool ttygetb() +int ttyctrl() +errchk ttygetb, ttyctrl + +begin + # If hardcopy terminal, output formfeed instead of clear. + if (ttygetb (tty, "ht")) + status = ttyctrl (fd, tty, "ff", T_NLINES(tty)) + else + status = ERR + if (status == ERR) + status = ttyctrl (fd, tty, "cl", T_NLINES(tty)) + + # If ff or cl capability not found, the best we can do is output + # a newline. + if (status == ERR) + call putline (fd, "\n") +end |