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/fio/putc.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/fio/putc.x')
-rw-r--r-- | sys/fio/putc.x | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/fio/putc.x b/sys/fio/putc.x new file mode 100644 index 00000000..3021347d --- /dev/null +++ b/sys/fio/putc.x @@ -0,0 +1,38 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <config.h> +include <fio.h> + +# PUTC -- Put a character to a file. + +procedure putc (fd, ch) + +int fd # output file +char ch # character to be output + +int and() +errchk flsbuf +include <fio.com> + +begin + if (iop[fd] < bufptr[fd] || iop[fd] >= otop[fd]) + call flsbuf (fd, 0) + + Memc[iop[fd]] = ch + iop[fd] = iop[fd] + 1 + + if (ch == '\n') # end of line of text? + if (and (FF_FLUSH, fflags[fd]) != 0) + call flsbuf (fd, 0) +end + + +# PUTCHAR -- Put a character to the standard output. + +procedure putchar (ch) + +char ch # character to be output + +begin + call putc (STDOUT, ch) +end |