
**
**
**	$VER: SPrintF.c 1.1
**
**	(c) 1994-1995 GC/TBR
**
**


******* vartools.lib/SPrintF **************************************************
*
*  NAME
*	SPrintF -- string formatter
*
*  SYNOPSIS
*	buf = SPrintF(buf, fmt, arg1, ...)
*
*	STRPTR SPrintF(STRPTR, STRPTR, ...)
*
*  FUNCTION
*	This is easy C interface for RawDoFmt. Does perefectly the same.
*
*  INPUTS
*	buf = buffer to store formatted string
*	fmt = format string
*	args = data stream to format in
*
*  RESULT
*	Same as buf, for convinience.
*
*  SEE ALSO
*	exec.library/RawDoFmt()
*
******************************************************************************/

		opt	alink

		incdir	"asminc:"
		include "lvo30/exec_lib.i"

		XREF	_SysBase
		XDEF	_SPrintF
	
* ostring, format, {values} 

_SPrintF	movem.l a2/a3/a6,-(sp)

		move.l	4*4(sp),a3		; Get the output string pointer
		move.l	5*4(sp),a0		; Get the FormatString pointer
		lea	6*4(sp),a1		; Get the pointer to the DataStream
		lea	.putchar(pc),a2
		move.l	_SysBase,a6
		jsr	_LVORawDoFmt(a6)
		move.l	a3,d0			; NEW: retval = output string
		movem.l (sp)+,a2/a3/a6
		rts

		CNOP	0,4

.putchar	move.b	d0,(a3)+		; Put data to output string
		rts


