aboutsummaryrefslogtreecommitdiffstats
path: root/src/byte_source.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/byte_source.c')
-rw-r--r--src/byte_source.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/byte_source.c b/src/byte_source.c
index 1b02c2be..1a67157b 100644
--- a/src/byte_source.c
+++ b/src/byte_source.c
@@ -16,7 +16,7 @@
#include "serd_internal.h"
-static inline SerdStatus
+SerdStatus
serd_byte_source_page(SerdByteSource* source)
{
source->read_head = 0;
@@ -96,36 +96,3 @@ serd_byte_source_close(SerdByteSource* source)
memset(source, '\0', sizeof(*source));
return SERD_SUCCESS;
}
-
-SerdStatus
-serd_byte_source_advance(SerdByteSource* source)
-{
- const bool paging = source->page_size > 1;
- SerdStatus st = SERD_SUCCESS;
-
- switch (serd_byte_source_peek(source)) {
- case '\0': break;
- case '\n': ++source->cur.line; source->cur.col = 0; break;
- default: ++source->cur.col;
- }
-
- // Reset EOF marker for reading from sockets/pipes
- source->eof = source->eof && !source->from_stream;
-
- if (source->from_stream && paging) {
- if (++source->read_head == source->page_size) {
- st = serd_byte_source_page(source);
- }
- } else if (source->from_stream) {
- if (!source->read_func(&source->read_byte, 1, 1, source->stream)) {
- st = source->error_func(source->stream) ? SERD_ERR_UNKNOWN
- : SERD_FAILURE;
- }
- } else if (source->eof) {
- st = SERD_FAILURE; // Can't read past end of string
- } else {
- ++source->read_head; // Move to next character in string
- }
-
- return st;
-}