Logo Search packages:      
Sourcecode: cbmconvert version File versions  Download package

static void writeLog ( enum Verbosity  verbosity,
const struct Filename name,
const char *  format,
  ... 
) [static]

Call-back function for diagnostic output

Parameters:
verbosity the verbosity level
name the file name associated with the message (or NULL)
format printf-like format string followed by arguments

Definition at line 73 of file main.c.

References currentFilename, getFilename(), and verbosityLevel.

Referenced by main(), and writeFile().

{
  static struct Filename oldname;

  if (verbosityLevel >= verbosity) {
    va_list ap;

    if (currentFilename) {
      fprintf (stderr, "`%s':\n", currentFilename);
      currentFilename = 0;
    }

    fputs ("  ", stderr);

    if (name) {
      if (memcmp(name, &oldname, sizeof oldname))
      fprintf (stderr, "`%s':\n    ", getFilename (name));
      else
      fputs ("  ", stderr);
      memcpy(&oldname, name, sizeof oldname);
    }

    va_start (ap, format);
    vfprintf (stderr, format, ap);
    va_end (ap);

    fputc ('\n', stderr);
  }
}


Generated by  Doxygen 1.6.0   Back to index