| uint32_t | uint32_t | ||||
| text_decoder_peekc(espeak_ng_TEXT_DECODER *decoder) | text_decoder_peekc(espeak_ng_TEXT_DECODER *decoder) | ||||
| { | { | ||||
| if (decoder->current == decoder->end) return 0; | |||||
| const uint8_t *current = decoder->current; | const uint8_t *current = decoder->current; | ||||
| uint32_t c = decoder->get(decoder); | uint32_t c = decoder->get(decoder); | ||||
| decoder->current = current; | decoder->current = current; |
| assert(text_decoder_getc(decoder) == 'd'); | assert(text_decoder_getc(decoder) == 'd'); | ||||
| assert(text_decoder_eof(decoder) == 1); | assert(text_decoder_eof(decoder) == 1); | ||||
| // Calling peekc past the end of the buffer. | |||||
| assert(text_decoder_peekc(decoder) == '\0'); | |||||
| assert(text_decoder_eof(decoder) == 1); | |||||
| destroy_text_decoder(decoder); | destroy_text_decoder(decoder); | ||||
| } | } | ||||