ixmldebug.h 1.4 KB

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