* config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat
[official-gcc.git] / gcc / ada / tree_io.ads
blob776a41c65624100b322717c1a151667701332ff8
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- T R E E _ I O --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
32 -- --
33 ------------------------------------------------------------------------------
35 -- This package contains the routines used to read and write the tree files
36 -- used by ASIS. Only the actual read and write routines are here. The open,
37 -- create and close routines are elsewhere (in Osint in the compiler, and in
38 -- the tree read driver for the tree read interface).
40 with GNAT.OS_Lib; use GNAT.OS_Lib;
41 with System; use System;
42 with Types; use Types;
44 package Tree_IO is
46 Tree_Format_Error : exception;
47 -- Raised if a format error is detected in the input file
49 procedure Tree_Read_Initialize (Desc : File_Descriptor);
50 -- Called to initialize reading of a tree file. This call must be made
51 -- before calls to Tree_Read_xx. No calls to Tree_Write_xx are permitted
52 -- after this call.
54 procedure Tree_Read_Data (Addr : Address; Length : Int);
55 -- Checks that the Length provided is the same as what has been provided
56 -- to the corresponding Tree_Write_Data from the current tree file,
57 -- Tree_Format_Error is raised if it is not the case. If Length is
58 -- correct and non zero, reads Length bytes of information into memory
59 -- starting at Addr from the current tree file.
61 procedure Tree_Read_Bool (B : out Boolean);
62 -- Reads a single boolean value. The boolean value must have been written
63 -- with a call to the Tree_Write_Bool procedure.
65 procedure Tree_Read_Char (C : out Character);
66 -- Reads a single character. The character must have been written with a
67 -- call to the Tree_Write_Char procedure.
69 procedure Tree_Read_Int (N : out Int);
70 -- Reads a single integer value. The integer must have been written with
71 -- a call to the Tree_Write_Int procedure.
73 procedure Tree_Read_Str (S : out String_Ptr);
74 -- Read string, allocate on heap, and return pointer to allocated string
75 -- which always has a lower bound of 1.
77 procedure Tree_Read_Terminate;
78 -- Called after reading all data, checks that the buffer pointers is at
79 -- the end of file, raising Tree_Format_Error if not.
81 procedure Tree_Write_Initialize (Desc : File_Descriptor);
82 -- Called to initialize writing of a tree file. This call must be made
83 -- before calls to Tree_Write_xx. No calls to Tree_Read_xx are permitted
84 -- after this call.
86 procedure Tree_Write_Data (Addr : Address; Length : Int);
87 -- Writes Length then, if Length is not null, Length bytes of data
88 -- starting at Addr to current tree file
90 procedure Tree_Write_Bool (B : Boolean);
91 -- Writes a single boolean value to the current tree file
93 procedure Tree_Write_Char (C : Character);
94 -- Writes a single character to the current tree file
96 procedure Tree_Write_Int (N : Int);
97 -- Writes a single integer value to the current tree file
99 procedure Tree_Write_Str (S : String_Ptr);
100 -- Write out string value referenced by S. Low bound must be 1.
102 procedure Tree_Write_Terminate;
103 -- Terminates writing of the file (flushing the buffer), but does not
104 -- close the file (the caller is responsible for closing the file).
106 end Tree_IO;