forked from dsheets/ocaml-osx-cf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcf.mli
217 lines (154 loc) · 3.99 KB
/
cf.mli
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
(*
* Copyright (c) 2015 David Sheets <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*)
module type PTR_TYP = sig
type t
val typ : t Ctypes.typ
end
module Type : sig
val release : unit Ctypes.ptr -> unit
val retain : unit Ctypes.ptr -> unit Ctypes.ptr
end
module String : sig
module Encoding : sig
type t =
| MacRoman
| WindowsLatin1
| ISOLatin1
| NextStepLatin
| ASCII
| Unicode
| UTF8
| NonLossyASCII
| UTF16
| UTF16BE
| UTF16LE
| UTF32
| UTF32BE
| UTF32LE
val t : t Ctypes.typ
end
type t
type cfstring = t
module Bytes : sig
type t = bytes
val to_bytes : cfstring -> t
val of_bytes : t -> cfstring
val typ : t Ctypes.typ
include PTR_TYP with type t := t
end
module String : sig
type t = string
val to_string : cfstring -> t
val of_string : t -> cfstring
val typ : t Ctypes.typ
include PTR_TYP with type t := t
end
include PTR_TYP with type t := t
end
module Array : sig
type t
type cfarray = t
module CArray : sig
type t = unit Ctypes.ptr Ctypes.CArray.t
val to_carray : cfarray -> t
val of_carray : t -> cfarray
val typ : t Ctypes.typ
module Make(T : PTR_TYP) : sig
include PTR_TYP with type t = T.t Ctypes.CArray.t
end
include PTR_TYP with type t := t
end
module List : sig
type t = unit Ctypes.ptr list
val to_list : cfarray -> t
val of_list : t -> cfarray
val typ : t Ctypes.typ
module Make(T : PTR_TYP) : sig
include PTR_TYP with type t = T.t list
end
include PTR_TYP with type t := t
end
end
module Index : sig
type t = int
val typ : t Ctypes.typ
end
module Allocator : sig
open Ctypes
type retain_callback_t = unit ptr -> unit ptr
type release_callback_t = unit ptr -> unit
type copy_description_callback_t = unit ptr -> bytes
val retain_callback_typ : retain_callback_t typ
val release_callback_typ : release_callback_t typ
val copy_description_callback_typ : copy_description_callback_t typ
end
module RunLoop : sig
type t
module Mode : sig
type t =
| Default
| CommonModes
| Mode of string
val typ : t Ctypes.typ
end
module Observer : sig
module Activity : sig
type t =
| Entry
| BeforeTimers
| BeforeSources
| BeforeWaiting
| AfterWaiting
| Exit
type select =
| Only of t list
| All
val to_string : t -> string
end
module Callback : sig
type t = Activity.t -> unit
end
type t
val create :
Activity.select -> ?repeats:bool -> ?order:int -> Callback.t -> t
val invalidate :
t -> unit
end
module RunResult : sig
type t =
| Finished
| Stopped
| TimedOut
| HandledSource
val typ : t Ctypes.typ
val to_string : t -> string
end
val typ : t Ctypes.typ
val remove_observer : t -> Observer.t -> Mode.t -> unit
val add_observer : t -> Observer.t -> Mode.t -> unit
val run : unit -> unit
val run_in_mode :
?return_after_source_handled:bool -> ?seconds:float -> Mode.t ->
RunResult.t
val get_current : unit -> t
val stop : t -> unit
val release : t -> unit
end
module TimeInterval : sig
type t = float
val typ : t Ctypes.typ
end