diff options
| author | 2009-07-26 19:34:22 -0700 | |
|---|---|---|
| committer | 2009-07-26 19:34:22 -0700 | |
| commit | eea538c94f01f8054f69f059614f19400187a472 (patch) | |
| tree | 209a12dc8c8eaece15b8153d15e689c8c2147ab6 /src/utils.c | |
| parent | 8ebfd7d8eea89bb27e4e6dbb1f37fd90d98b439c (diff) | |
| parent | 19c9750d670435ce430f0fc85a55faf127bdfbf9 (diff) | |
| download | libimobiledevice-eea538c94f01f8054f69f059614f19400187a472.tar.gz libimobiledevice-eea538c94f01f8054f69f059614f19400187a472.tar.bz2 | |
Merge commit 'martin-s/martin'
[#46 state:resolved]
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c index 5b0872d..3c08351 100644 --- a/src/utils.c +++ b/src/utils.c | |||
| @@ -20,7 +20,10 @@ | |||
| 20 | */ | 20 | */ |
| 21 | #include <stdarg.h> | 21 | #include <stdarg.h> |
| 22 | #include <stdio.h> | 22 | #include <stdio.h> |
| 23 | #include <stdint.h> | ||
| 24 | |||
| 23 | #include "utils.h" | 25 | #include "utils.h" |
| 26 | #include "libiphone/libiphone.h" | ||
| 24 | 27 | ||
| 25 | int toto_debug = 0; | 28 | int toto_debug = 0; |
| 26 | uint16_t dbg_mask = 0; | 29 | uint16_t dbg_mask = 0; |
| @@ -31,7 +34,7 @@ uint16_t dbg_mask = 0; | |||
| 31 | * | 34 | * |
| 32 | * @param level Set to 0 for no debugging or 1 for debugging. | 35 | * @param level Set to 0 for no debugging or 1 for debugging. |
| 33 | */ | 36 | */ |
| 34 | void iphone_set_debug(int level) | 37 | void iphone_set_debug_level(int level) |
| 35 | { | 38 | { |
| 36 | toto_debug = level; | 39 | toto_debug = level; |
| 37 | } | 40 | } |
| @@ -116,13 +119,12 @@ inline void log_debug_buffer(const char *data, const int length) | |||
| 116 | inline void dump_debug_buffer(const char *file, const char *data, const int length) | 119 | inline void dump_debug_buffer(const char *file, const char *data, const int length) |
| 117 | { | 120 | { |
| 118 | #ifndef STRIP_DEBUG_CODE | 121 | #ifndef STRIP_DEBUG_CODE |
| 119 | |||
| 120 | /* run the real fprintf */ | 122 | /* run the real fprintf */ |
| 121 | if (toto_debug) { | 123 | if (toto_debug) { |
| 122 | FILE *my_ssl_packet = fopen(file, "w+"); | 124 | FILE *my_ssl_packet = fopen(file, "w+"); |
| 123 | fwrite(data, 1, length, my_ssl_packet); | 125 | fwrite(data, 1, length, my_ssl_packet); |
| 124 | fflush(my_ssl_packet); | 126 | fflush(my_ssl_packet); |
| 125 | fprintf(stderr, "Wrote SSL packet to drive, too.\n"); | 127 | fprintf(stderr, "%s: Wrote SSL packet to drive, too.\n", __func__); |
| 126 | fclose(my_ssl_packet); | 128 | fclose(my_ssl_packet); |
| 127 | } | 129 | } |
| 128 | #endif | 130 | #endif |
