commit a446197aa05a0ff494db84c6e6f280a9567f6cea
Author: Christophe Fergeau <[email protected]>
Date: Wed Oct 28 10:05:20 2009 +0100
adjust to libiphone API changes
configure.ac | 4 ++++
src/itdb_iphone.c | 8 ++++++--
tools/ipod-lockdown.c | 5 ++++-
3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 704644c..30a7cd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,10 @@ if test "x$with_libiphone" != "xno"; then
fi
if test "x$enable_libiphone" = "xyes"; then
+ AC_CHECK_LIB([libiphone], [iphone_device_new], [libiphone_1_0=yes],
[libiphone10=no])
+ if test x"$libiphone_1_0" = xyes; then
+ AC_DEFINE([HAVE_LIBIPHONE_1_0], 1, [Define if libiphone is using
its newer API])
+ fi
AC_DEFINE(HAVE_LIBIPHONE, 1, [Define if you have libiphone support])
AC_SUBST(LIBIPHONE_CFLAGS)
AC_SUBST(LIBIPHONE_LIBS)
diff --git a/src/itdb_iphone.c b/src/itdb_iphone.c
index fc8aebe..2cd3963 100644
--- a/src/itdb_iphone.c
+++ b/src/itdb_iphone.c
@@ -92,8 +92,12 @@ int itdb_iphone_start_sync(Itdb_Device *device, void
**prepdata)
*prepdata = NULL;
pdata_loc = g_new0 (struct itdbprep_int, 1);
-
- if (IPHONE_E_SUCCESS != iphone_get_device_by_uuid(&pdata_loc->device,
uuid)) {
+#ifdef HAVE_LIBIPHONE_1_0
+ res = iphone_device_new(&pdata_loc->device, uuid);
+#else
+ res = iphone_get_device_by_uuid(&pdata_loc->device, uuid);
+#endif
+ if (IPHONE_E_SUCCESS != res) {
fprintf(stderr, "No iPhone found, is it plugged in?\n");
res = -ENODEV;
goto leave_with_err;
diff --git a/tools/ipod-lockdown.c b/tools/ipod-lockdown.c
index f831494..5ee8f77 100644
--- a/tools/ipod-lockdown.c
+++ b/tools/ipod-lockdown.c
@@ -47,8 +47,11 @@ read_sysinfo_extended_by_uuid (const char *uuid)
plist_t value = NULL;
plist_t global = NULL;
plist_t ptr = NULL;
-
+#ifdef HAVE_LIBIPHONE_1_0
+ ret = iphone_device_new(&device, uuid);
+#else
ret = iphone_get_device_by_uuid(&device, uuid);
+#endif
if (ret != IPHONE_E_SUCCESS) {
printf("No device found with uuid %s, is it plugged in?\n",
uuid);
return NULL;
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2