DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

putc(D3oddi)


putc, putcb, putcbp, putcf -- write to clists

Synopsis

int putc(int c, struct clist *cp);

int putcb(struct cblock *cbp, struct clist *cp);

int putcbp(struct clist *cp, char *buf, int n);

void putcf(struct cblock *cbp);

Description

The putc( ) function adds one character to the clist buffer.

The putcb( ) function adds the cblock to the clist buffer.

The putcbp( ) function appends the specified number of characters from the character buffer to the clist. If the current cblock does not have room for these characters, putcbp gets new cblocks from the free list as needed.

The putcf( ) function frees the specified cblock.

Arguments


c
Character to be added to the clist buffer.

cp
Pointer to the clist buffer.

cbp
Pointer to the cblock.

buf
Character buffer from which to read characters.

n
Number of characters to read.

Return values

putc returns 0 if it places the specified character in the buffer, or it returns -1 if there is no free space.

putcb always returns 0.

putcbp returns the number of characters put in the clist. If no clists are available, getcbp issues a CONFIG: error message using cmn_err(D3oddi) and returns the number of characters actually stored.

putcf has no return value.

Usage

These functions can be used only with character device drivers. They protect their internal critical sections of code using spltty(D3oddi).

Context and synchronization

Non-blockable, interrupt, user, or blockable context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

This function is not supported for DDI drivers, where serial drivers are implemented as STREAMS devices and do not use clists and cblocks.

References

cmn_err(D3oddi), getc(D3oddi), spltty(D3oddi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005