From 221636904b9389a3709c40c38ca3dbf51e4c32f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Dec 2022 10:05:19 -0500 Subject: Add serd_reader_skip_until_byte() to public API --- include/serd/serd.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/serd') diff --git a/include/serd/serd.h b/include/serd/serd.h index cf6b5e4d..42e85f87 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -856,6 +856,19 @@ SerdStatus serd_reader_read_string(SerdReader* SERD_NONNULL reader, const uint8_t* SERD_NONNULL utf8); +/** + Skip over bytes in the input until a specific byte is encountered. + + Typically used for recording from errors in a line-based syntax by skipping + ahead to the next newline. + + @return #SERD_SUCCESS if the given byte was reached, or #SERD_FAILURE if the + end of input is reached. +*/ +SERD_API +SerdStatus +serd_reader_skip_until_byte(SerdReader* SERD_NONNULL reader, uint8_t byte); + /// Free `reader` SERD_API void -- cgit v1.2.1