OSDN Git Service

* sysdep.c: Problem discovered during IA64 VMS port.
[pf3gnuchains/gcc-fork.git] / gcc / ada / symbols.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              S Y M B O L S                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2003 Free Software Foundation, Inc.               --
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. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 --  This package allows the creation of symbol files to be used for linking
28 --  libraries. The format of symbol files depends on the platform, so there is
29 --  several implementations of the body.
30
31 with GNAT.Dynamic_Tables;
32 with GNAT.OS_Lib;         use GNAT.OS_Lib;
33
34 package Symbols is
35
36    type Symbol_Kind is (Data, Proc);
37    --  To distinguish between the different kinds of symbols
38
39    type Symbol_Data is record
40       Name    : String_Access;
41       Kind    : Symbol_Kind := Data;
42       Present : Boolean := True;
43    end record;
44    --  Data (name and kind) for each of the symbols
45
46    package Symbol_Table is new GNAT.Dynamic_Tables
47      (Table_Component_Type => Symbol_Data,
48       Table_Index_Type     => Natural,
49       Table_Low_Bound      => 0,
50       Table_Initial        => 100,
51       Table_Increment      => 100);
52    --  The symbol tables
53
54    Original_Symbols : Symbol_Table.Instance;
55    --  The symbols, if any, found in the original symbol table
56
57    Complete_Symbols : Symbol_Table.Instance;
58    --  The symbols, if any, found in the objects files
59
60    procedure Initialize
61      (Symbol_File : String;
62       Force       : Boolean;
63       Quiet       : Boolean;
64       Success     : out Boolean);
65    --  Initialize a symbol file. This procedure must be called before
66    --  Processing any object file. Depending on the platforms and the
67    --  circumstances, additional messages may be issued if Quiet is False.
68
69    procedure Process
70      (Object_File : String;
71       Success     : out Boolean);
72    --  Get the symbols from an object file. Success is set to True if the
73    --  object file exists and has the expected format.
74
75    procedure Finalize
76      (Quiet   : Boolean;
77       Success : out Boolean);
78    --  Finalize the symbol file. This procedure should be called after
79    --  Initialize (once) and Process (one or more times). If Success is
80    --  True, the symbol file is written and closed, ready to be used for
81    --  linking the library. Depending on the platforms and the circumstances,
82    --  additional messages may be issued if Quiet is False.
83
84 end Symbols;