Imported Upstream version 1.0.26
[platform/upstream/alsa-plugins.git] / maemo / debug.h
1 /**
2  * @file debug.h 
3  * @brief Debugging Macros
4  * <p>
5  * Copyright (C) 2006 Nokia Corporation
6  * <p>
7  * Contact: Eduardo Bezerra Valentin <eduardo.valentin@indt.org.br>
8  * 
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  * */
24 #ifndef _DEBUG_H
25 #define _DEBUG_H
26
27 //#define DEBUG
28 #undef DEBUG
29 #ifdef DEBUG
30 #define DEBUG_OUTPUT stderr
31 #define DPRINT(fmt,arg...) fprintf(DEBUG_OUTPUT, "%s(): " fmt,\
32                 __FUNCTION__, ##arg)
33 #define DENTER()  fprintf(DEBUG_OUTPUT, "ENTER %s()\n", __FUNCTION__)
34 #define DLEAVE(a)  fprintf(DEBUG_OUTPUT, "LEAVE %s() %d\n", __FUNCTION__, a)
35 #else
36 #define DPRINT(fmt,arg...) do { } while (0)
37 #define DENTER() do { } while (0)
38 #define DLEAVE(a) do { } while (0)
39 #endif
40
41 /* Errors on/off */
42 #define ERROR_DEBUG
43 /* #undef ERROR_DEBUG */
44 #ifdef ERROR_DEBUG
45 #define DERROR(fmt,arg...)      fprintf(stderr, "%s(): " fmt, \
46                 __FUNCTION__, ##arg)
47 #else
48 #define DERROR(fmt,arg...) \
49         do { } while (0)
50 #endif
51
52 #endif                          /* _DEBUG_H */