diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-06-05 17:40:56 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-06-05 17:40:56 +0200 |
commit | 14866791ca3e0050844dfab0b2375aa3395a4bab (patch) | |
tree | 89f178ed2565d054ec3582b9f18c7ad595ff5012 /lib | |
parent | a02c7c1cf4b0ba7666575648562f99f593306c27 (diff) | |
download | libvyosconfig-14866791ca3e0050844dfab0b2375aa3395a4bab.tar.gz libvyosconfig-14866791ca3e0050844dfab0b2375aa3395a4bab.zip |
Add commands formatter function to the bindings.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bindings.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bindings.ml b/lib/bindings.ml index 925c6ee..4b8d04b 100644 --- a/lib/bindings.ml +++ b/lib/bindings.ml @@ -19,6 +19,9 @@ let from_string s = let render c_ptr = Vyos1x_renderer.render (Root.get c_ptr) +let render_commands c_ptr = + CT.render_commands ~alwayssort:true ~sortchildren:true (Root.get c_ptr) [] + let set_add_value c_ptr path value = let ct = Root.get c_ptr in let path = Pcre.split ~rex:(Pcre.regexp "\\s+") path in @@ -115,6 +118,7 @@ struct let () = I.internal "destroy" ((ptr void) @-> returning void) destroy let () = I.internal "from_string" (string @-> returning (ptr void)) from_string let () = I.internal "to_string" ((ptr void) @-> returning string) render + 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 let () = I.internal "set_valueless" ((ptr void) @-> string @-> returning int) set_valueless |