Skip to content

Commit

Permalink
update inner lib name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranxy committed Aug 6, 2023
1 parent 3d87bcc commit 2991cca
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
24 changes: 12 additions & 12 deletions bindings/ocaml/lib/blocking_operator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
under the License.
*)

type scheme = SchemeStr of string | Scheme of Inner.Scheme.scheme
type scheme = SchemeStr of string | Scheme of Opendalinner.Scheme.scheme

let new_operator (input : scheme) (args : (string * string) list) =
match input with
| SchemeStr str -> Inner.Block_operator.new_blocking_operator_str str args
| Scheme s -> Inner.Block_operator.new_blocking_operator s args
| SchemeStr str -> Opendalinner.Block_operator.new_blocking_operator_str str args
| Scheme s -> Opendalinner.Block_operator.new_blocking_operator s args

let is_exist = Inner.Block_operator.blocking_is_exist
let create_dir = Inner.Block_operator.blocking_create_dir
let read = Inner.Block_operator.blocking_read
let write = Inner.Block_operator.blocking_write
let copy = Inner.Block_operator.blocking_copy
let rename = Inner.Block_operator.blocking_rename
let delete = Inner.Block_operator.blocking_delete
let remove = Inner.Block_operator.blocking_remove
let remove_all = Inner.Block_operator.blocking_remove_all
let is_exist = Opendalinner.Block_operator.blocking_is_exist
let create_dir = Opendalinner.Block_operator.blocking_create_dir
let read = Opendalinner.Block_operator.blocking_read
let write = Opendalinner.Block_operator.blocking_write
let copy = Opendalinner.Block_operator.blocking_copy
let rename = Opendalinner.Block_operator.blocking_rename
let delete = Opendalinner.Block_operator.blocking_delete
let remove = Opendalinner.Block_operator.blocking_remove
let remove_all = Opendalinner.Block_operator.blocking_remove_all
22 changes: 11 additions & 11 deletions bindings/ocaml/lib/blocking_operator.mli
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
(** Services that OpenDAL supports *)
type scheme =
| SchemeStr of string (** [SchemeStr]: Parse a string as Scheme *)
| Scheme of Inner.Scheme.scheme (** [Scheme]: Use the scheme directly *)
| Scheme of Opendalinner.Scheme.scheme (** [Scheme]: Use the scheme directly *)


val new_operator :
scheme ->
(string * string) list ->
(Inner.Block_operator.blocking_operator, string) result
(Opendalinner.Block_operator.blocking_operator, string) result
(** [new_operator scheme config_map] Create a new block operator from given scheme and config_map.
@param scheme The support service
Expand All @@ -35,7 +35,7 @@ val new_operator :
*)

val is_exist :
Inner.Block_operator.blocking_operator -> string -> (bool, string) result
Opendalinner.Block_operator.blocking_operator -> string -> (bool, string) result
(** [is_exist operator path] Check if this path exists or not.
@param operator The block operator
Expand All @@ -44,7 +44,7 @@ val is_exist :
*)

val create_dir :
Inner.Block_operator.blocking_operator -> string -> (bool, string) result
Opendalinner.Block_operator.blocking_operator -> string -> (bool, string) result
(** [create_dir operator path] Create a dir at given path.
# Notes
Expand All @@ -62,7 +62,7 @@ val create_dir :
*)

val read :
Inner.Block_operator.blocking_operator ->
Opendalinner.Block_operator.blocking_operator ->
string ->
(char array, string) result
(** [read operator path] Read the whole path into a bytes.
Expand All @@ -73,7 +73,7 @@ val read :
*)

val write :
Inner.Block_operator.blocking_operator ->
Opendalinner.Block_operator.blocking_operator ->
string ->
bytes ->
(unit, string) result
Expand All @@ -85,7 +85,7 @@ val write :
*)

val copy :
Inner.Block_operator.blocking_operator ->
Opendalinner.Block_operator.blocking_operator ->
string ->
string ->
(unit, string) result
Expand All @@ -100,7 +100,7 @@ val copy :
*)

val rename :
Inner.Block_operator.blocking_operator ->
Opendalinner.Block_operator.blocking_operator ->
string ->
string ->
(unit, string) result
Expand All @@ -114,15 +114,15 @@ val rename :
*)

val delete :
Inner.Block_operator.blocking_operator -> string -> (unit, string) result
Opendalinner.Block_operator.blocking_operator -> string -> (unit, string) result
(** [delete operator path] Delete given path.
- Delete not existing error won't return errors.
@param operator The block operator
@param path file path
*)

val remove :
Inner.Block_operator.blocking_operator ->
Opendalinner.Block_operator.blocking_operator ->
string array ->
(unit, string) result
(** [remove operator paths] Remove path array.
Expand All @@ -132,7 +132,7 @@ val remove :
*)

val remove_all :
Inner.Block_operator.blocking_operator -> string -> (unit, string) result
Opendalinner.Block_operator.blocking_operator -> string -> (unit, string) result
(** [remove_all operator path] Remove the path and all nested dirs and files recursively.
- We don't support batch delete now, will call delete on each object in turn
@param operator The block operator
Expand Down
2 changes: 1 addition & 1 deletion bindings/ocaml/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
(library
(name opendal)
(public_name opendal)
(libraries opendal.inner))
(libraries opendal.opendalinner))
4 changes: 2 additions & 2 deletions bindings/ocaml/lib/opendal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*)

module Scheme = Inner.Scheme
module Scheme = Opendalinner.Scheme
module Blocking_operator = Blocking_operator

type blocking_operator = Inner.Block_operator.blocking_operator
type blocking_operator = Opendalinner.Block_operator.blocking_operator
12 changes: 6 additions & 6 deletions bindings/ocaml/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
; under the License.

(rule
(targets libinner.a dllinner.so)
(targets libopendalinner.a dllopendalinner.so)
(deps
(glob_files *.rs))
(action
(progn
(run sh -c "cd %{project_root}/../.. && cargo build --release")
(run sh -c
"mv %{project_root}/../../../../target/release/libopendal_ocaml.so ./dllinner.so 2> /dev/null || mv %{project_root}/../../../../target/release/libopendal_ocaml.dylib ./dllinner.so")
"mv %{project_root}/../../../../target/release/libopendal_ocaml.so ./dllopendalinner.so 2> /dev/null || mv %{project_root}/../../../../target/release/libopendal_ocaml.dylib ./dllopendalinner.so")
(run mv %{project_root}/../../../../target/release/libopendal_ocaml.a
libinner.a))))
libopendalinner.a))))

(library
(name inner)
(public_name opendal.inner)
(foreign_archives inner)
(name opendalinner)
(public_name opendal.opendalinner)
(foreign_archives opendalinner)
(c_library_flags
(-lpthread -lc -lm)))

0 comments on commit 2991cca

Please sign in to comment.