2 This file is part of the "OCamlFuse" library.
4 OCamlFuse is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation (version 2 of the License).
8 OCamlFuse is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with OCamlFuse. See the file LICENSE. If you haven't received
15 a copy of the GNU General Public License, write to:
17 Free Software Foundation, Inc.,
18 59 Temple Place, Suite 330, Boston, MA
23 applejack@users.sf.net
32 let _ = Callback.register
"ocaml_list_length" List.length
34 external is_null
: 'a
Com.opaque
-> bool = "ocaml_fuse_is_null"
36 let undefined _ = raise
(Unix.Unix_error
(Unix.ENOSYS
,"undefined",""))
38 let fuse_loop fuse
(multithreaded
) =
41 then fun x y
-> ignore
(Thread.create x y
)
42 else fun x y
-> ignore
(x y
)
44 while not
(__fuse_exited fuse
) do
45 let cmd = __fuse_read_cmd fuse
in
47 then f (__fuse_process_cmd fuse
) cmd
50 let _ = Callback.register
"ocaml_fuse_loop" fuse_loop
52 let default_op_names = {
87 "__caml_cb_" ^
(string_of_int
r)
96 Unix.Unix_error
(err
,_,_) -> Bad err
97 | _ -> Bad
Unix.ERANGE
(* TODO: find a better way to signal the user and log this *)
99 let name = supply () in
100 Callback.register
name cb;
110 Unix.Unix_error
(err
,_,_) -> Bad err
111 | _ -> Bad
Unix.ERANGE
in
112 let name = supply () in
113 Callback.register
name cb;
123 Unix.Unix_error
(err
,_,_) -> Bad err
124 | _ -> Bad
Unix.ERANGE
in
125 let name = supply () in
126 Callback.register
name cb;
136 Unix.Unix_error
(err
,_,_) -> Bad err
137 | _ -> Bad
Unix.ERANGE
in
138 let name = supply () in
139 Callback.register
name cb;