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/fmkpbbuf.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/fio/fmkpbbuf.x')
-rw-r--r-- | sys/fio/fmkpbbuf.x | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/fio/fmkpbbuf.x b/sys/fio/fmkpbbuf.x new file mode 100644 index 00000000..ee891949 --- /dev/null +++ b/sys/fio/fmkpbbuf.x @@ -0,0 +1,34 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <config.h> +include <fio.h> + +# FMKPBBUF -- Make the push back buffer. Called when the first attempt is +# made to push data back into an input stream. + +procedure fmkpbbuf (fd) + +int fd +int buflen +pointer bp +errchk malloc +include <fio.com> + +begin + fp = fiodes[fd] + if (bufptr[fd] == NULL) + call fmkbfs (fd) + + buflen = FPBBUFSIZE(fp) + if (buflen <= 0) { + buflen = SZ_PBBUF + FPBBUFSIZE(fp) = buflen + } + + call malloc (bp, buflen, TY_CHAR) + + FPBBUF(fp) = bp + FPBTOP(fp) = bp + buflen + FPBIOP(fp) = bp + FPBSP(fp) = (FPBTOP(fp) - 1) / SZ_INT + 1 +end |