OAR

RTEMS GNU Tools On-Line Library


vprintf

PREV UP next Bookshelf

3.39: vprintf, vfprintf, vsprintf---format argument list

Synopsis

#include <stdio.h>
#include <stdarg.h>
int vprintf(const char *fmt, va_list list);
int vfprintf(FILE *fp, const char *fmt, va_list list);
int vsprintf(char *str, const char *fmt, va_list list);
int vsnprintf(char *str, size_t size, const char *fmt, va_list list);

int _vprintf_r(void *reent, const char *fmt,
    va_list list);
int _vfprintf_r(void *reent, FILE *fp, const char *fmt,
    va_list list);
int _vsprintf_r(void *reent, char *str, const char *fmt,
    va_list list);
int _vsnprintf_r(void *reent, char *str, size_t size, const char *fmt,
    va_list list);

Description
vprintf, vfprintf, vsprintf and vsnprintf are (respectively) variants of printf, fprintf, sprintf and snprintf. They differ only in allowing their caller to pass the variable argument list as a va_list object (initialized by va_start) rather than directly accepting a variable number of arguments.


Returns
The return values are consistent with the corresponding functions: vsprintf returns the number of bytes in the output string, save that the concluding NULL is not counted. vprintf and vfprintf return the number of characters transmitted. If an error occurs, vprintf and vfprintf return EOF. No error returns occur for vsprintf.


Portability
ANSI C requires all three functions.

Supporting OS subroutines required: close, fstat, isatty, lseek, read, sbrk, write.



PREV UP next Bookshelf

Packaging copyright © 1988-2000 OAR Corporation
Context copyright by each document's author. See Free Software Foundation for information.