summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-06-21 21:58:12 +0200
committerGravatar Nikias Bassen2021-06-21 21:58:12 +0200
commitb2582f5a89dd979640cc83f6404270f380ad0f58 (patch)
tree727211c6b4f07977fab18e7f535cab3871fed497 /src
parent8ff4224fa45d630a777caf46e8ab377d3164e94d (diff)
downloadlibimobiledevice-glue-b2582f5a89dd979640cc83f6404270f380ad0f58.tar.gz
libimobiledevice-glue-b2582f5a89dd979640cc83f6404270f380ad0f58.tar.bz2
utils: Add plist_print_to_stream_with_indentation()
Diffstat (limited to 'src')
-rw-r--r--src/utils.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index f1c1420..fa692a0 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -534,13 +534,12 @@ static void plist_node_print_to_stream(plist_t node, int* indent_level, FILE* st
}
}
-LIBIMOBILEDEVICE_GLUE_API void plist_print_to_stream(plist_t plist, FILE* stream)
+LIBIMOBILEDEVICE_GLUE_API void plist_print_to_stream_with_indentation(plist_t plist, FILE* stream, unsigned int indentation)
{
- int indent = 0;
-
if (!plist || !stream)
return;
+ int indent = indentation;
switch (plist_get_node_type(plist)) {
case PLIST_DICT:
plist_dict_print_to_stream(plist, &indent, stream);
@@ -552,3 +551,8 @@ LIBIMOBILEDEVICE_GLUE_API void plist_print_to_stream(plist_t plist, FILE* stream
plist_node_print_to_stream(plist, &indent, stream);
}
}
+
+LIBIMOBILEDEVICE_GLUE_API void plist_print_to_stream(plist_t plist, FILE* stream)
+{
+ plist_print_to_stream_with_indentation(plist, stream, 0);
+}