Example #1
0
VOID
SIfprintf( FILE *ioptr, const char *fmt, ... )
{
	va_list	ap;

	va_start( ap, fmt );
	SIdofrmt(PUTC, ioptr, fmt, ap);
	va_end( ap );
}
Example #2
0
VOID
SIprintf( const char *fmt, ... )
{
	va_list	ap;

	va_start( ap, fmt );
	SIdofrmt(PUTC, stdout, fmt, ap);
	va_end( ap );
}
Example #3
0
char *
STprintf(char *buffer, const char *fmt, ...)
{
	FILE	iobuf;
	va_list	ap2;

	iobuf._ptr = (char*)buffer;
	iobuf._cnt = MAXI2;
	va_start(ap2, fmt);
	SIdofrmt(&iobuf, fmt, STiflush, ap2);
	va_end(ap2);
	*iobuf._ptr = '\0';
	return (buffer);
}
Example #4
0
/*
** Name:	STnprintf - VMS version of snprintf()
**
** Description:
**	VMS doesn't seem to have the handy routine snprintf(), which
**      sets a maximum length for output to a buffer.  This routine
**      emulates what is available on Unix, Linux and Windows.
**
** History:
**	08-jun-2004 (loera01)
*           Created.
*/
char *
STnprintf(char *buffer, i4 len, const char *fmt, ...)
{
	FILE	iobuf;
	va_list	ap2;

	iobuf._ptr = (char*)buffer;
        iobuf._flag = _IOSTRG;
	iobuf._cnt = len;
	va_start(ap2, fmt);
	SIdofrmt(&iobuf, fmt, STiflush, ap2);
	va_end(ap2);
        if( iobuf._cnt > 0 )
        {
  	    *iobuf._ptr = '\0';
	    return (buffer);
        }
        else
            return -1;
}