Blame maemo/debug.h

Packit Service cd2a00
/**
Packit Service cd2a00
 * @file debug.h 
Packit Service cd2a00
 * @brief Debugging Macros
Packit Service cd2a00
 * 

Packit Service cd2a00
 * Copyright (C) 2006 Nokia Corporation
Packit Service cd2a00
 * 

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