diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-16 20:23:03 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-16 20:23:03 +0100 |
commit | bef801a0ac1f46f40e56b38c8860689d379b72ea (patch) | |
tree | d0dcc127a144222411796ac2a129570fb98a68e4 /src/files_map.ads | |
parent | d231838679aefd39370742f995b3c5a5e8055bc5 (diff) | |
download | ghdl-bef801a0ac1f46f40e56b38c8860689d379b72ea.tar.gz ghdl-bef801a0ac1f46f40e56b38c8860689d379b72ea.tar.bz2 ghdl-bef801a0ac1f46f40e56b38c8860689d379b72ea.zip |
files_map: add Set_File_Length, Reverse_Source_File
Diffstat (limited to 'src/files_map.ads')
-rw-r--r-- | src/files_map.ads | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/files_map.ads b/src/files_map.ads index f09e5b6e0..7d23f45c6 100644 --- a/src/files_map.ads +++ b/src/files_map.ads @@ -46,6 +46,11 @@ package Files_Map is function Read_Source_File (Directory : Name_Id; Name : Name_Id) return Source_File_Entry; + -- Reserve an entry, but do not read any file. + function Reserve_Source_File + (Directory : Name_Id; Name : Name_Id; Length : Source_Ptr) + return Source_File_Entry; + -- Each file in memory has two terminal EOT. EOT : constant Character := Character'Val (4); @@ -89,7 +94,9 @@ 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; - -- Return the length of the file (which is the size of the file buffer). + -- Set/Get 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); function Get_File_Length (File : Source_File_Entry) return Source_Ptr; -- Return the name of the file. |