diff options
author | Martin Szulecki | 2009-09-23 13:24:45 +0200 |
---|---|---|
committer | Nikias Bassen | 2009-09-23 13:24:45 +0200 |
commit | e619fc9e4d90c9e86d1e05fe37ad6fbf284d6de8 (patch) | |
tree | 3fda3043b386cb6c9ac773eba61fad1eec833944 | |
parent | b6e197667f5c94edca5f6617b897cf9b879e4a2a (diff) | |
download | usbmuxd-e619fc9e4d90c9e86d1e05fe37ad6fbf284d6de8.tar.gz usbmuxd-e619fc9e4d90c9e86d1e05fe37ad6fbf284d6de8.tar.bz2 |
Add usbmuxd_device_list_free function
-rw-r--r-- | libusbmuxd/libusbmuxd.c | 8 | ||||
-rw-r--r-- | libusbmuxd/usbmuxd.h | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c index a00ceb0..6970816 100644 --- a/libusbmuxd/libusbmuxd.c +++ b/libusbmuxd/libusbmuxd.c @@ -397,6 +397,14 @@ int usbmuxd_get_device_list(usbmuxd_device_info_t **device_list) return dev_cnt; } +int usbmuxd_device_list_free(usbmuxd_device_info_t **device_list) +{ + if (device_list) { + free(*device_list); + } + return 0; +} + int usbmuxd_get_device_by_uuid(const char *uuid, usbmuxd_device_info_t *device) { usbmuxd_device_info_t *dev_list = NULL; diff --git a/libusbmuxd/usbmuxd.h b/libusbmuxd/usbmuxd.h index 106f921..f3b57b3 100644 --- a/libusbmuxd/usbmuxd.h +++ b/libusbmuxd/usbmuxd.h @@ -68,6 +68,15 @@ int usbmuxd_unsubscribe(); int usbmuxd_get_device_list(usbmuxd_device_info_t **device_list); /** + * Frees the device list returned by an usbmuxd_get_device_list call + * + * @param device_list A pointer to an array of usbmuxd_device_info_t to free. + * + * @return 0 on success, -1 on error. + */ +int usbmuxd_device_list_free(usbmuxd_device_info_t **device_list); + +/** * Gets device information for the device specified by uuid. * * @param uuid A device uuid of the device to look for. If uuid is NULL, |