summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/Makefile.am2
-rw-r--r--common/debug.c3
-rw-r--r--common/debug.h16
-rw-r--r--configure.ac7
-rw-r--r--dev/Makefile.am2
-rw-r--r--src/afc.c48
-rw-r--r--src/debugserver.c28
-rw-r--r--src/diagnostics_relay.c22
-rw-r--r--src/file_relay.c10
-rw-r--r--src/heartbeat.c12
-rw-r--r--src/house_arrest.c14
-rw-r--r--src/idevice.c31
-rw-r--r--src/idevice.h10
-rw-r--r--src/installation_proxy.c30
-rw-r--r--src/lockdown.c53
-rw-r--r--src/misagent.c14
-rw-r--r--src/mobile_image_mounter.c14
-rw-r--r--src/mobilebackup.c24
-rw-r--r--src/mobilebackup2.c20
-rw-r--r--src/mobilesync.c42
-rw-r--r--src/notification_proxy.c14
-rw-r--r--src/property_list_service.c16
-rw-r--r--src/restore.c23
-rw-r--r--src/sbservices.c16
-rw-r--r--src/screenshotr.c8
-rw-r--r--src/service.c16
-rw-r--r--src/syslog_relay.c14
-rw-r--r--src/webinspector.c12
28 files changed, 263 insertions, 258 deletions
diff --git a/common/Makefile.am b/common/Makefile.am
index b5ea6c1..eb1db28 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusbmuxd_CFLAGS) $(libplist_CFLAGS) $(LFS_CFLAGS)
AM_LDFLAGS = $(libusbmuxd_LIBS) $(libplist_LIBS) ${libpthread_LIBS}
diff --git a/common/debug.c b/common/debug.c
index 2cc9db1..a7e33df 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -32,6 +32,7 @@
#include <time.h>
#include "debug.h"
+#include "idevice.h"
#include "libimobiledevice/libimobiledevice.h"
#ifndef STRIP_DEBUG_CODE
@@ -46,7 +47,7 @@ int debug_level = 0;
*
* @param level Set to 0 for no debugging or 1 for debugging.
*/
-void idevice_set_debug_level(int level)
+LIBIMOBILEDEVICE_API void idevice_set_debug_level(int level)
{
debug_level = level;
}
diff --git a/common/debug.h b/common/debug.h
index 3a66ee4..99a94b7 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -25,14 +25,6 @@
#include <plist/plist.h>
-#ifndef LIBIMOBILEDEVICE_INTERNAL
-#ifdef WIN32
-#define LIBIMOBILEDEVICE_INTERNAL
-#else
-#define LIBIMOBILEDEVICE_INTERNAL __attribute__((visibility("hidden")))
-#endif
-#endif
-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE)
#define debug_info(...) debug_info_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
#define debug_plist(a) debug_plist_real (__func__, __FILE__, __LINE__, a)
@@ -44,14 +36,14 @@
#define debug_plist(a)
#endif
-LIBIMOBILEDEVICE_INTERNAL void debug_info_real(const char *func,
+void debug_info_real(const char *func,
const char *file,
int line,
const char *format, ...);
-LIBIMOBILEDEVICE_INTERNAL void debug_buffer(const char *data, const int length);
-LIBIMOBILEDEVICE_INTERNAL void debug_buffer_to_file(const char *file, const char *data, const int length);
-LIBIMOBILEDEVICE_INTERNAL void debug_plist_real(const char *func,
+void debug_buffer(const char *data, const int length);
+void debug_buffer_to_file(const char *file, const char *data, const int length);
+void debug_plist_real(const char *func,
const char *file,
int line,
plist_t plist);
diff --git a/configure.ac b/configure.ac
index 6e3e058..0e335f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,9 +188,14 @@ else
building_debug_code=yes
fi
-AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fsigned-char")
+AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fsigned-char -fvisibility=hidden")
AC_SUBST(GLOBAL_CFLAGS)
+case "$GLOBAL_CFLAGS" in
+ *-fvisibility=hidden*)
+ AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden])
+esac
+
# check for large file support
AC_SYS_LARGEFILE
LFS_CFLAGS=''
diff --git a/dev/Makefile.am b/dev/Makefile.am
index 3815af6..89ef75b 100644
--- a/dev/Makefile.am
+++ b/dev/Makefile.am
@@ -18,7 +18,7 @@ lckd_client_LDADD = $(top_builddir)/src/libimobiledevice.la
afccheck_SOURCES = afccheck.c
afccheck_CFLAGS = -I$(top_srcdir) $(AM_CFLAGS)
-afccheck_LDFLAGS = $(AM_LDFLAGS)
+afccheck_LDFLAGS = $(top_builddir)/common/libinternalcommon.la $(AM_LDFLAGS)
afccheck_LDADD = $(top_builddir)/src/libimobiledevice.la
filerelaytest_SOURCES = filerelaytest.c
diff --git a/src/afc.c b/src/afc.c
index 2e2d62c..d6890e4 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -68,7 +68,7 @@ static void afc_unlock(afc_client_t client)
* invalid, or AFC_E_NO_MEM if there is a memory allocation problem.
*/
-afc_error_t afc_client_new_with_service_client(service_client_t service_client, afc_client_t *client)
+LIBIMOBILEDEVICE_API afc_error_t afc_client_new_with_service_client(service_client_t service_client, afc_client_t *client)
{
if (!service_client)
return AFC_E_INVALID_ARG;
@@ -96,7 +96,7 @@ afc_error_t afc_client_new_with_service_client(service_client_t service_client,
return AFC_E_SUCCESS;
}
-afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t * client)
+LIBIMOBILEDEVICE_API afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t * client)
{
if (!device || !service || service->port == 0)
return AFC_E_INVALID_ARG;
@@ -115,14 +115,14 @@ afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t serv
return err;
}
-afc_error_t afc_client_start_service(idevice_t device, afc_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API afc_error_t afc_client_start_service(idevice_t device, afc_client_t * client, const char* label)
{
afc_error_t err = AFC_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, AFC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(afc_client_new), &err);
return err;
}
-afc_error_t afc_client_free(afc_client_t client)
+LIBIMOBILEDEVICE_API afc_error_t afc_client_free(afc_client_t client)
{
if (!client || !client->afc_packet)
return AFC_E_INVALID_ARG;
@@ -402,7 +402,7 @@ static char **make_strings_list(char *tokens, uint32_t length)
return list;
}
-afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information)
+LIBIMOBILEDEVICE_API afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information)
{
uint32_t bytes = 0;
char *data = NULL, **list_loc = NULL;
@@ -438,7 +438,7 @@ afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***di
return ret;
}
-afc_error_t afc_get_device_info(afc_client_t client, char ***device_information)
+LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info(afc_client_t client, char ***device_information)
{
uint32_t bytes = 0;
char *data = NULL, **list = NULL;
@@ -475,7 +475,7 @@ afc_error_t afc_get_device_info(afc_client_t client, char ***device_information)
return ret;
}
-afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value)
+LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value)
{
afc_error_t ret = AFC_E_INTERNAL_ERROR;
char **kvps, **ptr;
@@ -502,7 +502,7 @@ afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char *
return ret;
}
-afc_error_t afc_remove_path(afc_client_t client, const char *path)
+LIBIMOBILEDEVICE_API afc_error_t afc_remove_path(afc_client_t client, const char *path)
{
uint32_t bytes = 0;
afc_error_t ret = AFC_E_UNKNOWN_ERROR;
@@ -530,7 +530,7 @@ afc_error_t afc_remove_path(afc_client_t client, const char *path)
return ret;
}
-afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to)
+LIBIMOBILEDEVICE_API afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to)
{
if (!client || !from || !to || !client->afc_packet || !client->parent)
return AFC_E_INVALID_ARG;
@@ -559,7 +559,7 @@ afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *t
return ret;
}
-afc_error_t afc_make_directory(afc_client_t client, const char *path)
+LIBIMOBILEDEVICE_API afc_error_t afc_make_directory(afc_client_t client, const char *path)
{
uint32_t bytes = 0;
afc_error_t ret = AFC_E_UNKNOWN_ERROR;
@@ -583,7 +583,7 @@ afc_error_t afc_make_directory(afc_client_t client, const char *path)
return ret;
}
-afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information)
+LIBIMOBILEDEVICE_API afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information)
{
char *received = NULL;
uint32_t bytes = 0;
@@ -613,7 +613,7 @@ afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***fil
return ret;
}
-afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle)
{
if (!client || !client->parent || !client->afc_packet)
return AFC_E_INVALID_ARG;
@@ -661,7 +661,7 @@ afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mo
return ret;
}
-afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read)
{
char *input = NULL;
uint32_t current_count = 0, bytes_loc = 0;
@@ -714,7 +714,7 @@ afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint
return ret;
}
-afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written)
{
uint32_t current_count = 0;
uint32_t bytes_loc = 0;
@@ -746,7 +746,7 @@ afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *dat
return ret;
}
-afc_error_t afc_file_close(afc_client_t client, uint64_t handle)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_close(afc_client_t client, uint64_t handle)
{
uint32_t bytes = 0;
afc_error_t ret = AFC_E_UNKNOWN_ERROR;
@@ -774,7 +774,7 @@ afc_error_t afc_file_close(afc_client_t client, uint64_t handle)
return ret;
}
-afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation)
{
uint32_t bytes = 0;
struct {
@@ -808,7 +808,7 @@ afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t op
return ret;
}
-afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence)
{
uint32_t bytes = 0;
struct {
@@ -841,7 +841,7 @@ afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset,
return ret;
}
-afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position)
{
char *buffer = NULL;
uint32_t bytes = 0;
@@ -874,7 +874,7 @@ afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *positi
return ret;
}
-afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize)
+LIBIMOBILEDEVICE_API afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize)
{
uint32_t bytes = 0;
struct {
@@ -905,7 +905,7 @@ afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t new
return ret;
}
-afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize)
+LIBIMOBILEDEVICE_API afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize)
{
if (!client || !path || !client->afc_packet || !client->parent)
return AFC_E_INVALID_ARG;
@@ -935,7 +935,7 @@ afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize
return ret;
}
-afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname)
+LIBIMOBILEDEVICE_API afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname)
{
if (!client || !target || !linkname || !client->afc_packet || !client->parent)
return AFC_E_INVALID_ARG;
@@ -969,7 +969,7 @@ afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const c
return ret;
}
-afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime)
+LIBIMOBILEDEVICE_API afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime)
{
if (!client || !path || !client->afc_packet || !client->parent)
return AFC_E_INVALID_ARG;
@@ -998,7 +998,7 @@ afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mt
return ret;
}
-afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path)
+LIBIMOBILEDEVICE_API afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path)
{
uint32_t bytes = 0;
afc_error_t ret = AFC_E_UNKNOWN_ERROR;
@@ -1022,7 +1022,7 @@ afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path)
return ret;
}
-afc_error_t afc_dictionary_free(char **dictionary)
+LIBIMOBILEDEVICE_API afc_error_t afc_dictionary_free(char **dictionary)
{
int i = 0;
diff --git a/src/debugserver.c b/src/debugserver.c
index 1e38698..b5ba9e1 100644
--- a/src/debugserver.c
+++ b/src/debugserver.c
@@ -60,7 +60,7 @@ static debugserver_error_t debugserver_error(service_error_t err)
return DEBUGSERVER_E_UNKNOWN_ERROR;
}
-debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_descriptor_t service, debugserver_client_t* client)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_descriptor_t service, debugserver_client_t* client)
{
*client = NULL;
@@ -88,14 +88,14 @@ debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_d
return 0;
}
-debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label)
{
debugserver_error_t err = DEBUGSERVER_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, DEBUGSERVER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err);
return err;
}
-debugserver_error_t debugserver_client_free(debugserver_client_t client)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_free(debugserver_client_t client)
{
if (!client)
return DEBUGSERVER_E_INVALID_ARG;
@@ -107,7 +107,7 @@ debugserver_error_t debugserver_client_free(debugserver_client_t client)
return err;
}
-debugserver_error_t debugserver_client_send(debugserver_client_t client, const char* data, uint32_t size, uint32_t *sent)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send(debugserver_client_t client, const char* data, uint32_t size, uint32_t *sent)
{
debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR;
int bytes = 0;
@@ -128,7 +128,7 @@ debugserver_error_t debugserver_client_send(debugserver_client_t client, const c
return res;
}
-debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
{
debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR;
int bytes = 0;
@@ -148,12 +148,12 @@ debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t
return res;
}
-debugserver_error_t debugserver_client_receive(debugserver_client_t client, char* data, uint32_t size, uint32_t *received)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive(debugserver_client_t client, char* data, uint32_t size, uint32_t *received)
{
return debugserver_client_receive_with_timeout(client, data, size, received, 1000);
}
-debugserver_error_t debugserver_command_new(const char* name, int argc, const char* argv[], debugserver_command_t* command)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, const char* argv[], debugserver_command_t* command)
{
int i;
debugserver_command_t tmp = (debugserver_command_t) malloc(sizeof(struct debugserver_command_private));
@@ -178,7 +178,7 @@ debugserver_error_t debugserver_command_new(const char* name, int argc, const ch
return DEBUGSERVER_E_SUCCESS;
}
-debugserver_error_t debugserver_command_free(debugserver_command_t command)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_free(debugserver_command_t command)
{
int i;
debugserver_error_t res = DEBUGSERVER_E_UNKNOWN_ERROR;
@@ -256,7 +256,7 @@ static int debugserver_response_is_checksum_valid(const char* response, uint32_t
return 1;
}
-void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32_t* encoded_length)
+LIBIMOBILEDEVICE_API void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32_t* encoded_length)
{
uint32_t position;
uint32_t index;
@@ -272,7 +272,7 @@ void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32
}
}
-void debugserver_decode_string(const char *encoded_buffer, size_t encoded_length, char** buffer)
+LIBIMOBILEDEVICE_API void debugserver_decode_string(const char *encoded_buffer, size_t encoded_length, char** buffer)
{
*buffer = malloc(sizeof(char) * ((encoded_length / 2)+1));
char* t = *buffer;
@@ -367,7 +367,7 @@ static int debugserver_client_receive_internal_check(debugserver_client_t client
return did_receive_char;
}
-debugserver_error_t debugserver_client_receive_response(debugserver_client_t client, char** response)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_response(debugserver_client_t client, char** response)
{
debugserver_error_t res = DEBUGSERVER_E_SUCCESS;
@@ -468,7 +468,7 @@ debugserver_error_t debugserver_client_receive_response(debugserver_client_t cli
return res;
}
-debugserver_error_t debugserver_client_send_command(debugserver_client_t client, debugserver_command_t command, char** response)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send_command(debugserver_client_t client, debugserver_command_t command, char** response)
{
debugserver_error_t res = DEBUGSERVER_E_SUCCESS;
int i;
@@ -533,7 +533,7 @@ cleanup:
return res;
}
-debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_client_t client, const char* env, char** response)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_client_t client, const char* env, char** response)
{
if (!client || !env)
return DEBUGSERVER_E_INVALID_ARG;
@@ -549,7 +549,7 @@ debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_c
return result;
}
-debugserver_error_t debugserver_client_set_argv(debugserver_client_t client, int argc, char* argv[], char** response)
+LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_argv(debugserver_client_t client, int argc, char* argv[], char** response)
{
if (!client || !argc)
return DEBUGSERVER_E_INVALID_ARG;
diff --git a/src/diagnostics_relay.c b/src/diagnostics_relay.c
index cc9c645..055f60a 100644
--- a/src/diagnostics_relay.c
+++ b/src/diagnostics_relay.c
@@ -69,7 +69,7 @@ static int diagnostics_relay_check_result(plist_t dict)
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client)
{
if (!device || !service || service->port == 0 || !client || *client) {
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -89,14 +89,14 @@ diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdow
return DIAGNOSTICS_RELAY_E_SUCCESS;
}
-diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t * client, const char* label)
{
diagnostics_relay_error_t err = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, DIAGNOSTICS_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(diagnostics_relay_client_new), &err);
return err;
}
-diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client)
{
if (!client)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -162,7 +162,7 @@ static diagnostics_relay_error_t diagnostics_relay_send(diagnostics_relay_client
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client)
{
if (!client)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -196,7 +196,7 @@ diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t c
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client)
{
if (!client)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -272,17 +272,17 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags)
{
return internal_diagnostics_relay_action(client, "Restart", flags);
}
-diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags)
{
return internal_diagnostics_relay_action(client, "Shutdown", flags);
}
-diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics)
{
if (!client || diagnostics == NULL)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -323,7 +323,7 @@ diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_rela
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result)
{
if (!client || plist_get_node_type(keys) != PLIST_ARRAY || result == NULL)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -365,7 +365,7 @@ diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_rela
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* name, const char* class, plist_t* result)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* name, const char* class, plist_t* result)
{
if (!client || (name == NULL && class == NULL) || result == NULL)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
@@ -410,7 +410,7 @@ diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_r
return ret;
}
-diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result)
+LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result)
{
if (!client || plane == NULL || result == NULL)
return DIAGNOSTICS_RELAY_E_INVALID_ARG;
diff --git a/src/file_relay.c b/src/file_relay.c
index 9508c2a..64b04ad 100644
--- a/src/file_relay.c
+++ b/src/file_relay.c
@@ -24,7 +24,7 @@
#include "property_list_service.h"
#include "common/debug.h"
-file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client)
+LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client)
{
if (!device || !service || service->port == 0 || !client || *client) {
return FILE_RELAY_E_INVALID_ARG;
@@ -44,14 +44,14 @@ file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_des
return FILE_RELAY_E_SUCCESS;
}
-file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label)
{
file_relay_error_t err = FILE_RELAY_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, FILE_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(file_relay_client_new), &err);
return err;
}
-file_relay_error_t file_relay_client_free(file_relay_client_t client)
+LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_free(file_relay_client_t client)
{
if (!client)
return FILE_RELAY_E_INVALID_ARG;
@@ -62,7 +62,7 @@ file_relay_error_t file_relay_client_free(file_relay_client_t client)
return FILE_RELAY_E_SUCCESS;
}
-file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout)
+LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout)
{
if (!client || !client->parent || !sources || !sources[0]) {
return FILE_RELAY_E_INVALID_ARG;
@@ -154,7 +154,7 @@ leave:
return err;
}
-file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection)
+LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection)
{
return file_relay_request_sources_timeout(client, sources, connection, 60000);
}
diff --git a/src/heartbeat.c b/src/heartbeat.c
index 7654dd0..a6e70ef 100644
--- a/src/heartbeat.c
+++ b/src/heartbeat.c
@@ -58,7 +58,7 @@ static heartbeat_error_t heartbeat_error(property_list_service_error_t err)
return HEARTBEAT_E_UNKNOWN_ERROR;
}
-heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client)
{
*client = NULL;
@@ -85,14 +85,14 @@ heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descr
return 0;
}
-heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label)
{
heartbeat_error_t err = HEARTBEAT_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, HEARTBEAT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(heartbeat_client_new), &err);
return err;
}
-heartbeat_error_t heartbeat_client_free(heartbeat_client_t client)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_free(heartbeat_client_t client)
{
if (!client)
return HEARTBEAT_E_INVALID_ARG;
@@ -103,7 +103,7 @@ heartbeat_error_t heartbeat_client_free(heartbeat_client_t client)
return err;
}
-heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist)
{
heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR;
@@ -118,12 +118,12 @@ heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist)
return res;
}
-heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist)
{
return heartbeat_receive_with_timeout(client, plist, 1000);
}
-heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms)
+LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms)
{
heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR;
plist_t outplist = NULL;
diff --git a/src/house_arrest.c b/src/house_arrest.c
index 4158368..b719d6f 100644
--- a/src/house_arrest.c
+++ b/src/house_arrest.c
@@ -55,7 +55,7 @@ static house_arrest_error_t house_arrest_error(property_list_service_error_t err
return HOUSE_ARREST_E_UNKNOWN_ERROR;
}
-house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service_descriptor_t service, house_arrest_client_t *client)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service_descriptor_t service, house_arrest_client_t *client)
{
property_list_service_client_t plistclient = NULL;
house_arrest_error_t err = house_arrest_error(property_list_service_client_new(device, service, &plistclient));
@@ -71,14 +71,14 @@ house_arrest_error_t house_arrest_client_new(idevice_t device, lockdownd_service
return HOUSE_ARREST_E_SUCCESS;
}
-house_arrest_error_t house_arrest_client_start_service(idevice_t device, house_arrest_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_start_service(idevice_t device, house_arrest_client_t * client, const char* label)
{
house_arrest_error_t err = HOUSE_ARREST_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, HOUSE_ARREST_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(house_arrest_client_new), &err);
return err;
}
-house_arrest_error_t house_arrest_client_free(house_arrest_client_t client)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_client_free(house_arrest_client_t client)
{
if (!client)
return HOUSE_ARREST_E_INVALID_ARG;
@@ -93,7 +93,7 @@ house_arrest_error_t house_arrest_client_free(house_arrest_client_t client)
return err;
}
-house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, plist_t dict)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, plist_t dict)
{
if (!client || !client->parent || !dict)
return HOUSE_ARREST_E_INVALID_ARG;
@@ -109,7 +109,7 @@ house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, pli
return res;
}
-house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, const char *command, const char *appid)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, const char *command, const char *appid)
{
if (!client || !client->parent || !command || !appid)
return HOUSE_ARREST_E_INVALID_ARG;
@@ -129,7 +129,7 @@ house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, con
return res;
}
-house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist_t *dict)
+LIBIMOBILEDEVICE_API house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist_t *dict)
{
if (!client || !client->parent)
return HOUSE_ARREST_E_INVALID_ARG;
@@ -147,7 +147,7 @@ house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist
return res;
}
-afc_error_t afc_client_new_from_house_arrest_client(house_arrest_client_t client, afc_client_t *afc_client)
+LIBIMOBILEDEVICE_API afc_error_t afc_client_new_from_house_arrest_client(house_arrest_client_t client, afc_client_t *afc_client)
{
if (!client || !client->parent || (client->mode == HOUSE_ARREST_CLIENT_MODE_AFC)) {
return AFC_E_INVALID_ARG;
diff --git a/src/idevice.c b/src/idevice.c
index 8cacf4c..4fae693 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -147,7 +147,7 @@ static void usbmux_event_cb(const usbmuxd_event_t *event, void *user_data)
}
}
-idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data)
{
event_cb = callback;
int res = usbmuxd_subscribe(usbmux_event_cb, user_data);
@@ -159,7 +159,7 @@ idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_
return IDEVICE_E_SUCCESS;
}
-idevice_error_t idevice_event_unsubscribe()
+LIBIMOBILEDEVICE_API idevice_error_t idevice_event_unsubscribe()
{
event_cb = NULL;
int res = usbmuxd_unsubscribe();
@@ -170,7 +170,7 @@ idevice_error_t idevice_event_unsubscribe()
return IDEVICE_E_SUCCESS;
}
-idevice_error_t idevice_get_device_list(char ***devices, int *count)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_get_device_list(char ***devices, int *count)
{
usbmuxd_device_info_t *dev_list;
@@ -200,7 +200,7 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count)
return IDEVICE_E_SUCCESS;
}
-idevice_error_t idevice_device_list_free(char **devices)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_device_list_free(char **devices)
{
if (devices) {
int i = 0;
@@ -213,7 +213,7 @@ idevice_error_t idevice_device_list_free(char **devices)
return IDEVICE_E_SUCCESS;
}
-idevice_error_t idevice_new(idevice_t * device, const char *udid)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_new(idevice_t * device, const char *udid)
{
usbmuxd_device_info_t muxdev;
int res = usbmuxd_get_device_by_udid(udid, &muxdev);
@@ -230,7 +230,7 @@ idevice_error_t idevice_new(idevice_t * device, const char *udid)
return IDEVICE_E_NO_DEVICE;
}
-idevice_error_t idevice_free(idevice_t device)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_free(idevice_t device)
{
if (!device)
return IDEVICE_E_INVALID_ARG;
@@ -250,7 +250,7 @@ idevice_error_t idevice_free(idevice_t device)
return ret;
}
-idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection)
{
if (!device) {
return IDEVICE_E_INVALID_ARG;
@@ -276,7 +276,7 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect
return IDEVICE_E_UNKNOWN_ERROR;
}
-idevice_error_t idevice_disconnect(idevice_connection_t connection)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_disconnect(idevice_connection_t connection)
{
if (!connection) {
return IDEVICE_E_INVALID_ARG;
@@ -326,7 +326,7 @@ static idevice_error_t internal_connection_send(idevice_connection_t connection,
}
-idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_send(idevice_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes)
{
if (!connection || !data || (connection->ssl_data && !connection->ssl_data->session)) {
return IDEVICE_E_INVALID_ARG;
@@ -372,7 +372,7 @@ static idevice_error_t internal_connection_receive_timeout(idevice_connection_t
return IDEVICE_E_UNKNOWN_ERROR;
}
-idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout)
{
if (!connection || (connection->ssl_data && !connection->ssl_data->session)) {
return IDEVICE_E_INVALID_ARG;
@@ -426,7 +426,7 @@ static idevice_error_t internal_connection_receive(idevice_connection_t connecti
return IDEVICE_E_UNKNOWN_ERROR;
}
-idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive(idevice_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes)
{
if (!connection || (connection->ssl_data && !connection->ssl_data->session)) {
return IDEVICE_E_INVALID_ARG;
@@ -449,7 +449,7 @@ idevice_error_t idevice_connection_receive(idevice_connection_t connection, char
return internal_connection_receive(connection, data, len, recv_bytes);
}
-idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
{
if (!device)
return IDEVICE_E_INVALID_ARG;
@@ -463,7 +463,7 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
return IDEVICE_E_UNKNOWN_ERROR;
}
-idevice_error_t idevice_get_udid(idevice_t device, char **udid)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_get_udid(idevice_t device, char **udid)
{
if (!device || !udid)
return IDEVICE_E_INVALID_ARG;
@@ -632,7 +632,7 @@ static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t
}
#endif
-idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
{
if (!connection || connection->ssl_data)
return IDEVICE_E_INVALID_ARG;
@@ -772,7 +772,7 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
return ret;
}
-idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection)
+LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection)
{
if (!connection)
return IDEVICE_E_INVALID_ARG;
@@ -801,4 +801,3 @@ idevice_error_t idevice_connection_disable_ssl(idevice_connection_t connection)
return IDEVICE_E_SUCCESS;
}
-
diff --git a/src/idevice.h b/src/idevice.h
index 13616ef..575e313 100644
--- a/src/idevice.h
+++ b/src/idevice.h
@@ -33,6 +33,16 @@
#include <gnutls/x509.h>
#endif
+#ifdef WIN32
+#define LIBIMOBILEDEVICE_API __declspec( dllexport )
+#else
+#ifdef HAVE_FVISIBILITY
+#define LIBIMOBILEDEVICE_API __attribute__((visibility("default")))
+#else
+#define LIBIMOBILEDEVICE_API
+#endif
+#endif
+
#include "common/userpref.h"
#include "libimobiledevice/libimobiledevice.h"
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index e3a8103..578756e 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -86,7 +86,7 @@ static instproxy_error_t instproxy_error(property_list_service_error_t err)
return INSTPROXY_E_UNKNOWN_ERROR;
}
-instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, instproxy_client_t *client)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, instproxy_client_t *client)
{
property_list_service_client_t plistclient = NULL;
instproxy_error_t err = instproxy_error(property_list_service_client_new(device, service, &plistclient));
@@ -103,14 +103,14 @@ instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descr
return INSTPROXY_E_SUCCESS;
}
-instproxy_error_t instproxy_client_start_service(idevice_t device, instproxy_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_start_service(idevice_t device, instproxy_client_t * client, const char* label)
{
instproxy_error_t err = INSTPROXY_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, INSTPROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(instproxy_client_new), &err);
return err;
}
-instproxy_error_t instproxy_client_free(instproxy_client_t client)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_free(instproxy_client_t client)
{
if (!client)
return INSTPROXY_E_INVALID_ARG;
@@ -162,7 +162,7 @@ static instproxy_error_t instproxy_send_command(instproxy_client_t client, const
return err;
}
-instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result)
{
if (!client || !client->parent || !result)
return INSTPROXY_E_INVALID_ARG;
@@ -414,17 +414,17 @@ static instproxy_error_t instproxy_install_or_upgrade(instproxy_client_t client,
return instproxy_create_status_updater(client, status_cb, command, user_data);
}
-instproxy_error_t instproxy_install(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_install(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
return instproxy_install_or_upgrade(client, pkg_path, client_options, status_cb, "Install", user_data);
}
-instproxy_error_t instproxy_upgrade(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_upgrade(instproxy_client_t client, const char *pkg_path, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
return instproxy_install_or_upgrade(client, pkg_path, client_options, status_cb, "Upgrade", user_data);
}
-instproxy_error_t instproxy_uninstall(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_uninstall(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
if (!client || !client->parent || !appid) {
return INSTPROXY_E_INVALID_ARG;
@@ -448,7 +448,7 @@ instproxy_error_t instproxy_uninstall(instproxy_client_t client, const char *app
return instproxy_create_status_updater(client, status_cb, "Uninstall", user_data);
}
-instproxy_error_t instproxy_lookup_archives(instproxy_client_t client, plist_t client_options, plist_t *result)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_lookup_archives(instproxy_client_t client, plist_t client_options, plist_t *result)
{
if (!client || !client->parent || !result)
return INSTPROXY_E_INVALID_ARG;
@@ -474,7 +474,7 @@ leave_unlock:
return res;
}
-instproxy_error_t instproxy_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
if (!client || !client->parent || !appid)
return INSTPROXY_E_INVALID_ARG;
@@ -494,7 +494,7 @@ instproxy_error_t instproxy_archive(instproxy_client_t client, const char *appid
return instproxy_create_status_updater(client, status_cb, "Archive", user_data);
}
-instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
if (!client || !client->parent || !appid)
return INSTPROXY_E_INVALID_ARG;
@@ -514,7 +514,7 @@ instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid
return instproxy_create_status_updater(client, status_cb, "Restore", user_data);
}
-instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
{
if (!client || !client->parent || !appid)
return INSTPROXY_E_INVALID_ARG;
@@ -534,12 +534,12 @@ instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char
return instproxy_create_status_updater(client, status_cb, "RemoveArchive", user_data);
}
-plist_t instproxy_client_options_new()
+LIBIMOBILEDEVICE_API plist_t instproxy_client_options_new()
{
return plist_new_dict();
}
-void instproxy_client_options_add(plist_t client_options, ...)
+LIBIMOBILEDEVICE_API void instproxy_client_options_add(plist_t client_options, ...)
{
if (!client_options)
return;
@@ -572,14 +572,14 @@ void instproxy_client_options_add(plist_t client_options, ...)
va_end(args);
}
-void instproxy_client_options_free(plist_t client_options)
+LIBIMOBILEDEVICE_API void instproxy_client_options_free(plist_t client_options)
{
if (client_options) {
plist_free(client_options);
}
}
-instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* appid, char** path)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* appid, char** path)
{
if (!client || !client->parent || !appid)
return INSTPROXY_E_INVALID_ARG;
diff --git a/src/lockdown.c b/src/lockdown.c
index 5c07bcc..8dc1644 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -154,7 +154,7 @@ static void plist_dict_add_label(plist_t plist, const char *label)
}
}
-lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -237,7 +237,7 @@ static lockdownd_error_t lockdownd_client_free_simple(lockdownd_client_t client)
return ret;
}
-lockdownd_error_t lockdownd_client_free(lockdownd_client_t client)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_free(lockdownd_client_t client)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -253,7 +253,7 @@ lockdownd_error_t lockdownd_client_free(lockdownd_client_t client)
return ret;
}
-void lockdownd_client_set_label(lockdownd_client_t client, const char *label)
+LIBIMOBILEDEVICE_API void lockdownd_client_set_label(lockdownd_client_t client, const char *label)
{
if (client) {
if (client->label)
@@ -263,7 +263,7 @@ void lockdownd_client_set_label(lockdownd_client_t client, const char *label)
}
}
-lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist)
{
if (!client || !plist || (plist && *plist))
return LOCKDOWN_E_INVALID_ARG;
@@ -281,7 +281,7 @@ lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist)
return ret;
}
-lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist)
{
if (!client || !plist)
return LOCKDOWN_E_INVALID_ARG;
@@ -296,7 +296,7 @@ lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist)
return ret;
}
-lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -341,7 +341,7 @@ lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type)
return ret;
}
-lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -396,7 +396,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom
return ret;
}
-lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value)
{
if (!client || !value)
return LOCKDOWN_E_INVALID_ARG;
@@ -444,7 +444,7 @@ lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *dom
return ret;
}
-lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -491,7 +491,7 @@ lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *
return ret;
}
-lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t client, char **udid)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t client, char **udid)
{
lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR;
plist_t value = NULL;
@@ -537,7 +537,7 @@ static lockdownd_error_t lockdownd_get_device_public_key_as_key_data(lockdownd_c
return ret;
}
-lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name)
{
lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR;
plist_t value = NULL;
@@ -554,7 +554,7 @@ lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **de
return ret;
}
-lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -587,7 +587,7 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli
return LOCKDOWN_E_SUCCESS;
}
-lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -952,22 +952,22 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_
return ret;
}
-lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
{
return lockdownd_do_pair(client, pair_record, "Pair");
}
-lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
{
return lockdownd_do_pair(client, pair_record, "ValidatePair");
}
-lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record)
{
return lockdownd_do_pair(client, pair_record, "Unpair");
}
-lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -995,7 +995,7 @@ lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
return ret;
}
-lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -1028,7 +1028,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
return ret;
}
-lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled)
{
lockdownd_error_t ret = LOCKDOWN_E_SUCCESS;
plist_t dict = NULL;
@@ -1281,17 +1281,17 @@ static lockdownd_error_t lockdownd_do_start_service(lockdownd_client_t client, c
return ret;
}
-lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service)
{
return lockdownd_do_start_service(client, identifier, 0, service);
}
-lockdownd_error_t lockdownd_start_service_with_escrow_bag(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_start_service_with_escrow_bag(lockdownd_client_t client, const char *identifier, lockdownd_service_descriptor_t *service)
{
return lockdownd_do_start_service(client, identifier, 1, service);
}
-lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -1342,7 +1342,7 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati
return ret;
}
-lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -1389,7 +1389,7 @@ static void str_remove_spaces(char *source)
*dest = 0;
}
-lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -1444,8 +1444,7 @@ lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, cha
return LOCKDOWN_E_SUCCESS;
}
-
-lockdownd_error_t lockdownd_data_classes_free(char **classes)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_data_classes_free(char **classes)
{
if (classes) {
int i = 0;
@@ -1457,7 +1456,7 @@ lockdownd_error_t lockdownd_data_classes_free(char **classes)
return LOCKDOWN_E_SUCCESS;
}
-lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service)
+LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service)
{
if (service)
free(service);
diff --git a/src/misagent.c b/src/misagent.c
index 96dddba..e00fb17 100644
--- a/src/misagent.c
+++ b/src/misagent.c
@@ -87,7 +87,7 @@ static misagent_error_t misagent_check_result(plist_t response, int* status_code
}
}
-misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client)
{
property_list_service_client_t plistclient = NULL;
misagent_error_t err = misagent_error(property_list_service_client_new(device, service, &plistclient));
@@ -103,14 +103,14 @@ misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descrip
return MISAGENT_E_SUCCESS;
}
-misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t * client, const char* label)
{
misagent_error_t err = MISAGENT_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, MISAGENT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(misagent_client_new), &err);
return err;
}
-misagent_error_t misagent_client_free(misagent_client_t client)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_client_free(misagent_client_t client)
{
if (!client)
return MISAGENT_E_INVALID_ARG;
@@ -125,7 +125,7 @@ misagent_error_t misagent_client_free(misagent_client_t client)
return err;
}
-misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
{
if (!client || !client->parent || !profile || (plist_get_node_type(profile) != PLIST_DATA))
return MISAGENT_E_INVALID_ARG;
@@ -162,7 +162,7 @@ misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
return res;
}
-misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
{
if (!client || !client->parent || !profiles)
return MISAGENT_E_INVALID_ARG;
@@ -202,7 +202,7 @@ misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
}
-misagent_error_t misagent_remove(misagent_client_t client, const char* profileID)
+LIBIMOBILEDEVICE_API misagent_error_t misagent_remove(misagent_client_t client, const char* profileID)
{
if (!client || !client->parent || !profileID)
return MISAGENT_E_INVALID_ARG;
@@ -239,7 +239,7 @@ misagent_error_t misagent_remove(misagent_client_t client, const char* profileID
return res;
}
-int misagent_get_status_code(misagent_client_t client)
+LIBIMOBILEDEVICE_API int misagent_get_status_code(misagent_client_t client)
{
if (!client) {
return -1;
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c
index ab32cac..9696b8c 100644
--- a/src/mobile_image_mounter.c
+++ b/src/mobile_image_mounter.c
@@ -75,7 +75,7 @@ static mobile_image_mounter_error_t mobile_image_mounter_error(property_list_ser
return MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR;
}
-mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdownd_service_descriptor_t service, mobile_image_mounter_client_t *client)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdownd_service_descriptor_t service, mobile_image_mounter_client_t *client)
{
property_list_service_client_t plistclient = NULL;
mobile_image_mounter_error_t err = mobile_image_mounter_error(property_list_service_client_new(device, service, &plistclient));
@@ -92,14 +92,14 @@ mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdown
return MOBILE_IMAGE_MOUNTER_E_SUCCESS;
}
-mobile_image_mounter_error_t mobile_image_mounter_start_service(idevice_t device, mobile_image_mounter_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_start_service(idevice_t device, mobile_image_mounter_client_t * client, const char* label)
{
mobile_image_mounter_error_t err = MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, MOBILE_IMAGE_MOUNTER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobile_image_mounter_new), &err);
return err;
}
-mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client)
{
if (!client)
return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG;
@@ -112,7 +112,7 @@ mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_clie
return MOBILE_IMAGE_MOUNTER_E_SUCCESS;
}
-mobile_image_mounter_error_t mobile_image_mounter_lookup_image(mobile_image_mounter_client_t client, const char *image_type, plist_t *result)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_lookup_image(mobile_image_mounter_client_t client, const char *image_type, plist_t *result)
{
if (!client || !image_type || !result) {
return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG;
@@ -141,7 +141,7 @@ leave_unlock:
return res;
}
-mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata)
{
if (!client || !image_type || (image_size == 0) || !upload_cb) {
return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG;
@@ -252,7 +252,7 @@ leave_unlock:
}
-mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result)
{
if (!client || !image_path || !image_type || !result) {
return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG;
@@ -284,7 +284,7 @@ leave_unlock:
return res;
}
-mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client)
+LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client)
{
if (!client) {
return MOBILE_IMAGE_MOUNTER_E_INVALID_ARG;
diff --git a/src/mobilebackup.c b/src/mobilebackup.c
index 7107d12..eefaef3 100644
--- a/src/mobilebackup.c
+++ b/src/mobilebackup.c
@@ -60,7 +60,7 @@ static mobilebackup_error_t mobilebackup_error(device_link_service_error_t err)
return MOBILEBACKUP_E_UNKNOWN_ERROR;
}
-mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilebackup_client_t * client)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilebackup_client_t * client)
{
if (!device || !service || service->port == 0 || !client || *client)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -87,14 +87,14 @@ mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service
return ret;
}
-mobilebackup_error_t mobilebackup_client_start_service(idevice_t device, mobilebackup_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_start_service(idevice_t device, mobilebackup_client_t * client, const char* label)
{
mobilebackup_error_t err = MOBILEBACKUP_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, MOBILEBACKUP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup_client_new), &err);
return err;
}
-mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client)
{
if (!client)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -107,7 +107,7 @@ mobilebackup_error_t mobilebackup_client_free(mobilebackup_client_t client)
return err;
}
-mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t * plist)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t * plist)
{
if (!client)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -115,7 +115,7 @@ mobilebackup_error_t mobilebackup_receive(mobilebackup_client_t client, plist_t
return ret;
}
-mobilebackup_error_t mobilebackup_send(mobilebackup_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send(mobilebackup_client_t client, plist_t plist)
{
if (!client || !plist)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -232,7 +232,7 @@ leave:
return err;
}
-mobilebackup_error_t mobilebackup_request_backup(mobilebackup_client_t client, plist_t backup_manifest, const char *base_path, const char *proto_version)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_request_backup(mobilebackup_client_t client, plist_t backup_manifest, const char *base_path, const char *proto_version)
{
if (!client || !client->parent || !base_path || !proto_version)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -292,12 +292,12 @@ leave:
return err;
}
-mobilebackup_error_t mobilebackup_send_backup_file_received(mobilebackup_client_t client)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_backup_file_received(mobilebackup_client_t client)
{
return mobilebackup_send_message(client, "kBackupMessageBackupFileReceived", NULL);
}
-mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, plist_t backup_manifest, mobilebackup_flags_t flags, const char *proto_version)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, plist_t backup_manifest, mobilebackup_flags_t flags, const char *proto_version)
{
if (!client || !client->parent || !backup_manifest || !proto_version)
return MOBILEBACKUP_E_INVALID_ARG;
@@ -351,17 +351,17 @@ leave:
return err;
}
-mobilebackup_error_t mobilebackup_receive_restore_file_received(mobilebackup_client_t client, plist_t *result)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive_restore_file_received(mobilebackup_client_t client, plist_t *result)
{
return mobilebackup_receive_message(client, "BackupMessageRestoreFileReceived", result);
}
-mobilebackup_error_t mobilebackup_receive_restore_application_received(mobilebackup_client_t client, plist_t *result)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_receive_restore_application_received(mobilebackup_client_t client, plist_t *result)
{
return mobilebackup_receive_message(client, "BackupMessageRestoreApplicationReceived", result);
}
-mobilebackup_error_t mobilebackup_send_restore_complete(mobilebackup_client_t client)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_restore_complete(mobilebackup_client_t client)
{
mobilebackup_error_t err = mobilebackup_send_message(client, "BackupMessageRestoreComplete", NULL);
if (err != MOBILEBACKUP_E_SUCCESS) {
@@ -406,7 +406,7 @@ mobilebackup_error_t mobilebackup_send_restore_complete(mobilebackup_client_t cl
return err;
}
-mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const char *reason)
+LIBIMOBILEDEVICE_API mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const char *reason)
{
if (!client || !client->parent || !reason)
return MOBILEBACKUP_E_INVALID_ARG;
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c
index 41fe5d3..38b4069 100644
--- a/src/mobilebackup2.c
+++ b/src/mobilebackup2.c
@@ -61,7 +61,7 @@ static mobilebackup2_error_t mobilebackup2_error(device_link_service_error_t err
return MOBILEBACKUP2_E_UNKNOWN_ERROR;
}
-mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_service_descriptor_t service,
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_service_descriptor_t service,
mobilebackup2_client_t * client)
{
if (!device || !service || service->port == 0 || !client || *client)
@@ -89,14 +89,14 @@ mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, lockdownd_servi
return ret;
}
-mobilebackup2_error_t mobilebackup2_client_start_service(idevice_t device, mobilebackup2_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_start_service(idevice_t device, mobilebackup2_client_t * client, const char* label)
{
mobilebackup2_error_t err = MOBILEBACKUP2_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, MOBILEBACKUP2_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilebackup2_client_new), &err);
return err;
}
-mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client)
{
if (!client)
return MOBILEBACKUP2_E_INVALID_ARG;
@@ -109,7 +109,7 @@ mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client)
return err;
}
-mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options)
{
if (!client || !client->parent || (!message && !options))
return MOBILEBACKUP2_E_INVALID_ARG;
@@ -207,12 +207,12 @@ leave:
return err;
}
-mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage)
{
return mobilebackup2_error(device_link_service_receive_message(client->parent, msg_plist, dlmessage));
}
-mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes)
{
if (!client || !client->parent || !data || (length == 0) || !bytes)
return MOBILEBACKUP2_E_INVALID_ARG;
@@ -238,7 +238,7 @@ mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, cons
}
}
-mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes)
{
if (!client || !client->parent || !data || (length == 0) || !bytes)
return MOBILEBACKUP2_E_INVALID_ARG;
@@ -265,7 +265,7 @@ mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, c
}
}
-mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t client, double local_versions[], char count, double *remote_version)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t client, double local_versions[], char count, double *remote_version)
{
int i;
@@ -323,7 +323,7 @@ leave:
return err;
}
-mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options)
{
if (!client || !client->parent || !request || !target_identifier)
return MOBILEBACKUP2_E_INVALID_ARG;
@@ -354,7 +354,7 @@ mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client,
return err;
}
-mobilebackup2_error_t mobilebackup2_send_status_response(mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2)
+LIBIMOBILEDEVICE_API mobilebackup2_error_t mobilebackup2_send_status_response(mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2)
{
if (!client || !client->parent)
return MOBILEBACKUP2_E_INVALID_ARG;
diff --git a/src/mobilesync.c b/src/mobilesync.c
index f0fc4b2..6138762 100644
--- a/src/mobilesync.c
+++ b/src/mobilesync.c
@@ -65,7 +65,7 @@ static mobilesync_error_t mobilesync_error(device_link_service_error_t err)
return MOBILESYNC_E_UNKNOWN_ERROR;
}
-mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service,
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service,
mobilesync_client_t * client)
{
if (!device || !service || service->port == 0 || !client || *client)
@@ -95,14 +95,14 @@ mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_des
return ret;
}
-mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t * client, const char* label)
{
mobilesync_error_t err = MOBILESYNC_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, MOBILESYNC_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(mobilesync_client_new), &err);
return err;
}
-mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
{
if (!client)
return MOBILESYNC_E_INVALID_ARG;
@@ -112,7 +112,7 @@ mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
return err;
}
-mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plist)
{
if (!client)
return MOBILESYNC_E_INVALID_ARG;
@@ -120,14 +120,14 @@ mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t * plis
return ret;
}
-mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist)
{
if (!client || !plist)
return MOBILESYNC_E_INVALID_ARG;
return mobilesync_error(device_link_service_send(client->parent, plist));
}
-mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description)
{
if (!client || client->data_class || !data_class ||
!anchors || !anchors->computer_anchor) {
@@ -253,7 +253,7 @@ mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data
return err;
}
-mobilesync_error_t mobilesync_finish(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_finish(mobilesync_client_t client)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -338,17 +338,17 @@ static mobilesync_error_t mobilesync_get_records(mobilesync_client_t client, con
return err;
}
-mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client)
{
return mobilesync_get_records(client, "SDMessageGetAllRecordsFromDevice");
}
-mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client)
{
return mobilesync_get_records(client, "SDMessageGetChangesFromDevice");
}
-mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -415,7 +415,7 @@ mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_
return err;
}
-mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -484,7 +484,7 @@ mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t cl
return err;
}
-mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -518,7 +518,7 @@ static plist_t create_process_changes_message(const char *data_class, plist_t en
return msg;
}
-mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -585,7 +585,7 @@ mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_cli
return err;
}
-mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions)
{
if (!client || !client->data_class || !entities) {
return MOBILESYNC_E_INVALID_ARG;
@@ -613,7 +613,7 @@ mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t e
return err;
}
-mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping)
{
if (!client || !client->data_class) {
return MOBILESYNC_E_INVALID_ARG;
@@ -682,7 +682,7 @@ mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plis
return err;
}
-mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason)
+LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason)
{
if (!client || !client->data_class || !reason) {
return MOBILESYNC_E_INVALID_ARG;
@@ -708,7 +708,7 @@ mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* rea
return err;
}
-mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor)
+LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor)
{
mobilesync_anchors_t anchors = (mobilesync_anchors_t) malloc(sizeof(mobilesync_anchors));
if (device_anchor != NULL) {
@@ -725,7 +725,7 @@ mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const cha
return anchors;
}
-void mobilesync_anchors_free(mobilesync_anchors_t anchors)
+LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors)
{
if (anchors->device_anchor != NULL) {
free(anchors->device_anchor);
@@ -739,12 +739,12 @@ void mobilesync_anchors_free(mobilesync_anchors_t anchors)
anchors = NULL;
}
-plist_t mobilesync_actions_new()
+LIBIMOBILEDEVICE_API plist_t mobilesync_actions_new()
{
return plist_new_dict();
}
-void mobilesync_actions_add(plist_t actions, ...)
+LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...)
{
if (!actions)
return;
@@ -776,7 +776,7 @@ void mobilesync_actions_add(plist_t actions, ...)
va_end(args);
}
-void mobilesync_actions_free(plist_t actions)
+LIBIMOBILEDEVICE_API void mobilesync_actions_free(plist_t actions)
{
if (actions) {
plist_free(actions);
diff --git a/src/notification_proxy.c b/src/notification_proxy.c
index 909ede4..541e429 100644
--- a/src/notification_proxy.c
+++ b/src/notification_proxy.c
@@ -86,7 +86,7 @@ static np_error_t np_error(property_list_service_error_t err)
return NP_E_UNKNOWN_ERROR;
}
-np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client)
+LIBIMOBILEDEVICE_API np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client)
{
property_list_service_client_t plistclient = NULL;
np_error_t err = np_error(property_list_service_client_new(device, service, &plistclient));
@@ -104,14 +104,14 @@ np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t servic
return NP_E_SUCCESS;
}
-np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label)
+LIBIMOBILEDEVICE_API np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label)
{
np_error_t err = NP_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, NP_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(np_client_new), &err);
return err;
}
-np_error_t np_client_free(np_client_t client)
+LIBIMOBILEDEVICE_API np_error_t np_client_free(np_client_t client)
{
if (!client)
return NP_E_INVALID_ARG;
@@ -128,7 +128,7 @@ np_error_t np_client_free(np_client_t client)
return NP_E_SUCCESS;
}
-np_error_t np_post_notification(np_client_t client, const char *notification)
+LIBIMOBILEDEVICE_API np_error_t np_post_notification(np_client_t client, const char *notification)
{
if (!client || !notification) {
return NP_E_INVALID_ARG;
@@ -179,7 +179,7 @@ np_error_t np_post_notification(np_client_t client, const char *notification)
return res;
}
-np_error_t np_observe_notification( np_client_t client, const char *notification )
+LIBIMOBILEDEVICE_API np_error_t np_observe_notification( np_client_t client, const char *notification )
{
if (!client || !notification) {
return NP_E_INVALID_ARG;
@@ -200,7 +200,7 @@ np_error_t np_observe_notification( np_client_t client, const char *notification
return res;
}
-np_error_t np_observe_notifications(np_client_t client, const char **notification_spec)
+LIBIMOBILEDEVICE_API np_error_t np_observe_notifications(np_client_t client, const char **notification_spec)
{
int i = 0;
np_error_t res = NP_E_UNKNOWN_ERROR;
@@ -329,7 +329,7 @@ void* np_notifier( void* arg )
return NULL;
}
-np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb, void *user_data )
+LIBIMOBILEDEVICE_API np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb, void *user_data )
{
if (!client)
return NP_E_INVALID_ARG;
diff --git a/src/property_list_service.c b/src/property_list_service.c
index c260d3e..931c1ef 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -54,7 +54,7 @@ static property_list_service_error_t service_to_property_list_service_error(serv
return PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR;
}
-property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client)
{
if (!device || !service || service->port == 0 || !client || *client)
return PROPERTY_LIST_SERVICE_E_INVALID_ARG;
@@ -74,7 +74,7 @@ property_list_service_error_t property_list_service_client_new(idevice_t device,
return PROPERTY_LIST_SERVICE_E_SUCCESS;
}
-property_list_service_error_t property_list_service_client_free(property_list_service_client_t client)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_client_free(property_list_service_client_t client)
{
if (!client)
return PROPERTY_LIST_SERVICE_E_INVALID_ARG;
@@ -147,12 +147,12 @@ static property_list_service_error_t internal_plist_send(property_list_service_c
return res;
}
-property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist)
{
return internal_plist_send(client, plist, 0);
}
-property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist)
{
return internal_plist_send(client, plist, 1);
}
@@ -250,24 +250,24 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
return res;
}
-property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout)
{
return internal_plist_receive_timeout(client, plist, timeout);
}
-property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist)
{
return internal_plist_receive_timeout(client, plist, 10000);
}
-property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client)
{
if (!client || !client->parent)
return PROPERTY_LIST_SERVICE_E_INVALID_ARG;
return service_to_property_list_service_error(service_enable_ssl(client->parent));
}
-property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client)
+LIBIMOBILEDEVICE_API property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client)
{
if (!client || !client->parent)
return PROPERTY_LIST_SERVICE_E_INVALID_ARG;
diff --git a/src/restore.c b/src/restore.c
index 2a025e8..3f6be8f 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -89,7 +89,7 @@ static void plist_dict_add_label(plist_t plist, const char *label)
}
}
-restored_error_t restored_client_free(restored_client_t client)
+LIBIMOBILEDEVICE_API restored_error_t restored_client_free(restored_client_t client)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -119,7 +119,7 @@ restored_error_t restored_client_free(restored_client_t client)
return ret;
}
-void restored_client_set_label(restored_client_t client, const char *label)
+LIBIMOBILEDEVICE_API void restored_client_set_label(restored_client_t client, const char *label)
{
if (client) {
if (client->label)
@@ -129,7 +129,7 @@ void restored_client_set_label(restored_client_t client, const char *label)
}
}
-restored_error_t restored_receive(restored_client_t client, plist_t *plist)
+LIBIMOBILEDEVICE_API restored_error_t restored_receive(restored_client_t client, plist_t *plist)
{
if (!client || !plist || (plist && *plist))
return RESTORE_E_INVALID_ARG;
@@ -148,7 +148,7 @@ restored_error_t restored_receive(restored_client_t client, plist_t *plist)
return ret;
}
-restored_error_t restored_send(restored_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API restored_error_t restored_send(restored_client_t client, plist_t plist)
{
if (!client || !plist)
return RESTORE_E_INVALID_ARG;
@@ -163,7 +163,7 @@ restored_error_t restored_send(restored_client_t client, plist_t plist)
return ret;
}
-restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version)
+LIBIMOBILEDEVICE_API restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -222,7 +222,7 @@ restored_error_t restored_query_type(restored_client_t client, char **type, uint
return ret;
}
-restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value)
+LIBIMOBILEDEVICE_API restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value)
{
if (!client || !key)
return RESTORE_E_INVALID_ARG;
@@ -264,7 +264,7 @@ restored_error_t restored_query_value(restored_client_t client, const char *key,
return ret;
}
-restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value)
+LIBIMOBILEDEVICE_API restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value)
{
if (!client || !value || (value && *value))
return RESTORE_E_INVALID_ARG;
@@ -291,7 +291,7 @@ restored_error_t restored_get_value(restored_client_t client, const char *key, p
return ret;
}
-restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label)
+LIBIMOBILEDEVICE_API restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -332,7 +332,7 @@ restored_error_t restored_client_new(idevice_t device, restored_client_t *client
return ret;
}
-restored_error_t restored_goodbye(restored_client_t client)
+LIBIMOBILEDEVICE_API restored_error_t restored_goodbye(restored_client_t client)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -364,7 +364,7 @@ restored_error_t restored_goodbye(restored_client_t client)
return ret;
}
-restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version)
+LIBIMOBILEDEVICE_API restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -388,7 +388,7 @@ restored_error_t restored_start_restore(restored_client_t client, plist_t option
return ret;
}
-restored_error_t restored_reboot(restored_client_t client)
+LIBIMOBILEDEVICE_API restored_error_t restored_reboot(restored_client_t client)
{
if (!client)
return RESTORE_E_INVALID_ARG;
@@ -419,4 +419,3 @@ restored_error_t restored_reboot(restored_client_t client)
dict = NULL;
return ret;
}
-
diff --git a/src/sbservices.c b/src/sbservices.c
index ea12e35..20f0b5f 100644
--- a/src/sbservices.c
+++ b/src/sbservices.c
@@ -76,7 +76,7 @@ static sbservices_error_t sbservices_error(property_list_service_error_t err)
return SBSERVICES_E_UNKNOWN_ERROR;
}
-sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client)
{
property_list_service_client_t plistclient = NULL;
sbservices_error_t err = sbservices_error(property_list_service_client_new(device, service, &plistclient));
@@ -92,14 +92,14 @@ sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_des
return SBSERVICES_E_SUCCESS;
}
-sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t * client, const char* label)
{
sbservices_error_t err = SBSERVICES_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, SBSERVICES_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(sbservices_client_new), &err);
return err;
}
-sbservices_error_t sbservices_client_free(sbservices_client_t client)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_client_free(sbservices_client_t client)
{
if (!client)
return SBSERVICES_E_INVALID_ARG;
@@ -112,7 +112,7 @@ sbservices_error_t sbservices_client_free(sbservices_client_t client)
return err;
}
-sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version)
{
if (!client || !client->parent || !state)
return SBSERVICES_E_INVALID_ARG;
@@ -152,7 +152,7 @@ leave_unlock:
return res;
}
-sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate)
{
if (!client || !client->parent || !newstate)
return SBSERVICES_E_INVALID_ARG;
@@ -178,7 +178,7 @@ sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t
return res;
}
-sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize)
{
if (!client || !client->parent || !bundleId || !pngdata)
return SBSERVICES_E_INVALID_ARG;
@@ -215,7 +215,7 @@ leave_unlock:
return res;
}
-sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation)
{
if (!client || !client->parent || !interface_orientation)
return SBSERVICES_E_INVALID_ARG;
@@ -253,7 +253,7 @@ leave_unlock:
return res;
}
-sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize)
+LIBIMOBILEDEVICE_API sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize)
{
if (!client || !client->parent || !pngdata)
return SBSERVICES_E_INVALID_ARG;
diff --git a/src/screenshotr.c b/src/screenshotr.c
index e92fe9f..eed271e 100644
--- a/src/screenshotr.c
+++ b/src/screenshotr.c
@@ -58,7 +58,7 @@ static screenshotr_error_t screenshotr_error(device_link_service_error_t err)
return SCREENSHOTR_E_UNKNOWN_ERROR;
}
-screenshotr_error_t screenshotr_client_new(idevice_t device, lockdownd_service_descriptor_t service,
+LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_new(idevice_t device, lockdownd_service_descriptor_t service,
screenshotr_client_t * client)
{
if (!device || !service || service->port == 0 || !client || *client)
@@ -86,14 +86,14 @@ screenshotr_error_t screenshotr_client_new(idevice_t device, lockdownd_service_d
return ret;
}
-screenshotr_error_t screenshotr_client_start_service(idevice_t device, screenshotr_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_start_service(idevice_t device, screenshotr_client_t * client, const char* label)
{
screenshotr_error_t err = SCREENSHOTR_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, SCREENSHOTR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(screenshotr_client_new), &err);
return err;
}
-screenshotr_error_t screenshotr_client_free(screenshotr_client_t client)
+LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_client_free(screenshotr_client_t client)
{
if (!client)
return SCREENSHOTR_E_INVALID_ARG;
@@ -103,7 +103,7 @@ screenshotr_error_t screenshotr_client_free(screenshotr_client_t client)
return err;
}
-screenshotr_error_t screenshotr_take_screenshot(screenshotr_client_t client, char **imgdata, uint64_t *imgsize)
+LIBIMOBILEDEVICE_API screenshotr_error_t screenshotr_take_screenshot(screenshotr_client_t client, char **imgdata, uint64_t *imgsize)
{
if (!client || !client->parent || !imgdata)
return SCREENSHOTR_E_INVALID_ARG;
diff --git a/src/service.c b/src/service.c
index 701c8b4..c4743dc 100644
--- a/src/service.c
+++ b/src/service.c
@@ -52,7 +52,7 @@ static service_error_t idevice_to_service_error(idevice_error_t err)
return SERVICE_E_UNKNOWN_ERROR;
}
-service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client)
+LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client)
{
if (!device || !service || service->port == 0 || !client || *client)
return SERVICE_E_INVALID_ARG;
@@ -76,7 +76,7 @@ service_error_t service_client_new(idevice_t device, lockdownd_service_descripto
return SERVICE_E_SUCCESS;
}
-service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code)
+LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code)
{
*client = NULL;
@@ -115,7 +115,7 @@ service_error_t service_client_factory_start_service(idevice_t device, const cha
return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR;
}
-service_error_t service_client_free(service_client_t client)
+LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client)
{
if (!client)
return SERVICE_E_INVALID_ARG;
@@ -128,7 +128,7 @@ service_error_t service_client_free(service_client_t client)
return err;
}
-service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent)
+LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent)
{
service_error_t res = SERVICE_E_UNKNOWN_ERROR;
int bytes = 0;
@@ -149,7 +149,7 @@ service_error_t service_send(service_client_t client, const char* data, uint32_t
return res;
}
-service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
+LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
{
service_error_t res = SERVICE_E_UNKNOWN_ERROR;
int bytes = 0;
@@ -169,19 +169,19 @@ service_error_t service_receive_with_timeout(service_client_t client, char* data
return res;
}
-service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received)
+LIBIMOBILEDEVICE_API service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received)
{
return service_receive_with_timeout(client, data, size, received, 10000);
}
-service_error_t service_enable_ssl(service_client_t client)
+LIBIMOBILEDEVICE_API service_error_t service_enable_ssl(service_client_t client)
{
if (!client || !client->connection)
return SERVICE_E_INVALID_ARG;
return idevice_to_service_error(idevice_connection_enable_ssl(client->connection));
}
-service_error_t service_disable_ssl(service_client_t client)
+LIBIMOBILEDEVICE_API service_error_t service_disable_ssl(service_client_t client)
{
if (!client || !client->connection)
return SERVICE_E_INVALID_ARG;
diff --git a/src/syslog_relay.c b/src/syslog_relay.c
index a636e6e..63e7d34 100644
--- a/src/syslog_relay.c
+++ b/src/syslog_relay.c
@@ -61,7 +61,7 @@ static syslog_relay_error_t syslog_relay_error(service_error_t err)
return SYSLOG_RELAY_E_UNKNOWN_ERROR;
}
-syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client)
{
*client = NULL;
@@ -89,14 +89,14 @@ syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service
return 0;
}
-syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label)
{
syslog_relay_error_t err = SYSLOG_RELAY_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, SYSLOG_RELAY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(syslog_relay_client_new), &err);
return err;
}
-syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client)
{
if (!client)
return SYSLOG_RELAY_E_INVALID_ARG;
@@ -112,12 +112,12 @@ syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client)
return err;
}
-syslog_relay_error_t syslog_relay_receive(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_receive(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received)
{
return syslog_relay_receive_with_timeout(client, data, size, received, 1000);
}
-syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout)
{
syslog_relay_error_t res = SYSLOG_RELAY_E_UNKNOWN_ERROR;
int bytes = 0;
@@ -171,7 +171,7 @@ void *syslog_relay_worker(void *arg)
return NULL;
}
-syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data)
{
if (!client || !callback)
return SYSLOG_RELAY_E_INVALID_ARG;
@@ -198,7 +198,7 @@ syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, sy
return res;
}
-syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client)
+LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client)
{
if (client->worker) {
/* notify thread to finish */
diff --git a/src/webinspector.c b/src/webinspector.c
index 31c5b2c..de30cd1 100644
--- a/src/webinspector.c
+++ b/src/webinspector.c
@@ -58,7 +58,7 @@ static webinspector_error_t webinspector_error(property_list_service_error_t err
return WEBINSPECTOR_E_UNKNOWN_ERROR;
}
-webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t * client)
{
*client = NULL;
@@ -85,14 +85,14 @@ webinspector_error_t webinspector_client_new(idevice_t device, lockdownd_service
return 0;
}
-webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_start_service(idevice_t device, webinspector_client_t * client, const char* label)
{
webinspector_error_t err = WEBINSPECTOR_E_UNKNOWN_ERROR;
service_client_factory_start_service(device, WEBINSPECTOR_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(webinspector_client_new), &err);
return err;
}
-webinspector_error_t webinspector_client_free(webinspector_client_t client)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_client_free(webinspector_client_t client)
{
if (!client)
return WEBINSPECTOR_E_INVALID_ARG;
@@ -103,7 +103,7 @@ webinspector_error_t webinspector_client_free(webinspector_client_t client)
return err;
}
-webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_send(webinspector_client_t client, plist_t plist)
{
webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR;
@@ -160,12 +160,12 @@ webinspector_error_t webinspector_send(webinspector_client_t client, plist_t pli
return res;
}
-webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_receive(webinspector_client_t client, plist_t * plist)
{
return webinspector_receive_with_timeout(client, plist, 5000);
}
-webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms)
+LIBIMOBILEDEVICE_API webinspector_error_t webinspector_receive_with_timeout(webinspector_client_t client, plist_t * plist, uint32_t timeout_ms)
{
webinspector_error_t res = WEBINSPECTOR_E_UNKNOWN_ERROR;
plist_t message = NULL;