PUTC(K) UNIX System V PUTC(K)
Name
putc, putcb, putcbp, putcf - write to clists
Syntax
int
putc(c, cp)
int c;
struct clist *cp;
int
putcb(cbp, cp)
struct cblock *cbp;
struct clist *cp;
int
putcbp(p, cp, n)
struct clist *p;
char *cp;
int n;
int
putcf(cbp)
struct cblock *cbp;
Description
The putc routine moves one character to the clist buffer for
each call. putc contains a "critical" section of code and
should be protected from interrupts when called.
The putcb routine moves one cblock to the clist buffer for
each call.
The putcbp routine appends characters from a buffer to the
clist given as an argument. If the current cblock has no
room for the requested characters, putcbp gets new cblocks
from the free list as needed.
The putcf routine puts the specified cblock onto the
freelist.
Parameters
The value of c is an integer that specifies the character to
be moved.
A pointer cp specifies the clist buffer where the character
is placed.
The pointer cbp specifies the cblock to be moved by putcb.
The pointer cp specifies the clist buffer to where the
cblock is moved by putcb.
The argument cbp specifies a pointer to a cblock.
Return Value
The putc routine returns 0 if it places the specified
character in the buffer, or returns -1 if there is no free
space. The putcb routine returns 0 after placing the
specified cblock in the buffer.
Notes
These routines can be used only with character device
drivers.
See Also
getc(K), spl(K)
(printed 7/7/89)