Ejemplo n.º 1
0
static void
start_line(int verbose, int lineend)
{
  char	flg;

  if (flag_localtime || flag_utc)
    gettimeofday(&stamp, NULL);

  tino_buf_resetO(&prefix);

  add_prefix("");
  if (flag_localtime)
    add_time(localtime);
  if (flag_utc)
    add_time(gmtime);

  flg	= verbose ? '-' : lineend ? ' ' : '+';
  if (flag_verbose && producer)
    add_prefix("[%ld]", (long)producer);

  if (flag_linecount)
    {
      if (!in_line)
	line_nr++;
      add_prefix((flag_linecount==1 ? "%5d%c" : flag_linecount==2 ? "%05d%c" : "%d%c"), line_nr, flg);
    }
  else if (flag_verbose)
    add_prefix("%c", flg);
}
Ejemplo n.º 2
0
/* This actually is a hack.
 *
 * We only have one single operation active at a time.  So we can use
 * a static buffer here which keeps the intermediate string.
 */
static const char *
get_src(const char *name)
{
  static TINO_BUF	buf;

  if (!m_source)
    return name;

  tino_buf_resetO(&buf);
  tino_buf_add_sO(&buf, m_source);
  tino_buf_add_sO(&buf, name);
  return tino_buf_get_sN(&buf);
}