aboutsummaryrefslogtreecommitdiffstats
path: root/src/serd_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r--src/serd_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h
index ee55de27..9a875daa 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -290,4 +290,17 @@ uri_is_under(const SerdURI* uri, const SerdURI* root)
return true;
}
+/* Error reporting */
+
+static inline void
+serd_error(SerdErrorSink error_sink, void* handle, const SerdError* e)
+{
+ if (error_sink) {
+ error_sink(handle, e);
+ } else {
+ fprintf(stderr, "error: %s:%u:%u: ", e->filename, e->line, e->col);
+ vfprintf(stderr, e->fmt, *e->args);
+ }
+}
+
#endif // SERD_INTERNAL_H