error.c
author viric@llimona
Mon, 24 Sep 2007 13:59:40 +0200
changeset 38 f1e581c862d5
parent 26 96920c3707b3
child 53 07500c5c53cb
permissions -rw-r--r--
Improved help. Moving to 0.2.

/*
    stdin mix - a mixer/multiplexer for stdin to processes
    Copyright (C) 2007  LluĂ­s Batlle i Rossell

    Please find the license in the provided COPYING file.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>

#include "main.h"

void error(const char *msg, ...)
{
    va_list v;

    va_start(v, msg);
    vfprintf(stderr, msg, v);
    putc('\n', stderr);
    fprintf(stderr, " errno %i: %s\n", errno, strerror(errno));
    finish(-1);
}

void not_implemented(const char *msg, ...)
{
    va_list v;

    va_start(v, msg);
    fprintf(stderr, "Not implemented: ");
    vfprintf(stderr, msg, v);
    putc('\n', stderr);
    fprintf(stderr, " errno %i: %s\n", errno, strerror(errno));
    finish(-1);
}