meanwhile 1.1.1
mw_debug.h File Reference
#include <stdarg.h>
#include <glib.h>
#include "mw_common.h"

Go to the source code of this file.

Macros

#define g_debug(format...)
 
#define g_info(format...)
 
#define MW_MAILME_ADDRESS   "meanwhile-devel@lists.sourceforge.net"
 email address used in mw_debug_mailme.
 
#define MW_MAILME_CUT_START   "-------- begin copy --------"
 
#define MW_MAILME_CUT_STOP   "--------- end copy ---------"
 
#define MW_MAILME_MESSAGE
 message used in mw_debug_mailme instructing user on what to do with the debugging output produced from that function
 
#define NSTR(str)
 replaces NULL strings with "(null)".
 

Functions

void mw_debug_data (const guchar *buf, gsize len, const char *info,...)
 
void mw_debug_datav (const guchar *buf, gsize len, const char *info, va_list args)
 
void mw_debug_opaque (struct mwOpaque *o, const char *info,...)
 
void mw_debug_opaquev (struct mwOpaque *o, const char *info, va_list args)
 
void mw_mailme_data (const guchar *buf, gsize len, const char *info,...)
 
void mw_mailme_datav (const guchar *buf, gsize len, const char *info, va_list args)
 
void mw_mailme_opaque (struct mwOpaque *o, const char *info,...)
 Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.
 
void mw_mailme_opaquev (struct mwOpaque *o, const char *info, va_list args)
 Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.
 

Macro Definition Documentation

◆ g_debug

#define g_debug ( format...)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)

◆ g_info

#define g_info ( format...)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)

◆ MW_MAILME_ADDRESS

#define MW_MAILME_ADDRESS   "meanwhile-devel@lists.sourceforge.net"

email address used in mw_debug_mailme.

◆ MW_MAILME_CUT_START

#define MW_MAILME_CUT_START   "-------- begin copy --------"

◆ MW_MAILME_CUT_STOP

#define MW_MAILME_CUT_STOP   "--------- end copy ---------"

◆ MW_MAILME_MESSAGE

#define MW_MAILME_MESSAGE
Value:
"\n" \
" Greetings! It seems that you've run across protocol data that the\n" \
"Meanwhile library does not yet know about. As such, there may be\n" \
"some unexpected behaviour in this session. If you'd like to help\n" \
"resolve this issue, please copy and paste the following block into\n" \
"an email to the address listed below with a brief explanation of\n" \
"what you were doing at the time of this message. Thanks a lot!"

message used in mw_debug_mailme instructing user on what to do with the debugging output produced from that function

◆ NSTR

#define NSTR ( str)
Value:
((str)? (str): "(null)")

replaces NULL strings with "(null)".

useful for printf where you're unsure that the s will be non-NULL. Note that while the linux printf will do this automatically, not all will. The others will instead segfault

Function Documentation

◆ mw_debug_data()

void mw_debug_data ( const guchar * buf,
gsize len,
const char * info,
... )

◆ mw_debug_datav()

void mw_debug_datav ( const guchar * buf,
gsize len,
const char * info,
va_list args )

◆ mw_debug_opaque()

void mw_debug_opaque ( struct mwOpaque * o,
const char * info,
... )

◆ mw_debug_opaquev()

void mw_debug_opaquev ( struct mwOpaque * o,
const char * info,
va_list args )

◆ mw_mailme_data()

void mw_mailme_data ( const guchar * buf,
gsize len,
const char * info,
... )

◆ mw_mailme_datav()

void mw_mailme_datav ( const guchar * buf,
gsize len,
const char * info,
va_list args )

◆ mw_mailme_opaque()

void mw_mailme_opaque ( struct mwOpaque * o,
const char * info,
... )

Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.

if MW_MAILME is undefined or false, this function acts the same as mw_mailme_opaque.

  • block data to be printed in a hex block
  • info a printf-style format string

The resulting message is in the following format:

" Please send mail to: " MW_MAILME_ADDRESS
info
block
#define MW_MAILME_CUT_START
Definition mw_debug.h:55
#define MW_MAILME_ADDRESS
email address used in mw_debug_mailme.
Definition mw_debug.h:50
#define MW_MAILME_MESSAGE
message used in mw_debug_mailme instructing user on what to do with the debugging output produced fro...
Definition mw_debug.h:67
#define MW_MAILME_CUT_STOP
Definition mw_debug.h:60

◆ mw_mailme_opaquev()

void mw_mailme_opaquev ( struct mwOpaque * o,
const char * info,
va_list args )

Outputs a hex dump of a mwOpaque with debugging info and a pre-defined message.

Identical to mw_mailme_opaque, but taking a va_list argument