Leaked source code of windows server 2003
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.

59 lines
1.1 KiB

  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 FAR
  7. #define FAR
  8. #endif
  9. # ifndef FLAT
  10. # define FLAT
  11. # endif
  12. #else
  13. #ifndef FAR
  14. #define FAR __far
  15. #endif
  16. #endif
  17. #ifndef NULL
  18. # define NULL 0
  19. #endif
  20. #ifndef _WCHAR_T_DEFINED
  21. typedef unsigned short wchar_t;
  22. #define _WCHAR_T_DEFINED
  23. #endif
  24. struct w4io
  25. {
  26. union
  27. {
  28. struct
  29. {
  30. wchar_t FAR *_pwcbuf; // wchar_t output buffer
  31. wchar_t FAR *_pwcstart;
  32. } wc;
  33. struct
  34. {
  35. char FAR *_pchbuf; // char output buffer
  36. char FAR *_pchstart;
  37. } ch;
  38. } buf ;
  39. unsigned int cchleft; // output buffer character count
  40. void (_cdecl *writechar)(int ch,
  41. int num,
  42. struct w4io FAR *f,
  43. int FAR *pcchwritten);
  44. };
  45. #define pwcbuf buf.wc._pwcbuf
  46. #define pwcstart buf.wc._pwcstart
  47. #define pchbuf buf.ch._pchbuf
  48. #define pchstart buf.ch._pchstart
  49. #define REG1 register
  50. #define REG2 register
  51. /* prototypes */
  52. int _cdecl w4iooutput(struct w4io FAR *stream, const char FAR *format, va_list argptr);