diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 22:15:53 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:04 +0200 |
commit | 8c4a8baf4f9081bdb9523c08005a529a71fd6722 (patch) | |
tree | 6b51d5d5741243e9489e06138f2aeb53b924d769 /src/world.c | |
parent | 6fcf2dce8d519b4fee2b7b891e3710061cca981c (diff) | |
download | serd-8c4a8baf4f9081bdb9523c08005a529a71fd6722.tar.gz serd-8c4a8baf4f9081bdb9523c08005a529a71fd6722.tar.bz2 serd-8c4a8baf4f9081bdb9523c08005a529a71fd6722.zip |
Add SerdCursor to public API
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/world.c b/src/world.c index 54990029..351f246a 100644 --- a/src/world.c +++ b/src/world.c @@ -18,6 +18,7 @@ #include "world.h" +#include "cursor.h" #include "node.h" #include "serd_config.h" @@ -55,7 +56,14 @@ serd_world_error(const SerdWorld* world, const SerdError* e) if (world->error_sink) { world->error_sink(world->error_handle, e); } else { - fprintf(stderr, "error: %s:%u:%u: ", e->filename, e->line, e->col); + fprintf(stderr, "error: "); + if (e->cursor) { + fprintf(stderr, + "%s:%u:%u: ", + serd_node_get_string(e->cursor->file), + e->cursor->line, + e->cursor->col); + } vfprintf(stderr, e->fmt, *e->args); } return e->status; @@ -66,7 +74,7 @@ serd_world_errorf(const SerdWorld* world, SerdStatus st, const char* fmt, ...) { va_list args; va_start(args, fmt); - const SerdError e = { st, NULL, 0, 0, fmt, &args }; + const SerdError e = { st, NULL, fmt, &args }; serd_world_error(world, &e); va_end(args); return st; |