blob: d8cc7e9e07c18bb73d1825651331a32515bba328 [file] [log] [blame]
package FS.FILO.Ext2 is
type T is private;
function Is_Mounted (State : T) return Boolean;
function Is_Open (State : T) return Boolean
with
Post => (if Is_Open'Result then Is_Mounted (State));
procedure Mount
(State : in out T;
Part_Len : in Partition_Length;
Success : out Boolean)
with
Pre => not Is_Mounted (State),
Post => Success = Is_Mounted (State);
procedure Open
(State : in out T;
File_Len : out File_Length;
File_Path : in String;
Success : out Boolean)
with
Pre => Is_Mounted (State) and not Is_Open (State),
Post => Success = Is_Open (State);
procedure Close (State : in out T)
with
Pre => Is_Open (State),
Post => Is_Mounted (State);
procedure Read
(State : in out T;
File_Len : in File_Length;
File_Pos : in out File_Offset;
Buf : out Buffer_Type;
Len : out Natural)
with
Pre => Is_Open (State),
Post => Is_Open (State);
private
type State is (Unmounted, Mounted, File_Opened);
type T is record
S : State;
end record;
end FS.FILO.Ext2;