summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-03-28 22:16:56 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-03-28 22:16:56 -0500
commit696df30c6c5c8662b3448ecf4b9e17673bfcbcb5 (patch)
tree79554692f5c3d158051d21f3208b10f5746a8728
parent63175de457808b64ecd07a16293c44d15901c8bd (diff)
downloadlibvyosconfig-696df30c6c5c8662b3448ecf4b9e17673bfcbcb5.tar.gz
libvyosconfig-696df30c6c5c8662b3448ecf4b9e17673bfcbcb5.zip
T6180: add binding for mask_tree
-rw-r--r--lib/bindings.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/bindings.ml b/lib/bindings.ml
index 4547a36..4039da8 100644
--- a/lib/bindings.ml
+++ b/lib/bindings.ml
@@ -213,6 +213,16 @@ let reference_tree_to_json from_dir to_file =
let s = Printf.sprintf "Write_error \'%s\'" msg in
error_message := s; 1
+let mask_tree c_ptr_l c_ptr_r =
+ let ct_l = Root.get c_ptr_l in
+ let ct_r = Root.get c_ptr_r in
+ try
+ let ct_ret = CD.mask_tree ct_l ct_r in
+ Ctypes.Root.create ct_ret
+ with
+ | CD.Incommensurable -> error_message := "Incommensurable"; Ctypes.null
+ | CD.Empty_comparison -> error_message := "Empty comparison"; Ctypes.null
+
module Stubs(I : Cstubs_inverted.INTERNAL) =
struct
@@ -242,4 +252,5 @@ struct
let () = I.internal "show_diff" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string) show_diff
let () = I.internal "tree_union" ((ptr void) @-> (ptr void) @-> returning (ptr void)) tree_union
let () = I.internal "reference_tree_to_json" (string @-> string @-> returning int) reference_tree_to_json
+ let () = I.internal "mask_tree" ((ptr void) @-> (ptr void) @-> returning (ptr void)) mask_tree
end