diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/console.c | 11 | ||||
-rw-r--r-- | tools/console.h | 5 | ||||
-rw-r--r-- | tools/serd-pipe.c | 14 |
3 files changed, 14 insertions, 16 deletions
diff --git a/tools/console.c b/tools/console.c index d0e6aaef..f7de779f 100644 --- a/tools/console.c +++ b/tools/console.c @@ -64,7 +64,9 @@ serd_set_base_uri_from_path(SerdEnv* const env, const char* const path) } SerdSyntax -serd_choose_syntax(const SerdSyntax requested, const char* const filename) +serd_choose_syntax(SerdWorld* const world, + const SerdSyntax requested, + const char* const filename) { if (requested) { return requested; @@ -75,9 +77,10 @@ serd_choose_syntax(const SerdSyntax requested, const char* const filename) return guessed; } - fprintf(stderr, - "warning: unable to determine syntax of \"%s\", trying TriG\n", - filename); + serd_logf(world, + SERD_LOG_LEVEL_WARNING, + "unable to determine syntax of \"%s\", trying TriG", + filename); return SERD_TRIG; } diff --git a/tools/console.h b/tools/console.h index 273b40c9..29b0a7df 100644 --- a/tools/console.h +++ b/tools/console.h @@ -9,6 +9,7 @@ #include "serd/output_stream.h" #include "serd/status.h" #include "serd/syntax.h" +#include "serd/world.h" #include <stdio.h> @@ -22,7 +23,9 @@ SerdStatus serd_set_base_uri_from_path(SerdEnv* env, const char* path); SerdSyntax -serd_choose_syntax(SerdSyntax requested, const char* filename); +serd_choose_syntax(SerdWorld* world, + SerdSyntax requested, + const char* filename); SerdInputStream serd_open_tool_input(const char* filename); diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c index b09c12e1..734d02f4 100644 --- a/tools/serd-pipe.c +++ b/tools/serd-pipe.c @@ -4,8 +4,8 @@ #include "console.h" #include "serd/env.h" -#include "serd/error.h" #include "serd/input_stream.h" +#include "serd/log.h" #include "serd/node.h" #include "serd/output_stream.h" #include "serd/reader.h" @@ -69,14 +69,6 @@ missing_arg(const char* const name, const char opt) } static SerdStatus -quiet_error_func(void* const handle, const SerdError* const e) -{ - (void)handle; - (void)e; - return SERD_SUCCESS; -} - -static SerdStatus read_file(SerdWorld* const world, const SerdSyntax syntax, const SerdReaderFlags flags, @@ -304,7 +296,7 @@ main(int argc, char** argv) serd_writer_new(world, output_syntax, writer_flags, env, &out, block_size); if (quiet) { - serd_world_set_error_func(world, quiet_error_func, NULL); + serd_set_log_func(world, serd_quiet_log_func, NULL); } if (root_uri) { @@ -355,7 +347,7 @@ main(int argc, char** argv) } if ((st = read_file(world, - serd_choose_syntax(input_syntax, inputs[i]), + serd_choose_syntax(world, input_syntax, inputs[i]), reader_flags, serd_writer_sink(writer), stack_size, |