summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-10-27 14:39:32 +0100
committerDaniil Baturin <daniil@baturin.org>2019-10-27 14:39:32 +0100
commit5138b5ebe36f7f1ca089d1da50b4a86b4b1fee20 (patch)
tree1483e495d1b2d138767e0f9005403c7014085af0 /lib
parent73757c03487832d7ae50d7e029def49b7d28e03d (diff)
downloadlibvyosconfig-5138b5ebe36f7f1ca089d1da50b4a86b4b1fee20.tar.gz
libvyosconfig-5138b5ebe36f7f1ca089d1da50b4a86b4b1fee20.zip
T1773: Expose functions for JSON rendering.
Diffstat (limited to 'lib')
-rw-r--r--lib/bindings.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bindings.ml b/lib/bindings.ml
index 1734a52..db1d375 100644
--- a/lib/bindings.ml
+++ b/lib/bindings.ml
@@ -37,6 +37,12 @@ let get_error () = !error_message
let render_config c_ptr =
CT.render_config (Root.get c_ptr)
+let render_json c_ptr =
+ CT.render_json (Root.get c_ptr)
+
+let render_json_ast c_ptr =
+ CT.render_json_ast (Root.get c_ptr)
+
let render_commands c_ptr =
CT.render_commands (Root.get c_ptr) []
@@ -155,6 +161,8 @@ struct
let () = I.internal "from_string" (string @-> returning (ptr void)) from_string
let () = I.internal "get_error" (void @-> returning string) get_error
let () = I.internal "to_string" ((ptr void) @-> returning string) render_config
+ let () = I.internal "to_json" ((ptr void) @-> returning string) render_json
+ let () = I.internal "to_json_ast" ((ptr void) @-> returning string) render_json_ast
let () = I.internal "to_commands" ((ptr void) @-> returning string) render_commands
let () = I.internal "set_add_value" ((ptr void) @-> string @-> string @-> returning int) set_add_value
let () = I.internal "set_replace_value" ((ptr void) @-> string @-> string @-> returning int) set_replace_value