From fd3ec03cb1ade6322c347bef3e325a0ab747b7fe Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 7 Nov 2012 22:16:45 +0100 Subject: idevicerestore: add function to set cache path --- src/idevicerestore.c | 13 +++++++++++++ src/idevicerestore.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.1-32-gdbae