Skip to content

Commit

Permalink
Merge pull request vyos#13 from jestabro/tree-mask
Browse files Browse the repository at this point in the history
T6180: add binding for mask_tree
  • Loading branch information
jestabro authored Mar 29, 2024
2 parents 63175de + 696df30 commit c6141d9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit c6141d9

Please sign in to comment.