/*
 * DANG_BEGIN_MODULE
 *
 * Holds the *_printf() routines for DOSEMU
 *
 * DANG_END_MODULE
 *
 * DANG_BEGIN_CHANGELOG
 *
 * $Date: $
 * $Source: $
 * $Revision: $
 * $State: $
 *
 * $Log: $
 *
 * DANG_END_CHANGELOG
 */

#include "dosemu.h"
#include "base/bios.h"

#include <stdarg.h>

void p_dos_str(const char *fmt,...)
{
  va_list args;
  char buf[1025], *s;

  va_start(args, fmt);
  vsprintf(buf, fmt, args);
  va_end(args);

  s = buf;
  while (*s) 
    char_out(*s++, READ_BYTE(BIOS_CURRENT_SCREEN_PAGE));
}

int error(const char *f, ...)
{
  va_list ap;
  int result;

  va_start(ap, f);
  fprintf(stderr, "DOSEMU error:");
  result = vfprintf(stderr, f, ap);
  va_end(ap);
  return result;
}

int hard_error(const char *f, ...)
{
  va_list ap;
  int result;

  va_start(ap, f);
  fprintf(stderr, "DOSEMU hard error:");
  result = vfprintf(stderr, f, ap);
  va_end(ap);
  return result;
}
        
