summaryrefslogtreecommitdiffstats
path: root/src/afc.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-02 16:13:49 +0200
committerGravatar Martin Szulecki2014-10-02 16:13:49 +0200
commit9eaaae751d4a3b3e6bd6d95e5c355cb26390845f (patch)
tree782fb20c2a638993b44b003da33dc8b9a609e42e /src/afc.c
parentff5807ceca06d67a3f87c1aa147416b4ef3c25ec (diff)
downloadlibimobiledevice-9eaaae751d4a3b3e6bd6d95e5c355cb26390845f.tar.gz
libimobiledevice-9eaaae751d4a3b3e6bd6d95e5c355cb26390845f.tar.bz2
afc: Unify argument names for some functions to match overall API
Diffstat (limited to 'src/afc.c')
-rw-r--r--src/afc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/afc.c b/src/afc.c
index ae5e245..50ac5bf 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -402,19 +402,19 @@ static char **make_strings_list(char *tokens, uint32_t length)
402 return list; 402 return list;
403} 403}
404 404
405afc_error_t afc_read_directory(afc_client_t client, const char *dir, char ***list) 405afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information)
406{ 406{
407 uint32_t bytes = 0; 407 uint32_t bytes = 0;
408 char *data = NULL, **list_loc = NULL; 408 char *data = NULL, **list_loc = NULL;
409 afc_error_t ret = AFC_E_UNKNOWN_ERROR; 409 afc_error_t ret = AFC_E_UNKNOWN_ERROR;
410 410
411 if (!client || !dir || !list || (list && *list)) 411 if (!client || !path || !directory_information || (directory_information && *directory_information))
412 return AFC_E_INVALID_ARG; 412 return AFC_E_INVALID_ARG;
413 413
414 afc_lock(client); 414 afc_lock(client);
415 415
416 /* Send the command */ 416 /* Send the command */
417 ret = afc_dispatch_packet(client, AFC_OP_READ_DIR, dir, strlen(dir)+1, NULL, 0, &bytes); 417 ret = afc_dispatch_packet(client, AFC_OP_READ_DIR, path, strlen(path)+1, NULL, 0, &bytes);
418 if (ret != AFC_E_SUCCESS) { 418 if (ret != AFC_E_SUCCESS) {
419 afc_unlock(client); 419 afc_unlock(client);
420 return AFC_E_NOT_ENOUGH_DATA; 420 return AFC_E_NOT_ENOUGH_DATA;
@@ -433,18 +433,18 @@ afc_error_t afc_read_directory(afc_client_t client, const char *dir, char ***lis
433 free(data); 433 free(data);
434 434
435 afc_unlock(client); 435 afc_unlock(client);
436 *list = list_loc; 436 *directory_information = list_loc;
437 437
438 return ret; 438 return ret;
439} 439}
440 440
441afc_error_t afc_get_device_info(afc_client_t client, char ***infos) 441afc_error_t afc_get_device_info(afc_client_t client, char ***device_information)
442{ 442{
443 uint32_t bytes = 0; 443 uint32_t bytes = 0;
444 char *data = NULL, **list = NULL; 444 char *data = NULL, **list = NULL;
445 afc_error_t ret = AFC_E_UNKNOWN_ERROR; 445 afc_error_t ret = AFC_E_UNKNOWN_ERROR;
446 446
447 if (!client || !infos) 447 if (!client || !device_information)
448 return AFC_E_INVALID_ARG; 448 return AFC_E_INVALID_ARG;
449 449
450 afc_lock(client); 450 afc_lock(client);
@@ -470,7 +470,7 @@ afc_error_t afc_get_device_info(afc_client_t client, char ***infos)
470 470
471 afc_unlock(client); 471 afc_unlock(client);
472 472
473 *infos = list; 473 *device_information = list;
474 474
475 return ret; 475 return ret;
476} 476}
@@ -559,7 +559,7 @@ afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *t
559 return ret; 559 return ret;
560} 560}
561 561
562afc_error_t afc_make_directory(afc_client_t client, const char *dir) 562afc_error_t afc_make_directory(afc_client_t client, const char *path)
563{ 563{
564 uint32_t bytes = 0; 564 uint32_t bytes = 0;
565 afc_error_t ret = AFC_E_UNKNOWN_ERROR; 565 afc_error_t ret = AFC_E_UNKNOWN_ERROR;
@@ -570,7 +570,7 @@ afc_error_t afc_make_directory(afc_client_t client, const char *dir)
570 afc_lock(client); 570 afc_lock(client);
571 571
572 /* Send command */ 572 /* Send command */
573 ret = afc_dispatch_packet(client, AFC_OP_MAKE_DIR, dir, strlen(dir)+1, NULL, 0, &bytes); 573 ret = afc_dispatch_packet(client, AFC_OP_MAKE_DIR, path, strlen(path)+1, NULL, 0, &bytes);
574 if (ret != AFC_E_SUCCESS) { 574 if (ret != AFC_E_SUCCESS) {
575 afc_unlock(client); 575 afc_unlock(client);
576 return AFC_E_NOT_ENOUGH_DATA; 576 return AFC_E_NOT_ENOUGH_DATA;
@@ -583,13 +583,13 @@ afc_error_t afc_make_directory(afc_client_t client, const char *dir)
583 return ret; 583 return ret;
584} 584}
585 585
586afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***infolist) 586afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information)
587{ 587{
588 char *received = NULL; 588 char *received = NULL;
589 uint32_t bytes = 0; 589 uint32_t bytes = 0;
590 afc_error_t ret = AFC_E_UNKNOWN_ERROR; 590 afc_error_t ret = AFC_E_UNKNOWN_ERROR;
591 591
592 if (!client || !path || !infolist) 592 if (!client || !path || !file_information)
593 return AFC_E_INVALID_ARG; 593 return AFC_E_INVALID_ARG;
594 594
595 afc_lock(client); 595 afc_lock(client);
@@ -604,7 +604,7 @@ afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***inf
604 /* Receive data */ 604 /* Receive data */
605 ret = afc_receive_data(client, &received, &bytes); 605 ret = afc_receive_data(client, &received, &bytes);
606 if (received) { 606 if (received) {
607 *infolist = make_strings_list(received, bytes); 607 *file_information = make_strings_list(received, bytes);
608 free(received); 608 free(received);
609 } 609 }
610 610