diff options
author | David Robillard <d@drobilla.net> | 2018-11-26 22:14:39 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-26 22:14:39 +0100 |
commit | af475a0c5ee0f61c3046caa0d9b563c07a14d995 (patch) | |
tree | 6b6db89aa95772dbd60cff12315d535f709d812a /serd | |
parent | 2a1a2522b23122e2428019489df9ddb5b0ec30ea (diff) | |
download | serd-af475a0c5ee0f61c3046caa0d9b563c07a14d995.tar.gz serd-af475a0c5ee0f61c3046caa0d9b563c07a14d995.tar.bz2 serd-af475a0c5ee0f61c3046caa0d9b563c07a14d995.zip |
Rename SerdError to SerdMessage
Towards more general usage for all types of logging.
Diffstat (limited to 'serd')
-rw-r--r-- | serd/serd.h | 28 | ||||
-rw-r--r-- | serd/serd.hpp | 4 |
2 files changed, 16 insertions, 16 deletions
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(); } |