From 926b13a799549eae8e03c337d9fe49116e703cb1 Mon Sep 17 00:00:00 2001 From: Dennis Ritchie Date: Wed, 14 Feb 1973 22:26:23 -0500 Subject: [PATCH] Research V3 development Work on file man/man3/putc.3 Synthesized-from: v3 --- man/man3/putc.3 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 man/man3/putc.3 diff --git a/man/man3/putc.3 b/man/man3/putc.3 new file mode 100644 index 0000000000..9a14bf8b69 --- /dev/null +++ b/man/man3/putc.3 @@ -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______ creates +the given file (mode 17) and sets up the buffer iobuf_____ (size 518(10) bytes); +putc____ and putw____ write a byte or word respectively +onto the file; +flush_____ 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______ 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_____ to force out the last of the output. +.sp +The user must supply iobuf_____, which should begin on a word boundary. + +To write a new file using the same buffer, it +suffices to call flush_____, close the file, +and call fcreat______ 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______ call +.sp +.ti 0 +BUGS -- -- 2.20.1