diff options
author | John Estabrook <jestabro@vyos.io> | 2022-02-27 09:42:07 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2022-02-27 10:11:08 -0600 |
commit | ee296ca445452d6a5021144cd8747d1456ae315e (patch) | |
tree | 66a5915cbc6cd8eb50d1871bd711dea5c3e13974 | |
parent | 41c75d8440f3430a12e425b67d97dba6ba081b39 (diff) | |
download | libvyosconfig-ee296ca445452d6a5021144cd8747d1456ae315e.tar.gz libvyosconfig-ee296ca445452d6a5021144cd8747d1456ae315e.zip |
T4235: binding for trim_tree
-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 7236c5a..d9d2051 100644 --- a/lib/bindings.ml +++ b/lib/bindings.ml @@ -176,6 +176,16 @@ let diff_tree path c_ptr_l c_ptr_r = | CD.Incommensurable -> error_message := "Incommensurable"; Ctypes.null | CD.Empty_comparison -> error_message := "Empty comparison"; Ctypes.null +let trim_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.trim_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 @@ -202,4 +212,5 @@ struct let () = I.internal "return_value" ((ptr void) @-> string @-> returning string) return_value let () = I.internal "return_values" ((ptr void) @-> string @-> returning string) return_values let () = I.internal "diff_tree" (string @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) diff_tree + let () = I.internal "trim_tree" ((ptr void) @-> (ptr void) @-> returning (ptr void)) trim_tree end |