Woolz Image Processing  Version 1.7.5
WlzDebug.h
Go to the documentation of this file.
1 #ifndef WLZ_DEBUG_H
2 #define WLZ_DEBUG_H
3 #if defined(__GNUC__)
4 #ident "University of Edinburgh $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $"
5 #else
6 static char _WlzDebug_h[] = "University of Edinburgh $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $";
7 #endif
8 /*!
9 * \file libWlz/WlzDebug.h
10 * \author Bill Hill
11 * \date March 1999
12 * \version $Id: 9cd9c6e05f4ba0824f6867ad27c6105fba689563 $
13 * \par
14 * Address:
15 * MRC Human Genetics Unit,
16 * MRC Institute of Genetics and Molecular Medicine,
17 * University of Edinburgh,
18 * Western General Hospital,
19 * Edinburgh, EH4 2XU, UK.
20 * \par
21 * Copyright (C), [2012],
22 * The University Court of the University of Edinburgh,
23 * Old College, Edinburgh, UK.
24 *
25 * This program is free software; you can redistribute it and/or
26 * modify it under the terms of the GNU General Public License
27 * as published by the Free Software Foundation; either version 2
28 * of the License, or (at your option) any later version.
29 *
30 * This program is distributed in the hope that it will be
31 * useful but WITHOUT ANY WARRANTY; without even the implied
32 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
33 * PURPOSE. See the GNU General Public License for more
34 * details.
35 *
36 * You should have received a copy of the GNU General Public
37 * License along with this program; if not, write to the Free
38 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
39 * Boston, MA 02110-1301, USA.
40 * \brief Defines the Woolz debug masks and function prototypes.
41 * \ingroup WlzDebug
42 */
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
47 
48 /*!
49 * \enum _WlzDbgMask
50 * \ingroup WlzDebug
51 * \brief Woolz debug bit masks.
52 * Typedef: ::WlzDbgMask
53 */
54 typedef enum _WlzDbgMask
55 {
56  WLZ_DBG_NONE = (0), /*!< No debug output */
57  WLZ_DBG_LVL_1 = (1), /*!< Least debug output */
58  WLZ_DBG_LVL_2 = (1<<1), /*!< Intermediate debug output */
59  WLZ_DBG_LVL_3 = (1<<2), /*!< Most debug output */
60  WLZ_DBG_LVL_FN = (1<<3), /*!< Function entry and return */
61  WLZ_DBG_ALLOC = (1<<4) /*!< Allocation and freeing */
62 } WlzDbgMask;
63 
64 typedef WlzErrorNum (*WlzDbgFn)(char *, ...);
65 typedef WlzErrorNum (*WlzDbgObjFn)(WlzObject *, int);
66 
67 /************************************************************************
68 * Woolz debugging prototypes. *
69 ************************************************************************/
70 extern WlzDbgMask wlzDbgMask;
72 extern void *wlzDbgData;
73 extern void *wlzDbgObjData;
74 extern WlzDbgFn wlzDbgOutFn;
76 
77 extern WlzErrorNum WlzDbgWrite(char *, ...);
78 extern WlzErrorNum WlzDbgObjWrite(WlzObject *, int);
79 
80 /************************************************************************
81 * Woolz debugging macros. *
82 ************************************************************************/
83 #define WLZ_DBG(F,M) \
84  ((((F)&(wlzDbgMask))==(F))?(*wlzDbgOutFn) M:WLZ_ERR_NONE)
85 #define WLZ_DBGOBJ(F,O,X) \
86  ((((F)&(wlzDbgObjMask))==(F))?(*wlzDbgOutObjFn)((O),(X)):WLZ_ERR_NONE)
87 
88 
89 #ifndef WLZ_EXT_BIND
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */
93 #endif /* WLZ_EXT_BIND */
94 
95 #endif /* !WLZ_DEBUG_H Don't put anything after this line */
Definition: WlzDebug.h:61
Definition: WlzDebug.h:56
WlzDbgObjFn wlzDbgOutObjFn
enum _WlzDbgMask WlzDbgMask
WlzDbgMask wlzDbgMask
Definition: WlzDebug.c:50
void * wlzDbgObjData
Definition: WlzDebug.c:53
WlzErrorNum(* WlzDbgFn)(char *,...)
Definition: WlzDebug.h:64
Definition: WlzDebug.h:58
WlzErrorNum WlzDbgWrite(char *,...)
Writes out the given debug message to the debug file.
Definition: WlzDebug.c:65
Definition: WlzDebug.h:57
_WlzDbgMask
Woolz debug bit masks. Typedef: WlzDbgMask.
Definition: WlzDebug.h:54
The Woolz object. Typedef: WlzObject.
Definition: WlzType.h:2751
void * wlzDbgData
Definition: WlzDebug.c:52
Definition: WlzDebug.h:60
WlzErrorNum(* WlzDbgObjFn)(WlzObject *, int)
Definition: WlzDebug.h:65
WlzErrorNum WlzDbgObjWrite(WlzObject *, int)
Writes out the given debug Woolz object to the woolz debug file.
Definition: WlzDebug.c:92
WlzDbgFn wlzDbgOutFn
Definition: WlzDebug.c:56
enum _WlzErrorNum WlzErrorNum
WlzDbgMask wlzDbgObjMask
Definition: WlzDebug.c:51
Definition: WlzDebug.h:59