Skip to content

Commit

Permalink
fix: update argument order for extism_log_callback
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Nov 14, 2023
1 parent aebdb49 commit 46a4f6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ let log_callback =
Foreign.dynamic_funptr ~runtime_lock:true
Ctypes.(ptr char @-> uintptr_t @-> returning void)

let extism_log_callback name f =
let extism_log_callback f level =
let (module Callback) = log_callback in
let cb = Callback.of_fun f in
fn "extism_log_callback"
(string_opt @-> Callback.t @-> returning bool)
name cb
(Callback.t @-> string_opt @-> returning bool)
cb level

let extism_version = fn "extism_version" (void @-> returning string)
let extism_plugin_free = fn "extism_plugin_free" (plugin @-> returning void)
Expand Down
2 changes: 1 addition & 1 deletion src/extism.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let set_log_callback ?level f =
let fx s length =
f @@ Ctypes.string_from_ptr s ~length:(Ctypes.Uintptr.to_int length)
in
Bindings.extism_log_callback (parse_level level) fx
Bindings.extism_log_callback fx (parse_level level)

let%test _ =
let log_file =
Expand Down

0 comments on commit 46a4f6b

Please sign in to comment.