blob: ab2b9c8de98015b774222dbecf49cd49c45d3374 [file] [log] [blame]
Thomas Heijligen5c43abc2023-12-11 15:24:36 +00001package body FILO.FS is
Nico Huber3a5cd8c2023-11-27 17:38:06 +01002
3 C_Part_Length : unsigned_long
4 with
5 Import => True,
6 Convention => C,
7 External_Name => "part_length";
8
9 C_File_Max : int
10 with
11 Import => True,
12 Convention => C,
13 External_Name => "filemax";
14
15 C_File_Pos : int
16 with
17 Import => True,
18 Convention => C,
19 External_Name => "filepos";
20
Nico Huber51f60412023-12-04 14:48:11 +010021 function Part_Len return Partition_Length is (Partition_Length (C_Part_Length));
Nico Huber3a5cd8c2023-11-27 17:38:06 +010022
23 function File_Max return File_Length is
24 begin
25 if C_File_Max < 0 then
26 return 0;
27 end if;
28
29 return File_Length (C_File_Max);
30 end File_Max;
31
32 procedure Set_File_Max (Len : File_Length) is
33 begin
34 C_File_Max := int (Len);
35 end Set_File_Max;
36
37 function File_Pos return File_Offset is
38 begin
39 if C_File_Pos < 0 then
40 return 0;
41 end if;
42
43 return File_Offset (C_File_Pos);
44 end File_Pos;
45
46 procedure Set_File_Pos (Off : File_Offset) is
47 begin
48 C_File_Pos := int (Off);
49 end Set_File_Pos;
50
Thomas Heijligen5c43abc2023-12-11 15:24:36 +000051end FILO.FS;