diff options
author | Martin Szulecki | 2015-01-26 22:35:17 +0100 |
---|---|---|
committer | Martin Szulecki | 2015-01-27 22:01:23 +0100 |
commit | db4f941a4c83b997e301f8cb14a5ae301d059689 (patch) | |
tree | 361f42d306ec9d0be84749c1bf95b63597484516 /src | |
parent | 4902178daf5c7861b4e6ecb1bdb05120ca8bf70d (diff) | |
download | libimobiledevice-db4f941a4c83b997e301f8cb14a5ae301d059689.tar.gz libimobiledevice-db4f941a4c83b997e301f8cb14a5ae301d059689.tar.bz2 |
installation_proxy: Add new helper to set return attributes in client options
Diffstat (limited to 'src')
-rw-r--r-- | src/installation_proxy.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/installation_proxy.c b/src/installation_proxy.c index e279edf..3d9d314 100644 --- a/src/installation_proxy.c +++ b/src/installation_proxy.c @@ -578,6 +578,27 @@ LIBIMOBILEDEVICE_API void instproxy_client_options_add(plist_t client_options, . va_end(args); } +LIBIMOBILEDEVICE_API void instproxy_client_options_set_return_attributes(plist_t client_options, ...) +{ + if (!client_options) + return; + + plist_t return_attributes = plist_new_array(); + + va_list args; + va_start(args, client_options); + char *arg = va_arg(args, char*); + while (arg) { + char *attribute = strdup(arg); + plist_array_append_item(return_attributes, plist_new_string(attribute)); + free(attribute); + arg = va_arg(args, char*); + } + va_end(args); + + plist_dict_set_item(client_options, "ReturnAttributes", return_attributes); +} + LIBIMOBILEDEVICE_API void instproxy_client_options_free(plist_t client_options) { if (client_options) { |