diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-08-19 03:12:28 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-08-19 03:12:28 +0000 |
commit | 1fd361a1ea06e44286c213ca1f814f49306fdc43 (patch) | |
tree | 64c8c96cf54d8718847339a403e5e67b922e8c3f /converter/other/pamtosvg/exception.c | |
download | netpbm-mirror-1fd361a1ea06e44286c213ca1f814f49306fdc43.tar.gz netpbm-mirror-1fd361a1ea06e44286c213ca1f814f49306fdc43.tar.xz netpbm-mirror-1fd361a1ea06e44286c213ca1f814f49306fdc43.zip |
Create Subversion repository
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtosvg/exception.c')
-rw-r--r-- | converter/other/pamtosvg/exception.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/converter/other/pamtosvg/exception.c b/converter/other/pamtosvg/exception.c new file mode 100644 index 00000000..43761936 --- /dev/null +++ b/converter/other/pamtosvg/exception.c @@ -0,0 +1,55 @@ + +#include "exception.h" + +at_exception_type +at_exception_new(at_msg_func client_func, + void * const client_data) { + + at_exception_type e; + + e.msg_type = 0; + e.client_func = client_func; + e.client_data = client_data; + + return e; +} + + + +bool +at_exception_got_fatal(at_exception_type * const exception) { + + return (exception->msg_type == AT_MSG_FATAL); +} + + + +void +at_exception_fatal(at_exception_type * const exception, + const char * const message) { + + if (exception) { + 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 * const exception, + const char * const message) { + + if (exception) { + exception->msg_type = AT_MSG_WARNING; + if (exception->client_func) { + exception->client_func(message, + AT_MSG_WARNING, + exception->client_data); + } + } +} |