diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-06 19:26:31 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-06 19:26:31 +0100 |
commit | a9c2b17053a324a92e86dd0e3bc65d34bae08db3 (patch) | |
tree | 4ee7cd7713aa0d8828102b59f012e43bcfc2f099 /src/files_map.ads | |
parent | 3a49c7ff29374c6f085e2d9dc46b200afbfc9a2c (diff) | |
download | ghdl-a9c2b17053a324a92e86dd0e3bc65d34bae08db3.tar.gz ghdl-a9c2b17053a324a92e86dd0e3bc65d34bae08db3.tar.bz2 ghdl-a9c2b17053a324a92e86dd0e3bc65d34bae08db3.zip |
files_map: add Discard_Source_File, Free_Source_File,
Diffstat (limited to 'src/files_map.ads')
-rw-r--r-- | src/files_map.ads | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/files_map.ads b/src/files_map.ads index a72c75d07..131da8ffa 100644 --- a/src/files_map.ads +++ b/src/files_map.ads @@ -80,6 +80,14 @@ package Files_Map is -- carefully used as the corresponding locations will be reused. procedure Unload_Last_Source_File (File : Source_File_Entry); + -- Mark FILE as unavailable: clear the name and directory. + -- This is needed before creating a new source file with the same name. + procedure Discard_Source_File (File : Source_File_Entry); + + -- Free resources used by FILE, but keep the entry. + -- (It could be recycled for files that could fit - not implemented). + procedure Free_Source_File (File : Source_File_Entry); + -- Relocate location LOC (which must be in the reference of INST_FILE) -- for instrnace INST_FILE. function Instance_Relocate @@ -102,13 +110,19 @@ package Files_Map is -- Likewise but return a pointer. To be used only from non-Ada code. function Get_File_Buffer (File : Source_File_Entry) return File_Buffer_Ptr; - -- Set/Get the length of the file (which is less than the size of the - -- file buffer). The gap is not included in the length. + -- Set the length of the file (which is less than the size of the + -- file buffer). -- Set also append two EOT at the end of the file. procedure Set_File_Length (File : Source_File_Entry; Length : Source_Ptr); + + -- Get the position of the first EOT character. function Get_File_Length (File : Source_File_Entry) return Source_Ptr; - -- Get the length of the buffer, which includes the gap and the + -- Get the length of the content; this is the file length minus the gap, + -- if the gap is before the end. + function Get_Content_Length (File : Source_File_Entry) return Source_Ptr; + + -- Get the length of the buffer, which always includes the gap and the -- two terminal EOT. function Get_Buffer_Length (File : Source_File_Entry) return Source_Ptr; |