1
2
3 #ifndef IXMLDEBUG_H
4 #define IXMLDEBUG_H
5
6
7 #include "UpnpGlobal.h"
8 #include "ixml.h"
9
10
11 /*!
12 * \file
13 *
14 * \brief Auxiliar routines to aid debugging.
15 */
16
17
18 /*!
19 * \brief Prints the debug statement either on the standard output or log file
20 * along with the information from where this debug statement is coming.
21 */
22 #ifdef DEBUG
23 void IxmlPrintf(
24 /*! [in] The file name, usually __FILE__. */
25 const char *DbgFileName,
26 /*! [in] The line number, usually __LINE__ or a variable that got the
27 * __LINE__ at the appropriate place. */
28 int DbgLineNo,
29 /*! [in] The function name. */
30 const char *FunctionName,
31 /*! [in] Printf like format specification. */
32 const char* FmtStr,
33 /*! [in] Printf like Variable number of arguments that will go in the debug
34 * statement. */
35 ...)
36 #if (__GNUC__ >= 3)
37 /* This enables printf like format checking by the compiler */
38 __attribute__((format (__printf__, 4, 5)))
39 #endif
40 ;
41 #else /* DEBUG */
IxmlPrintf(const char * FmtStr,...)42 static UPNP_INLINE void IxmlPrintf(
43 const char *FmtStr,
44 ...)
45 {
46 (void)FmtStr;
47 }
48 #endif /* DEBUG */
49
50
51 /*!
52 * \brief Print the node names and values of a XML tree.
53 */
54 #ifdef DEBUG
55 void printNodes(
56 /*! [in] The root of the tree to print. */
57 IXML_Node *tmpRoot,
58 /*! [in] The depth to print. */
59 int depth);
60 #else
printNodes(IXML_Node * tmpRoot,int depth)61 static UPNP_INLINE void printNodes(
62 IXML_Node *tmpRoot,
63 int depth)
64 {
65 (void)tmpRoot;
66 (void)depth;
67 }
68 #endif
69
70
71 #endif /* IXMLDEBUG_H */
72
73