diff options
author | John Estabrook <jestabro@vyos.io> | 2024-05-03 12:33:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 12:33:50 -0500 |
commit | 6c1f8a3f9d2ca5f83e58fee469b00ef81612e939 (patch) | |
tree | 79554692f5c3d158051d21f3208b10f5746a8728 | |
parent | 63175de457808b64ecd07a16293c44d15901c8bd (diff) | |
parent | 10b273014e523a919bc85c19b1bb6dea4a85970d (diff) | |
download | libvyosconfig-6c1f8a3f9d2ca5f83e58fee469b00ef81612e939.tar.gz libvyosconfig-6c1f8a3f9d2ca5f83e58fee469b00ef81612e939.zip |
Merge pull request #14 from vyos/mergify/bp/sagitta/pr-13
T6180: add binding for mask_tree (backport #13)
-rw-r--r-- | lib/bindings.ml | 11 |
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 |