From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/fio/getc.x | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sys/fio/getc.x (limited to 'sys/fio/getc.x') diff --git a/sys/fio/getc.x b/sys/fio/getc.x new file mode 100644 index 00000000..b8c469d5 --- /dev/null +++ b/sys/fio/getc.x @@ -0,0 +1,27 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include + +# GETC -- Get a character from a file. + +char procedure getc (fd, ch) + +int fd # input file +char ch # character (output) +int filbuf() +errchk filbuf +include + +begin + if (iop[fd] < bufptr[fd] || iop[fd] >= itop[fd]) + if (filbuf(fd) == EOF) { + ch = EOF + return (EOF) + } + + ch = Memc[iop[fd]] + iop[fd] = iop[fd] + 1 + + return (ch) +end -- cgit