2008-05-08 19:21:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef IXMLDEBUG_H
|
|
|
|
#define IXMLDEBUG_H
|
|
|
|
|
|
|
|
|
2008-06-10 01:19:00 +02:00
|
|
|
#include "UpnpGlobal.h"
|
2010-04-16 15:38:06 +02:00
|
|
|
#include "ixml.h"
|
2008-05-08 19:21:59 +02:00
|
|
|
|
|
|
|
|
2008-06-05 01:14:45 +02:00
|
|
|
/*!
|
|
|
|
* \file
|
2008-06-08 01:43:45 +02:00
|
|
|
*
|
|
|
|
* \brief Auxiliar routines to aid debugging.
|
2008-06-05 01:14:45 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-05-08 19:21:59 +02:00
|
|
|
/*!
|
|
|
|
* \brief Prints the debug statement either on the standard output or log file
|
|
|
|
* along with the information from where this debug statement is coming.
|
2008-06-08 01:43:45 +02:00
|
|
|
*/
|
2008-05-08 19:21:59 +02:00
|
|
|
#ifdef DEBUG
|
|
|
|
void IxmlPrintf(
|
2010-04-16 15:38:06 +02:00
|
|
|
/*! [in] The file name, usually __FILE__. */
|
|
|
|
const char *DbgFileName,
|
|
|
|
/*! [in] The line number, usually __LINE__ or a variable that got the
|
|
|
|
* __LINE__ at the appropriate place. */
|
|
|
|
int DbgLineNo,
|
|
|
|
/*! [in] The function name. */
|
|
|
|
const char *FunctionName,
|
2008-05-08 19:21:59 +02:00
|
|
|
/*! [in] Printf like format specification. */
|
|
|
|
const char* FmtStr,
|
|
|
|
/*! [in] Printf like Variable number of arguments that will go in the debug
|
|
|
|
* statement. */
|
|
|
|
...)
|
|
|
|
#if (__GNUC__ >= 3)
|
|
|
|
/* This enables printf like format checking by the compiler */
|
2010-04-16 15:38:06 +02:00
|
|
|
__attribute__((format (__printf__, 4, 5)))
|
2008-05-08 19:21:59 +02:00
|
|
|
#endif
|
|
|
|
;
|
|
|
|
#else /* DEBUG */
|
2008-06-07 00:28:46 +02:00
|
|
|
static UPNP_INLINE void IxmlPrintf(
|
2008-05-08 19:21:59 +02:00
|
|
|
const char* FmtStr,
|
|
|
|
...) {}
|
|
|
|
#endif /* DEBUG */
|
|
|
|
|
|
|
|
|
2010-04-16 15:38:06 +02:00
|
|
|
/*!
|
|
|
|
* \brief Print the node names and values of a XML tree.
|
|
|
|
*/
|
|
|
|
#ifdef DEBUG
|
|
|
|
void printNodes(
|
|
|
|
/*! [in] The root of the tree to print. */
|
|
|
|
IXML_Node *tmpRoot,
|
|
|
|
/*! [in] The depth to print. */
|
|
|
|
int depth);
|
|
|
|
#else
|
|
|
|
static UPNP_INLINE void printNodes(
|
|
|
|
IXML_Node *tmpRoot,
|
|
|
|
int depth)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-05-08 19:21:59 +02:00
|
|
|
#endif /* IXMLDEBUG_H */
|
|
|
|
|