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.

206 lines
5.6 KiB

  1. /***********************************************************************
  2. * Microsoft (R) Windows (R) Resource Compiler
  3. *
  4. * Copyright (c) Microsoft Corporation. All rights reserved.
  5. *
  6. * File Comments:
  7. *
  8. *
  9. ***********************************************************************/
  10. /************************************************************************/
  11. /* Define types for greater visibility and easier portability */
  12. /************************************************************************/
  13. #ifndef _WINDOWS_
  14. typedef char CHAR;
  15. typedef unsigned char BYTE;
  16. typedef CHAR * PCHAR;
  17. typedef unsigned short WCHAR;
  18. typedef unsigned char UCHAR;
  19. typedef UCHAR * PUCHAR;
  20. typedef WCHAR * PWCHAR;
  21. typedef short SHORT;
  22. typedef SHORT * PSHORT;
  23. typedef unsigned short USHORT;
  24. typedef USHORT * PUSHORT;
  25. typedef int INT;
  26. typedef INT BOOL;
  27. typedef INT * PINT;
  28. typedef unsigned int UINT;
  29. typedef UINT * PUINT;
  30. typedef long LONG;
  31. typedef LONG * PLONG;
  32. typedef unsigned long ULONG;
  33. typedef ULONG * PULONG;
  34. typedef void VOID;
  35. typedef VOID * PVOID;
  36. #endif
  37. typedef double DOUBLE;
  38. typedef DOUBLE * PDOUBLE;
  39. /************************************************************************/
  40. /* */
  41. /* Define internal types */
  42. /* */
  43. /************************************************************************/
  44. #define TRUE 1
  45. #define FALSE 0
  46. #define EXTERN extern
  47. #define REG register
  48. #define STATIC static
  49. #define BIG_BUFFER 512
  50. #define MED_BUFFER 256
  51. #define SMALL_BUFFER 128
  52. #define TINY_BUFFER 32
  53. #define MSG_BUFF_SIZE 2048
  54. #define IFSTACK_SIZE TINY_BUFFER
  55. /*
  56. ** some commonly used typdefs for scalar items
  57. */
  58. typedef UINT p1key_t;
  59. typedef UCHAR hash_t;
  60. typedef UCHAR token_t;
  61. typedef UCHAR shape_t;
  62. typedef UCHAR blknum_t; /* lexical level */
  63. typedef UCHAR class_t;
  64. typedef USHORT btype_t; /* basic type specifier */
  65. typedef USHORT refcnt_t; /* symbol's reference count */
  66. typedef USHORT hey_t; /* unique keys */
  67. typedef USHORT offset_t; /* members offset within a struct */
  68. typedef ULONG abnd_t; /* array bound type */
  69. typedef ULONG len_t; /* number of bytes/bits of member/field */
  70. typedef struct s_adj symadj_t;
  71. typedef struct s_defn defn_t;
  72. typedef struct s_flist flist_t;
  73. typedef struct s_indir indir_t;
  74. typedef struct s_stack stack_t;
  75. typedef struct s_sym sym_t;
  76. typedef struct s_table table_t;
  77. typedef struct s_toklist toklist_t;
  78. typedef struct s_tree tree_t;
  79. typedef struct s_type type_t;
  80. typedef struct s_case case_t;
  81. typedef union u_ivalue ivalue_t;
  82. /*
  83. ** abstract char pointer types
  84. */
  85. typedef PWCHAR ptext_t; /* wherever input text comes from */
  86. /*
  87. ** other abstract pointer types
  88. */
  89. typedef type_t * ptype_t; /* ptr to types */
  90. typedef indir_t * pindir_t; /* ptr to indirections */
  91. typedef flist_t * pflist_t; /* ptr to formal list type */
  92. typedef sym_t * psym_t; /* symbol ptrs */
  93. typedef defn_t * pdefn_t; /* #define names */
  94. typedef tree_t * ptree_t;
  95. typedef struct s_realt {
  96. LONG S_sizet;
  97. DOUBLE S_realt;
  98. } Srealt_t;
  99. /* declspec type */
  100. struct s_declspec {
  101. class_t ds_calss;
  102. ptype_t ds_type;
  103. };
  104. typedef struct s_declspec declspec_t;
  105. typedef declspec_t * pdeclspec_t;
  106. /* string type */
  107. struct s_string {
  108. WCHAR * str_ptr;
  109. USHORT str_len;
  110. };
  111. typedef struct s_string string_t;
  112. typedef string_t * pstring_t;
  113. /* rcon type */
  114. struct rcon {
  115. Srealt_t rcon_real;
  116. };
  117. typedef struct rcon rcon_t;
  118. typedef struct rcon * prcon_t;
  119. /* hln type */
  120. struct s_hln {
  121. PWCHAR hln_name;
  122. UCHAR hln_hash;
  123. UCHAR hln_length;
  124. };
  125. typedef struct s_hln hln_t;
  126. typedef hln_t * phln_t;
  127. /*
  128. ** union used to return values from the lexer
  129. */
  130. typedef union s_lextype {
  131. btype_t yy_btype;
  132. PWCHAR yy_cstr;
  133. int yy_int;
  134. int yy_class;
  135. long yy_long;
  136. hln_t yy_ident;
  137. declspec_t yy_declspec;
  138. string_t yy_string;
  139. psym_t yy_symbol;
  140. token_t yy_token;
  141. ptree_t yy_tree;
  142. ptype_t yy_type;
  143. } lextype_t;
  144. /* value_t definition */
  145. union u_value {
  146. prcon_t v_rcon;
  147. long v_long;
  148. string_t v_string;
  149. psym_t v_symbol;
  150. };
  151. typedef union u_value value_t;
  152. /* keytab_t definition */
  153. typedef struct {
  154. const WCHAR *k_text;
  155. UCHAR k_token;
  156. } keytab_t;
  157. /************************************************************************/
  158. /* LIST definition for \D values */
  159. /************************************************************************/
  160. #define MAXLIST 100
  161. typedef struct LIST {
  162. INT li_top;
  163. WCHAR * li_defns[MAXLIST];
  164. } LIST;
  165. #define UNREFERENCED_PARAMETER(x) (x)