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.

144 lines
4.7 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. * minlit.h
  9. */
  10. #include <config.h> /* Specifies conditional consts */
  11. #if _M_IX86 >= 300
  12. #define M_I386 1
  13. #endif
  14. #if OSMSDOS
  15. #define M_WORDSWAP TRUE
  16. #endif
  17. #define AND && /* Logical AND */
  18. #define OR || /* Logical OR */
  19. #define NOT ! /* Logical NOT */
  20. #if OSXENIX
  21. #define NEAR
  22. #define UNALIGNED
  23. #else
  24. #if defined(M_I386) OR defined(_WIN32)
  25. #define NEAR
  26. #if defined( _X86_ )
  27. #define UNALIGNED
  28. #else
  29. #define UNALIGNED __unaligned
  30. #endif
  31. #if defined(_M_IX86) OR defined(_WIN32)
  32. #define PASCAL
  33. #else
  34. #define PASCAL pascal
  35. #endif
  36. #else
  37. #if defined(M_I86LM)
  38. #define NEAR
  39. #define UNALIGNED
  40. #else
  41. #define NEAR near
  42. #define UNALIGNED
  43. #endif
  44. #define PASCAL pascal
  45. #endif
  46. #endif
  47. /*
  48. * Choose proper stdio.h
  49. */
  50. #if OSXENIX OR NOT OWNSTDIO
  51. #include <stdio.h> /* Standard I/O */
  52. #else
  53. #include "stdio20.h" /* DOS 2.0 standard I/O definitions */
  54. #endif
  55. #if OSMSDOS
  56. #undef stderr
  57. #define stderr stdout /* Errors to stdout on DOS */
  58. #endif
  59. #if PROFILE OR defined( _WIN32 ) /* If generating profile or building NTGroup version */
  60. #define LOCAL /* No local procedures */
  61. #else /* Else if not generating profile */
  62. #define LOCAL static /* Permit local procedures */
  63. #endif /* End conditional definition */
  64. #define _VALUE(a) fprintf(stderr,"v = %lx\r\n",(long) a)
  65. #if DEBUG OR ASSRTON
  66. #define ASSERT(c) if(!(c)) { fprintf(stderr,"!(%s)\r\n","c"); }
  67. #else
  68. #define ASSERT(c)
  69. #endif
  70. #if DEBUG OR TRACE
  71. #define _TRACE()
  72. #define _ENTER(f) fprintf(stderr,"Entering \"%s\"\r\n","f")
  73. #define ENTER(f) { _ENTER(f); _TRACE(); }
  74. #define _LEAVE(f,v) { _VALUE(v); fprintf(stderr,"Leaving \"%s\"\r\n","f"); }
  75. #define LEAVE(f,v) { _TRACE(); _LEAVE(f,v); }
  76. #else
  77. #define ENTER(f)
  78. #define LEAVE(f,v)
  79. #endif
  80. #if DEBUG
  81. #define DEBUGVALUE(v) _VALUE(v)
  82. #define DEBUGMSG(m) fprintf(stderr,"%s\r\n",m)
  83. #define DEBUGSB(sb) { OutSb(stderr,sb); NEWLINE(stderr); fflush(stderr); }
  84. #define RETURN(x) { DEBUGVALUE(x); return(x); }
  85. #else
  86. #define DEBUGVALUE(v)
  87. #define DEBUGMSG(m)
  88. #define DEBUGSB(sb)
  89. #define RETURN(x) return(x)
  90. #endif
  91. #if SIGNEDBYTE
  92. #define B2W(x) ((WORD)(x) & 0377)
  93. /* Signed 8-bit to unsigned 16-bit */
  94. #define B2L(x) ((long)(x) & 0377)
  95. /* Signed 8-bit to unsigned 32-bit */
  96. #else
  97. #define B2W(x) ((WORD)(x)) /* Unsigned 8-bit to unsigned 16-bit */
  98. #define B2L(x) ((long)(x)) /* Unsigned 8-bit to unsigned 32-bit */
  99. #endif
  100. #if ODDWORDLN /* If machine word length not 16 */
  101. #define LO16BITS(x) ((WORD)((x) & ~(~0 << WORDLN)))
  102. /* Macro to take low 16 bits of word */
  103. #else /* Else if normal word length */
  104. #define LO16BITS(x) ((WORD)(x)) /* No-op */
  105. #endif /* End macro definition */
  106. #define BYTELN 8 /* 8 bits per byte */
  107. #define WORDLN 16 /* 16 bits per word */
  108. #define SBLEN 256 /* Max string length */
  109. typedef unsigned long DWORD; /* 32-bit unsigned integer */
  110. typedef unsigned short WORD; /* 16-bit unsigned integer */
  111. typedef unsigned char BYTE; /* 8-bit unsigned integer */
  112. typedef unsigned int UINT; /* 16 or 32 bit integer */
  113. typedef FILE *BSTYPE; /* Byte stream (same as file handle) */
  114. typedef long LFATYPE; /* File offset */
  115. typedef BYTE SBTYPE[SBLEN]; /* Character string type */
  116. #if M_BYTESWAP
  117. extern WORD getword(); /* Get word given a char pointer */
  118. extern DWORD getdword(char *cp);/* Get dword given a char pointer */
  119. #else
  120. #define getword(x) ( * ( (WORD UNALIGNED *) (x) ) )
  121. #define getdword(x) ( * ( (DWORD UNALIGNED *) (x) ) )
  122. #define highWord(x) ( * ( ( (WORD UNALIGNED *) (x) ) + 1 ) )
  123. #endif
  124. #if NOREGISTER
  125. #define REGISTER
  126. #else
  127. #define REGISTER register
  128. #endif
  129. #if NEWSYM AND (CPU8086 OR CPU286) AND NOT CPU386
  130. #define FAR far
  131. #else
  132. #define FAR
  133. #endif