home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / informix / 2423 < prev    next >
Encoding:
Text File  |  1992-11-14  |  2.0 KB  |  68 lines

  1. Path: sparky!uunet!destroyer!sol.ctr.columbia.edu!emory!emory!not-for-mail
  2. From: zellich@STL-07SIMA.ARMY.MIL (Rich Zellich)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: tracking execution
  5. Date: 13 Nov 1992 13:38:04 -0500
  6. Organization: Mailing List Gateway
  7. Lines: 53
  8. Sender: walt@mathcs.emory.edu
  9. Distribution: world
  10. Message-ID: <1e0smcINN4b3@emory.mathcs.emory.edu>
  11. Reply-To: zellich@STL-07SIMA.ARMY.MIL (Rich Zellich)
  12. NNTP-Posting-Host: emory.mathcs.emory.edu
  13. X-Informix-List-ID: <list.1605>
  14.  
  15. I think this may be what you're looking for...
  16. -Rich
  17. -------
  18.  
  19.  
  20. The following is in our project's master .h file:
  21. (Note that *every* module in the project does OssTrace("thismodulename");
  22.  as the first line of executable code in the module [where thismodulename
  23.  is, of course, the individual module name...should someone forget to do
  24.  this in a new module, then the "(unknown)" declaration in WriteOssLog.c
  25.  will be used].)
  26.  
  27. /*
  28.  * OssTrace will eventually be defined to not only declare a static variable
  29.  * containing the name of the function, but call WriteOssLog if we are
  30.  * tracing.
  31.  */
  32. extern char __exec_start[], __exec_end[], __ossname[];
  33.  
  34. #define OssTrace(x) static char __ossname[] = x; \
  35.            if (oss_trace||oss_debug) { WriteOssLog(ERR_TRACE, __exec_start); \
  36.                       __osstrace(__ossname, __FILE__); }
  37.  
  38. /*
  39.  * WriteOssLog passes the name of the function, obtained from OssTrace.
  40.  * If not defined in the current function, it will pick up the one defined
  41.  * in WriteOssLog itself, which will be empty.
  42.  */
  43. #define WriteOssLog(i, m) _WriteOssLog(__ossname, __FILE__, __LINE__, i, m)
  44.  
  45.  
  46.  
  47.  
  48. WriteOssLog.c contains the following global declarations:
  49.  
  50. char __exec_start[] = "Starting execution";
  51. char __exec_end[]   = "Ending execution";
  52. char __ossname[]    = "(unknown)";
  53.  
  54.  
  55.  
  56.  
  57.  
  58. The following is a typical call to WriteOssLog():
  59.  
  60.    if ( status == ABEND )
  61.       {
  62.       /*:DON Error:*/
  63.       UpdateMsg(ABEND, &LVT);
  64.       sprintf(msg, don_error, MG_DON);
  65.       WriteOssLog(ERR_MISC, msg);
  66.       return(ULMainReturn(&LVT, rep_req_flag, &original_a0));
  67.       }
  68.