Research V3 development
authorDennis Ritchie <dmr@research.uucp>
Thu, 15 Feb 1973 03:26:23 +0000 (22:26 -0500)
committerDennis Ritchie <dmr@research.uucp>
Thu, 15 Feb 1973 03:26:23 +0000 (22:26 -0500)
Work on file man/man3/putc.3

Synthesized-from: v3

man/man3/putc.3 [new file with mode: 0644]

diff --git a/man/man3/putc.3 b/man/man3/putc.3
new file mode 100644 (file)
index 0000000..9a14bf8
--- /dev/null
@@ -0,0 +1,60 @@
+.pa 1
+.he 'PUTC,PUTW,FCREAT,FLUSH (III)'6/12/72'PUTC,PUTW,FCREAT,FLUSH (III)'
+.ti 0
+NAME           putc, putw, fcreat, flush  --  buffered output
+.sp
+.ti 0
+SYNOPSIS       mov     $filename,r0
+.br
+jsr    r5,fcreat; iobuf
+
+(get byte in r0)
+.br
+jsr    r5,putc; iobuf
+
+(get word in r0)
+.br
+jsr    r5,putw; iobuf
+.sp
+jsr    r5,flush; iobuf
+.sp
+.ti 0
+DESCRIPTION    fcreat\b\b\b\b\b\b______ creates
+the given file (mode 17) and sets up the buffer iobuf\b\b\b\b\b_____ (size 518(10) bytes);
+putc\b\b\b\b____ and putw\b\b\b\b____ write a byte or word respectively
+onto the file;
+flush\b\b\b\b\b_____ forces the contents of the buffer to be written, but
+does not close the file.
+The format of the buffer is:
+.sp
+.nf
+iobuf: .=.+2           / file descriptor
+       .=.+2           / characters unused in buffer
+       .=.+2           / ptr to next free character
+       .=.+512.        / buffer
+.sp
+.fi
+fcreat\b\b\b\b\b\b______ sets the error bit (c-bit) if the 
+file creation failed; none of the other routines
+return error information.
+.sp
+Before terminating, a program should call
+flush\b\b\b\b\b_____ to force out the last of the output.
+.sp
+The user must supply iobuf\b\b\b\b\b_____, which should begin on a word boundary.
+
+To write a new file using the same buffer, it
+suffices to call flush\b\b\b\b\b_____, close the file,
+and call fcreat\b\b\b\b\b\b______ again.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       creat(II), write(II), getc(III)
+.sp
+.ti 0
+DIAGNOSTICS    error bit possible on fcreat\b\b\b\b\b\b______ call
+.sp
+.ti 0
+BUGS           --