diff options
author | David Robillard <d@drobilla.net> | 2020-06-28 23:26:48 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | a083c64f506175029280ff76defa0ad7d7ae2ea0 (patch) | |
tree | 5e666749e352659d225d9c45c60bee06bd2bfe5c /src/world.c | |
parent | 20eb7727954f9d8b7164146895904bbe595f5932 (diff) | |
download | serd-a083c64f506175029280ff76defa0ad7d7ae2ea0.tar.gz serd-a083c64f506175029280ff76defa0ad7d7ae2ea0.tar.bz2 serd-a083c64f506175029280ff76defa0ad7d7ae2ea0.zip |
Simplify input stream API
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/world.c b/src/world.c index cb4ba02d..9f10de49 100644 --- a/src/world.c +++ b/src/world.c @@ -5,44 +5,17 @@ #include "caret.h" #include "node.h" -#include "serd_config.h" -#include "system.h" #include "serd/node.h" #include "serd/string_view.h" -#if defined(USE_POSIX_FADVISE) -# include <fcntl.h> -#endif - #include <assert.h> -#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -FILE* -serd_world_fopen(SerdWorld* world, const char* path, const char* mode) -{ - FILE* fd = fopen(path, mode); - if (!fd) { - char message[1024] = {0}; - serd_system_strerror(errno, message, sizeof(message)); - - serd_world_errorf( - world, SERD_BAD_STREAM, "failed to open file %s (%s)\n", path, message); - return NULL; - } - -#if USE_POSIX_FADVISE && USE_FILENO - (void)posix_fadvise(fileno(fd), 0, 0, POSIX_FADV_SEQUENTIAL); -#endif - - return fd; -} - SerdStatus serd_world_error(const SerdWorld* const world, const SerdError* const e) { |