Skip to content

Commit

Permalink
[OS] Add a module type in OS.Types, just defining BLKIF for now. This…
Browse files Browse the repository at this point in the history
… may not be the right place for it, but it'll do for now. Also define a similar module type for a readonly filesystem in block/direct
  • Loading branch information
avsm committed Aug 31, 2011
1 parent df35c76 commit cb49ca4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/block/direct/block.smlpack
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Manager
RO
Types
Simple
9 changes: 9 additions & 0 deletions lib/block/direct/types.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module type RO = sig
type t
exception Error
val create : Manager.interface -> t Lwt.t
val iter_s : t -> (string -> unit Lwt.t) -> unit Lwt.t

val size : t -> string -> int64 Lwt.t
val read : t -> string -> Bitstring.t Lwt_stream.t Lwt.t
end
1 change: 1 addition & 0 deletions lib/os/unix/oS.smlpack
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Console
Netif
Main
Blkif
Types
9 changes: 9 additions & 0 deletions lib/os/unix/types.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module type BLKIF = sig
type t
type id = string

val create : (id -> t -> unit Lwt.t) -> unit Lwt.t
val destroy : t -> unit Lwt.t
val read_page : t -> int64 -> Bitstring.t Lwt.t
val sector_size: t -> int
end

0 comments on commit cb49ca4

Please sign in to comment.