/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* out.c -- some basic output routines
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <time.h>
#include "out.h"
#include "stats.h"
#include "io.h"
/* stats we keep for "out" module */
static int Exitcode;
static const char *Myname;
/* buffer used to format all prints */
/*
* out_init -- initialize this module
*/
void
{
return;
else
Myname++;
}
void
out_fini(void)
{
}
/*
* out_altfp -- store an alternate fp for O_ALTFP
*/
void
{
}
/*
* voutbufprintf -- like vprintf, but appends to Outbuf
*/
static void
{
}
/*
* outbufprintf -- like printf, but appends to Outbuf
*/
/*PRINTFLIKE1*/
static void
{
}
/*
* vout -- va_list version of out()
*
* all the output processing work is done here.
*/
static void
{
/*
* just return if called with a disabled output type. this
* prevents debug prints when Debug is off, verbose prints
* when Verbose is off, and language warnings when warnings
* are quenched (which they are when we're loading a .eft file).
*
*/
return;
return;
return;
return;
return;
return;
/* some things only happen at the beginning of a print */
if (Outidx == 0) {
Exitcode++;
} else {
Exitcode++;
outbufprintf("fatal error: ");
Exitcode++;
outbufprintf("error: ");
outbufprintf("warning: ");
}
}
}
/* fmt can be NULL if the caller just wanted flags processed */
/* O_SYS means convert errno to a string and append it */
if (Outidx != 0)
outbufprintf(": ");
if (msg)
else
}
/* O_STAMP means convert add a timestamp */
char *tmsg;
if (Outidx != 0)
outbufprintf(" ");
}
}
return; /* not done filling Outbuf */
/* done filling Outbuf, platform calls will add newline */
else
/* reset output buffer */
Outidx = 0;
Outbuf[0] = '\0';
}
/*
* out -- spew a line of output, with various options
*/
/*PRINTFLIKE2*/
void
{
}
/*
* outfl -- spew a filename:linenumber message
*/
/*PRINTFLIKE4*/
void
{
if (fname)
}
/*
* out_exit -- exit the program
*/
void
{
}
/*
* out_errcount -- return the number of O_ERR messages issued so far
*/
int
out_errcount(void)
{
return (stats_counter_value(Errcount));
}
/*
* out_warncount -- return the number of O_WARN messages issued so far
*/
int
out_warncount(void)
{
return (stats_counter_value(Warncount));
}