📄 putc.3
字号:
.th PUTC III 6/12/72.sh NAMEputc, putw, fcreat, fflush \*- buffered output.sh SYNOPSIS.ft B.nfmov $filename,r0jsr r5,fcreat; iobuf.s3fcreat(file, iobuf)char *file;struct buf *iobuf;.s3.ft R(get byte in r0).ft Bjsr r5,putc; iobuf.s3putc(c, iobuf)int c;struct buf *iobuf;.s3.ft R(get word in r0).ft Bjsr r5,putw; iobuf.s3putw(w, iobuf);.brint w;.brstruct buf *iobuf;.s3jsr r5,flush; iobuf.s3fflush(iobuf)struct buf *iobuf;.fi.ft R.sh DESCRIPTION.it Fcreatcreatesthe given file (mode 666) and sets up the buffer.it iobuf(size 518 bytes);.it putcand.it putwwrite a byte or word respectivelyonto the file;.it flushforces the contents of the buffer to be written, butdoes not close the file.The structure of the buffer is:.nf.ft B.nfstruct buf { int fildes; /* File descriptor */ int nunused; /* Remaining slots */ char *xfree; /* Ptr to next free slot */ char buff[512]; /* The buffer */};.ft R.s3.fiBefore terminating, a program should call.it flushto force out the last of the output.it (fflushfrom C)..s3The user must supply.it iobuf,which should begin on a word boundary..s3To write a new file using the same buffer, itsuffices to call.it [f]flush,close the file,andcall.it fcreatagain..sh "SEE ALSO"creat (II), write (II), getc (III).sh DIAGNOSTICS.it Fcreatsets the error bit (c-bit) if the file creation failed (from C, returns \*-1)..it Putcand.it putwreturn their character (word) argument.In all calls .it errnois set appropriately to 0 or toa system error number.See introduction (II)..sh BUGS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -