{0, NULL}
};
+int add_profile_item_to_json(struct traverse_state *state,
+ const char *section,
+ const char *subsection,
+ const char *key,
+ uintmax_t value)
+{
+ struct json_object section_json, subsection_json;
+ int result = 0;
+
+ section_json = json_get_object(&state->root_json, section);
+ if (json_is_invalid(§ion_json)) {
+ goto failure;
+ }
+ subsection_json = json_get_object(§ion_json, subsection);
+ if (json_is_invalid(&subsection_json)) {
+ goto failure;
+ }
+
+ result = json_add_int(&subsection_json, key, value);
+ if (result < 0) {
+ goto failure;
+ }
+
+ result = json_update_object(§ion_json, subsection, &subsection_json);
+ if (result < 0) {
+ goto failure;
+ }
+ result = json_update_object(&state->root_json, section, §ion_json);
+ if (result < 0) {
+ goto failure;
+ }
+
+ return 0;
+failure:
+ json_free(§ion_json);
+ json_free(&subsection_json);
+ return -1;
+}
+
int add_section_to_json(struct traverse_state *state,
const char *key)
{
int add_general_information_to_json(struct traverse_state *state);
+int add_profile_item_to_json(struct traverse_state *state,
+ const char *section,
+ const char *subsection,
+ const char *key,
+ uintmax_t value);
+
int traverse_connections_json(struct traverse_state *state,
const struct connections_data *crec,
const char *encryption_cipher,
return 0;
}
+int add_profile_item_to_json(struct traverse_state *state,
+ const char *section,
+ const char *subsection,
+ const char *key,
+ uintmax_t value)
+{
+ return 0;
+}
+
int traverse_connections_json(struct traverse_state *state,
const struct connections_data *crec,
const char *encryption_cipher,