]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/json: expose libjansson json_dumps
authorJason Ish <jason.ish@oisf.net>
Fri, 6 Mar 2020 21:13:44 +0000 (15:13 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 3 Jun 2020 11:36:55 +0000 (13:36 +0200)
This will be temporarily used by JsonBuilder to add the ability
to extend JsonBuilder with Jansson's json_t types.

rust/src/json.rs

index 9c5e6fa958d2d68e79ba47c655fb12e24ff9a0f0..b4e772307cef1c0d37e829fbf2cd0658e32aef42 100644 (file)
@@ -20,6 +20,7 @@
 
 use std::ffi::CString;
 use std::os::raw::c_char;
+use std::os::raw::c_int;
 
 /// The Rust place holder for the json_t pointer.
 pub enum JsonT {}
@@ -37,6 +38,7 @@ extern {
     fn json_integer(val: u64) -> *mut JsonT;
     fn SCJsonDecref(value: *mut JsonT);
     fn SCJsonBool(val: bool) -> *mut JsonT;
+    pub fn json_dumps(js: *mut JsonT, flags: c_int) -> *const c_char;
 }
 
 pub struct Json {