Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (30 sloc) 0.477 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/* eprintf.c
*
* Definitions of various clean output functions
*/

#include <stdarg.h>
#include <stdio.h>

#include "eprintf.h"

static int g_volume = 0;

void
louder(void)
{
    ++g_volume;
}

int
get_loudness(void)
{
    return g_volume;
}


int
eprintf(int level, const char *fmt, ...)
{
    if (level > g_volume)
        return 0;

    va_list ap;
    va_start(ap, fmt);

    int rv = vfprintf(stderr, fmt, ap);
    // fflush(stderr);

    va_end(ap);

    return rv;
}
Something went wrong with that request. Please try again.