From 7adc81dddd764b0ef76fefd73852b835d3211b9b Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 28 Nov 2009 04:33:24 +0100 Subject: uint32_t type fixes for afc_file_read/afc_file_write This patch also adapts all corresponding internal functions. The buffer lengths are now consistently handled as uint32_t. --- include/libiphone/afc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/libiphone/afc.h b/include/libiphone/afc.h index 1c714c9..94eb02e 100644 --- a/include/libiphone/afc.h +++ b/include/libiphone/afc.h @@ -95,8 +95,8 @@ afc_error_t afc_get_file_info(afc_client_t client, const char *filename, char ** afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle); afc_error_t afc_file_close(afc_client_t client, uint64_t handle); afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation); -afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, int length, uint32_t *bytes); -afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, int length, uint32_t *bytes); +afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read); +afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written); afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence); afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position); afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize); -- cgit v1.1-32-gdbae From fe239d46809996def06502d55f8b34b46e475e53 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 28 Nov 2009 04:50:01 +0100 Subject: afc_truncate: use uint64_t instead of off_t This makes afc_truncate look more like afc_file_truncate which is also using uint64_t for the file size. [#82 state:resolved] Signed-off-by: Matt Colyer --- include/libiphone/afc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/libiphone/afc.h b/include/libiphone/afc.h index 94eb02e..7eff678 100644 --- a/include/libiphone/afc.h +++ b/include/libiphone/afc.h @@ -103,7 +103,7 @@ afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t new afc_error_t afc_remove_path(afc_client_t client, const char *path); afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to); afc_error_t afc_make_directory(afc_client_t client, const char *dir); -afc_error_t afc_truncate(afc_client_t client, const char *path, off_t newsize); +afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize); afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname); afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime); -- cgit v1.1-32-gdbae From 213025d04ae8788be393b63e245f2805386f7f8a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 7 Dec 2009 18:07:56 +0100 Subject: fix signature of lockdownd_stop_session This removes the session_id parameter from lockdownd_stop_session because the session_id is stored in the lockdownd_client_int structure anyway. --- include/libiphone/lockdown.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index af58190..daa5800 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -60,7 +60,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port); -lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id); +lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client); lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *host_id); -- cgit v1.1-32-gdbae From b9ecd70c30ac1fd7024cadfcda9c7be1d1f7f44f Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 7 Dec 2009 18:58:55 +0100 Subject: cache device uuid in client struct When accessing/storing key info with userprefs, a device uuid is required that makes it possible to distinguish between different devices. On execution of lockdownd_client_new, the uuid is queried via lockdown and now stored in the client struct for later reuse. This patch also removes the uuid parameter from lockdownd_pair(). --- include/libiphone/lockdown.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index daa5800..e6b75da 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -63,7 +63,7 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client); lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); -lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *host_id); +lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *host_id); lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); -- cgit v1.1-32-gdbae From 318cc4f7b336109819c7b4c6a1a9f2e8d37d9bed Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 7 Dec 2009 19:27:54 +0100 Subject: New function lockdownd_validate_pair() This function allows the current host (or the host specified by the given HostID to become the trusted host of the device. [#89 state:resolved] Signed-off-by: Matt Colyer --- include/libiphone/lockdown.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index e6b75da..31ffeab 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -64,6 +64,7 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client); lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *host_id); +lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, char *host_id); lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); -- cgit v1.1-32-gdbae