home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / a-types.h < prev    next >
Text File  |  2000-07-19  |  10KB  |  331 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                         GNAT COMPILER COMPONENTS                         */
  4. /*                                                                          */
  5. /*                              A - T Y P E S                               */
  6. /*                                                                          */
  7. /*                              C Header File                               */
  8. /*                                                                          */
  9. /*                             $Revision: 1.23 $                            */
  10. /*                                                                          */
  11. /*          Copyright (C) 1992-1997, Free Software Foundation, Inc.         */
  12. /*                                                                          */
  13. /* GNAT is free software;  you can  redistribute it  and/or modify it under */
  14. /* terms of the  GNU General Public License as published  by the Free Soft- */
  15. /* ware  Foundation;  either version 2,  or (at your option) any later ver- */
  16. /* sion.  GNAT is distributed in the hope that it will be useful, but WITH- */
  17. /* OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY */
  18. /* or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License */
  19. /* for  more details.  You should have  received  a copy of the GNU General */
  20. /* Public License  distributed with GNAT;  see file COPYING.  If not, write */
  21. /* to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, */
  22. /* MA 02111-1307, USA.                                                      */
  23. /*                                                                          */
  24. /* GNAT was originally developed  by the GNAT team at  New York University. */
  25. /* It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). */
  26. /*                                                                          */
  27. /****************************************************************************/
  28.  
  29. /* This is the C file that corresponds to the Ada package spec Types. It was
  30.    created manually from the files types.ads and types.adb.
  31.  
  32.    This package contains host independent type definitions which are used 
  33.    throughout the compiler modules. The comments in the C version are brief
  34.    reminders of the purpose of each declaration.  For complete documentation,
  35.    see the Ada version of these definitions.  */
  36.  
  37. /* Boolean Types:  */
  38.  
  39. /* Boolean type (cannot use enum, because of bit field restriction on some
  40.    compilers.  */
  41. typedef unsigned char Boolean;
  42. #define False 0
  43. #define True  1
  44.  
  45. /* General Use Integer Types */
  46.  
  47. /* Signed 32/bit integer */
  48. typedef int Int;
  49.  
  50. /* Signed 16 bit integer */
  51. typedef short Short;
  52.  
  53. /* Non/negative Int values */
  54. typedef Int Nat;
  55.  
  56. /* Positive Int values */
  57. typedef Int Pos;
  58.  
  59. /* 8/bit unsigned integer */
  60. typedef char Byte;
  61.  
  62. /* 8/Bit Character and String Types:  */
  63.  
  64. /* 8/bit character type */
  65. typedef char Char;
  66.  
  67. /* Graphic characters, as defined in ARM */
  68. typedef Char Graphic_Character;
  69.  
  70. /* Line terminator characters (LF, VT, FF, CR) */
  71. typedef Char Line_Terminator;
  72.  
  73. /* Characters with the upper bit set */
  74. typedef Char Upper_Half_Character;
  75.  
  76. /* String type built on Char (note that zero is an OK index) */
  77. typedef Char *Str;
  78.  
  79. /* Pointer to string of Chars */
  80. typedef Char *Str_Ptr;
  81.  
  82. /* Types for Node/Entity Kinds:  */
  83.  
  84. /* The reason that these are defined here in the C version, rather than in the
  85.    corresponding packages is that the requirement for putting bodies of
  86.    inlined stuff IN the C header changes the dependencies.  Both a-sinfo.h
  87.    and a-einfo.h now reference routines defined in tree.h.
  88.  
  89.    Note: these types would more naturally be defined as unsigned  char, but
  90.    once again, the annoying restriction on bit fields for some compilers
  91.    bites us!  */
  92.  
  93. typedef unsigned int Node_Kind;
  94. typedef unsigned int Entity_Kind;
  95.  
  96. /* Types used for Text Buffer Handling:  */
  97.  
  98. /* Type used for subscripts in text buffer.  */
  99. typedef Int Text_Ptr;
  100.  
  101. /* Text buffer used to hold source file or library information file.  */
  102. typedef Char *Text_Buffer;
  103.  
  104. /* Pointer to text buffer.  */
  105. typedef Char *Text_Buffer_Ptr;
  106.  
  107. /* Types used for Source Input Handling:  */
  108.  
  109. /* Line number type, used for storing all line numbers.  */
  110. typedef Int Line_Number_Type;
  111.  
  112. /* Column number type, used for storing all column numbers.  */
  113. typedef Int Column_Number_Type;
  114.  
  115. /* Type used to store text of a source file.  */
  116. typedef Text_Buffer Source_Buffer;
  117.  
  118. /* Pointer to source buffer. */
  119. typedef Text_Buffer_Ptr Source_Buffer_Ptr;
  120.  
  121. /* Type used for source location.  */
  122. typedef Text_Ptr Source_Ptr;
  123.  
  124. /* Value used to indicate no source position set.  */
  125. #define No_Location -1
  126.  
  127. /* Used for Sloc in all nodes in the representation of package Standard.  */
  128. #define Standard_Location -2
  129.  
  130. /* Type used for union of all possible ID values covering all ranges */
  131. typedef int Union_Id;
  132.  
  133. /* Range definitions for Tree Data:  */
  134.  
  135. #define List_Low_Bound        -100000000
  136. #define List_High_Bound        0
  137.  
  138. #define Node_Low_Bound        0
  139. #define Node_High_Bound        99999999
  140.  
  141. #define Elist_Low_Bound        100000000
  142. #define Elist_High_Bound    199999999
  143.  
  144. #define Elmt_Low_Bound        200000000
  145. #define Elmt_High_Bound        299999999
  146.  
  147. #define Names_Low_Bound        300000000
  148. #define Names_High_Bound    399999999
  149.  
  150. #define Strings_Low_Bound    400000000
  151. #define Strings_High_Bound    499999999
  152.  
  153. #define Uint_Low_Bound        500000000
  154. #define Uint_High_Bound        599999999
  155.  
  156. #define Ureal_Low_Bound        600000000
  157. #define Ureal_High_Bound        699999999
  158.  
  159. #define Char_Code_Bias        700000000
  160.  
  161.    SUBTYPE (List_Range,      Int, List_Low_Bound,    List_High_Bound)
  162.    SUBTYPE (Node_Range,      Int, Node_Low_Bound,    Node_High_Bound)
  163.    SUBTYPE (Elist_Range,     Int, Elist_Low_Bound,   Elist_High_Bound)
  164.    SUBTYPE (Elmt_Range,      Int, Elmt_Low_Bound,    Elmt_High_Bound)
  165.    SUBTYPE (Names_Range,     Int, Names_Low_Bound,   Names_High_Bound)
  166.    SUBTYPE (Strings_Range,   Int, Strings_Low_Bound, Strings_High_Bound)
  167.    SUBTYPE (Uint_Range,      Int, Uint_Low_Bound,    Uint_High_Bound)
  168.    SUBTYPE (Ureal_Range,     Int, Ureal_Low_Bound,   Ureal_High_Bound)
  169.    SUBTYPE (Char_Code_Range, Int, Char_Code_Bias,    (Char_Code_Bias + 65535))
  170.  
  171. /* Types for Names_Table Package:  */
  172.  
  173. typedef Int Name_Id;
  174.  
  175. /* Name_Id value for no name present.  */
  176. #define No_Name Names_Low_Bound
  177.  
  178. /* Name_Id value for bad name.  */
  179. #define Error_Name (Names_Low_Bound + 1)
  180.  
  181. /* First subscript of names table. */
  182. #define First_Name_Id (Names_Low_Bound + 2)
  183.  
  184. /* Types for Tree Package:  */
  185.  
  186. /* Subscript of nodes table entry.  */
  187. typedef Int Node_Id;
  188.  
  189. /* Used in semantics for Node_Id value referencing an entity.  */
  190. typedef Node_Id Entity_Id;
  191.  
  192. /* Null node.  */
  193. #define Empty 0
  194.  
  195. /* Error node.  */
  196. #define Error 1
  197.  
  198. /* Subscript of first allocated node.  */
  199. #define First_Node_Id Empty
  200.  
  201. /* Subscript of entry in lists table.  */
  202. typedef Int List_Id;
  203.  
  204. /* Indicates absence of a list.  */
  205. #define No_List 0
  206.  
  207. /* Error list. */
  208. #define Error_List List_Low_Bound
  209.  
  210. /* Subscript of first allocated list header.  */
  211. #define First_List_Id Error_List
  212.  
  213. /* Element list Id, subscript value of entry in lists table.  */
  214. typedef Int Elist_Id;
  215.  
  216. /* Used to indicate absence of an element list.  */
  217. #define No_Elist Elist_Low_Bound
  218.  
  219. /* Subscript of first allocated elist header */
  220. #define First_Elist_Id (No_Elist + 1)
  221.  
  222. /* Element Id, subscript value of entry in elements table.  */
  223. typedef Int Elmt_Id;
  224.  
  225. /* Used to indicate absence of a list element.  */
  226. #define No_Elmt Elmt_Low_Bound
  227.  
  228. /* Subscript of first allocated element */
  229. #define First_Elmt_Id (No_Elmt + 1)
  230.  
  231. /* Types for String_Table Package:  */
  232.  
  233. /* Subscript of strings table entry.  */
  234. typedef Int String_Id;
  235.  
  236. /* Used to indicate missing string Id.  */
  237. #define No_String Strings_Low_Bound
  238.  
  239. /* Subscript of first entry in strings table.  */
  240. #define First_String_Id (No_String + 1)
  241.  
  242. /* Types for Uint_Support Package:  */
  243.  
  244. /* Type used for representation of universal integers.  */
  245. typedef Int Uint;
  246.  
  247. /* Used to indicate missing Uint value.  */
  248. #define No_Uint Uint_Low_Bound
  249.  
  250. /* Base value used to represent Uint values.  */
  251. #define Base 32768
  252.  
  253. #define Uint_Direct_Bias  (Uint_Low_Bound + Base)
  254. #define Uint_Direct_First (Uint_Direct_Bias - (Base - 1))
  255. #define Uint_Direct_Last  (Uint_Direct_Bias + (Base - 1))
  256.  
  257. /* Define range of direct biased values (in range -(Base-1)..+(Base-1)).  */
  258. SUBTYPE (Uint_Direct, Uint, Uint_Direct_First, Uint_Direct_Last)
  259.  
  260. /* Subscript of first entry in Uint table.  */
  261. #define Uint_First_Entry (Uint_Direct_Last + 1)
  262.  
  263. /* Constants in Uint format.  */
  264. #define Uint_0  (Uint_Direct_Bias + 0)
  265. #define Uint_1  (Uint_Direct_Bias + 1)
  266. #define Uint_2  (Uint_Direct_Bias + 2)
  267. #define Uint_10 (Uint_Direct_Bias + 10)
  268. #define Uint_16 (Uint_Direct_Bias + 16)
  269.  
  270. /* Types for Ureal_Support Package:  */
  271.  
  272. /* Type used for representation of universal reals.  */
  273. typedef Int Ureal;
  274.  
  275. /* Used to indicate missing Uint value.  */
  276. #define No_Ureal Ureal_Low_Bound
  277.  
  278. /* Subscript of first entry in Ureal table.  */
  279. #define Ureal_First_Entry (No_Ureal + 1)
  280.  
  281. /* Character Code Type:  */
  282.  
  283. /* Character code value, intended to be 16 bits.  */
  284. typedef short Char_Code;
  285.  
  286. /* Types Used for Library Management:  */
  287.  
  288. /* Unit number.  */
  289. typedef Int Unit_Number_Type;
  290.  
  291. /* Unit number value for main unit.  */
  292. #define Main_Unit 0
  293.  
  294. /* Type used for lines table.  */
  295. typedef Source_Ptr *Lines_Table_Type;
  296.  
  297. /* Type used for pointer to lines table.  */
  298. typedef Source_Ptr *Lines_Table_Ptr;
  299.  
  300. /* Length of time stamp value.  */
  301. #define Time_Stamp_Length 22
  302.  
  303. /* Type used to represent time stamp.  */
  304. typedef Char *Time_Stamp_Type;
  305.  
  306. /* Name_Id synonym used for file names.  */
  307. typedef Name_Id File_Name_Type;
  308.  
  309. /* Constant used to indicate no file found.  */
  310. #define No_File No_Name
  311.  
  312. /* Name_Id synonym used for unit names.  */
  313. typedef Name_Id Unit_Name_Type;
  314.  
  315. /* Definitions for mechanism type and values */
  316. typedef Int Mechanism_Type;
  317. #define Default            0
  318. #define By_Copy            (-1)
  319. #define By_Reference       (-2)
  320. #define By_Descriptor      (-3)
  321. #define By_Descriptor_UBS  (-4)
  322. #define By_Descriptor_UBSB (-5)
  323. #define By_Descriptor_UBA  (-6)
  324. #define By_Descriptor_S    (-7)
  325. #define By_Descriptor_SB   (-8)
  326. #define By_Descriptor_A    (-9)
  327. #define By_Descriptor_NCA  (-10)
  328.  
  329.  
  330. /* End of a-types.h (C version of Types package specification) */
  331.