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)
45 int *buf = (int *) malloc(buffersize); 45 int *buf = (int *) malloc(buffersize);
46 int *buf2 = (int *) malloc(buffersize); 46 int *buf2 = (int *) malloc(buffersize);
47 unsigned int bytes = 0; 47 unsigned int bytes = 0;
48 uint64_t position = 0;
49
48 //fill buffer 50 //fill buffer
49 int i = 0; 51 int i = 0;
50 for (i = 0; i < BUFFER_SIZE; i++) { 52 for (i = 0; i < BUFFER_SIZE; i++) {
@@ -65,9 +67,12 @@ void check_afc(gpointer data)
65 //now read it 67 //now read it
66 bytes = 0; 68 bytes = 0;
67 afc_file_open(((param *) data)->afc, path, AFC_FOPEN_RDONLY, &file); 69 afc_file_open(((param *) data)->afc, path, AFC_FOPEN_RDONLY, &file);
68 afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize, &bytes); 70 afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize/2, &bytes);
71 afc_file_read(((param *) data)->afc, file, (char *) buf2 + (buffersize/2), buffersize/2, &bytes);
72 if(AFC_E_SUCCESS != afc_file_tell(((param *) data)->afc, file, &position))
73 printf("Tell operation failed\n");
69 afc_file_close(((param *) data)->afc, file); 74 afc_file_close(((param *) data)->afc, file);
70 if (bytes != buffersize) 75 if (position != buffersize)
71 printf("Read operation failed\n"); 76 printf("Read operation failed\n");
72 77
73 //compare buffers 78 //compare buffers