The method adds an empty json object (value) under a given section name
(key) to a given json object.
Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
#include <jansson.h>
#include "audit_logging.h" /* various JSON helpers */
#include "auth/common_auth.h"
+
+int add_section_to_json(struct traverse_state *state,
+ const char *key)
+{
+ struct json_object empty_json;
+ int result;
+
+ empty_json = json_new_object();
+ if (json_is_invalid(&empty_json)) {
+ return -1;
+ }
+
+ result = json_add_object(&state->root_json, key, &empty_json);
+ if (result < 0) {
+ return -1;
+ }
+
+ return result;
+}
#ifndef STATUS_JSON_H
#define STATUS_JSON_H
+int add_section_to_json(struct traverse_state *state,
+ const char *key);
+
#endif
#include "../libcli/security/security.h"
#include "librpc/gen_ndr/open_files.h"
#include "status_json.h"
+
+int add_section_to_json(struct traverse_state *state,
+ const char *key)
+{
+ return 0;
+}