From 255fb07204db93a302305795c2220901cf7a883e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 2 Oct 2017 20:45:43 +0200 Subject: Add subprograms in Files_Map and Name_Table for interfacing. Renames Fat_String_Acc to Thin_String_Ptr. --- src/files_map.ads | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/files_map.ads') diff --git a/src/files_map.ads b/src/files_map.ads index b3fa5b7fe..c7c5da447 100644 --- a/src/files_map.ads +++ b/src/files_map.ads @@ -88,6 +88,9 @@ package Files_Map is -- Return a buffer (access to the contents of the file) for a file entry. function Get_File_Source (File : Source_File_Entry) return File_Buffer_Acc; + -- 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). function Get_File_Length (File : Source_File_Entry) return Source_Ptr; @@ -129,6 +132,15 @@ package Files_Map is procedure File_Add_Line_Number (File : Source_File_Entry; Line : Natural; Pos : Source_Ptr); + -- Convert LOCATION to a source file. Return No_Source_File_Entry if + -- LOCATION is incorrect. + function Location_To_File (Location : Location_Type) + return Source_File_Entry; + + -- Convert LOCATION and FILE to a position (offset) into the source file. + function Location_File_To_Pos + (Location : Location_Type; File : Source_File_Entry) return Source_Ptr; + -- Convert LOCATION into a source file FILE and an offset POS in the -- file. procedure Location_To_File_Pos (Location : Location_Type; -- cgit v1.2.3