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


void debuginit()
	{
	FILE* f = fopen("debug.txt","w+");
	fclose(f);
	}

void debugprintf( char* fmt, ... )
	{

	va_list         ap;
	char   p[1024];

	va_start( ap,fmt );
	vsnprintf( p,1024,fmt,ap );
	va_end( ap );


	FILE* f = fopen("debug.txt","a+");
	fprintf( f, p );
	fprintf( f, "\n");
	fflush(f);
	fclose(f);
	}

