fn json_string(value: *const c_char) -> *mut JsonT;
fn json_integer(val: u64) -> *mut JsonT;
+ fn SCJsonBool(val: bool) -> *mut JsonT;
}
pub struct Json {
}
}
+ pub fn set_boolean(&self, key: &str, val: bool) {
+ unsafe {
+ json_object_set_new(self.js,
+ CString::new(key).unwrap().as_ptr(),
+ SCJsonBool(val));
+ }
+ }
+
pub fn array_append(&self, val: Json) {
unsafe {
json_array_append_new(self.js, val.js);
OutputRegisterModule(MODULE_NAME, "eve-log", OutputJsonInitCtx);
}
+json_t *SCJsonBool(int val)
+{
+ return (val ? json_true() : json_false());
+}
+
/* Default Sensor ID value */
static int64_t sensor_id = -1; /* -1 = not defined */
LogFileCtx *file_ctx;
} AlertJsonThread;
+json_t *SCJsonBool(int val);
+
#endif /* HAVE_LIBJANSSON */
#endif /* __OUTPUT_JSON_H__ */
#endif
/* Appears not all current distros have jansson that defines this. */
#ifndef json_boolean
-#define json_boolean(val) ((val) ? json_true() : json_false())
+#define json_boolean(val) SCJsonBool((val))
+//#define json_boolean(val) ((val) ? json_true() : json_false())
#endif
#endif