return copy;
}
+
+#ifdef __TIZEN__
+pa_idxset *pa_idxset_filtered_copy(pa_idxset *s, pa_copy_func_t copy_func, pa_compare_func_t filter_func, const void *filter) {
+ pa_idxset *copy;
+ struct idxset_entry *i;
+
+ pa_assert(s);
+
+ copy = pa_idxset_new(s->hash_func, s->compare_func);
+
+ for (i = s->iterate_list_head; i; i = i->iterate_next) {
+ if (filter_func) {
+ if (filter_func(i->data, filter))
+ pa_idxset_put(copy, copy_func ? copy_func(i->data) : i->data, NULL);
+ } else
+ pa_idxset_put(copy, copy_func ? copy_func(i->data) : i->data, NULL);
+ }
+
+ return copy;
+}
+#endif
\ No newline at end of file
* copy will be made. */
pa_idxset *pa_idxset_copy(pa_idxset *s, pa_copy_func_t copy_func);
+#ifdef __TIZEN__
+/* Similar to pa_idxset_copy(), but with a filter that can choose the entry to be copied */
+pa_idxset* pa_idxset_filtered_copy(pa_idxset *s, pa_copy_func_t copy_func, pa_compare_func_t filter_func, const void *filter);
+#endif
+
/* A macro to ease iteration through all entries */
#define PA_IDXSET_FOREACH(e, s, idx) \
for ((e) = pa_idxset_first((s), &(idx)); (e); (e) = pa_idxset_next((s), &(idx)))