annotate gcc/ada/namet.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /****************************************************************************
kono
parents:
diff changeset
2 * *
kono
parents:
diff changeset
3 * GNAT COMPILER COMPONENTS *
kono
parents:
diff changeset
4 * *
kono
parents:
diff changeset
5 * N A M E T *
kono
parents:
diff changeset
6 * *
kono
parents:
diff changeset
7 * C Header File *
kono
parents:
diff changeset
8 * *
kono
parents:
diff changeset
9 * Copyright (C) 1992-2017, Free Software Foundation, Inc. *
kono
parents:
diff changeset
10 * *
kono
parents:
diff changeset
11 * GNAT is free software; you can redistribute it and/or modify it under *
kono
parents:
diff changeset
12 * terms of the GNU General Public License as published by the Free Soft- *
kono
parents:
diff changeset
13 * ware Foundation; either version 3, or (at your option) any later ver- *
kono
parents:
diff changeset
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
kono
parents:
diff changeset
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
kono
parents:
diff changeset
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
kono
parents:
diff changeset
17 * for more details. You should have received a copy of the GNU General *
kono
parents:
diff changeset
18 * Public License distributed with GNAT; see file COPYING3. If not, go to *
kono
parents:
diff changeset
19 * http://www.gnu.org/licenses for a complete copy of the license. *
kono
parents:
diff changeset
20 * *
kono
parents:
diff changeset
21 * GNAT was originally developed by the GNAT team at New York University. *
kono
parents:
diff changeset
22 * Extensive contributions were provided by Ada Core Technologies Inc. *
kono
parents:
diff changeset
23 * *
kono
parents:
diff changeset
24 ****************************************************************************/
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* This is the C file that corresponds to the Ada package specification
kono
parents:
diff changeset
27 Namet. It was created manually from files namet.ads and namet.adb.
kono
parents:
diff changeset
28 Subprograms from Exp_Dbug and Sinput are also made accessible here. */
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 #ifdef __cplusplus
kono
parents:
diff changeset
31 extern "C" {
kono
parents:
diff changeset
32 #endif
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* Structure defining a names table entry. */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 struct Name_Entry
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 Int Name_Chars_Index; /* Starting location of char in Name_Chars table. */
kono
parents:
diff changeset
39 Short Name_Len; /* Length of this name in characters. */
kono
parents:
diff changeset
40 Byte Byte_Info; /* Byte value associated with this name */
kono
parents:
diff changeset
41 Byte Spare; /* Unused */
kono
parents:
diff changeset
42 Name_Id Hash_Link; /* Link to next entry in names table for same hash
kono
parents:
diff changeset
43 code. Not accessed by C routines. */
kono
parents:
diff changeset
44 Int Int_Info; /* Int value associated with this name */
kono
parents:
diff changeset
45 };
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* Pointer to names table vector. */
kono
parents:
diff changeset
48 #define Names_Ptr namet__name_entries__table
kono
parents:
diff changeset
49 extern struct Name_Entry *Names_Ptr;
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 /* Pointer to name characters table. */
kono
parents:
diff changeset
52 #define Name_Chars_Ptr namet__name_chars__table
kono
parents:
diff changeset
53 extern char *Name_Chars_Ptr;
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 /* This is Hostparm.Max_Line_Length. */
kono
parents:
diff changeset
56 #define Max_Line_Length (32767 - 1)
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 /* The global name buffer. */
kono
parents:
diff changeset
59 struct Bounded_String
kono
parents:
diff changeset
60 {
kono
parents:
diff changeset
61 Nat Max_Length;
kono
parents:
diff changeset
62 Nat Length;
kono
parents:
diff changeset
63 char Chars[4 * Max_Line_Length]; /* Exact value for overflow detection. */
kono
parents:
diff changeset
64 };
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 #define Global_Name_Buffer namet__global_name_buffer
kono
parents:
diff changeset
67 extern struct Bounded_String Global_Name_Buffer;
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #define Name_Buffer Global_Name_Buffer.Chars
kono
parents:
diff changeset
70 #define Name_Len Global_Name_Buffer.Length
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 /* Get_Name_String returns a NUL terminated C string for the specified name.
kono
parents:
diff changeset
73 We could use the official Ada routine for this purpose, but since the
kono
parents:
diff changeset
74 strings we want are sitting in the name strings table in exactly the form
kono
parents:
diff changeset
75 we need them (NUL terminated), we just point to the name directly. */
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 static char *Get_Name_String (Name_Id);
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 INLINE char *
kono
parents:
diff changeset
80 Get_Name_String (Name_Id Id)
kono
parents:
diff changeset
81 {
kono
parents:
diff changeset
82 return Name_Chars_Ptr + Names_Ptr[Id - First_Name_Id].Name_Chars_Index + 1;
kono
parents:
diff changeset
83 }
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 #define Name_Equals namet__name_equals
kono
parents:
diff changeset
86 extern Boolean Name_Equals (Name_Id, Name_Id);
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 /* The following routines and variables are not part of Namet, but we
kono
parents:
diff changeset
89 include the header here since it seems the best place for it. */
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 #define Get_Encoded_Type_Name exp_dbug__get_encoded_type_name
kono
parents:
diff changeset
92 extern Boolean Get_Encoded_Type_Name (Entity_Id);
kono
parents:
diff changeset
93 #define Get_Variant_Encoding exp_dbug__get_variant_encoding
kono
parents:
diff changeset
94 extern void Get_Variant_Encoding (Entity_Id);
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 #define Spec_Context_List exp_dbug__spec_context_list
kono
parents:
diff changeset
97 #define Body_Context_List exp_dbug__body_context_list
kono
parents:
diff changeset
98 extern char *Spec_Context_List, *Body_Context_List;
kono
parents:
diff changeset
99 #define Spec_Filename exp_dbug__spec_filename
kono
parents:
diff changeset
100 #define Body_Filename exp_dbug__body_filename
kono
parents:
diff changeset
101 extern char *Spec_Filename, *Body_Filename;
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 /* Here are some functions in sinput.adb we call from trans.c. */
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 typedef Nat Source_File_Index;
kono
parents:
diff changeset
106 typedef Int Logical_Line_Number;
kono
parents:
diff changeset
107 typedef Int Column_Number;
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 #define Debug_Source_Name sinput__debug_source_name
kono
parents:
diff changeset
110 #define Full_Debug_Name sinput__full_debug_name
kono
parents:
diff changeset
111 #define Reference_Name sinput__reference_name
kono
parents:
diff changeset
112 #define Get_Source_File_Index sinput__get_source_file_index
kono
parents:
diff changeset
113 #define Get_Logical_Line_Number sinput__get_logical_line_number
kono
parents:
diff changeset
114 #define Get_Column_Number sinput__get_column_number
kono
parents:
diff changeset
115 #define Instantiation sinput__instantiation
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 extern File_Name_Type Debug_Source_Name (Source_File_Index);
kono
parents:
diff changeset
118 extern File_Name_Type Full_Debug_Name (Source_File_Index);
kono
parents:
diff changeset
119 extern File_Name_Type Reference_Name (Source_File_Index);
kono
parents:
diff changeset
120 extern Source_File_Index Get_Source_File_Index (Source_Ptr);
kono
parents:
diff changeset
121 extern Logical_Line_Number Get_Logical_Line_Number (Source_Ptr);
kono
parents:
diff changeset
122 extern Column_Number Get_Column_Number (Source_Ptr);
kono
parents:
diff changeset
123 extern Source_Ptr Instantiation (Source_File_Index);
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 #ifdef __cplusplus
kono
parents:
diff changeset
126 }
kono
parents:
diff changeset
127 #endif