package ceph

  1. Overview
  2. Docs
Bindings to libcephfs

Install

Dune Dependency

Authors

Maintainers

Sources

ceph-20240106.tbz
sha256=b6ca906022f832c5ca72dbdc5b7ff03b131a2f3c65c6e7e2914d4bb557dbe2d2
sha512=243f58f9156608c50d8e42ec87d2362c38bcc2d80e0bdee44514fc1f7a46defc066e1dab16048555175d8e1ab975841bea5eeeaa4b2e270959f9e97778d033e9

doc/src/ceph.stubs/bindings.ml.html

Source file bindings.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
open Ctypes

module S = Structs.C(Structs_generated)

module C(F : Cstubs.FOREIGN) =
struct
  open F

  let version = foreign "ceph_version" @@ ptr int @-> ptr int @-> ptr int @-> returning string

  type mount_info
  let struct_mount_info : mount_info structure typ = structure "ceph_mount_info"
  let handle = ptr struct_mount_info

  let fd = int

  type dir_result
  let struct_dir_result : dir_result structure typ = structure "ceph_dir_result"
  let dir_result = ptr struct_dir_result

  let create = foreign "ceph_create" @@ ptr handle @-> string_opt @-> returning int
  let release = foreign "ceph_release" @@ handle @-> returning int

  let init = foreign "ceph_init" @@ handle @-> returning int
  let mount = foreign "ceph_mount" @@ handle @-> string_opt @-> returning int
  let unmount = foreign "ceph_unmount" @@ handle @-> returning int

  let conf_read_file = foreign "ceph_conf_read_file" @@ handle @-> string_opt @-> returning int
  let conf_parse_env = foreign "ceph_conf_parse_env" @@ handle @-> string_opt @-> returning int
  let conf_set = foreign "ceph_conf_set" @@ handle @-> string @-> string @-> returning int

  let getcwd = foreign "ceph_getcwd" @@ handle @-> returning string
  let chdir = foreign "ceph_chdir" @@ handle @-> string @-> returning int
  let mkdir = foreign "ceph_mkdir" @@ handle @-> string @-> int @-> returning int
  let mkdirs = foreign "ceph_mkdirs" @@ handle @-> string @-> int @-> returning int
  let rmdir = foreign "ceph_rmdir" @@ handle @-> string @-> returning int

  let link = foreign "ceph_link" @@ handle @-> string @-> string @-> returning int
  let symlink = foreign "ceph_symlink" @@ handle @-> string @-> string @-> returning int
  let unlink = foreign "ceph_unlink" @@ handle @-> string @-> returning int

  let rename = foreign "ceph_rename" @@ handle @-> string @-> string @-> returning int
  let chmod = foreign "ceph_chmod" @@ handle @-> string @-> int @-> returning int
  let chown = foreign "ceph_chown" @@ handle @-> string @-> int @-> int @-> returning int
  let lchown = foreign "ceph_lchown" @@ handle @-> string @-> int @-> int @-> returning int

  let opendir = foreign "ceph_opendir" @@ handle @-> string @-> ptr dir_result @-> returning int
  let closedir = foreign "ceph_closedir" @@ handle @-> dir_result @-> returning int
  let readdir = foreign "ceph_readdir" @@ handle @-> dir_result @-> returning (ptr_opt S.struct_dirent)
  let readdirplus = foreign "ceph_readdirplus_r" @@
    handle @-> dir_result @-> ptr S.struct_dirent @-> ptr S.struct_statx @-> uint @-> uint @-> ptr void @-> returning int

  let openfile = foreign "ceph_open" @@ handle @-> string @-> int @-> int @-> returning fd
  let close = foreign "ceph_close" @@ handle @-> fd @-> returning int
  let fallocate = foreign "ceph_fallocate" @@ handle @-> fd @-> int @-> int64_t @-> int64_t @-> returning int
  let fsync = foreign "ceph_fsync" @@ handle @-> fd @-> int @-> returning int

  let statx = foreign "ceph_statx" @@ handle @-> string @-> ptr S.struct_statx @-> uint @-> uint @-> returning int
  let fstatx = foreign "ceph_fstatx" @@ handle @-> fd @-> ptr S.struct_statx @-> uint @-> uint @-> returning int

end
OCaml

Innovation. Community. Security.