/
dbIoSig.ml
93 lines (76 loc) · 2.93 KB
/
dbIoSig.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
(*
Copyright © 2011 MLstate
This file is part of OPA.
OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
module type S =
sig
exception Corruption
exception EOF
type t
type mode = Create | Append | ReadOnly
type file = Node | Uid | Uid_rev | Timestamp | Flags | Trans | Db_state | Config | Lock
type write = WChar of char | WInt of int | WString of string | WFloat of float | WInt32 of int32 | WInt64 of int64
type read = RChar | RInt | RString | RFloat | RInt32 | RInt64
val make : ?_extension:string -> mode -> string -> t
val get_name : t -> file -> string
val get_location : t -> string
val empty_file : t -> file -> unit
val output : t -> file -> unit
val add_int : t -> file -> int -> unit
val add_char : t -> file -> char -> unit
val add_string : t -> file -> string -> unit
val add_float : t -> file -> float -> unit
val add_int32 : t -> file -> int32 -> unit
val add_int64 : t -> file -> int64 -> unit
val add : t -> file -> ?output:bool -> write list -> unit
val seek_out : t -> file -> int -> unit
val position_out : t -> file -> int
val read_int : t -> file -> int
val read_char : t -> file -> char
val read_string : t -> file -> string
val read_float : t -> file -> float
val read_int32 : t -> file -> int32
val read_int64 : t -> file -> int64
val read : t -> file -> read list -> write list
val position_in : t -> file -> int
val seek_in : t -> file -> int -> unit
val length : t -> file -> int
val close : t -> unit
val is_open : t -> bool
val reset_files : t -> unit
val set_size : t -> file -> int -> unit
val copy_file : t -> file -> ?location:string -> string -> unit
val single_write : string -> write list -> unit
val single_read : string -> read list -> write list
val get_single_length : string -> int
type unik
val create_unik : ?mode:mode -> string -> unik
val add_unik : unik -> ?output:bool -> write list -> unit
val position_out_unik : unik -> int
val seek_out_unik : unik -> int -> unit
val mv : t -> unik -> file -> unit
(*
Specialized read/write
*)
module Channel :
sig
type channel
val get : t -> file -> channel
val add : channel -> write -> unit
val read_char : channel -> char
val read_int : channel -> int
val read_string : channel -> string
val add_char : channel -> char -> unit
val add_int : channel -> int -> unit
val add_string : channel -> string -> unit
end
end