|
Data Structures | |
| struct | printf_conversion |
| Conversion data for stream_vprintf(). More... | |
| struct | stream_ops |
| Stream backend operations. More... | |
Enumerations | |
| enum | conversion_state { STATE_NORMAL, STATE_FLAG, STATE_WIDTH, STATE_PERIOD, STATE_PRECISION, STATE_LENGTH, STATE_CONVSPEC } |
stream_vprintf() format conversion state. More... | |
Functions | |
| static void | stream_priv_write (struct stream *stream, const char *data, size_t len) |
| Write characters to the output stream. | |
| static int | stream_priv_putchar (struct stream *stream, char c) |
| Send one character to the output stream. | |
| static int | stream_priv_putstr (struct stream *stream, const char *str) |
| Send a nul-terminated string to the output stream. | |
| static void | stream_priv_commit (struct stream *stream) |
| Commit the output stream. | |
| static int | stream_priv_print_signed (struct stream *stream, struct printf_conversion *conv) |
| Print a signed integer according to the conversion specification. | |
| static int | stream_priv_print_unsigned (struct stream *stream, struct printf_conversion *conv) |
| Print an unsigned integer according to the conversion specification. | |
| static unsigned int | stream_buf_size (struct stream *stream) |
| Return the size of the buffer associated with stream. | |
| static bool | stream_buf_has_data (struct stream *stream) |
| Return true if stream contains any data which can be extracted. | |
| static bool | stream_buf_is_full (struct stream *stream) |
| Return true if stream currently cannot accept any more data. | |
| static unsigned int | stream_buf_unused (struct stream *stream) |
| Return the number of bytes available for insertion into stream. | |
| static unsigned int | stream_buf_used (struct stream *stream) |
| Return the number of bytes available for extraction from stream. | |
| static unsigned int | stream_buf_unused_before_end (struct stream *stream) |
| Return the number of unused bytes before the buffer wraps around. | |
| static unsigned int | stream_buf_used_before_end (struct stream *stream) |
| Return the number of bytes available for extraction from stream before the buffer wraps around. | |
| static unsigned int | stream_buf_head (struct stream *stream) |
| Return the head index of stream, i.e. the index at which to insert the next byte. | |
| static unsigned int | stream_buf_tail (struct stream *stream) |
| Return the tail index of stream, i.e. the index at which to extract the next byte. | |
| static char | stream_buf_insert_char (struct stream *stream, char c) |
| Insert the character c at the head of stream. | |
| static char | stream_buf_extract_char (struct stream *stream) |
| Extract one character from the tail of stream. | |
| enum conversion_state |
stream_vprintf() format conversion state.
For internal use only.
This indicates what the parser will be looking for next. The parser may pass through several states for each character in the format conversion spec, as many of the fields are optional.
Definition at line 58 of file stream_core.c.
| static char stream_buf_extract_char | ( | struct stream * | stream | ) | [inline, static] |
Extract one character from the tail of stream.
Definition at line 225 of file stream.h.
References assert, stream::data, stream::ring, ring_extract_entries(), stream_buf_has_data(), and stream_buf_tail().
Referenced by snprintf_stream_commit(), and sprintf_stream_commit().
| static bool stream_buf_has_data | ( | struct stream * | stream | ) | [inline, static] |
Return true if stream contains any data which can be extracted.
Definition at line 149 of file stream.h.
References stream::ring, and ring_is_empty().
Referenced by snprintf_stream_commit(), sprintf_stream_commit(), and stream_buf_extract_char().
| static unsigned int stream_buf_head | ( | struct stream * | stream | ) | [inline, static] |
Return the head index of stream, i.e. the index at which to insert the next byte.
Definition at line 193 of file stream.h.
References stream::ring, ring_get_head(), and stream_buf_size().
Referenced by stream_buf_insert_char(), and stream_priv_write().
| static char stream_buf_insert_char | ( | struct stream * | stream, | |
| char | c | |||
| ) | [inline, static] |
Insert the character c at the head of stream.
Definition at line 211 of file stream.h.
References assert, stream::data, stream::ring, ring_insert_entries(), stream_buf_head(), and stream_buf_is_full().
| static bool stream_buf_is_full | ( | struct stream * | stream | ) | [inline, static] |
Return true if stream currently cannot accept any more data.
Definition at line 155 of file stream.h.
References stream::ring, ring_is_full(), and stream_buf_size().
Referenced by stream_buf_insert_char().
| static unsigned int stream_buf_size | ( | struct stream * | stream | ) | [inline, static] |
Return the size of the buffer associated with stream.
Definition at line 143 of file stream.h.
References stream::ring_mask.
Referenced by stream_buf_head(), stream_buf_is_full(), stream_buf_tail(), stream_buf_unused(), stream_buf_unused_before_end(), and stream_buf_used_before_end().
| static unsigned int stream_buf_tail | ( | struct stream * | stream | ) | [inline, static] |
Return the tail index of stream, i.e. the index at which to extract the next byte.
Definition at line 202 of file stream.h.
References stream::ring, ring_get_tail(), and stream_buf_size().
Referenced by stream_buf_extract_char().
| static unsigned int stream_buf_unused | ( | struct stream * | stream | ) | [inline, static] |
Return the number of bytes available for insertion into stream.
Definition at line 161 of file stream.h.
References stream::ring, ring_entries_unused(), and stream_buf_size().
Referenced by stream_priv_write().
| static unsigned int stream_buf_unused_before_end | ( | struct stream * | stream | ) | [inline, static] |
Return the number of unused bytes before the buffer wraps around.
Definition at line 173 of file stream.h.
References stream::ring, ring_entries_unused_before_end(), and stream_buf_size().
Referenced by stream_priv_write().
| static unsigned int stream_buf_used | ( | struct stream * | stream | ) | [inline, static] |
Return the number of bytes available for extraction from stream.
Definition at line 167 of file stream.h.
References stream::ring, and ring_entries_used().
| static unsigned int stream_buf_used_before_end | ( | struct stream * | stream | ) | [inline, static] |
Return the number of bytes available for extraction from stream before the buffer wraps around.
Definition at line 183 of file stream.h.
References stream::ring, ring_entries_used_before_end(), and stream_buf_size().
| static void stream_priv_commit | ( | struct stream * | stream | ) | [static] |
Commit the output stream.
For internal use only.
This will tell the stream backend that the output buffer contains new data, which may trigger the backend to push the data to the hardware.
| stream | The stream into which new data has been inserted. |
Definition at line 183 of file stream_core.c.
References stream_ops::commit, and stream::ops.
| static int stream_priv_print_signed | ( | struct stream * | stream, | |
| struct printf_conversion * | conv | |||
| ) | [static] |
Print a signed integer according to the conversion specification.
For internal use only.
| stream | The stream to which the output is to be sent | |
| conv | conversion data parsed from the format string. |
Definition at line 198 of file stream_core.c.
References printf_conversion::arg, printf_conversion::d, printf_conversion::pad_char, stream_priv_write(), and printf_conversion::width.
| static int stream_priv_print_unsigned | ( | struct stream * | stream, | |
| struct printf_conversion * | conv | |||
| ) | [static] |
Print an unsigned integer according to the conversion specification.
For internal use only.
| stream | The stream to which the output is to be sent | |
| conv | Conversion data parsed from the format string. |
Definition at line 247 of file stream_core.c.
References printf_conversion::arg, printf_conversion::pad_char, printf_conversion::spec, stream_priv_write(), printf_conversion::u, and printf_conversion::width.
| static int stream_priv_putchar | ( | struct stream * | stream, | |
| char | c | |||
| ) | [static] |
Send one character to the output stream.
For internal use only.
| stream | The stream to which the output is to be sent | |
| c | Character to be inserted into the stream buffer |
Definition at line 147 of file stream_core.c.
References stream_priv_write().
| static int stream_priv_putstr | ( | struct stream * | stream, | |
| const char * | str | |||
| ) | [static] |
Send a nul-terminated string to the output stream.
For internal use only.
| stream | The stream to which the output is to be sent | |
| str | Nul-terminated string to be inserted into the stream buffer |
Definition at line 164 of file stream_core.c.
References stream_priv_write(), and strlen().
| static void stream_priv_write | ( | struct stream * | stream, | |
| const char * | data, | |||
| size_t | len | |||
| ) | [static] |
Write characters to the output stream.
For internal use only.
| stream | The stream to which the output is to be sent | |
| data | Pointer to the character buffer. | |
| len | Length of the character buffer in bytes. |
Definition at line 115 of file stream_core.c.
References cpu_irq_restore(), cpu_irq_save(), stream::data, stream_ops::make_room, memcpy(), min_u, stream::ops, stream::ring, ring_insert_entries(), stream_buf_head(), stream_buf_unused(), and stream_buf_unused_before_end().
Referenced by stream_priv_print_signed(), stream_priv_print_unsigned(), stream_priv_putchar(), and stream_priv_putstr().
1.6.3