summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-05-16 13:50:30 -0500
committerGitHub <noreply@github.com>2023-05-16 13:50:30 -0500
commitec930f944a730571cad9e5a2d4108821116a68ba (patch)
tree9cc019787fdabba2c88b97db146a9dacc67e9ba6
parent137d7c3f977f6d1870feb1d99c02bedda151d819 (diff)
parentded5d4ff51e8f24eb8e2ca1f00a1314bf13315e3 (diff)
downloadlibvyosconfig-ec930f944a730571cad9e5a2d4108821116a68ba.tar.gz
libvyosconfig-ec930f944a730571cad9e5a2d4108821116a68ba.zip
Merge pull request #10 from jestabro/reference-tree
T5194: add binding for reference_tree_to_json
-rw-r--r--lib/bindings.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bindings.ml b/lib/bindings.ml
index 37be3a2..965d84f 100644
--- a/lib/bindings.ml
+++ b/lib/bindings.ml
@@ -210,6 +210,17 @@ let tree_union c_ptr_l c_ptr_r =
with
CD.Nonexistent_child -> error_message := "Nonexistent child"; Ctypes.null
+let reference_tree_to_json from_dir to_file =
+ try
+ Generate.reference_tree_to_json from_dir to_file; 0
+ with
+ | Generate.Load_error msg ->
+ let s = Printf.sprintf "Load_error \'%s\'" msg in
+ error_message := s; 1
+ | Generate.Write_error msg ->
+ let s = Printf.sprintf "Write_error \'%s\'" msg in
+ error_message := s; 1
+
module Stubs(I : Cstubs_inverted.INTERNAL) =
struct
@@ -239,4 +250,5 @@ struct
let () = I.internal "trim_tree" ((ptr void) @-> (ptr void) @-> returning (ptr void)) trim_tree
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
end