diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fio/xerputc.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/fio/xerputc.x')
-rw-r--r-- | sys/fio/xerputc.x | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/fio/xerputc.x b/sys/fio/xerputc.x new file mode 100644 index 00000000..5fda4026 --- /dev/null +++ b/sys/fio/xerputc.x @@ -0,0 +1,37 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include <config.h> +include <fio.h> + +# XERPUTC -- Low level routine, called by the error handling code, to +# accumulate an error command, and send it off to the CL. Clumsy, but +# necessary to avoid recursion if an error abort occurs in a routine +# such as PUTC or FLSBUF. The buffer is automatically flushed to CLOUT +# when newline is encountered. + +procedure xerputc (ch) + +char ch +int op, junk, nchars +char msg[SZ_LINE+1] +include <fio.com> +data op /1/ + +begin + msg[op] = ch + + if (ch == '\n' || op > SZ_PATHNAME) { + fp = fiodes[CLOUT] + nchars = op + op = 0 + + if (FTYPE(fp) == TEXT_FILE) + call fputtx (CLOUT, msg, nchars, junk) + else { + call zcall4 (ZAWRBF(fp), FCHAN(fp), msg, nchars * SZB_CHAR, 0) + } + } + + op = op + 1 +end |