summaryrefslogtreecommitdiffstats
path: root/swig
diff options
context:
space:
mode:
Diffstat (limited to 'swig')
-rw-r--r--swig/Makefile.am32
-rw-r--r--swig/imobiledevice.i (renamed from swig/iphone.i)66
2 files changed, 49 insertions, 49 deletions
diff --git a/swig/Makefile.am b/swig/Makefile.am
index ef87733..6852aad 100644
--- a/swig/Makefile.am
+++ b/swig/Makefile.am
@@ -1,33 +1,33 @@
1INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir) 1INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir)
2 2
3if HAVE_SWIG 3if HAVE_SWIG
4BUILT_SOURCES = iphone_wrap.cxx 4BUILT_SOURCES = imobiledevice_wrap.cxx
5SWIG_SOURCES = iphone.i 5SWIG_SOURCES = imobiledevice.i
6 6
7CLEANFILES = \ 7CLEANFILES = \
8 *.pyc \ 8 *.pyc \
9 *.pyo \ 9 *.pyo \
10 _iphone.so \ 10 _imobiledevice.so \
11 iphone.py \ 11 imobiledevice.py \
12 iphone_wrap.cxx 12 imobiledevice_wrap.cxx
13 13
14EXTRA_DIST = \ 14EXTRA_DIST = \
15 __init__.py \ 15 __init__.py \
16 iphone.i 16 imobiledevice.i
17 17
18swigincludedir =$(includedir)/libiphone/swig 18swigincludedir =$(includedir)/libimobiledevice/swig
19swiginclude_HEADERS = $(SWIG_SOURCES) 19swiginclude_HEADERS = $(SWIG_SOURCES)
20 20
21iphonedir = $(pyexecdir)/iphone 21imobiledevicedir = $(pyexecdir)/imobiledevice
22iphone_PYTHON = __init__.py 22imobiledevice_PYTHON = __init__.py
23nodist_iphone_PYTHON = iphone.py 23nodist_imobiledevice_PYTHON = imobiledevice.py
24iphone_LTLIBRARIES = _iphone.la 24imobiledevice_LTLIBRARIES = _imobiledevice.la
25nodist__iphone_la_SOURCES = iphone_wrap.cxx $(SWIG_SOURCES) 25nodist__imobiledevice_la_SOURCES = imobiledevice_wrap.cxx $(SWIG_SOURCES)
26_iphone_la_CFLAGS = $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src 26_imobiledevice_la_CFLAGS = $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src
27_iphone_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) 27_imobiledevice_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
28_iphone_la_LIBADD = $(top_builddir)/src/libiphone.la $(libplistmm_LIBS) 28_imobiledevice_la_LIBADD = $(top_builddir)/src/libimobiledevice.la $(libplistmm_LIBS)
29 29
30iphone_wrap.cxx : $(SWIG_SOURCES) 30imobiledevice_wrap.cxx : $(SWIG_SOURCES)
31 $(SWIG) $(SWIG_PYTHON_OPT) $(INCLUDES) -I$(top_srcdir)/src -o $@ $< 31 $(SWIG) $(SWIG_PYTHON_OPT) $(INCLUDES) -I$(top_srcdir)/src -o $@ $<
32 32
33endif # HAVE_SWIG 33endif # HAVE_SWIG
diff --git a/swig/iphone.i b/swig/imobiledevice.i
index 81ef488..f978c8e 100644
--- a/swig/iphone.i
+++ b/swig/imobiledevice.i
@@ -1,31 +1,31 @@
1 /* swig.i */ 1 /* swig.i */
2 %module iphone 2 %module imobiledevice
3 %feature("autodoc", "1"); 3 %feature("autodoc", "1");
4 %{ 4 %{
5 /* Includes the header in the wrapper code */ 5 /* Includes the header in the wrapper code */
6 #include <libiphone/libiphone.h> 6 #include <libimobiledevice/libimobiledevice.h>
7 #include <libiphone/lockdown.h> 7 #include <libimobiledevice/lockdown.h>
8 #include <libiphone/mobilesync.h> 8 #include <libimobiledevice/mobilesync.h>
9 #include <plist/plist.h> 9 #include <plist/plist.h>
10 #include <plist/plist++.h> 10 #include <plist/plist++.h>
11 #include "../src/debug.h" 11 #include "../src/debug.h"
12 typedef struct { 12 typedef struct {
13 iphone_device_t dev; 13 idevice_t dev;
14 } iPhone; 14 } idevice;
15 15
16 typedef struct { 16 typedef struct {
17 iPhone* dev; 17 idevice* dev;
18 lockdownd_client_t client; 18 lockdownd_client_t client;
19 } Lockdownd; 19 } Lockdownd;
20 20
21 typedef struct { 21 typedef struct {
22 iPhone* dev; 22 idevice* dev;
23 mobilesync_client_t client; 23 mobilesync_client_t client;
24 } MobileSync; 24 } MobileSync;
25 25
26//now declare funtions to handle creation and deletion of objects 26//now declare funtions to handle creation and deletion of objects
27void my_delete_iPhone(iPhone* dev); 27void my_delete_idevice(idevice* dev);
28Lockdownd* my_new_Lockdownd(iPhone* phone); 28Lockdownd* my_new_Lockdownd(idevice* device);
29void my_delete_Lockdownd(Lockdownd* lckd); 29void my_delete_Lockdownd(Lockdownd* lckd);
30MobileSync* my_new_MobileSync(Lockdownd* lckd); 30MobileSync* my_new_MobileSync(Lockdownd* lckd);
31PList::Node* new_node_from_plist(plist_t node); 31PList::Node* new_node_from_plist(plist_t node);
@@ -37,16 +37,16 @@ PList::Node* new_node_from_plist(plist_t node);
37%include "plist/swig/plist.i" 37%include "plist/swig/plist.i"
38 38
39typedef struct { 39typedef struct {
40 iphone_device_t dev; 40 idevice_t dev;
41} iPhone; 41} idevice;
42 42
43typedef struct { 43typedef struct {
44 iPhone* dev; 44 idevice* dev;
45 lockdownd_client_t client; 45 lockdownd_client_t client;
46} Lockdownd; 46} Lockdownd;
47 47
48typedef struct { 48typedef struct {
49 iPhone* dev; 49 idevice* dev;
50 mobilesync_client_t client; 50 mobilesync_client_t client;
51} MobileSync; 51} MobileSync;
52 52
@@ -54,19 +54,19 @@ typedef struct {
54//now define funtions to handle creation and deletion of objects 54//now define funtions to handle creation and deletion of objects
55 55
56 56
57void my_delete_iPhone(iPhone* dev) { 57void my_delete_idevice(idevice* dev) {
58 if (dev) { 58 if (dev) {
59 iphone_device_free(dev->dev); 59 idevice_free(dev->dev);
60 free(dev); 60 free(dev);
61 } 61 }
62} 62}
63 63
64Lockdownd* my_new_Lockdownd(iPhone* phone) { 64Lockdownd* my_new_Lockdownd(idevice* device) {
65 if (!phone) return NULL; 65 if (!device) return NULL;
66 Lockdownd* client = (Lockdownd*) malloc(sizeof(Lockdownd)); 66 Lockdownd* client = (Lockdownd*) malloc(sizeof(Lockdownd));
67 client->dev = phone; 67 client->dev = device;
68 client->client = NULL; 68 client->client = NULL;
69 if (LOCKDOWN_E_SUCCESS == lockdownd_client_new_with_handshake(phone->dev , &(client->client), NULL)) { 69 if (LOCKDOWN_E_SUCCESS == lockdownd_client_new_with_handshake(device->dev , &(client->client), NULL)) {
70 return client; 70 return client;
71 } 71 }
72 else { 72 else {
@@ -133,29 +133,29 @@ PList::Node* new_node_from_plist(plist_t node)
133%} 133%}
134 134
135 135
136%extend iPhone { // Attach these functions to struct iPhone 136%extend idevice { // Attach these functions to struct idevice
137 iPhone() { 137 idevice() {
138 iPhone* phone = (iPhone*) malloc(sizeof(iPhone)); 138 idevice* device = (idevice*) malloc(sizeof(idevice));
139 phone->dev = NULL; 139 device->dev = NULL;
140 return phone; 140 return device;
141 } 141 }
142 142
143 ~iPhone() { 143 ~idevice() {
144 my_delete_iPhone($self); 144 my_delete_idevice($self);
145 } 145 }
146 146
147 void set_debug_level(int level) { 147 void set_debug_level(int level) {
148 iphone_set_debug_level(level); 148 idevice_set_debug_level(level);
149 } 149 }
150 150
151 int init_device_by_uuid(char* uuid) { 151 int init_device_by_uuid(char* uuid) {
152 if (IPHONE_E_SUCCESS == iphone_device_new(&($self->dev), uuid)) 152 if (IDEVICE_E_SUCCESS == idevice_new(&($self->dev), uuid))
153 return 1; 153 return 1;
154 return 0; 154 return 0;
155 } 155 }
156 156
157 int init_device() { 157 int init_device() {
158 if (IPHONE_E_SUCCESS == iphone_device_new(&($self->dev), NULL)) 158 if (IDEVICE_E_SUCCESS == idevice_new(&($self->dev), NULL))
159 return 1; 159 return 1;
160 return 0; 160 return 0;
161 } 161 }
@@ -163,7 +163,7 @@ PList::Node* new_node_from_plist(plist_t node)
163 %newobject get_uuid; 163 %newobject get_uuid;
164 char* get_uuid(){ 164 char* get_uuid(){
165 char* uuid = NULL; 165 char* uuid = NULL;
166 iphone_device_get_uuid($self->dev, &uuid); 166 idevice_get_uuid($self->dev, &uuid);
167 return uuid; 167 return uuid;
168 } 168 }
169 169
@@ -174,8 +174,8 @@ PList::Node* new_node_from_plist(plist_t node)
174 174
175 175
176%extend Lockdownd { // Attach these functions to struct Lockdownd 176%extend Lockdownd { // Attach these functions to struct Lockdownd
177 Lockdownd(iPhone* phone) { 177 Lockdownd(idevice* device) {
178 return my_new_Lockdownd(phone); 178 return my_new_Lockdownd(device);
179 } 179 }
180 180
181 ~Lockdownd() { 181 ~Lockdownd() {