aboutsummaryrefslogtreecommitdiff
path: root/sys/fio/putci.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fio/putci.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/fio/putci.x')
-rw-r--r--sys/fio/putci.x26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/fio/putci.x b/sys/fio/putci.x
new file mode 100644
index 00000000..eeedb30e
--- /dev/null
+++ b/sys/fio/putci.x
@@ -0,0 +1,26 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <config.h>
+include <fio.h>
+
+# PUTCI -- Put a character constant (passed as an integer) to a file.
+
+procedure putci (fd, ch)
+
+int fd # output file
+int 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