From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/fio/getci.x | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sys/fio/getci.x (limited to 'sys/fio/getci.x') diff --git a/sys/fio/getci.x b/sys/fio/getci.x new file mode 100644 index 00000000..64dd6f66 --- /dev/null +++ b/sys/fio/getci.x @@ -0,0 +1,27 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include + +# GETCI -- Get a character (passed as an integer) from a file. + +int procedure getci (fd, ch) + +int fd # input file +int 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