home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / vwprintf.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  2KB  |  62 lines

  1. /***
  2. *vwprintf.c - wprintf from a var args pointer
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines vwprintf() - print formatted data from an argument list pointer
  8. *
  9. *******************************************************************************/
  10.  
  11.  
  12. #include <cruntime.h>
  13. #include <stdio.h>
  14. #include <wchar.h>
  15. #include <dbgint.h>
  16. #include <stdarg.h>
  17. #include <internal.h>
  18. #include <file2.h>
  19. #include <mtdll.h>
  20.  
  21. /***
  22. *int vwprintf(format, ap) - print formatted data from an argument list pointer
  23. *
  24. *Purpose:
  25. *       Prints formatted data items to stdout.  Uses a pointer to a
  26. *       variable length list of arguments instead of an argument list.
  27. *
  28. *Entry:
  29. *       wchar_t *format - format string, describes data format to write
  30. *       va_list ap - pointer to variable length arg list
  31. *
  32. *Exit:
  33. *       returns number of wide characters written
  34. *
  35. *Exceptions:
  36. *
  37. *******************************************************************************/
  38.  
  39. int __cdecl vwprintf (
  40.         const wchar_t *format,
  41.         va_list ap
  42.         )
  43. /*
  44.  * stdout 'V'ariable, 'W'char_t 'PRINT', 'F'ormatted
  45.  */
  46. {
  47.         REG1 FILE *stream = stdout;
  48.         REG2 int buffing;
  49.         REG3 int retval;
  50.  
  51.         _ASSERTE(format != NULL);
  52.  
  53.         _lock_str(stream);
  54.         buffing = _stbuf(stream);
  55.         retval = _woutput(stream, format, ap );
  56.         _ftbuf(buffing, stream);
  57.         _unlock_str(stream);
  58.  
  59.         return(retval);
  60. }
  61.  
  62.