/* ======================================================================== */
/* = Programmname    : ListSVPs_Subs V9.1                                 = */
/* =                                                                      = */
/* ======================================================================== */
/* = Autor/Copyright : (c) 1990-94 by Andreas Ralph Kleinert.             = */
/* =                   All rights reserved.                               = */
/* ======================================================================== */
/* = Funktion        : Sub-Routines for ListSVPs V9.1                     = */
/* =                                                                      = */
/* ======================================================================== */
/* = Compiler        : SAS/C V6.51                                        = */
/* =                                                                      = */
/* ======================================================================== */

#include <dos.h> /* to prevent multiple include, include this at FIRST ! */

#include <exec/types.h>
#include <exec/memory.h>

#include <proto/exec.h>
#include <proto/dos.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#define N (NULL) /* as usual */


void __stdargs K_Printf(char *formatstring, ...);


/* *************************************************** */
/* *                                                 * */
/* * K_Printf : Replacement for printf()-Output      * */
/* *                                                 * */
/* *************************************************** */

#define KIP_BUFLEN (1200)

extern void Fmt(void);

void __stdargs K_Printf(char *formatstring, ...)
{
 UBYTE *buffer;

 buffer = (UBYTE *) AllocMem(KIP_BUFLEN, MEMF_CLEAR);
 if(buffer)
  {
   RawDoFmt((APTR) formatstring, (APTR) (((ULONG *)&formatstring)+1), (APTR) &Fmt, (APTR) buffer);

   Write(Output(), buffer, strlen(buffer));

   FreeMem(buffer, KIP_BUFLEN);
  }
}
