From af475a0c5ee0f61c3046caa0d9b563c07a14d995 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 26 Nov 2018 22:14:39 +0100 Subject: Rename SerdError to SerdMessage Towards more general usage for all types of logging. --- serd/serd.h | 28 ++++++++++++++-------------- serd/serd.hpp | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'serd') diff --git a/serd/serd.h b/serd/serd.h index 29bff936..8aa22f7a 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -349,14 +349,14 @@ typedef struct { } SerdBuffer; /** - An error description. + A message description. */ typedef struct { - SerdStatus status; /**< Error code */ - const SerdCursor* cursor; /**< Origin of error, or NULL */ + SerdStatus status; /**< Status code */ + const SerdCursor* cursor; /**< Origin of message, or NULL */ const char* fmt; /**< Message format string (printf style) */ va_list* args; /**< Arguments for fmt */ -} SerdError; +} SerdMessage; /** A parsed URI. @@ -882,13 +882,13 @@ serd_node_free(SerdNode* node); */ /** - Sink (callback) for errors. + Sink (callback) for log messages. @param handle Handle for user data. - @param error Error description. + @param msg Message description. */ -typedef SerdStatus (*SerdErrorSink)(void* handle, - const SerdError* error); +typedef SerdStatus (*SerdMessageSink)(void* handle, + const SerdMessage* msg); /** Sink (callback) for base URI changes. @@ -960,16 +960,16 @@ const SerdNode* serd_world_get_blank(SerdWorld* world); /** - Set a function to be called when errors occur. + Set a function to be called with log messages (typically errors). - The `error_sink` will be called with `handle` as its first argument. If - no error function is set, errors are printed to stderr. + The `msg_sink` will be called with `handle` as its first argument. If + no sink is set, messages are printed to stderr. */ SERD_API 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); /** @} diff --git a/serd/serd.hpp b/serd/serd.hpp index bb2d48a1..85cc4b6a 100644 --- a/serd/serd.hpp +++ b/serd/serd.hpp @@ -529,9 +529,9 @@ public: Node get_blank() { return Node(serd_world_get_blank(c_obj())); } - void set_error_sink(SerdErrorSink error_sink, void* handle) + void set_message_sink(SerdMessageSink msg_sink, void* handle) { - serd_world_set_error_sink(c_obj(), error_sink, handle); + serd_world_set_message_sink(c_obj(), msg_sink, handle); } // operator SerdWorld*() { return c_obj(); } -- cgit v1.2.1