summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libmng/libmng_error.h
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /src/3rdparty/libmng/libmng_error.h
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/3rdparty/libmng/libmng_error.h')
-rw-r--r--src/3rdparty/libmng/libmng_error.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/3rdparty/libmng/libmng_error.h b/src/3rdparty/libmng/libmng_error.h
new file mode 100644
index 0000000000..b49ff73308
--- /dev/null
+++ b/src/3rdparty/libmng/libmng_error.h
@@ -0,0 +1,119 @@
+/* ************************************************************************** */
+/* * For conditions of distribution and use, * */
+/* * see copyright notice in libmng.h * */
+/* ************************************************************************** */
+/* * * */
+/* * project : libmng * */
+/* * file : libmng_error.h copyright (c) 2000-2002 G.Juyn * */
+/* * version : 1.0.5 * */
+/* * * */
+/* * purpose : Error functions (definition) * */
+/* * * */
+/* * author : G.Juyn * */
+/* * * */
+/* * comment : Definition of the generic error-codes and functions * */
+/* * * */
+/* * changes : 0.5.1 - 05/06/2000 - G.Juyn * */
+/* * - added some errorcodes * */
+/* * 0.5.1 - 05/08/2000 - G.Juyn * */
+/* * - added some errorcodes * */
+/* * - changed strict-ANSI stuff * */
+/* * 0.5.1 - 05/11/2000 - G.Juyn * */
+/* * - added application errorcodes (used with callbacks) * */
+/* * - moved chunk-access errorcodes to severity 5 * */
+/* * * */
+/* * 0.5.2 - 05/20/2000 - G.Juyn * */
+/* * - added JNG errorcodes * */
+/* * 0.5.2 - 05/23/2000 - G.Juyn * */
+/* * - added error tell-tale definition * */
+/* * 0.5.2 - 05/30/2000 - G.Juyn * */
+/* * - added errorcodes for delta-image processing * */
+/* * 0.5.2 - 06/06/2000 - G.Juyn * */
+/* * - added errorcode for delayed buffer-processing * */
+/* * - moved errorcodes to "libmng.h" * */
+/* * * */
+/* * 0.9.1 - 07/15/2000 - G.Juyn * */
+/* * - added macro + routine to set returncode without * */
+/* * calling error callback * */
+/* * * */
+/* * 0.9.2 - 08/05/2000 - G.Juyn * */
+/* * - changed file-prefixes * */
+/* * * */
+/* * 1.0.5 - 08/19/2002 - G.Juyn * */
+/* * - B597134 - libmng pollutes the linker namespace * */
+/* * 1.0.5 - 08/20/2002 - G.Juyn * */
+/* * - added option for soft-handling of errors * */
+/* * * */
+/* ************************************************************************** */
+
+#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
+#pragma option -A /* force ANSI-C */
+#endif
+
+#ifndef _libmng_error_h_
+#define _libmng_error_h_
+
+/* ************************************************************************** */
+/* * * */
+/* * Default error routines * */
+/* * * */
+/* ************************************************************************** */
+
+mng_bool mng_store_error (mng_datap pData,
+ mng_retcode iError,
+ mng_retcode iExtra1,
+ mng_retcode iExtra2);
+
+mng_bool mng_process_error (mng_datap pData,
+ mng_retcode iError,
+ mng_retcode iExtra1,
+ mng_retcode iExtra2);
+
+/* ************************************************************************** */
+/* * * */
+/* * Error handling macros * */
+/* * * */
+/* ************************************************************************** */
+
+#ifdef MNG_SOFTERRORS
+#define MNG_ERROR(D,C) { if (!mng_process_error (D, C, 0, 0)) return C; }
+#define MNG_ERRORZ(D,Z) { if (!mng_process_error (D, MNG_ZLIBERROR, Z, 0)) return MNG_ZLIBERROR; }
+#define MNG_ERRORJ(D,J) { if (!mng_process_error (D, MNG_JPEGERROR, J, 0)) return MNG_JPEGERROR; }
+#define MNG_ERRORL(D,L) { if (!mng_process_error (D, MNG_LCMSERROR, L, 0)) return MNG_LCMSERROR; }
+#else
+#define MNG_ERROR(D,C) { mng_process_error (D, C, 0, 0); return C; }
+#define MNG_ERRORZ(D,Z) { mng_process_error (D, MNG_ZLIBERROR, Z, 0); return MNG_ZLIBERROR; }
+#define MNG_ERRORJ(D,J) { mng_process_error (D, MNG_JPEGERROR, J, 0); return MNG_JPEGERROR; }
+#define MNG_ERRORL(D,L) { mng_process_error (D, MNG_LCMSERROR, L, 0); return MNG_LCMSERROR; }
+#endif
+
+#define MNG_RETURN(D,C) { mng_store_error (D, C, 0, 0); return C; }
+
+#define MNG_WARNING(D,C) { if (!mng_process_error (D, C, 0, 0)) return C; }
+
+#define MNG_VALIDHANDLE(H) { if ((H == 0) || (((mng_datap)H)->iMagic != MNG_MAGIC)) \
+ return MNG_INVALIDHANDLE; }
+#define MNG_VALIDHANDLEX(H) { if ((H == 0) || (((mng_datap)H)->iMagic != MNG_MAGIC)) \
+ return 0; }
+#define MNG_VALIDCB(D,C) { if (!((mng_datap)D)->C) \
+ MNG_ERROR (((mng_datap)D), MNG_NOCALLBACK) }
+
+/* ************************************************************************** */
+/* * * */
+/* * Error string-table entry * */
+/* * * */
+/* ************************************************************************** */
+
+typedef struct {
+ mng_retcode iError;
+ mng_pchar zErrortext;
+ } mng_error_entry;
+typedef mng_error_entry const * mng_error_entryp;
+
+/* ************************************************************************** */
+
+#endif /* _libmng_error_h_ */
+
+/* ************************************************************************** */
+/* * end of file * */
+/* ************************************************************************** */