diff options
Diffstat (limited to 'dev/main.c')
| -rw-r--r-- | dev/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <libxml/tree.h> | 28 | #include <libxml/tree.h> |
| 29 | 29 | ||
| 30 | #include <libiphone/libiphone.h> | 30 | #include <libiphone/libiphone.h> |
| 31 | #include "../src/utils.h" | ||
| 31 | 32 | ||
| 32 | 33 | ||
| 33 | int main(int argc, char *argv[]) | 34 | int main(int argc, char *argv[]) |
| @@ -38,8 +39,10 @@ int main(int argc, char *argv[]) | |||
| 38 | 39 | ||
| 39 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { | 40 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { |
| 40 | iphone_set_debug(1); | 41 | iphone_set_debug(1); |
| 42 | iphone_set_debug_mask(DBGMASK_ALL); | ||
| 41 | } else { | 43 | } else { |
| 42 | iphone_set_debug(0); | 44 | iphone_set_debug(0); |
| 45 | iphone_set_debug_mask(DBGMASK_NONE); | ||
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { | 48 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { |
| @@ -87,7 +90,7 @@ int main(int argc, char *argv[]) | |||
| 87 | iphone_afc_get_file_attr(afc, "/iTunesOnTheGoPlaylist.plist", &stbuf); | 90 | iphone_afc_get_file_attr(afc, "/iTunesOnTheGoPlaylist.plist", &stbuf); |
| 88 | if (IPHONE_E_SUCCESS == | 91 | if (IPHONE_E_SUCCESS == |
| 89 | iphone_afc_open_file(afc, "/iTunesOnTheGoPlaylist.plist", IPHONE_AFC_FILE_READ, &my_file) && my_file) { | 92 | iphone_afc_open_file(afc, "/iTunesOnTheGoPlaylist.plist", IPHONE_AFC_FILE_READ, &my_file) && my_file) { |
| 90 | printf("A file size: %i\n", stbuf.st_size); | 93 | printf("A file size: %i\n", (int) stbuf.st_size); |
| 91 | char *file_data = (char *) malloc(sizeof(char) * stbuf.st_size); | 94 | char *file_data = (char *) malloc(sizeof(char) * stbuf.st_size); |
| 92 | iphone_afc_read_file(afc, my_file, file_data, stbuf.st_size, &bytes); | 95 | iphone_afc_read_file(afc, my_file, file_data, stbuf.st_size, &bytes); |
| 93 | if (bytes >= 0) { | 96 | if (bytes >= 0) { |
