diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 22:15:53 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 6a91bfca72fc2cfd7ba1002174475d71e35b2969 (patch) | |
tree | d1689b03faf96f58ac4c7ca9081a600491d09a02 /src/world.c | |
parent | 93e54363f5ae251acee94051f77305f60f0158c8 (diff) | |
download | serd-6a91bfca72fc2cfd7ba1002174475d71e35b2969.tar.gz serd-6a91bfca72fc2cfd7ba1002174475d71e35b2969.tar.bz2 serd-6a91bfca72fc2cfd7ba1002174475d71e35b2969.zip |
Add SerdCursor to public API
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/world.c b/src/world.c index a99bff8a..3d632f05 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,10 +56,13 @@ serd_world_error(const SerdWorld* world, const SerdError* e) if (world->error_sink) { world->error_sink(world->error_handle, e); } else { - if (e->filename) { - fprintf(stderr, "error: %s:%u:%u: ", e->filename, e->line, e->col); - } else { - fprintf(stderr, "error: "); + fprintf(stderr, "error: "); + if (e->cursor) { + fprintf(stderr, + "%s:%u:%u: ", + serd_node_string(e->cursor->file), + e->cursor->line, + e->cursor->col); } vfprintf(stderr, e->fmt, *e->args); } @@ -70,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; |