Woolz Image Processing Version 1.4.0
|
00001 #ifndef WLZ_DEBUG_H 00002 #define WLZ_DEBUG_H 00003 #if defined(__GNUC__) 00004 #ident "University of Edinburgh $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $" 00005 #else 00006 static char _WlzDebug_h[] = "University of Edinburgh $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $"; 00007 #endif 00008 /*! 00009 * \file libWlz/WlzDebug.h 00010 * \author Bill Hill 00011 * \date March 1999 00012 * \version $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $ 00013 * \par 00014 * Address: 00015 * MRC Human Genetics Unit, 00016 * MRC Institute of Genetics and Molecular Medicine, 00017 * University of Edinburgh, 00018 * Western General Hospital, 00019 * Edinburgh, EH4 2XU, UK. 00020 * \par 00021 * Copyright (C), [2012], 00022 * The University Court of the University of Edinburgh, 00023 * Old College, Edinburgh, UK. 00024 * 00025 * This program is free software; you can redistribute it and/or 00026 * modify it under the terms of the GNU General Public License 00027 * as published by the Free Software Foundation; either version 2 00028 * of the License, or (at your option) any later version. 00029 * 00030 * This program is distributed in the hope that it will be 00031 * useful but WITHOUT ANY WARRANTY; without even the implied 00032 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00033 * PURPOSE. See the GNU General Public License for more 00034 * details. 00035 * 00036 * You should have received a copy of the GNU General Public 00037 * License along with this program; if not, write to the Free 00038 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00039 * Boston, MA 02110-1301, USA. 00040 * \brief Defines the Woolz debug masks and function prototypes. 00041 * \ingroup WlzDebug 00042 */ 00043 00044 #ifdef __cplusplus 00045 extern "C" { 00046 #endif /* __cplusplus */ 00047 00048 /*! 00049 * \enum _WlzDbgMask 00050 * \ingroup WlzDebug 00051 * \brief Woolz debug bit masks. 00052 * Typedef: ::WlzDbgMask 00053 */ 00054 typedef enum _WlzDbgMask 00055 { 00056 WLZ_DBG_NONE = (0), /*!< No debug output */ 00057 WLZ_DBG_LVL_1 = (1), /*!< Least debug output */ 00058 WLZ_DBG_LVL_2 = (1<<1), /*!< Intermediate debug output */ 00059 WLZ_DBG_LVL_3 = (1<<2), /*!< Most debug output */ 00060 WLZ_DBG_LVL_FN = (1<<3), /*!< Function entry and return */ 00061 WLZ_DBG_ALLOC = (1<<4) /*!< Allocation and freeing */ 00062 } WlzDbgMask; 00063 00064 typedef WlzErrorNum (*WlzDbgFn)(char *, ...); 00065 typedef WlzErrorNum (*WlzDbgObjFn)(WlzObject *, int); 00066 00067 /************************************************************************ 00068 * Woolz debugging prototypes. * 00069 ************************************************************************/ 00070 extern WlzDbgMask wlzDbgMask; 00071 extern WlzDbgMask wlzDbgObjMask; 00072 extern void *wlzDbgData; 00073 extern void *wlzDbgObjData; 00074 extern WlzDbgFn wlzDbgOutFn; 00075 extern WlzDbgObjFn wlzDbgOutObjFn; 00076 00077 extern WlzErrorNum WlzDbgWrite(char *, ...); 00078 extern WlzErrorNum WlzDbgObjWrite(WlzObject *, int); 00079 00080 /************************************************************************ 00081 * Woolz debugging macros. * 00082 ************************************************************************/ 00083 #define WLZ_DBG(F,M) \ 00084 ((((F)&(wlzDbgMask))==(F))?(*wlzDbgOutFn) M:WLZ_ERR_NONE) 00085 #define WLZ_DBGOBJ(F,O,X) \ 00086 ((((F)&(wlzDbgObjMask))==(F))?(*wlzDbgOutObjFn)((O),(X)):WLZ_ERR_NONE) 00087 00088 00089 #ifndef WLZ_EXT_BIND 00090 #ifdef __cplusplus 00091 } 00092 #endif /* __cplusplus */ 00093 #endif /* WLZ_EXT_BIND */ 00094 00095 #endif /* !WLZ_DEBUG_H Don't put anything after this line */