aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/reader.c4
-rw-r--r--src/reader.h2
-rw-r--r--src/serdi.c4
-rw-r--r--src/world.c32
-rw-r--r--src/world.h6
-rw-r--r--src/writer.c36
6 files changed, 42 insertions, 42 deletions
diff --git a/src/reader.c b/src/reader.c
index ace6ef7d..0b0c2360 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -37,8 +37,8 @@ r_err(SerdReader* reader, SerdStatus st, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- const SerdError e = { st, &reader->source.cur, fmt, &args };
- serd_world_error(reader->world, &e);
+ const SerdMessage msg = { st, &reader->source.cur, fmt, &args };
+ serd_world_error(reader->world, &msg);
va_end(args);
return st;
}
diff --git a/src/reader.h b/src/reader.h
index 6e946f60..7e4c9756 100644
--- a/src/reader.h
+++ b/src/reader.h
@@ -46,7 +46,7 @@ typedef struct {
struct SerdReaderImpl {
SerdWorld* world;
const SerdSink* sink;
- SerdErrorSink error_sink;
+ SerdMessageSink msg_sink;
void* error_handle;
SerdNode* rdf_first;
SerdNode* rdf_rest;
diff --git a/src/serdi.c b/src/serdi.c
index 2bef5e4a..1a07c3e8 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -74,7 +74,7 @@ missing_arg(const char* name, char opt)
}
static SerdStatus
-quiet_error_sink(void* handle, const SerdError* e)
+quiet_error_sink(void* handle, const SerdMessage* msg)
{
return SERD_SUCCESS;
}
@@ -228,7 +228,7 @@ main(int argc, char** argv)
reader = serd_reader_new(world, input_syntax, sink, stack_size);
serd_reader_set_strict(reader, !lax);
if (quiet) {
- serd_world_set_error_sink(world, quiet_error_sink, NULL);
+ serd_world_set_message_sink(world, quiet_error_sink, NULL);
}
SerdNode* root = serd_new_uri(root_uri);
diff --git a/src/world.c b/src/world.c
index 52ef1bce..01a86dc5 100644
--- a/src/world.c
+++ b/src/world.c
@@ -51,22 +51,22 @@ serd_world_fopen(SerdWorld* world, const char* path, const char* mode)
}
SerdStatus
-serd_world_error(const SerdWorld* world, const SerdError* e)
+serd_world_error(const SerdWorld* world, const SerdMessage* msg)
{
- if (world->error_sink) {
- world->error_sink(world->error_handle, e);
+ if (world->msg_sink) {
+ world->msg_sink(world->msg_handle, msg);
} else {
fprintf(stderr, "error: ");
- if (e->cursor) {
+ if (msg->cursor) {
fprintf(stderr,
"%s:%u:%u: ",
- serd_node_get_string(e->cursor->file),
- e->cursor->line,
- e->cursor->col);
+ serd_node_get_string(msg->cursor->file),
+ msg->cursor->line,
+ msg->cursor->col);
}
- vfprintf(stderr, e->fmt, *e->args);
+ vfprintf(stderr, msg->fmt, *msg->args);
}
- return e->status;
+ return msg->status;
}
SerdStatus
@@ -74,8 +74,8 @@ serd_world_errorf(const SerdWorld* world, SerdStatus st, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- const SerdError e = { st, NULL, fmt, &args };
- serd_world_error(world, &e);
+ const SerdMessage msg = { st, NULL, fmt, &args };
+ serd_world_error(world, &msg);
va_end(args);
return st;
}
@@ -119,10 +119,10 @@ serd_world_get_blank(SerdWorld* world)
}
void
-serd_world_set_error_sink(SerdWorld* world,
- SerdErrorSink error_sink,
- void* handle)
+serd_world_set_message_sink(SerdWorld* world,
+ SerdMessageSink msg_sink,
+ void* handle)
{
- world->error_sink = error_sink;
- world->error_handle = handle;
+ world->msg_sink = msg_sink;
+ world->msg_handle = handle;
}
diff --git a/src/world.h b/src/world.h
index 232d458f..724bd038 100644
--- a/src/world.h
+++ b/src/world.h
@@ -23,8 +23,8 @@
struct SerdWorldImpl {
SerdNodes* nodes;
- SerdErrorSink error_sink;
- void* error_handle;
+ SerdMessageSink msg_sink;
+ void* msg_handle;
uint32_t next_blank_id;
SerdNode* blank_node;
const SerdNode* rdf_first;
@@ -38,7 +38,7 @@ struct SerdWorldImpl {
FILE* serd_world_fopen(SerdWorld* world, const char* path, const char* mode);
-SerdStatus serd_world_error(const SerdWorld* world, const SerdError* e);
+SerdStatus serd_world_error(const SerdWorld* world, const SerdMessage* msg);
SerdStatus
serd_world_errorf(const SerdWorld* world, SerdStatus st, const char* fmt, ...);
diff --git a/src/writer.c b/src/writer.c
index 446bcb18..ab649ff4 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -99,24 +99,24 @@ static const SepRule rules[] = {
};
struct SerdWriterImpl {
- SerdWorld* world;
- SerdSink iface;
- SerdSyntax syntax;
- SerdStyleFlags style;
- SerdEnv* env;
- SerdNode* root_node;
- SerdURI root_uri;
- SerdStack anon_stack;
- SerdWriteFunc write_func;
- void* stream;
- SerdErrorSink error_sink;
- void* error_handle;
- WriteContext context;
- unsigned indent;
- char* bprefix;
- size_t bprefix_len;
- Sep last_sep;
- bool empty;
+ SerdWorld* world;
+ SerdSink iface;
+ SerdSyntax syntax;
+ SerdStyleFlags style;
+ SerdEnv* env;
+ SerdNode* root_node;
+ SerdURI root_uri;
+ SerdStack anon_stack;
+ SerdWriteFunc write_func;
+ void* stream;
+ SerdMessageSink msg_sink;
+ void* msg_handle;
+ WriteContext context;
+ unsigned indent;
+ char* bprefix;
+ size_t bprefix_len;
+ Sep last_sep;
+ bool empty;
};
typedef enum {