aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-13 20:21:40 +0200
committerDavid Robillard <d@drobilla.net>2019-04-13 20:21:40 +0200
commit4de972d203f804dd5b1ae5c82ca01359f7d285a6 (patch)
tree1912a58e979a7d17500a0223b514fb802475e54c /src/world.c
parent72b0caa0ca029b83a5a1ad87d9035faea7897c72 (diff)
downloadserd-4de972d203f804dd5b1ae5c82ca01359f7d285a6.tar.gz
serd-4de972d203f804dd5b1ae5c82ca01359f7d285a6.tar.bz2
serd-4de972d203f804dd5b1ae5c82ca01359f7d285a6.zip
WIP: Remove SerdMessageremove-message
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/world.c b/src/world.c
index f16b0f95..be4be551 100644
--- a/src/world.c
+++ b/src/world.c
@@ -51,24 +51,30 @@ serd_world_fopen(SerdWorld* world, const char* path, const char* mode)
}
SerdStatus
-serd_world_log(const SerdWorld* world, const SerdMessage* msg)
+serd_world_vlogf(const SerdWorld* world,
+ SerdStatus st,
+ SerdLogLevel level,
+ const SerdCursor* cursor,
+ const char* fmt,
+ va_list args)
{
- static const char* level_strings[] = { "note", "warning", "error" };
+ static const char* const level_strings[] = { "note", "warning", "error" };
if (world->msg_func) {
- world->msg_func(world->msg_handle, msg);
+ world->msg_func(world->msg_handle, st, level, cursor, fmt, args);
} else {
- fprintf(stderr, "%s: ", level_strings[msg->level]);
- if (msg->cursor) {
+ fprintf(stderr, "%s: ", level_strings[level]);
+ if (cursor) {
fprintf(stderr,
"%s:%u:%u: ",
- serd_node_get_string(msg->cursor->file),
- msg->cursor->line,
- msg->cursor->col);
+ serd_node_get_string(cursor->file),
+ cursor->line,
+ cursor->col);
}
- vfprintf(stderr, msg->fmt, *msg->args);
+ vfprintf(stderr, fmt, args);
}
- return msg->status;
+
+ return st;
}
SerdStatus
@@ -81,8 +87,7 @@ serd_world_logf(const SerdWorld* world,
{
va_list args;
va_start(args, fmt);
- const SerdMessage msg = {st, level, cursor, fmt, &args};
- serd_world_log(world, &msg);
+ serd_world_vlogf(world, st, level, cursor, fmt, args);
va_end(args);
return st;
}