/*  This file is part of Whitix.
 *
 *  Whitix is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Whitix is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Whitix; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#include <module.h>
#include <stdarg.h>
#include <string.h>
#include <typedefs.h>

static void (*ConsoleOutput)(char* message, int length);

void KeSetOutput(void (*newOutput)(char*, int))
{
	ConsoleOutput=newOutput;
}

SYMBOL_EXPORT(KeSetOutput);

void KePrint(const char* message, ...)
{
	char buf[2048];
	int length;
	va_list args;

	va_start(args, message);
	length=vsprintf(buf, message, args);
	va_end(args);

	ConsoleOutput(buf, length);
}

SYMBOL_EXPORT(KePrint);
