| with Interfaces.C; |
| with Interfaces.C.Strings; |
| |
| use Interfaces.C; |
| |
| package body FS.FILO.VFS |
| with |
| SPARK_Mode => Off, |
| Convention => C |
| is |
| |
| function C_Mount return int |
| is |
| Success : Boolean; |
| begin |
| Mount (Success); |
| return (if Success then 1 else 0); |
| end C_Mount; |
| |
| function C_Open (File_Path : Strings.chars_ptr) return int |
| is |
| Success : Boolean; |
| begin |
| Open (Strings.Value (File_Path), Success); |
| return (if Success then 1 else 0); |
| end C_Open; |
| |
| function C_Read (Buf : System.Address; Len : int) return int |
| is |
| subtype Buffer_Range is Natural range 0 .. Integer (Len) - 1; |
| Buffer : Buffer_Type (Buffer_Range) |
| with |
| Convention => C, |
| Address => Buf; |
| |
| Read_Len : Natural; |
| begin |
| Read (Buffer, Read_Len); |
| return int (Read_Len); |
| end C_Read; |
| |
| end FS.FILO.VFS; |