/* bde/dprint.h: * $Log: dprint.h,v $ * Revision 1.14 2008/01/18 19:47:59 lechner * Minor typo correction. * * Revision 1.13 2008/01/17 05:29:26 lechner * Replaced '#if defined USECPLUSPLUS' with USECPLUSPLUS or USECC. * USECPLUSPLUS is always #defined. * -DUSECPLUSPLUS is now used in bde/srci/Imakefile, -DUSECC is used in pr_util_.... * * Revision 1.12 2007/11/29 02:02:32 lechner * Added: extern "C" int notacomment(const char*); * Clarified several comments. * * Revision 1.11 2007/02/10 03:31:48 lechner * Replaced macro get_rcount(viewname,tbl) by function get_rcount(viewname.tbl), * now in dprint.c. Arg2 = tbl is now quoted const string ttabbr or ASCII pkey. * Minor comment changes. * * Revision 1.10 2007/01/26 05:57:46 lechner * Revised comments to clarify find_tbl_idx use in printing rcounts. * * Revision 1.8 2006/02/13 03:19:32 lechner * Merely reformatted EP,DP,LP macro definitions. * * Revision 1.7 2005/12/11 22:20:59 lechner * Merely removed a commented-out #define. * * Revision 1.6 2005/10/23 07:12:22 lechner * Renamed XP (ExitProc) to LP (LeaveProc) to avoid name clash with XP * (paste macro of JPsim/olcarch) in pr_accessors.c from chgen13 . * * Revision 1.5 2005/08/26 02:51:58 lechner * Fixed typos - extra *_/ terminators. * * Revision 1.4 2005/08/26 02:35:33 lechner * Added macro #define XP do{printf("Exit %s at %s:%d\n",...)}while (0) * {EP; XP;} logs function entry and exit; * enable functions using vi commands in bde/maketrace.csh. * * Revision 1.3 2005/07/25 02:11:51 lechner * If USEDECC, cc and cxx do not recognize __FUNCTION__ used by DP EP and SP: * so try to avoid errors by #define __FUNCTION__ "Function?" . * * Revision 1.2 2005/05/02 03:03:23 lechner * Copied file from bde2alpha_rv branch onto trunk. * * Revision 1.1.2.7 2005/02/26 02:40:42 lechner * Added ' $Log: dprint.h,v $ * Added ' Revision 1.14 2008/01/18 19:47:59 lechner * Added ' Minor typo correction. * Added ' * Added ' Revision 1.13 2008/01/17 05:29:26 lechner * Added ' Replaced '#if defined USECPLUSPLUS' with USECPLUSPLUS or USECC. * Added ' USECPLUSPLUS is always #defined. * Added ' -DUSECPLUSPLUS is now used in bde/srci/Imakefile, -DUSECC is used in pr_util_.... * Added ' * Added ' Revision 1.12 2007/11/29 02:02:32 lechner * Added ' Added: extern "C" int notacomment(const char*); * Added ' Clarified several comments. * Added ' * Added ' Revision 1.11 2007/02/10 03:31:48 lechner * Added ' Replaced macro get_rcount(viewname,tbl) by function get_rcount(viewname.tbl), * Added ' now in dprint.c. Arg2 = tbl is now quoted const string ttabbr or ASCII pkey. * Added ' Minor comment changes. * Added ' * Added ' Revision 1.10 2007/01/26 05:57:46 lechner * Added ' Revised comments to clarify find_tbl_idx use in printing rcounts. * Added ' * Added ' Revision 1.8 2006/02/13 03:19:32 lechner * Added ' Merely reformatted EP,DP,LP macro definitions. * Added ' * Added ' Revision 1.7 2005/12/11 22:20:59 lechner * Added ' Merely removed a commented-out #define. * Added ' * Added ' Revision 1.6 2005/10/23 07:12:22 lechner * Added ' Renamed XP (ExitProc) to LP (LeaveProc) to avoid name clash with XP * Added ' (paste macro of JPsim/olcarch) in pr_accessors.c from chgen13 . * Added ' * Added ' Revision 1.5 2005/08/26 02:51:58 lechner * Added ' Fixed typos - extra *_/ terminators. * Added ' * Added ' Revision 1.4 2005/08/26 02:35:33 lechner * Added ' Added macro #define XP do{printf("Exit %s at %s:%d\n",...)}while (0) * Added ' {EP; XP;} logs function entry and exit; * Added ' enable functions using vi commands in bde/maketrace.csh. * Added ' * Added ' Revision 1.3 2005/07/25 02:11:51 lechner * Added ' If USEDECC, cc and cxx do not recognize __FUNCTION__ used by DP EP and SP: * Added ' so try to avoid errors by #define __FUNCTION__ "Function?" . * Added ' * Added ' Revision 1.2 2005/05/02 03:03:23 lechner * Added ' Copied file from bde2alpha_rv branch onto trunk. * Added '' and comments * ***************************************************** * Macros to wrap printf in #ifdef DEBUG brackets * Moved from bde/src; #include in any *schema.h - RJL 031020 * sources in pr_util/ dprint.c * Warning: I removed const from the gcc block and got an error from textops.cc: * It said discarding const was illegal * I added #ifdef DPRINT brackets - RJL 040621; no help for EP; in pr_util * __FUNCTION__ is supported by gcc/g++ but not cc/cxx . * __FUNCTION is NOT supported on Linux/mercury: TBD: Bypass for Linux */ /* [050830] I renamed XP(ExitProc) to LP(LeaveProc) to avoid clash with XP */ /* (chgen13 now generates XP = paste macro of JPsim/olcarch in pr_accessors.c*/ /* Macros to locate function calls and entry events: - RJL 040601 */ /* do{...}while(0) brackets on DP failed, in table_loop body (if((DP), ...)*/ /* (conditional EP, LP fails to insert \n or \\ before #endif) */ /* #define XP do{...} while (0) fails before '}' or 'return' */ /* Don't #include "configure.h" which is for [I]makefiles, not compilable */ #ifndef DPRINT #define DPRINT #include #include /* extern ["C"] int find_tbl_idx(const char*) is defined in pr_load.c */ /* extern ["C"] int find_view_idx(const char*) is defined in pr_load.c */ /* In configure.h, #define USEDECC to compile and link with cxx instead of g++*/ /* If USEDECC, cc and cxx do not recognize __FUNCTION__ in gcc for DP EP and SP: */ #ifdef USEDECC #define __FUNCTION__ "Function?" #endif #define EP \ do{ printf("Enter %s at %s:%d\n",__FUNCTION__,__FILE__,__LINE__);}while(0) #define LP \ do{ printf("Exit %s at %s:%d\n",__FUNCTION__,__FILE__,__LINE__);}while(0) #define DP \ do{ printf(" In %s at %s:%d\n",__FUNCTION__,__FILE__,__LINE__);}while(0) #define SP do{printf("\nstate:%s, event %s ",\ statename[state], &eventname[event->type][0]);DP; }while(0) /* DPS moved here from *ops.cc - RJL 080513 */ #define DPS(str) do{DP;dprint("\n%%");dprint(#str);dprint("\n");}while(0) /* Depending on USEDECC, __CPLUSPLUS is #defined in Imakefile, as cxx or g++ - RJL080116 */ /* But we want decls below to depend on src vs. pr_util_*log directories. */ /* for cxx; -DUSECPLUSPLUS ==> cxx */ #if defined USECPLUSPLUS extern "C" void dprint(const char*); extern "C" void dprintd(const char*, int);/* bug in strdup ref 060724?*/ extern "C" void dprints(const char*, const char*); extern "C" void dprintdd(const char*, const int,const int); extern "C" void dprintds(const char*, const int, const char*); extern "C" void dprintsd(const char*, const char*, const int); extern "C" void dprintss(const char*, const char*, const char*); extern "C" void printrowcounts(const char*); extern "C" int notacomment(const char*); extern "C" int isComment(const char*); #endif /* for gcc: -DUSECC ==> g++ */ #if defined USECC extern void dprint(const char*); extern void dprintd(const char*, const int); extern void dprints(const char*, const char*); extern void dprintdd(const char*, const int, const int); extern void dprintds(const char*, const int, const char*); extern void dprintsd(const char*, const char*, const int); extern void dprintss(const char*, const char*, const char*); extern void printrowcounts(const char*); extern int isComment(const char*); extern int notacomment(const char*); #endif /* Macro get_rcount_all was moved to 94sbde_schema.h-RJL070126 */ /* Macro get_rcount became function get_rcount in dprint.c -RJL070209 */ /*end of file dprint.h */ #endif