From 19dc6e13984f97a972feaceefa8384df75188f6a Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 22 Jan 2010 12:49:49 +0100 Subject: Implement printing data and date nodes in iphoneinfo --- tools/iphoneinfo.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tools/iphoneinfo.c') diff --git a/tools/iphoneinfo.c b/tools/iphoneinfo.c index acb62f7..5b131c4 100644 --- a/tools/iphoneinfo.c +++ b/tools/iphoneinfo.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -218,10 +219,11 @@ void print_usage(int argc, char **argv) void plist_node_to_string(plist_t node) { char *s = NULL; + char *data = NULL; double d; uint8_t b; - uint64_t u = 0; + GTimeVal tv = { 0, 0 }; plist_type t; @@ -259,11 +261,20 @@ void plist_node_to_string(plist_t node) break; case PLIST_DATA: - printf("\n"); + plist_get_data_val(node, &data, &u); + s = g_base64_encode((guchar *)data, u); + free(data); + printf("%s\n", s); + g_free(s); break; + case PLIST_DATE: - printf("\n"); + plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec); + s = g_time_val_to_iso8601(&tv); + printf("%s\n", s); + free(s); break; + case PLIST_ARRAY: case PLIST_DICT: printf("\n"); @@ -271,6 +282,7 @@ void plist_node_to_string(plist_t node) plist_children_to_string(node); indent_level--; break; + default: break; } -- cgit v1.1-32-gdbae