summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/device.c34
-rw-r--r--src/device.h2
-rw-r--r--src/gui.c2
-rw-r--r--src/main.c16
5 files changed, 28 insertions, 30 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index fe69ce7..a7e0778 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
AM_CFLAGS = \
$(GLOBAL_CFLAGS) \
- $(libiphone_CFLAGS) \
+ $(libimobiledevice_CFLAGS) \
$(libglib2_CFLAGS) \
$(libgthread2_CFLAGS) \
$(libplist_CFLAGS) \
@@ -11,7 +11,7 @@ AM_CFLAGS = \
-DSBMGR_DATA=\"$(pkgdatadir)\"
AM_LDFLAGS = \
- $(libiphone_LIBS) \
+ $(libimobiledevice_LIBS) \
$(libglib2_LIBS) \
$(libgthread2_LIBS) \
$(libplist_LIBS) \
diff --git a/src/device.c b/src/device.c
index bf2f2a2..b24757b 100644
--- a/src/device.c
+++ b/src/device.c
@@ -32,35 +32,35 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
-#include <libiphone/libiphone.h>
-#include <libiphone/lockdown.h>
-#include <libiphone/sbservices.h>
+#include <libimobiledevice/libimobiledevice.h>
+#include <libimobiledevice/lockdown.h>
+#include <libimobiledevice/sbservices.h>
#include "device.h"
-static GMutex *libiphone_mutex = NULL;
+static GMutex *idevice_mutex = NULL;
static GQuark device_domain = 0;
void device_init()
{
- libiphone_mutex = g_mutex_new();
- device_domain = g_quark_from_string("libiphone");
+ idevice_mutex = g_mutex_new();
+ device_domain = g_quark_from_string("libimobiledevice");
}
sbservices_client_t device_sbs_new(const char *uuid, GError **error)
{
sbservices_client_t sbc = NULL;
- iphone_device_t phone = NULL;
+ idevice_t phone = NULL;
lockdownd_client_t client = NULL;
uint16_t port = 0;
printf("%s: %s\n", __func__, uuid);
- g_mutex_lock(libiphone_mutex);
- if (IPHONE_E_SUCCESS != iphone_device_new(&phone, uuid)) {
+ g_mutex_lock(idevice_mutex);
+ if (IDEVICE_E_SUCCESS != idevice_new(&phone, uuid)) {
if (error)
*error = g_error_new(device_domain, ENODEV, _("No device found, is it plugged in?"));
- g_mutex_unlock(libiphone_mutex);
+ g_mutex_unlock(idevice_mutex);
return sbc;
}
@@ -85,8 +85,8 @@ sbservices_client_t device_sbs_new(const char *uuid, GError **error)
if (client) {
lockdownd_client_free(client);
}
- iphone_device_free(phone);
- g_mutex_unlock(libiphone_mutex);
+ idevice_free(phone);
+ g_mutex_unlock(idevice_mutex);
return sbc;
}
@@ -206,7 +206,7 @@ gboolean device_get_info(const char *uuid, device_info_t *device_info, GError **
{
uint64_t interval = 60;
plist_t node = NULL;
- iphone_device_t phone = NULL;
+ idevice_t phone = NULL;
lockdownd_client_t client = NULL;
gboolean res = FALSE;
@@ -218,8 +218,8 @@ gboolean device_get_info(const char *uuid, device_info_t *device_info, GError **
printf("%s\n", __func__);
- g_mutex_lock(libiphone_mutex);
- if (IPHONE_E_SUCCESS != iphone_device_new(&phone, uuid)) {
+ g_mutex_lock(idevice_mutex);
+ if (IDEVICE_E_SUCCESS != idevice_new(&phone, uuid)) {
*error = g_error_new(device_domain, ENODEV, _("No device found, is it plugged in?"));
goto leave_cleanup;
}
@@ -290,8 +290,8 @@ gboolean device_get_info(const char *uuid, device_info_t *device_info, GError **
if (client) {
lockdownd_client_free(client);
}
- iphone_device_free(phone);
- g_mutex_unlock(libiphone_mutex);
+ idevice_free(phone);
+ g_mutex_unlock(idevice_mutex);
return res;
}
diff --git a/src/device.h b/src/device.h
index 1fa7c4b..cfe4d54 100644
--- a/src/device.h
+++ b/src/device.h
@@ -25,7 +25,7 @@
#ifndef DEVICE_H
#define DEVICE_H
#include <glib.h>
-#include <libiphone/sbservices.h>
+#include <libimobiledevice/sbservices.h>
struct device_info_int {
char *uuid;
diff --git a/src/gui.c b/src/gui.c
index e7466d0..6538e79 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -29,8 +29,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <libiphone/libiphone.h>
-#include <libiphone/sbservices.h>
#include <plist/plist.h>
#include <time.h>
#include <sys/time.h>
diff --git a/src/main.c b/src/main.c
index 2246c29..c83cc84 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,8 +28,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <libiphone/libiphone.h>
-#include <libiphone/sbservices.h>
+#include <libimobiledevice/libimobiledevice.h>
+#include <libimobiledevice/sbservices.h>
#include <plist/plist.h>
#include <time.h>
#include <sys/time.h>
@@ -130,7 +130,7 @@ static void quit_program_cb(GtkWidget *widget, gpointer user_data)
{
/* cleanup */
sbmgr_finalize();
- iphone_event_unsubscribe();
+ idevice_event_unsubscribe();
gtk_main_quit();
}
@@ -156,9 +156,9 @@ static gpointer device_add_cb(gpointer user_data)
return NULL;
}
-static void device_event_cb(const iphone_event_t *event, void *user_data)
+static void device_event_cb(const idevice_event_t *event, void *user_data)
{
- if (event->event == IPHONE_DEVICE_ADD) {
+ if (event->event == IDEVICE_DEVICE_ADD) {
if (!current_uuid && (!match_uuid || !strcasecmp(match_uuid, event->uuid))) {
debug_printf("Device add event: adding device %s\n", event->uuid);
current_uuid = g_strdup(event->uuid);
@@ -166,7 +166,7 @@ static void device_event_cb(const iphone_event_t *event, void *user_data)
} else {
debug_printf("Device add event: ignoring device %s\n", event->uuid);
}
- } else if (event->event == IPHONE_DEVICE_REMOVE) {
+ } else if (event->event == IDEVICE_DEVICE_REMOVE) {
if (current_uuid && !strcasecmp(current_uuid, event->uuid)) {
debug_printf("Device remove event: removing device %s\n", event->uuid);
free(current_uuid);
@@ -252,7 +252,7 @@ static void wnd_init()
g_signal_connect(main_window, "hide", G_CALLBACK(quit_program_cb), NULL);
/* get notified when plug in/out events occur */
- iphone_event_subscribe(device_event_cb, NULL);
+ idevice_event_subscribe(device_event_cb, NULL);
}
/* main */
@@ -277,7 +277,7 @@ int main(int argc, char **argv)
/* parse cmdline args */
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
- iphone_set_debug_level(1);
+ idevice_set_debug_level(1);
continue;
} else if (!strcmp(argv[i], "-D") || !strcmp(argv[i], "--debug-app")) {
set_debug(TRUE);