diff options
| author | 2010-01-22 12:49:49 +0100 | |
|---|---|---|
| committer | 2010-01-22 12:49:49 +0100 | |
| commit | 19dc6e13984f97a972feaceefa8384df75188f6a (patch) | |
| tree | 4a72019eff00836d858158dc2f37d0cad3f9a623 /tools/iphoneinfo.c | |
| parent | e6b08f71f9ebf06541551f49a3ecda324918e440 (diff) | |
| download | libimobiledevice-19dc6e13984f97a972feaceefa8384df75188f6a.tar.gz libimobiledevice-19dc6e13984f97a972feaceefa8384df75188f6a.tar.bz2 | |
Implement printing data and date nodes in iphoneinfo
Diffstat (limited to 'tools/iphoneinfo.c')
| -rw-r--r-- | tools/iphoneinfo.c | 18 |
1 files changed, 15 insertions, 3 deletions
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 @@ | |||
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | #include <errno.h> | 24 | #include <errno.h> |
| 25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
| 26 | #include <glib.h> | ||
| 26 | 27 | ||
| 27 | #include <libiphone/libiphone.h> | 28 | #include <libiphone/libiphone.h> |
| 28 | #include <libiphone/lockdown.h> | 29 | #include <libiphone/lockdown.h> |
| @@ -218,10 +219,11 @@ void print_usage(int argc, char **argv) | |||
| 218 | void plist_node_to_string(plist_t node) | 219 | void plist_node_to_string(plist_t node) |
| 219 | { | 220 | { |
| 220 | char *s = NULL; | 221 | char *s = NULL; |
| 222 | char *data = NULL; | ||
| 221 | double d; | 223 | double d; |
| 222 | uint8_t b; | 224 | uint8_t b; |
| 223 | |||
| 224 | uint64_t u = 0; | 225 | uint64_t u = 0; |
| 226 | GTimeVal tv = { 0, 0 }; | ||
| 225 | 227 | ||
| 226 | plist_type t; | 228 | plist_type t; |
| 227 | 229 | ||
| @@ -259,11 +261,20 @@ void plist_node_to_string(plist_t node) | |||
| 259 | break; | 261 | break; |
| 260 | 262 | ||
| 261 | case PLIST_DATA: | 263 | case PLIST_DATA: |
| 262 | printf("\n"); | 264 | plist_get_data_val(node, &data, &u); |
| 265 | s = g_base64_encode((guchar *)data, u); | ||
| 266 | free(data); | ||
| 267 | printf("%s\n", s); | ||
| 268 | g_free(s); | ||
| 263 | break; | 269 | break; |
| 270 | |||
| 264 | case PLIST_DATE: | 271 | case PLIST_DATE: |
| 265 | printf("\n"); | 272 | plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec); |
| 273 | s = g_time_val_to_iso8601(&tv); | ||
| 274 | printf("%s\n", s); | ||
| 275 | free(s); | ||
| 266 | break; | 276 | break; |
| 277 | |||
| 267 | case PLIST_ARRAY: | 278 | case PLIST_ARRAY: |
| 268 | case PLIST_DICT: | 279 | case PLIST_DICT: |
| 269 | printf("\n"); | 280 | printf("\n"); |
| @@ -271,6 +282,7 @@ void plist_node_to_string(plist_t node) | |||
| 271 | plist_children_to_string(node); | 282 | plist_children_to_string(node); |
| 272 | indent_level--; | 283 | indent_level--; |
| 273 | break; | 284 | break; |
| 285 | |||
| 274 | default: | 286 | default: |
| 275 | break; | 287 | break; |
| 276 | } | 288 | } |
