Retrieves a character from a character list.
#include <sys/types.h>
#include <sys/errno.h>
#include <cblock.h>
int getc ( header)
struct clist *header;
Item | Description |
---|---|
header | Specifies the address of the clist structure that describes the character list. |
Attention: The caller of the getc service must ensure that the character list is pinned. This includes the clist header and all the cblock character buffers. Otherwise, the system may crash.
The getc kernel service returns the character at the front of the character list. After returning the last character in the buffer, the getc service frees that buffer.
The getc kernel service can be called from either the process or interrupt environment.
Item | Description |
---|---|
-1 | Indicates that the character list is empty. |