this repo has no description
at fix-build 3.1 kB view raw
1open Ctypes 2 3(* This Types_generated module is an instantiation of the Types 4 functor defined in the type_description.ml file. It's generated by 5 a C program that Dune creates and runs behind the scenes. *) 6module Types = Types_generated 7 8module Functions (F : Ctypes.FOREIGN) = struct 9 open F 10 11 let init = foreign "libzfs_init" (void @-> returning Types.libzfs_handle_t) 12 let errno = foreign "libzfs_errno" (Types.libzfs_handle_t @-> returning int) 13 14 let debug = 15 foreign "libzfs_print_on_error" 16 (Types.libzfs_handle_t @-> bool @-> returning void) 17 18 module Zpool = struct 19 let open_ = 20 foreign "zpool_open" 21 (Types.libzfs_handle_t @-> string @-> returning Types.zpool_handle_t) 22 23 let close = foreign "zpool_close" (Types.zpool_handle_t @-> returning void) 24 25 let get_name = 26 foreign "zpool_get_name" (Types.zpool_handle_t @-> returning string) 27 28 let get_state = 29 foreign "zpool_get_state" (Types.zpool_handle_t @-> returning int) 30 end 31 32 let create_ancestors = 33 foreign "zfs_create_ancestors" (Types.libzfs_handle_t @-> string @-> returning int) 34 35 let create = 36 foreign "zfs_create" 37 (Types.libzfs_handle_t @-> string @-> int @-> ptr Types.nvlist_t 38 @-> returning int) 39 40 let open_ = 41 foreign "zfs_open" 42 (Types.libzfs_handle_t @-> string @-> int @-> returning Types.zfs_handle_t) 43 44 let mount = 45 foreign "zfs_mount" (Types.zfs_handle_t @-> string @-> int @-> returning int) 46 47 let unmount = 48 foreign "zfs_unmount" 49 (Types.zfs_handle_t @-> string @-> int @-> returning int) 50 51 let close = foreign "zfs_close" (Types.zfs_handle_t @-> returning void) 52 let get_type = foreign "zfs_get_type" (Types.zfs_handle_t @-> returning int) 53 54 module Nvlist = struct 55 let alloc = 56 foreign "nvlist_alloc" 57 (ptr (ptr Types.nvlist_t) @-> int @-> int @-> returning int) 58 59 let free = foreign "nvlist_free" (ptr Types.nvlist_t @-> returning void) 60 61 let add_bool = 62 foreign "nvlist_add_boolean_value" 63 (ptr Types.nvlist_t @-> string @-> bool @-> returning int) 64 65 let add_string = 66 foreign "nvlist_add_string" 67 (ptr Types.nvlist_t @-> string @-> string @-> returning int) 68 69 let add_byte = 70 foreign "nvlist_add_byte" 71 (ptr Types.nvlist_t @-> string @-> uchar @-> returning int) 72 73 let add_int64 = 74 foreign "nvlist_add_int64" 75 (ptr Types.nvlist_t @-> string @-> int64_t @-> returning int) 76 end 77 78 let clone = 79 foreign "zfs_clone" 80 (Types.zfs_handle_t @-> string @-> ptr Types.nvlist_t @-> returning int) 81 82 let snapshot = 83 foreign "zfs_snapshot" 84 (Types.libzfs_handle_t @-> string @-> bool @-> ptr Types.nvlist_t 85 @-> returning int) 86 87 let exists = 88 foreign "zfs_dataset_exists" 89 (Types.libzfs_handle_t @-> string @-> int @-> returning bool) 90 91 let is_mounted = 92 foreign "is_mounted" 93 (Types.libzfs_handle_t @-> string @-> ptr string @-> returning bool) 94 95 let diff = 96 foreign "zfs_show_diffs" 97 (Types.zfs_handle_t @-> int @-> string @-> string_opt @-> int 98 @-> returning int) 99end