]>
Commit | Line | Data |
---|---|---|
38cbfe40 RK |
1 | /**************************************************************************** |
2 | * * | |
3 | * GNAT COMPILER COMPONENTS * | |
4 | * * | |
5 | * N A M E T * | |
6 | * * | |
7 | * C Header File * | |
8 | * * | |
fbf5a39b | 9 | * Copyright (C) 1992-2003 Free Software Foundation, Inc. * |
38cbfe40 RK |
10 | * * |
11 | * GNAT is free software; you can redistribute it and/or modify it under * | |
12 | * terms of the GNU General Public License as published by the Free Soft- * | |
13 | * ware Foundation; either version 2, or (at your option) any later ver- * | |
14 | * sion. GNAT is distributed in the hope that it will be useful, but WITH- * | |
15 | * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * | |
16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * | |
17 | * for more details. You should have received a copy of the GNU General * | |
18 | * Public License distributed with GNAT; see file COPYING. If not, write * | |
19 | * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, * | |
20 | * MA 02111-1307, USA. * | |
21 | * * | |
22 | * GNAT was originally developed by the GNAT team at New York University. * | |
71ff80dc | 23 | * Extensive contributions were provided by Ada Core Technologies Inc. * |
38cbfe40 RK |
24 | * * |
25 | ****************************************************************************/ | |
26 | ||
27 | /* This is the C file that corresponds to the Ada package specification | |
28 | Namet. It was created manually from files namet.ads and namet.adb. */ | |
29 | ||
30 | /* Structure defining a names table entry. */ | |
31 | ||
32 | struct Name_Entry | |
33 | { | |
34 | Int Name_Chars_Index; /* Starting location of char in Name_Chars table. */ | |
35 | Short Name_Len; /* Length of this name in characters. */ | |
36 | Byte Byte_Info; /* Byte value associated with this name */ | |
37 | Byte Spare; /* Unused */ | |
38 | Name_Id Hash_Link; /* Link to next entry in names table for same hash | |
39 | code. Not accessed by C routines. */ | |
40 | Int Int_Info; /* Int value associated with this name */ | |
41 | }; | |
42 | ||
43 | /* Pointer to names table vector. */ | |
44 | #define Names_Ptr namet__name_entries__table | |
45 | extern struct Name_Entry *Names_Ptr; | |
46 | ||
47 | /* Pointer to name characters table. */ | |
48 | #define Name_Chars_Ptr namet__name_chars__table | |
49 | extern char *Name_Chars_Ptr; | |
50 | ||
51 | #define Name_Buffer namet__name_buffer | |
52 | extern char Name_Buffer[]; | |
53 | ||
54 | extern Int namet__name_len; | |
55 | #define Name_Len namet__name_len | |
56 | ||
57 | /* Get_Name_String returns a null terminated C string for the specified name. | |
58 | We could use the official Ada routine for this purpose, but since the | |
59 | strings we want are sitting in the name strings table in exactly the form | |
60 | we need them (null terminated), we just point to the name directly. */ | |
61 | ||
62 | static char *Get_Name_String PARAMS ((Name_Id)); | |
63 | ||
64 | INLINE char * | |
65 | Get_Name_String (Id) | |
66 | Name_Id Id; | |
67 | { | |
07fc65c4 | 68 | return Name_Chars_Ptr + Names_Ptr[Id - First_Name_Id].Name_Chars_Index + 1; |
38cbfe40 RK |
69 | } |
70 | ||
71 | /* Get_Decoded_Name_String returns a null terminated C string in the same | |
72 | manner as Get_Name_String, except that it is decoded (i.e. upper half or | |
73 | wide characters are put back in their external form, and character literals | |
74 | are also returned in their external form (with surrounding apostrophes) */ | |
75 | ||
76 | extern void namet__get_decoded_name_string PARAMS ((Name_Id)); | |
77 | ||
78 | static char *Get_Decoded_Name_String PARAMS ((Name_Id)); | |
79 | ||
80 | INLINE char * | |
81 | Get_Decoded_Name_String (Id) | |
82 | Name_Id Id; | |
83 | { | |
84 | namet__get_decoded_name_string (Id); | |
07fc65c4 | 85 | Name_Buffer[Name_Len] = 0; |
38cbfe40 RK |
86 | return Name_Buffer; |
87 | } | |
88 | ||
89 | /* Like Get_Decoded_Name_String, but the result has all qualification and | |
90 | package body entity suffixes stripped, and also all letters are upper | |
91 | cased. This is used fo rbuilding the enumeration literal table. */ | |
92 | ||
93 | extern void casing__set_all_upper_case PARAMS ((void)); | |
38cbfe40 RK |
94 | |
95 | /* The following routines and variables are not part of Namet, but we | |
96 | include the header here since it seems the best place for it. */ | |
97 | ||
98 | #define Get_Encoded_Type_Name exp_dbug__get_encoded_type_name | |
99 | extern Boolean Get_Encoded_Type_Name PARAMS ((Entity_Id)); | |
100 | #define Get_Variant_Encoding exp_dbug__get_variant_encoding | |
101 | extern void Get_Variant_Encoding PARAMS ((Entity_Id)); | |
102 | ||
103 | #define Spec_Context_List exp_dbug__spec_context_list | |
104 | #define Body_Context_List exp_dbug__body_context_list | |
105 | extern char *Spec_Context_List, *Body_Context_List; | |
106 | #define Spec_Filename exp_dbug__spec_filename | |
107 | #define Body_Filename exp_dbug__body_filename | |
108 | extern char *Spec_Filename, *Body_Filename; | |
109 | ||
110 | #define Is_Non_Ada_Error exp_ch11__is_non_ada_error | |
111 | extern Boolean Is_Non_Ada_Error PARAMS ((Entity_Id)); | |
112 | ||
113 | /* Here are some functions in sinput.adb we call from a-trans.c. */ | |
114 | typedef Nat Source_File_Index; | |
115 | typedef Int Logical_Line_Number; | |
116 | ||
117 | #define Debug_Source_Name sinput__debug_source_name | |
fbf5a39b | 118 | #define Full_Debug_Name sinput__full_debug_name |
38cbfe40 RK |
119 | #define Reference_Name sinput__reference_name |
120 | #define Get_Source_File_Index sinput__get_source_file_index | |
121 | #define Get_Logical_Line_Number sinput__get_logical_line_number | |
122 | ||
123 | extern File_Name_Type Debug_Source_Name PARAMS ((Source_File_Index)); | |
fbf5a39b | 124 | extern File_Name_Type Full_Debug_Name PARAMS ((Source_File_Index)); |
38cbfe40 RK |
125 | extern File_Name_Type Reference_Name PARAMS ((Source_File_Index)); |
126 | extern Source_File_Index Get_Source_File_Index PARAMS ((Source_Ptr)); | |
127 | extern Logical_Line_Number Get_Logical_Line_Number PARAMS ((Source_Ptr)); |