summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/iphone.c19
-rw-r--r--src/iphone.h2
2 files changed, 11 insertions, 10 deletions
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <errno.h>
-#include <libiphone/libiphone.h>
+
+#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 <stdint.h>
+#include "libiphone/libiphone.h"
+
struct iphone_device_int {
char *buffer;
uint32_t handle;