| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

trace

#include "sfltron.h"
void
trace (const char *format, ...)

Synopsis

If the global variable trace_state is TRUE, this function formats the parameters (using printf() conventions) and sends these to stdout, or the trace_file if opened using set trace file(). The trace output is given a newline automatically.

Source Code - (sfltron.c)

{
    static char
        trace_text [LINE_MAX];
    va_list argptr;                     /*  Argument list pointer            */
    int fmtsize;

    if (trace_state)
      {
        va_start (argptr, format);      /*  Start variable args processing   */
#if (defined (DOES_SNPRINTF))
        fmtsize = vsnprintf (trace_text, LINE_MAX, format, argptr);
#else
        fmtsize = vsprintf  (trace_text, format, argptr);
#endif

        va_end (argptr);                /*  End variable args processing     */

        ASSERT (fmtsize < LINE_MAX);
        fprintf ((trace_file? trace_file: stdout), "%s: %s\n",
                  time_str (), trace_text);
        fflush   (trace_file? trace_file: stdout);
      }
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix