summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-11-07 22:16:45 +0100
committerGravatar Martin Szulecki2012-11-07 22:16:45 +0100
commitfd3ec03cb1ade6322c347bef3e325a0ab747b7fe (patch)
treeb8274ca961a5518df92dabe0930eb77f67040ece /src
parent4d890286652dfd73169ecdbeb6e82ecc6f55079e (diff)
downloadidevicerestore-fd3ec03cb1ade6322c347bef3e325a0ab747b7fe.tar.gz
idevicerestore-fd3ec03cb1ade6322c347bef3e325a0ab747b7fe.tar.bz2
idevicerestore: add function to set cache path
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c13
-rw-r--r--src/idevicerestore.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 3b95702..8c7ad83 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -941,6 +941,19 @@ void idevicerestore_set_ipsw(struct idevicerestore_client_t* client, const char*
}
}
+void idevicerestore_set_cache_path(struct idevicerestore_client_t* client, const char* path)
+{
+ if (!client)
+ return;
+ if (client->cache_dir) {
+ free(client->cache_dir);
+ client->cache_dir = NULL;
+ }
+ if (path) {
+ client->cache_dir = strdup(path);
+ }
+}
+
void idevicerestore_set_progress_callback(struct idevicerestore_client_t* client, idevicerestore_progress_cb_t cbfunc, void* userdata)
{
if (!client)
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index 5674665..37cbbc7 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -59,7 +59,7 @@ void idevicerestore_set_ecid(struct idevicerestore_client_t* client, unsigned lo
void idevicerestore_set_udid(struct idevicerestore_client_t* client, const char* udid);
void idevicerestore_set_flags(struct idevicerestore_client_t* client, int flags);
void idevicerestore_set_ipsw(struct idevicerestore_client_t* client, const char* path);
-
+void idevicerestore_set_cache_path(struct idevicerestore_client_t* client, const char* path);
void idevicerestore_set_progress_callback(struct idevicerestore_client_t* client, idevicerestore_progress_cb_t cbfunc, void* userdata);
void idevicerestore_set_info_stream(FILE* strm);
void idevicerestore_set_error_stream(FILE* strm);