Tracing

Or even better 

  The calls: 

  HTTRACE((type, msg, args)); 

  for example  

  HTTRACE((PROT_TRACE, "HTTP Clean.. status %d, net %p\n", status, net)); 

  #define PROT_TRACE (WWWTRACE & SHOW_PROTOCOL_TRACE),__FILE__,__LINE__ 

  #ifdef LIBWWW_TRACING 
  #define HTTRACE(args) HTTrace args 
  #else 
  #define HTTRACE(args) if (0); 
  #endif 

  void 
  HTTrace(int type, const char *file, int line, const char *fmt, ...) 
  { 
    va_list pArgs; 
    va_start(pArgs, fmt); 
    if(type) { 
      if (PHTTraceCallback) 
        return (*PHTTraceCallback)(file, line, fmt, pArgs); 
  #ifdef WWW_WIN_WINDOW 
      return (0); 
  #else 
      { 
         int ret1, ret2; 
         ret1 = vfprintf(stderr, "%s(%d)\t", file, line); 
         ret2 = vfprintf(stderr, fmt, pArgs); 
         if ((ret1 > 0) && (ret2 > 0)) return (ret1 + ret2); 
         return -1; 
      } 
  #endif 
    } 
  } 

  It seems this requires less changes than with HTTRACE1, HTTRACE2, ...
  What do you think? 

  Regards 
  Mikhail Grouchinski


____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1

Received on Friday, 19 February 1999 09:52:23 UTC