home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gnat-2.06-src.tgz
/
tar.out
/
fsf
/
gnat
/
ada
/
tree_io.ads
< prev
next >
Wrap
Text File
|
1996-09-28
|
4KB
|
88 lines
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- T R E E _ I O --
-- --
-- S p e c --
-- --
-- $Revision: 1.2 $ --
-- --
-- Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved --
-- --
-- The GNAT library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU Library General Public License as published by --
-- the Free Software Foundation; either version 2, or (at your option) any --
-- later version. The GNAT library is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- Library General Public License for more details. You should have --
-- received a copy of the GNU Library General Public License along with --
-- the GNAT library; see the file COPYING.LIB. If not, write to the Free --
-- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines used to read and write the tree files
-- used by ASIS. Only the actual read and write routines are here. The open,
-- create and close routines are elsewhere (in Osint in the compiler, and in
-- the tree read driver for the tree read interface).
with GNAT.OS_Lib; use GNAT.OS_Lib;
with System; use System;
with Types; use Types;
package Tree_IO is
Tree_Format_Error : exception;
-- Raised if a format error is detected in the input file
procedure Tree_Read_Initialize (Desc : File_Descriptor);
-- Called to initialize reading of a tree file. This call must be made
-- before calls to Tree_Read_xx. No calls to Tree_Write_xx are permitted
-- after this call.
procedure Tree_Read_Data (Addr : Address; Length : Int);
-- Reads Length bytes of information into memory starting at Addr. The
-- data must have been written with a call to Tree_Write_Data with the
-- same length. Tree_Format_Error is raised if this is not the case.
procedure Tree_Read_Bool (B : out Boolean);
-- Reads a single boolean value. The boolean value must have been written
-- with a call to the Tree_Write_Bool procedure.
procedure Tree_Read_Char (C : out Character);
-- Reads a single character. The character must have been written with a
-- call to the Tree_Write_Char procedure.
procedure Tree_Read_Int (N : out Int);
-- Reads a single integer value. The integer must have been written with
-- a call to the Tree_Write_Int procedure.
procedure Tree_Read_Terminate;
-- Called after reading all data, checks that the buffer pointers is at
-- the end of file, raising Tree_Format_Error if not.
procedure Tree_Write_Initialize (Desc : File_Descriptor);
-- Called to initialize writing of a tree file. This call must be made
-- before calls to Tree_Write_xx. No calls to Tree_Read_xx are permitted
-- after this call.
procedure Tree_Write_Data (Addr : Address; Length : Int);
-- Writes Length bytes of data starting at Addr to current tree file.
procedure Tree_Write_Bool (B : Boolean);
-- Writes a single boolean value to the current tree file
procedure Tree_Write_Char (C : Character);
-- Writes a single character to the current tree file
procedure Tree_Write_Int (N : Int);
-- Writes a single integer value to the current tree file
procedure Tree_Write_Terminate;
-- Terminates writing of the file (flushing the buffer), but does not
-- close the file (the caller is responsible for closing the file).
end Tree_IO;