/* bde/dprint.h: * $Log: dprint.h,v $ * 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.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 * *****************************************************8 * 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__ may not be supported by gcc * __FILE/FUNC/LINE__ are NOT supported on Linux/mercury: TBD: Bypass for Linux */ /* [050830] I renamed XP (ExitProc) to LP (LeaveProc) to avoid name clash with XP */ /* (paste macro of JPsim/olcarch) which chgen13 now generates 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' */ /* #include "configure.h" //configure.h is for [I]makefiles, not compilable */ #ifndef DPRINT #define DPRINT #include #include /* In 9*schema.h: extern int find_tbl_idx(char*); defin. 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__ used by 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) #if defined __CPLUSPLUS /* for g++ */ 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 isComment(char* tmpstr); /*:* ==> 'base initializer' error */ #else /* for gcc */ 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(char* tmpstr); #endif /*Macros used by printrowcounts(), moved from 94sbde_schema.h-RJL060808*/ /***********************************************************************/ /* Macro get_rcount_all returns the number of rows currently in the */ /* specified table. This includes all versions. [was pr_rcount_all -RJL] */ /* WARNING: needs tbl##_idx; find_tbl_idx() does NOT set this or return -1 */ /***********************************************************************/ #define get_rcount_all(tbl) hcg_table_seq_list[tbl##_idx].rcount /***********************************************************************/ /* Macro get_rcount returns the number of rows currently loaded in the */ /* specified table, iff in the specified view/version). [was pr_rcount]*/ /* If tbl is not a ttabbr in the view, 0 is returned. */ /* Side-effects: find_{tbl,view}_idx() updates hcg_{tbl,view}_idx resp.*/ /***********************************************************************/ /* Moved to 9*schenma.h fropm dprint.h - RJL070126 */ /* Added '&&find_tbl_idx(#tbl)' (side effect: update hcg_tbl_idx). - RJL060806 */ /* Bugs 060918: dprint.c:131: warning: implicit declaration of function `find_tbl_idx' * dprint.c:131: warning: array subscript has type `char' <<< #tbl? * Removed # from find_tbl_idx arg't. - syntax error outside a #defined macro - RJL070126 * Client dprint.c of get_rcount must quote the ttabbrev passed in. */ #define get_rcount(viewname,tbl) /* tbl is a string */\ ((find_view_idx(viewname) && (find_tbl_idx(tbl)) ) ? \ hcg_ts_list[hcg_tbl_idx].ts_list[hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx]].rcount : \ 0) //End of file dprint.h : #endif