DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦99b930830⟧ TextFile

    Length: 1950 (0x79e)
    Types: TextFile
    Notes: UNIX file
    Names: »putc.3s«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/man/man3/putc.3s« 

TextFile

.ig
	@(#)putc.3s	2.1	7/1/84
	@(#)Copyright (C) 1983 by National Semiconductor Corp.
..
.TH PUTC 3S 
.SH NAME
putc, putchar, fputc, putw \- put character or word on a stream
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.B int putc(c, stream)
.br
.B char c;
.br
.SM
.B FILE
.B *stream;
.PP
.B putchar(c)
.PP
.B fputc(c, stream)
.br
.SM
.B FILE
.B *stream;
.PP
.B putw(w, stream)
.br
.SM
.B FILE
.B *stream;
.SH DESCRIPTION
.I Putc
appends the character
.I c
to the named output
.IR stream .
It returns the character written.
.PP
.I Putchar(c)
is defined as 
.I "putc(c, stdout)."
.PP
.I Fputc
behaves like 
.I putc,
but is a genuine function rather than a macro.
It may be used to save on object text.
.PP
.I Putw
appends word 
(i.e.
.BR int )
.I w
to the output
.IR stream .
It returns the word written.
.I Putw
neither assumes nor causes special alignment in the file.
.PP
The standard stream
.I stdout
is normally buffered if and only if the
output does not refer to a terminal;
this default may be changed by
.IR setbuf (3).
The standard stream
.I stderr
is by default unbuffered unconditionally,
but use of
.I freopen
(see
.IR fopen (3))
will cause it to become buffered;
.IR setbuf ,
again, will set the state to whatever is desired.
When an output stream is unbuffered information appears on the
destination file or terminal as soon as written;
when it is buffered many characters are saved up and written as a block.
.I Fflush
(see 
.IR fclose (3))
may be used to force the block out early.
.SH "SEE ALSO"
fopen(3), fclose(3), getc(3),
puts(3), printf(3),
fread(3)
.SH DIAGNOSTICS
These functions return the constant
.SM
.B EOF
upon error.
Because this is a good integer,
.IR  ferror (3)
should be used to detect 
.I putw
errors.
.SH BUGS
Because it is implemented as a macro,
.I putc
treats a
.I stream
argument with side effects improperly.
In particular
`putc(c, *f++);'
doesn't work sensibly.
.PP
Errors can occur long after the call to
.I putc.