|
Data Structures | |
| struct | stream |
| A generic byte stream. More... | |
Modules | |
| Character Stream Implementation | |
| Debug Console | |
Functions | |
| int | stream_putstr (struct stream *stream, const char *str) |
| Write a string to a stream. | |
| int | stream_putchar (struct stream *stream, int c) |
| Write a single character to a stream. | |
| int | stream_vprintf (struct stream *stream, const char *format, va_list ap) |
| Formatted output conversion to a stream. | |
| int | stream_printf (struct stream *stream, const char *format,...) |
| Formatted output conversion. | |
A character stream is a FIFO queue of characters. At the front end, characters are inserted into the queue (the stream buffer), while at the back end, characters are extracted from the queue and usually processed in some way (e.g. sent to a hardware device).
The helper functions defined in this module ensure that the stream backend driver is notified when new data is inserted into the buffer, and they also wait for the backend to process some of the data when the buffer becomes too full to insert all the requested data.
| int stream_printf | ( | struct stream * | stream, | |
| const char * | format, | |||
| ... | ||||
| ) |
Formatted output conversion.
This is simply a convenience wrapper around stream_vprintf() taking a variable number of arguments.
| int stream_putchar | ( | struct stream * | stream, | |
| int | c | |||
| ) |
Write a single character to a stream.
| stream | The stream to which the output is to be sent | |
| c | The character to write. |
| int int stream_putstr | ( | struct stream * | stream, | |
| const char * | str | |||
| ) |
Write a string to a stream.
| stream | The stream to which the output is to be sent | |
| str | NUL-terminated string. |
| int stream_vprintf | ( | struct stream * | stream, | |
| const char * | format, | |||
| va_list | ap | |||
| ) |
Formatted output conversion to a stream.
Produce output according to format to the given stream. format is interpreted as a regular printf()-style format string with a few limitations (some specifiers are accepted but ignored.)
| stream | The stream to which the output is to be sent | |
| format | Format specification. | |
| ap | Format arguments as a vararg list. |
Referenced by snprintf(), and sprintf().
1.6.3