Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1019 B

  1. /***
  2. *w4io.h - fake FILE structure for Win 4 printf/sprintf/debug printf support
  3. *
  4. */
  5. #if defined(M_I386) || defined(FLAT)
  6. # ifndef FLAT
  7. # define FLAT
  8. # endif
  9. #elif !defined(M_I86LM)
  10. # error Must be FLAT or LARGE model.
  11. #endif
  12. #ifndef NULL
  13. # define NULL 0
  14. #endif
  15. #ifndef _WCHAR_T_DEFINED
  16. typedef unsigned short wchar_t;
  17. #define _WCHAR_T_DEFINED
  18. #endif
  19. struct w4io
  20. {
  21. union
  22. {
  23. struct
  24. {
  25. wchar_t *_pwcbuf; // wchar_t output buffer
  26. wchar_t *_pwcstart;
  27. } wc;
  28. struct
  29. {
  30. char *_pchbuf; // char output buffer
  31. char *_pchstart;
  32. } ch;
  33. } buf ;
  34. unsigned int cchleft; // output buffer character count
  35. void (_cdecl *writechar)(int ch,
  36. int num,
  37. struct w4io *f,
  38. int *pcchwritten);
  39. };
  40. #define pwcbuf buf.wc._pwcbuf
  41. #define pwcstart buf.wc._pwcstart
  42. #define pchbuf buf.ch._pchbuf
  43. #define pchstart buf.ch._pchstart
  44. #define REG1 register
  45. #define REG2 register
  46. /* prototypes */
  47. int _cdecl w4iooutput(struct w4io *stream, const char *format, va_list argptr);