summaryrefslogtreecommitdiffstats
path: root/dev
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-25 03:46:54 +0200
committerGravatar Martin Szulecki2009-07-25 03:46:54 +0200
commit0e255cfe381caedf0375e6834021333d971f8050 (patch)
treea9c5bcffb2a7cea2e037dad1513a502ffab7df28 /dev
parent8415e1f13dfc8c31fe4d1ff695af26189297795b (diff)
downloadlibimobiledevice-0e255cfe381caedf0375e6834021333d971f8050.tar.gz
libimobiledevice-0e255cfe381caedf0375e6834021333d971f8050.tar.bz2
Implement afc_file_tell() and adjust afc_receive_data() to handle it
Diffstat (limited to 'dev')
-rw-r--r--dev/afccheck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index d06a147..a9b666e 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -45,6 +45,8 @@ void check_afc(gpointer data)
int *buf = (int *) malloc(buffersize);
int *buf2 = (int *) malloc(buffersize);
unsigned int bytes = 0;
+ uint64_t position = 0;
+
//fill buffer
int i = 0;
for (i = 0; i < BUFFER_SIZE; i++) {
@@ -65,9 +67,12 @@ void check_afc(gpointer data)
//now read it
bytes = 0;
afc_file_open(((param *) data)->afc, path, AFC_FOPEN_RDONLY, &file);
- afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize, &bytes);
+ afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize/2, &bytes);
+ afc_file_read(((param *) data)->afc, file, (char *) buf2 + (buffersize/2), buffersize/2, &bytes);
+ if(AFC_E_SUCCESS != afc_file_tell(((param *) data)->afc, file, &position))
+ printf("Tell operation failed\n");
afc_file_close(((param *) data)->afc, file);
- if (bytes != buffersize)
+ if (position != buffersize)
printf("Read operation failed\n");
//compare buffers