123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157(*
This file is part of the "OCamlFuse" library.
OCamlFuse is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation (version 2 of the License).
OCamlFuse 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with OCamlFuse. See the file LICENSE. If you haven't received
a copy of the GNU General Public License, write to:
Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
Vincenzo Ciancia
applejack@users.sf.net
vincenzo_ml@yahoo.it
*)openFuse_libmoduleUnix_util=Unix_utilmoduleFuse_bindings=Fuse_bindingsmoduleFuse_lib=Fuse_libmoduleFuse_result=Fuse_resulttypebuffer=(char,Bigarray.int8_unsigned_elt,Bigarray.c_layout)Bigarray.Array1.ttypecontext=Fuse_bindings.__fuse_contextletget_context:unit->context=Fuse_bindings.fuse_get_contexttypexattr_flags=AUTO|CREATE|REPLACEtypeoperations={getattr:string->Unix.LargeFile.stats;readlink:string->string;mknod:string->int->unit;mkdir:string->int->unit;unlink:string->unit;rmdir:string->unit;symlink:string->string->unit;rename:string->string->unit;link:string->string->unit;chmod:string->int->unit;chown:string->int->int->unit;truncate:string->int64->unit;utime:string->float->float->unit;fopen:string->Unix.open_flaglist->intoption;(* TODO: optional arguments missing *)read:string->buffer->int64->int->int;(* TODO: optional arguments missing *)write:string->buffer->int64->int->int;(* TODO: optional arguments missing *)statfs:string->Unix_util.statvfs;flush:string->int->unit;(* TODO: optional arguments missing *)release:string->Unix.open_flaglist->int->unit;(* TODO: optional arguments missing *)fsync:string->bool->int->unit;(* TODO: optional arguments missing *)setxattr:string->string->string->xattr_flags->unit;getxattr:string->string->string;listxattr:string->stringlist;removexattr:string->string->unit;opendir:string->Unix.open_flaglist->intoption;(* TODO: optional arguments missing *)readdir:string->int->stringlist;(* TODO: optional arguments missing *)releasedir:string->Unix.open_flaglist->int->unit;(* TODO: optional arguments missing *)fsyncdir:string->bool->int->unit;(* TODO: optional arguments missing *)init:unit->unit;(* TODO: optional arguments missing and return value missing *)}letop_names_of_operationsops={Fuse_bindings.init=Fuse_lib.named_opops.init;Fuse_bindings.getattr=Fuse_lib.named_opops.getattr;Fuse_bindings.readlink=Fuse_lib.named_opops.readlink;Fuse_bindings.readdir=Fuse_lib.named_op_2ops.readdir;Fuse_bindings.opendir=Fuse_lib.named_op_2ops.opendir;Fuse_bindings.releasedir=Fuse_lib.named_op_3ops.releasedir;Fuse_bindings.fsyncdir=Fuse_lib.named_op_3ops.fsyncdir;Fuse_bindings.mknod=Fuse_lib.named_op_2ops.mknod;Fuse_bindings.mkdir=Fuse_lib.named_op_2ops.mkdir;Fuse_bindings.unlink=Fuse_lib.named_opops.unlink;Fuse_bindings.rmdir=Fuse_lib.named_opops.rmdir;Fuse_bindings.symlink=Fuse_lib.named_op_2ops.symlink;Fuse_bindings.rename=Fuse_lib.named_op_2ops.rename;Fuse_bindings.link=Fuse_lib.named_op_2ops.link;Fuse_bindings.chmod=Fuse_lib.named_op_2ops.chmod;Fuse_bindings.chown=Fuse_lib.named_op_3ops.chown;Fuse_bindings.truncate=Fuse_lib.named_op_2ops.truncate;Fuse_bindings.utime=Fuse_lib.named_op_3ops.utime;Fuse_bindings.fopen=Fuse_lib.named_op_2ops.fopen;Fuse_bindings.read=Fuse_lib.named_op_4ops.read;Fuse_bindings.write=Fuse_lib.named_op_4ops.write;Fuse_bindings.release=Fuse_lib.named_op_3ops.release;Fuse_bindings.flush=Fuse_lib.named_op_2ops.flush;Fuse_bindings.statfs=Fuse_lib.named_opops.statfs;Fuse_bindings.fsync=Fuse_lib.named_op_3ops.fsync;Fuse_bindings.listxattr=Fuse_lib.named_op(funpath->lets=ops.listxattrpathin(s,List.fold_left(funaccs->acc+1+String.lengths)0s));Fuse_bindings.getxattr=Fuse_lib.named_op_2ops.getxattr;Fuse_bindings.setxattr=Fuse_lib.named_op_4ops.setxattr;Fuse_bindings.removexattr=Fuse_lib.named_op_2ops.removexattr;}letdefault_operations={init=undefined;getattr=undefined;readdir=undefined;opendir=undefined;releasedir=undefined;fsyncdir=undefined;readlink=undefined;mknod=undefined;mkdir=undefined;unlink=undefined;rmdir=undefined;symlink=undefined;rename=undefined;link=undefined;chmod=undefined;chown=undefined;truncate=undefined;utime=undefined;fopen=undefined;read=undefined;write=undefined;flush=undefined;release=undefined;statfs=undefined;fsync=undefined;listxattr=undefined;getxattr=undefined;setxattr=undefined;removexattr=undefined;}letmainargvops=Fuse_bindings.ml_fuse_init();Fuse_bindings.set_fuse_operations(op_names_of_operationsops);Fuse_bindings.ml_fuse_mainargv(Fuse_bindings.get_fuse_operations())