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 --- src/iphone.c | 19 +++++++++---------- src/iphone.h | 2 ++ 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/iphone.c b/src/iphone.c index bdabc35..e694373 100644 --- a/src/iphone.c +++ b/src/iphone.c @@ -19,13 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "iphone.h" -#include "utils.h" #include #include #include -#include -#include + +#include "iphone.h" +#include "utils.h" /** * Retrieves a list of connected devices from usbmuxd and matches their @@ -95,13 +94,13 @@ iphone_error_t iphone_get_device(iphone_device_t * device) return iphone_get_device_by_uuid(device, NULL); } -uint32_t iphone_get_device_handle(iphone_device_t device) +iphone_error_t iphone_device_get_handle(iphone_device_t device, uint32_t *handle) { - if (device) { - return device->handle; - } else { - return 0; - } + if (!device) + return IPHONE_E_INVALID_ARG; + + *handle = device->handle; + return IPHONE_E_SUCCESS; } iphone_error_t iphone_device_get_uuid(iphone_device_t device, char **uuid) diff --git a/src/iphone.h b/src/iphone.h index 2ed0fba..6e14280 100644 --- a/src/iphone.h +++ b/src/iphone.h @@ -24,6 +24,8 @@ #include +#include "libiphone/libiphone.h" + struct iphone_device_int { char *buffer; uint32_t handle; -- cgit v1.1-32-gdbae