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.

56 lines
2.3 KiB

  1. /* SCCSID = %W% %E% */
  2. /*
  3. * Copyright Microsoft Corporation, 1983-1987
  4. *
  5. * This Module contains Proprietary Information of Microsoft
  6. * Corporation and should be treated as Confidential.
  7. */
  8. /****************************************************************
  9. * *
  10. * LINKER I/O INCLUDE FILE *
  11. * *
  12. ****************************************************************/
  13. #if IOMACROS /* If I/O macros requested */
  14. #define OutByte(f,b) putc(b,f) /* Write a byte to file f */
  15. #else /* Otherwise */
  16. #define OutByte(f,b) fputc(b,f) /* Write a byte to file f */
  17. #endif /* End conditional macro definition */
  18. #if WIN_3 OR CRLF
  19. extern char _eol[]; /* End-of-line sequence */
  20. #endif
  21. #if WIN_3
  22. #define NEWLINE(f) ((f)==bsLst ? fputs(_eol,f) : 0)
  23. #else
  24. #if CRLF /* If newline is ^M^J */
  25. #define NEWLINE(f) fputs(_eol,f) /* Newline macro */
  26. #else /* Else if newline is ^J */
  27. #define NEWLINE(f) OutByte(f,'\n') /* Newline macro */
  28. #endif /* End conditional macro definition */
  29. #endif
  30. #define RDTXT "rt" /* Text file */
  31. #define RDBIN "rb" /* Binary file */
  32. #define WRTXT "wt" /* Text file */
  33. #define WRBIN "wb" /* Binary file */
  34. #define SETRAW(f) /* No-op */
  35. #if M_WORDSWAP AND NOT M_BYTESWAP
  36. #define xread(a,b,c,d) fread(a,b,c,d)
  37. #else
  38. #define xread(a,b,c,d) sread(a,b,c,d)
  39. #define xwrite(a,b,c,d) swrite(a,b,c,d)
  40. #endif
  41. #if NOT NEWSYM
  42. #define OutSb(f,pb) fwrite(&((BYTE *)(pb))[1],1,B2W(((BYTE *)(pb))[0]),f)
  43. /* Write out length-prefixed string */
  44. #endif
  45. #if CLIBSTD AND NOT OSXENIX
  46. #include <fcntl.h>
  47. #include <share.h>
  48. #else
  49. #define O_RDONLY 0
  50. #define O_BINARY 0
  51. #define SH_DENYWR 0x20
  52. #endif
  53. #define CloseFile(f) { fclose(f); f = NULL; }