From 46a4f6bde72318317f3c4b7de4e0e7151800738d Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 13 Nov 2023 17:12:57 -0800 Subject: [PATCH] fix: update argument order for extism_log_callback --- src/bindings.ml | 6 +++--- src/extism.ml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bindings.ml b/src/bindings.ml index 57866b7..de80544 100644 --- a/src/bindings.ml +++ b/src/bindings.ml @@ -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) diff --git a/src/extism.ml b/src/extism.ml index b079f9c..d247a59 100644 --- a/src/extism.ml +++ b/src/extism.ml @@ -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 =