Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - c/lib5/stdio/vprint.c
There are 3 other files named vprint.c in the archive. Click here to see a list.
/*
 *	VFPRINTF, VPRINTF, VSPRINTF
 *
 *	Copyright (C) 1987 by Ian Macky, SRI International
 */

#include "stdio.h"
#include "varargs.h"

extern int _doprnt();			/* from printf.c */

int vfprintf(stream, format, arg)
FILE *stream;
char *format;
va_list arg;
{
    return _doprnt(format, &arg, stream);
}

int vprintf(format, arg)
char *format;
va_list arg;
{
    return _doprnt(format, &arg, stdout);
}

int vsprintf(s, format, arg)
char *s, *format;
va_list arg;
{
    FILE *f;
    int result;

    f = sopen(s, "w", 32767);		/* open string for output */
    result = _doprnt(format, &arg, f);	/* write to the string... */
    putc('\0', f);			/* null-terminate result */
    fclose(f);				/* "close" the string */
    return result;
}