aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-09 10:05:19 -0500
committerDavid Robillard <d@drobilla.net>2022-12-09 10:05:19 -0500
commit221636904b9389a3709c40c38ca3dbf51e4c32f7 (patch)
tree3227a9e14cb71d9e1fb5e88a6a167f149f662165 /src
parent9a222ac2ae6b4dac6dd8a414498523f472e90279 (diff)
downloadserd-221636904b9389a3709c40c38ca3dbf51e4c32f7.tar.gz
serd-221636904b9389a3709c40c38ca3dbf51e4c32f7.tar.bz2
serd-221636904b9389a3709c40c38ca3dbf51e4c32f7.zip
Add serd_reader_skip_until_byte() to public API
Diffstat (limited to 'src')
-rw-r--r--src/n3.c13
-rw-r--r--src/serd_config.h2
2 files changed, 10 insertions, 5 deletions
diff --git a/src/n3.c b/src/n3.c
index e36d753c..6577fa3b 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -1672,12 +1672,17 @@ read_n3_statement(SerdReader* const reader)
return st;
}
-static void
-skip_until(SerdReader* const reader, const uint8_t byte)
+SerdStatus
+serd_reader_skip_until_byte(SerdReader* const reader, const uint8_t byte)
{
- for (int c = 0; (c = peek_byte(reader)) && c != byte && c != EOF;) {
+ int c = peek_byte(reader);
+
+ while (c != byte && c != EOF) {
skip_byte(reader, c);
+ c = peek_byte(reader);
}
+
+ return c == EOF ? SERD_FAILURE : SERD_SUCCESS;
}
SerdStatus
@@ -1689,7 +1694,7 @@ read_turtleTrigDoc(SerdReader* const reader)
if (reader->strict) {
return st;
}
- skip_until(reader, '\n');
+ serd_reader_skip_until_byte(reader, '\n');
}
}
diff --git a/src/serd_config.h b/src/serd_config.h
index 98fb01c9..df73522b 100644
--- a/src/serd_config.h
+++ b/src/serd_config.h
@@ -16,7 +16,7 @@
#define SERD_CONFIG_H
// Define version unconditionally so a warning will catch a mismatch
-#define SERD_VERSION "0.30.17"
+#define SERD_VERSION "0.31.0"
#if !defined(SERD_NO_DEFAULT_CONFIG)