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

getc(D3oddi)


getc, getcb, getcbp, getcf -- read clist buffers

Synopsis

int getc(struct clist *cp);

struct cblock *getcb(struct clist *cp);

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

struct cblock *getcf(void);

Description

The getc( ) function removes and returns one character from a clist buffer.

The getcb( ) function removes and returns one cblock from the clist buffer.

The getcbp( ) function removes the specified number of characters from a clist and transfers them to a character buffer.

The getcf( ) function takes a cblock from the freelist and returns a pointer to it.

Arguments


cp
Pointer to a clist buffer.

buf
Character buffer to which to transfer the characters.

n
Number of characters to transfer.

Return values

getc returns the next character in the buffer or -1 if the buffer is empty.

getcb returns a pointer to the first cblock of the clist or NULL if the clist is empty.

getcbp returns the number of characters actually moved (which is less than or equal to n).

getcf returns a pointer to a cblock if available. Otherwise, it returns NULL.

Usage

These routines can be used only within character device drivers.

These routines 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

DDI drivers are implemented as STREAMS devices and do not use clists so there is no comparable function for DDI drivers.

References

putc(D3oddi), spltty(D3oddi)


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005