|
Packit |
675970 |
/**
|
|
Packit |
675970 |
* @file debug.h
|
|
Packit |
675970 |
* @brief Debugging Macros
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* Copyright (C) 2006 Nokia Corporation
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* Contact: Eduardo Bezerra Valentin <eduardo.valentin@indt.org.br>
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
675970 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
675970 |
* License as published by the Free Software Foundation; either
|
|
Packit |
675970 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
675970 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
675970 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
675970 |
* Library General Public License for more details.
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* You should have received a copy of the GNU Library General Public License
|
|
Packit |
675970 |
* along with this program; if not, write to the Free Software
|
|
Packit |
675970 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
675970 |
* */
|
|
Packit |
675970 |
#ifndef _DEBUG_H
|
|
Packit |
675970 |
#define _DEBUG_H
|
|
Packit |
675970 |
|
|
Packit |
675970 |
//#define DEBUG
|
|
Packit |
675970 |
#undef DEBUG
|
|
Packit |
675970 |
#ifdef DEBUG
|
|
Packit |
675970 |
#define DEBUG_OUTPUT stderr
|
|
Packit |
675970 |
#define DPRINT(fmt,arg...) fprintf(DEBUG_OUTPUT, "%s(): " fmt,\
|
|
Packit |
675970 |
__FUNCTION__, ##arg)
|
|
Packit |
675970 |
#define DENTER() fprintf(DEBUG_OUTPUT, "ENTER %s()\n", __FUNCTION__)
|
|
Packit |
675970 |
#define DLEAVE(a) fprintf(DEBUG_OUTPUT, "LEAVE %s() %d\n", __FUNCTION__, a)
|
|
Packit |
675970 |
#else
|
|
Packit |
675970 |
#define DPRINT(fmt,arg...) do { } while (0)
|
|
Packit |
675970 |
#define DENTER() do { } while (0)
|
|
Packit |
675970 |
#define DLEAVE(a) do { } while (0)
|
|
Packit |
675970 |
#endif
|
|
Packit |
675970 |
|
|
Packit |
675970 |
/* Errors on/off */
|
|
Packit |
675970 |
#define ERROR_DEBUG
|
|
Packit |
675970 |
/* #undef ERROR_DEBUG */
|
|
Packit |
675970 |
#ifdef ERROR_DEBUG
|
|
Packit |
675970 |
#define DERROR(fmt,arg...) fprintf(stderr, "%s(): " fmt, \
|
|
Packit |
675970 |
__FUNCTION__, ##arg)
|
|
Packit |
675970 |
#else
|
|
Packit |
675970 |
#define DERROR(fmt,arg...) \
|
|
Packit |
675970 |
do { } while (0)
|
|
Packit |
675970 |
#endif
|
|
Packit |
675970 |
|
|
Packit |
675970 |
#endif /* _DEBUG_H */
|