diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
commit | 35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch) | |
tree | 657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/3rdparty/autotrace/exception.c | |
parent | Initial commit. (diff) | |
download | inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip |
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/3rdparty/autotrace/exception.c')
-rw-r--r-- | src/3rdparty/autotrace/exception.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/3rdparty/autotrace/exception.c b/src/3rdparty/autotrace/exception.c new file mode 100644 index 0000000..c98777e --- /dev/null +++ b/src/3rdparty/autotrace/exception.c @@ -0,0 +1,47 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* Def: HAVE_CONFIG_H */ + +#include "exception.h" + +at_exception_type at_exception_new(at_msg_func client_func, gpointer client_data) +{ + at_exception_type e; + e.msg_type = AT_MSG_NOT_SET; + e.client_func = client_func; + e.client_data = client_data; + return e; +} + +gboolean at_exception_got_fatal(at_exception_type * exception) +{ + return (exception->msg_type == AT_MSG_FATAL) ? TRUE : FALSE; +} + +void at_exception_fatal(at_exception_type * exception, const gchar * message) +{ + if (!exception) + return; + exception->msg_type = AT_MSG_FATAL; + if (exception->client_func) { + exception->client_func(message, AT_MSG_FATAL, exception->client_data); + } +} + +void at_exception_warning(at_exception_type * exception, const gchar * message) +{ + if (!exception) + return; + exception->msg_type = AT_MSG_WARNING; + if (exception->client_func) { + exception->client_func(message, AT_MSG_WARNING, exception->client_data); + } +} + +GQuark at_error_quark(void) +{ + static GQuark q = 0; + if (q == 0) + q = g_quark_from_static_string("at-error-quark"); + return q; +} |