vprintf man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



VPRINTF(3S)							   VPRINTF(3S)

NAME
     vprintf, vfprintf, vsnprintf, vsprintf - print formatted output of a
     variable argument list

SYNOPSIS
     #include <stdarg.h>
     #include <stdio.h>

     int vprintf (const char *format, va_list arg);

     int vfprintf (FILE *stream, const char *format, va_list arg);

     int vsnprintf (char *s, size_t len, const char *format, va_list arg);

     int vsprintf (char *s, const char *format, va_list arg);

DESCRIPTION
     vprintf, vfprintf, vsnprintf, and vsprintf are the same as printf,
     fprintf, snprintf, and sprintf respectively, except that instead of being
     called with a variable number of arguments, they are called with an
     argument list, arg, as defined by stdarg(5).  The arg parameter must be
     initialized by the va_start macro (and possibly subsequent va_arg calls).
     The vprintf, vfprintf, vsnprintf, and vsprintf functions do not invoke
     the va_end macro.

EXAMPLE
     The following demonstrates the use of vfprintf to write an error routine.

     The stdarg.h header file defines the type va_list and a set of macros for
     advancing through a list of arguments whose number and types may vary.
     The argument ap to the vprint family of routines is of type va_list.
     This argument is used with the stdarg.h header file macros va_start,
     va_arg and va_end [see va_start, va_arg, and va_end in stdarg(5)].

     #include <stdio.h>
     #include <stdarg.h>

     /*
      *	  error should be called as:
      *	  error(function_name, format, arg1, arg2 ...);
      */
     void
     error(char *function_name, char *format, ...)
     {
	  va_list args;

	  va_start(args, format);
	  /* print out name of function causing error */
	  fprintf(stderr, "ERROR in %s: ", function_name);
	  /* print out remainder of message */
	  vfprintf(stderr, format, args);
	  va_end(args);

									Page 1

VPRINTF(3S)							   VPRINTF(3S)

     }

SEE ALSO
     printf(3S), stdarg(5).

DIAGNOSTICS
     vprintf, vfprintf, vsnprintf, and vsprintf return the number of
     characters transmitted, or return -1 if an error was encountered.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net