
/*
  File: include/basic/print.h
  Description: Custom pritnf-like routine declarations
  Part of the Mantis project
  (c) 2002 Lycos Inc.

  This file is distributed for the sole purpose of allowing you to write
  software to interface with Sonique 2 and other Mantis programs. It is
  not to be modified or used for any other purpose without written
  authorization.

  If you redistribute this file, it must be in the original package
  complete with all other files provided, including the usage agreement.

  Do not remove this notice.
*/

#ifndef _PRINT_H_
#define _PRINT_H_

#include "typesport.h"
#include <stdarg.h>

size_t vswprint( wchar_t* wcBuffer, size_t nBufferLen, const wchar_t* wcFormat, va_list args );
size_t swprint( wchar_t* wcBuffer, size_t nBufferLen, const wchar_t* wcFormat, ... );
size_t vsprint( char* szBuffer, size_t nBufferLen, const char* szFormat, va_list args );
size_t sprint( char* szBuffer, size_t nBufferLen, const char* szFormat, ... );

inline size_t vstprint( wchar_t* wcBuffer, size_t nBufferLen, const wchar_t* wcFormat, va_list args )
{
	return vswprint( wcBuffer, nBufferLen, wcFormat, args );
}
inline size_t stprint( wchar_t* wcBuffer, size_t nBufferLen, const wchar_t* wcFormat, ... )
{
	va_list args;
	va_start( args, wcFormat );
	size_t ret =  vswprint( wcBuffer, nBufferLen, wcFormat, args );
	va_end( args );
	return ret;
}

inline size_t vstprint( char* szBuffer, size_t nBufferLen, const char* szFormat, va_list args )
{
	return vsprint( szBuffer, nBufferLen, szFormat, args );
}

inline size_t stprint( char* szBuffer, size_t nBufferLen, const char* szFormat, ... )
{
	va_list args;
	va_start( args, szFormat );
	size_t ret =  vsprint( szBuffer, nBufferLen, szFormat, args );
	va_end( args );
	return ret;
}



#endif//_PRINT_H_
