core/vul/vul_printf.cxx
Go to the documentation of this file.
00001 // This is core/vul/vul_printf.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //
00006 // Author: Andrew W. Fitzgibbon, Oxford RRG
00007 // Created: 03 Jul 97
00008 //
00009 //-----------------------------------------------------------------------------
00010 
00011 #include "vul_printf.h"
00012 
00013 #include <vcl_cstdarg.h>
00014 #include <vcl_iostream.h>
00015 #include <vcl_cstdio.h> // for vsprintf()
00016 
00017 vcl_ostream& vul_printf(vcl_ostream& s, char const * fmt, ...)
00018 {
00019   char buf[65536];
00020 
00021   vcl_va_list ap;
00022   va_start(ap, fmt);
00023   vcl_vsprintf(buf, fmt, ap);
00024   va_end(ap);
00025 
00026   return s << buf;
00027 }