pa_debugprint.c File Reference

Implements log function. More...

#include <stdio.h>
#include <stdarg.h>
#include "pa_debugprint.h"

Defines

#define VSNPRINTF   vsnprintf
#define SIZEDUMP   1024

Functions

void PaUtil_SetDebugPrintFunction (PaUtilLogCallback cb)
void PaUtil_DebugPrint (const char *format,...)


Detailed Description

Implements log function.

PaUtil_SetLogPrintFunction can be user called to replace the provided DefaultLogPrint function, which writes to stderr. One can NOT pass var_args across compiler/dll boundaries as it is not "byte code/abi portable". So the technique used here is to allocate a local a static array, write in it, then callback the user with a pointer to its start.

Todo:
Consider allocating strdump using dynamic allocation.
Todo:
Consider reentrancy and possibly corrupted strdump buffer.

Define Documentation

#define SIZEDUMP   1024

#define VSNPRINTF   vsnprintf


Function Documentation

void PaUtil_DebugPrint ( const char *  format,
  ... 
)

PA_DEBUG() provides a simple debug message printing facility. The macro passes it's argument to a printf-like function called PaUtil_DebugPrint() which prints to stderr and always flushes the stream after printing. Because preprocessor macros cannot directly accept variable length argument lists, calls to the macro must include an additional set of parenthesis, eg: PA_DEBUG(("errorno: %d", 1001 ));

void PaUtil_SetDebugPrintFunction ( PaUtilLogCallback  cb  ) 

Install user provided log function


Generated on Wed Aug 22 15:26:19 2007 for PortAudio by  doxygen 1.5.2