debug
[Internal functions of Easydbus Library]

Collaboration diagram for debug:

Detailed Description

Debug feature is enabled only in compilation phase. In particular, there are for now only two debugging mode:


Files

file  debug.h

Functions

void _EasyDbusDebug (const char *file, const char *function, int line, const char *fmt,...)
 Main debug function.


Function Documentation

void _EasyDbusDebug ( const char *  file,
const char *  function,
int  line,
const char *  fmt,
  ... 
)

Main debug function.

For internal use only.

Definition at line 67 of file debug.c.

00070 {
00071    char *ptr;
00072    char *pptr;
00073    va_list ap;
00074 
00075    va_start (ap, fmt);
00076    vasprintf (&ptr, fmt, ap);
00077    va_end (ap);
00078 
00079    pptr = ptr + strlen (ptr) - 1;
00080    if (*pptr == '\n')
00081       *pptr = ' ';
00082 
00083 #ifdef TOFILE_DEBUG
00084    char buffer[1024];
00085 
00086    snprintf (buffer, 1024, "[%s@%s:%d] %s\n", file, function, line, ptr);
00087    write (debug_file_fd, buffer, strlen (buffer));
00088 #else
00089    fprintf (stderr, "[%s@%s:%d] %s\n", file, function, line, ptr);
00090    fflush (stderr);
00091 #endif
00092    free (ptr);


Generated on Thu Apr 10 10:03:22 2008 for EasyDbus-0.2 by  doxygen 1.5.4