blob: 30f1bca4d752792adf15ab4fd90de28119b4a271 [file] [log] [blame]
Nico Huber0a9591e2023-11-27 16:59:11 +01001with Interfaces.C;
2with Interfaces.C.Strings;
3
4use Interfaces.C;
5
Thomas Heijligend49cb122023-11-29 10:03:02 +00006package body FS.FILO.VFS
7with
8 SPARK_Mode => Off,
9 Convention => C
10is
Nico Huber0a9591e2023-11-27 16:59:11 +010011
12 function C_Mount return int
13 is
14 Success : Boolean;
15 begin
16 Mount (Success);
17 return (if Success then 1 else 0);
18 end C_Mount;
19
20 function C_Open (File_Path : Strings.chars_ptr) return int
21 is
22 Success : Boolean;
23 begin
24 Open (Strings.Value (File_Path), Success);
25 return (if Success then 1 else 0);
26 end C_Open;
27
28 function C_Read (Buf : System.Address; Len : int) return int
29 is
30 subtype Buffer_Range is Natural range 0 .. Integer (Len) - 1;
31 Buffer : Buffer_Type (Buffer_Range)
32 with
33 Convention => C,
34 Address => Buf;
35
36 Read_Len : Natural;
37 begin
38 Read (Buffer, Read_Len);
39 return int (Read_Len);
40 end C_Read;
41
42end FS.FILO.VFS;