# HG changeset patch # User Sean Halle # Date 1362246743 28800 # Node ID 43b0a2585dc32a072d7099e00ce75dc746a8ef2d # Parent 40e7625e57bda24f7c3ad72f73f5d96ecaaa8dd3 Compiles and runs, up to end of process, working on end process and shutdown diff -r 40e7625e57bd -r 43b0a2585dc3 Services_Offered_by_PR/Debugging/DEBUG__macros.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Services_Offered_by_PR/Debugging/DEBUG__macros.h Sat Mar 02 09:52:23 2013 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright 2009 OpenSourceResearchInstitute.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + +#ifndef _PR_DEFS_DEBUG_H +#define _PR_DEFS_DEBUG_H +#define _GNU_SOURCE + +/* + */ +#ifdef DEBUG__TURN_ON_DEBUG_PRINT + #define DEBUG__printf( bool, msg) \ + do{\ + if(bool)\ + { printf(msg);\ + printf(" | function: %s\n", __FUNCTION__);\ + fflush(stdin);\ + }\ + }while(0);/*macro magic to isolate var-names*/ + + #define DEBUG__printf1( bool, msg, param) \ + do{\ + if(bool)\ + { printf(msg, param);\ + printf(" | function: %s\n", __FUNCTION__);\ + fflush(stdin);\ + }\ + }while(0);/*macro magic to isolate var-names*/ + + #define DEBUG__printf2( bool, msg, p1, p2) \ + do{\ + if(bool)\ + { printf(msg, p1, p2); \ + printf(" | function: %s\n", __FUNCTION__);\ + fflush(stdin);\ + }\ + }while(0);/*macro magic to isolate var-names*/ + + #define DEBUG__printf3( bool, msg, p1, p2, p3) \ + do{\ + if(bool)\ + { printf(msg, p1, p2, p3); \ + printf(" | function: %s\n", __FUNCTION__);\ + fflush(stdin);\ + }\ + }while(0);/*macro magic to isolate var-names*/ + +#else + #define DEBUG__printf( bool, msg) + #define DEBUG__printf1( bool, msg, param) + #define DEBUG__printf2( bool, msg, p1, p2) +#endif + +//============================= ERROR MSGs ============================ +#define ERROR(msg) printf(msg); +#define ERROR1(msg, param) printf(msg, param); +#define ERROR2(msg, p1, p2) printf(msg, p1, p2); + +//=========================================================================== +#endif /* _PR_DEFS_H */ +