
/*
 *
 * io.c - part of Danovitsch Webcam
 *
 * Copyright (C) 2001 by Daan Vreeken
 *
 * Published under the terms of the GNU Public License 2.0
 * (or any later version)
 *
 */




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


#include "io.h"
#include "general.h"


#ifdef Debug
#undef Debug
#endif




void ExitFatal(char *Txt, ...)
{
	va_list		List;

	va_start(List,Txt);
	printf("Fatal: ");
	vprintf(Txt,List);
	printf("\n");
	va_end(List);

	exit(0);
}



void Error(char *Txt, ...)
{
	va_list		List;

	va_start(List,Txt);
	fprintf(stderr,"Error: ");
	vfprintf(stderr,Txt,List);
	fprintf(stderr,"\n");
	va_end(List);
}



void Debug(int Level, char *Txt, ...)
{
#ifdef DebugLevel
	va_list		List;

	if (Level<DebugLevel)
		return;

	va_start(List,Txt);
	printf("Debug: ");
	vprintf(Txt,List);
	printf("\n");
	va_end(List);
#endif
}



void Output(char *Txt, ...)
{
	va_list		List;

	va_start(List,Txt);
	vprintf(Txt,List);
	printf("\n");
	va_end(List);
}



void IO_Init(void)
{
	Output("%s started",Server_String);
}



