From abb74bcae219c25cffb7e30db6a34c69dcd92f0a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 6 Jul 2009 19:38:00 +0200 Subject: API cleanup for AFC Signed-off-by: Martin Szulecki --- include/libiphone/libiphone.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 463efa7..3f5d86c 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -54,29 +54,12 @@ extern "C" { typedef int16_t iphone_error_t; -typedef enum { - AFC_FOPEN_RDONLY = 0x00000001, // r O_RDONLY - AFC_FOPEN_RW = 0x00000002, // r+ O_RDWR | O_CREAT - AFC_FOPEN_WRONLY = 0x00000003, // w O_WRONLY | O_CREAT | O_TRUNC - AFC_FOPEN_WR = 0x00000004, // w+ O_RDWR | O_CREAT | O_TRUNC - AFC_FOPEN_APPEND = 0x00000005, // a O_WRONLY | O_APPEND | O_CREAT - AFC_FOPEN_RDAPPEND = 0x00000006 // a+ O_RDWR | O_APPEND | O_CREAT -} iphone_afc_file_mode_t; - -typedef enum { - IPHONE_AFC_HARDLINK = 1, - IPHONE_AFC_SYMLINK = 2 -} iphone_afc_link_type_t; - struct iphone_device_int; typedef struct iphone_device_int *iphone_device_t; struct iphone_lckd_client_int; typedef struct iphone_lckd_client_int *iphone_lckd_client_t; -struct iphone_afc_client_int; -typedef struct iphone_afc_client_int *iphone_afc_client_t; - struct iphone_msync_client_int; typedef struct iphone_msync_client_int *iphone_msync_client_t; @@ -111,29 +94,6 @@ iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, plist_t* plist); iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, plist_t plist); -//afc related functions -iphone_error_t iphone_afc_new_client ( iphone_device_t device, int dst_port, iphone_afc_client_t *client ); -iphone_error_t iphone_afc_free_client ( iphone_afc_client_t client ); -int iphone_afc_get_afcerror ( iphone_afc_client_t client ); -int iphone_afc_get_errno ( iphone_afc_client_t client ); - -iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***infos ); -iphone_error_t iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir, char ***list); - -iphone_error_t iphone_afc_get_file_info ( iphone_afc_client_t client, const char *filename, char ***infolist ); -iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, iphone_afc_file_mode_t file_mode, uint64_t *handle ); -iphone_error_t iphone_afc_close_file ( iphone_afc_client_t client, uint64_t handle); -iphone_error_t iphone_afc_lock_file ( iphone_afc_client_t client, uint64_t handle, int operation); -iphone_error_t iphone_afc_read_file ( iphone_afc_client_t client, uint64_t handle, char *data, int length, uint32_t *bytes); -iphone_error_t iphone_afc_write_file ( iphone_afc_client_t client, uint64_t handle, const char *data, int length, uint32_t *bytes); -iphone_error_t iphone_afc_seek_file ( iphone_afc_client_t client, uint64_t handle, int64_t offset, int whence); -iphone_error_t iphone_afc_truncate_file ( iphone_afc_client_t client, uint64_t handle, uint64_t newsize); -iphone_error_t iphone_afc_delete_file ( iphone_afc_client_t client, const char *path); -iphone_error_t iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to); -iphone_error_t iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir); -iphone_error_t iphone_afc_truncate(iphone_afc_client_t client, const char *path, off_t newsize); -iphone_error_t iphone_afc_make_link ( iphone_afc_client_t client, iphone_afc_link_type_t linktype, const char *target, const char *linkname); - iphone_error_t iphone_msync_new_client(iphone_device_t device, int dst_port, iphone_msync_client_t * client); -- cgit v1.1-32-gdbae From a1e2fec59eb7d0d2a3adbd4691b3ea2ee1302921 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 6 Jul 2009 19:46:35 +0200 Subject: API cleanup for NotificationProxy Signed-off-by: Martin Szulecki --- include/libiphone/libiphone.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 3f5d86c..456f000 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -63,9 +63,6 @@ typedef struct iphone_lckd_client_int *iphone_lckd_client_t; struct iphone_msync_client_int; typedef struct iphone_msync_client_int *iphone_msync_client_t; -struct iphone_np_client_int; -typedef struct iphone_np_client_int *iphone_np_client_t; - //debug related functions #define DBGMASK_ALL 0xFFFF #define DBGMASK_NONE 0x0000 @@ -102,36 +99,6 @@ iphone_error_t iphone_msync_free_client(iphone_msync_client_t client); iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t * plist); iphone_error_t iphone_msync_send(iphone_msync_client_t client, plist_t plist); -// NotificationProxy related -// notifications for use with post_notification (client --> device) -#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" -#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" -#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" - -// notifications for use with observe_notification (device --> client) -#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" -#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" -#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" -#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed" -#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed" -#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation" -#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" -#define NP_APP_INSTALLED "com.apple.mobile.application_installed" -#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" - -iphone_error_t iphone_np_new_client ( iphone_device_t device, int dst_port, iphone_np_client_t *client ); -iphone_error_t iphone_np_free_client ( iphone_np_client_t client ); - -iphone_error_t iphone_np_post_notification ( iphone_np_client_t client, const char *notification ); - -iphone_error_t iphone_np_observe_notification ( iphone_np_client_t client, const char *notification ); -iphone_error_t iphone_np_observe_notifications ( iphone_np_client_t client, const char **notification_spec ); -iphone_error_t iphone_np_get_notification ( iphone_np_client_t client, char **notification ); - -typedef void (*iphone_np_notify_cb_t) ( const char *notification ); - -iphone_error_t iphone_np_set_notify_callback ( iphone_np_client_t client, iphone_np_notify_cb_t notify_cb ); - #ifdef __cplusplus } #endif -- cgit v1.1-32-gdbae From 62a6f558ac7ca7a9b83c2ed810929732c02bbc9d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 7 Jul 2009 21:02:00 +0200 Subject: Cleanup lockdown request API and fix docs, tools, bindings and exports --- include/libiphone/libiphone.h | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 456f000..9e983bb 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -57,9 +57,6 @@ typedef int16_t iphone_error_t; struct iphone_device_int; typedef struct iphone_device_int *iphone_device_t; -struct iphone_lckd_client_int; -typedef struct iphone_lckd_client_int *iphone_lckd_client_t; - struct iphone_msync_client_int; typedef struct iphone_msync_client_int *iphone_msync_client_t; @@ -74,29 +71,15 @@ void iphone_set_debug_mask(uint16_t mask); void iphone_set_debug(int level); //device related functions -iphone_error_t iphone_get_device ( iphone_device_t *device ); -iphone_error_t iphone_get_device_by_uuid ( iphone_device_t *device, const char *uuid ); -iphone_error_t iphone_free_device ( iphone_device_t device ); - -uint32_t iphone_get_device_handle ( iphone_device_t device ); - -//lockdownd related functions -iphone_error_t lockdownd_get_device_uid(iphone_lckd_client_t control, char **uid); -iphone_error_t lockdownd_get_device_name ( iphone_lckd_client_t client, char **device_name ); -iphone_error_t iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client ); -iphone_error_t iphone_lckd_free_client( iphone_lckd_client_t client ); - -iphone_error_t iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service, int *port ); -iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, plist_t* plist); -iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, plist_t plist); - - +iphone_error_t iphone_get_device(iphone_device_t *device); +iphone_error_t iphone_get_device_by_uuid(iphone_device_t *device, const char *uuid); +iphone_error_t iphone_free_device(iphone_device_t device); +uint32_t iphone_get_device_handle(iphone_device_t device); iphone_error_t iphone_msync_new_client(iphone_device_t device, int dst_port, iphone_msync_client_t * client); iphone_error_t iphone_msync_free_client(iphone_msync_client_t client); - -iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t * plist); +iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t *plist); iphone_error_t iphone_msync_send(iphone_msync_client_t client, plist_t plist); #ifdef __cplusplus -- cgit v1.1-32-gdbae From a68a82800f116706354adb97da1ef0cfd3e38a52 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 14 Jul 2009 14:21:53 +0200 Subject: Cleanup mobilesync API and bindings. Move get_all_contacts() into msyncclient. --- include/libiphone/libiphone.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 9e983bb..fa26d14 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -57,9 +57,6 @@ typedef int16_t iphone_error_t; struct iphone_device_int; typedef struct iphone_device_int *iphone_device_t; -struct iphone_msync_client_int; -typedef struct iphone_msync_client_int *iphone_msync_client_t; - //debug related functions #define DBGMASK_ALL 0xFFFF #define DBGMASK_NONE 0x0000 @@ -76,12 +73,6 @@ iphone_error_t iphone_get_device_by_uuid(iphone_device_t *device, const char *uu iphone_error_t iphone_free_device(iphone_device_t device); uint32_t iphone_get_device_handle(iphone_device_t device); -iphone_error_t iphone_msync_new_client(iphone_device_t device, int dst_port, - iphone_msync_client_t * client); -iphone_error_t iphone_msync_free_client(iphone_msync_client_t client); -iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t *plist); -iphone_error_t iphone_msync_send(iphone_msync_client_t client, plist_t plist); - #ifdef __cplusplus } #endif -- cgit v1.1-32-gdbae From 601e70e8ee757b769bdc10b16e108e846a1a0b93 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 17:46:30 +0200 Subject: Rename iphone_set_debug() to iphone_set_debug_level() and code using it --- include/libiphone/libiphone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index fa26d14..fef59e0 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -57,7 +57,7 @@ typedef int16_t iphone_error_t; struct iphone_device_int; typedef struct iphone_device_int *iphone_device_t; -//debug related functions +/* Debugging */ #define DBGMASK_ALL 0xFFFF #define DBGMASK_NONE 0x0000 #define DBGMASK_USBMUX (1 << 1) @@ -65,7 +65,7 @@ typedef struct iphone_device_int *iphone_device_t; #define DBGMASK_MOBILESYNC (1 << 3) void iphone_set_debug_mask(uint16_t mask); -void iphone_set_debug(int level); +void iphone_set_debug_level(int level); //device related functions iphone_error_t iphone_get_device(iphone_device_t *device); -- cgit v1.1-32-gdbae From 15e2c165ac63e225e3fbfc531da5c1f19fede569 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 17:59:39 +0200 Subject: Remove DBGMASK_USBMUX as it is obsolete since the libusbmuxd code merge --- include/libiphone/libiphone.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index fef59e0..b8c1c59 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -60,9 +60,8 @@ typedef struct iphone_device_int *iphone_device_t; /* Debugging */ #define DBGMASK_ALL 0xFFFF #define DBGMASK_NONE 0x0000 -#define DBGMASK_USBMUX (1 << 1) -#define DBGMASK_LOCKDOWND (1 << 2) -#define DBGMASK_MOBILESYNC (1 << 3) +#define DBGMASK_LOCKDOWND (1 << 1) +#define DBGMASK_MOBILESYNC (1 << 2) void iphone_set_debug_mask(uint16_t mask); void iphone_set_debug_level(int level); -- cgit v1.1-32-gdbae From 19a28b0ed18c8ca2f855e7d129ddcdb8c939a707 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 23:51:53 +0200 Subject: Use iphone_device_get_uuid() not lockdown, for less overhead where possible --- include/libiphone/libiphone.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index b8c1c59..9764a7e 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -71,6 +71,7 @@ iphone_error_t iphone_get_device(iphone_device_t *device); iphone_error_t iphone_get_device_by_uuid(iphone_device_t *device, const char *uuid); iphone_error_t iphone_free_device(iphone_device_t device); uint32_t iphone_get_device_handle(iphone_device_t device); +iphone_error_t iphone_device_get_uuid(iphone_device_t device, char **uuid); #ifdef __cplusplus } -- cgit v1.1-32-gdbae From f5e9d76ebd74999512ab73f44fabba86879b1c1f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 02:40:25 +0200 Subject: Update lockdown API and introduce new error codes --- include/libiphone/libiphone.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 9764a7e..895e809 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -32,7 +32,7 @@ extern "C" { #include #include -//general errors +/* Error Codes */ #define IPHONE_E_SUCCESS 0 #define IPHONE_E_INVALID_ARG -1 #define IPHONE_E_UNKNOWN_ERROR -2 @@ -41,14 +41,6 @@ extern "C" { #define IPHONE_E_NOT_ENOUGH_DATA -5 #define IPHONE_E_BAD_HEADER -6 -//lockdownd specific error -#define IPHONE_E_INVALID_CONF -7 -#define IPHONE_E_PAIRING_FAILED -8 -#define IPHONE_E_SSL_ERROR -9 -#define IPHONE_E_PLIST_ERROR -10 -#define IPHONE_E_DICT_ERROR -11 -#define IPHONE_E_START_SERVICE_FAILED -12 - //afc specific error #define IPHONE_E_AFC_ERROR -13 -- cgit v1.1-32-gdbae From 5cb9ecc85240102402082c442d561d7350732027 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 02:54:40 +0200 Subject: Follow glib style and rename iphone_free_device to iphone_device_free --- include/libiphone/libiphone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 895e809..7974526 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -58,10 +58,10 @@ typedef struct iphone_device_int *iphone_device_t; void iphone_set_debug_mask(uint16_t mask); void iphone_set_debug_level(int level); -//device related functions +/* Interface */ iphone_error_t iphone_get_device(iphone_device_t *device); iphone_error_t iphone_get_device_by_uuid(iphone_device_t *device, const char *uuid); -iphone_error_t iphone_free_device(iphone_device_t device); +iphone_error_t iphone_device_free(iphone_device_t device); uint32_t iphone_get_device_handle(iphone_device_t device); iphone_error_t iphone_device_get_uuid(iphone_device_t device, char **uuid); -- cgit v1.1-32-gdbae From 1cfc2748d38eb97100cabced3b282108898099c2 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 03:07:01 +0200 Subject: Rename iphone_get_device_handle to iphone_device_get_handle and update tools --- include/libiphone/libiphone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 7974526..61820e0 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -62,7 +62,7 @@ void iphone_set_debug_level(int level); iphone_error_t iphone_get_device(iphone_device_t *device); iphone_error_t iphone_get_device_by_uuid(iphone_device_t *device, const char *uuid); iphone_error_t iphone_device_free(iphone_device_t device); -uint32_t iphone_get_device_handle(iphone_device_t device); +iphone_error_t iphone_device_get_handle(iphone_device_t device, uint32_t *handle); iphone_error_t iphone_device_get_uuid(iphone_device_t device, char **uuid); #ifdef __cplusplus -- cgit v1.1-32-gdbae From 50be30047dbb0d38fd8d61763c13ec75d2b52543 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 03:26:39 +0200 Subject: Update AFC API and use error codes from the STATUS operation response --- include/libiphone/libiphone.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 61820e0..014c8bf 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -37,12 +37,8 @@ extern "C" { #define IPHONE_E_INVALID_ARG -1 #define IPHONE_E_UNKNOWN_ERROR -2 #define IPHONE_E_NO_DEVICE -3 -#define IPHONE_E_TIMEOUT -4 -#define IPHONE_E_NOT_ENOUGH_DATA -5 -#define IPHONE_E_BAD_HEADER -6 - -//afc specific error -#define IPHONE_E_AFC_ERROR -13 +#define IPHONE_E_NOT_ENOUGH_DATA -4 +#define IPHONE_E_BAD_HEADER -5 typedef int16_t iphone_error_t; -- cgit v1.1-32-gdbae From da94f0ebc7232e8e9d0e629fe559b7bc93d9a1c6 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 18:12:49 +0200 Subject: Update doxygen config and allow generation of documentation --- include/libiphone/libiphone.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/libiphone/libiphone.h') diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h index 014c8bf..1451f15 100644 --- a/include/libiphone/libiphone.h +++ b/include/libiphone/libiphone.h @@ -1,6 +1,7 @@ -/* - * libiphone.h - * Main include of libiphone +/** + * @file libiphone/libiphone.h + * @brief Common code and device handling + * \internal * * Copyright (c) 2008 Jonathan Beck All Rights Reserved. * -- cgit v1.1-32-gdbae