sink-input: adjust log level of empty-pop operations
[platform/upstream/pulseaudio.git] / src / pulsecore / idxset.h
index 0b12ac1..2187b28 100644 (file)
@@ -18,9 +18,7 @@
   Lesser General Public License for more details.
 
   You should have received a copy of the GNU Lesser General Public
-  License along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
+  License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
 ***/
 
 #include <inttypes.h>
@@ -49,6 +47,7 @@ int pa_idxset_string_compare_func(const void *a, const void *b);
 
 typedef unsigned (*pa_hash_func_t)(const void *p);
 typedef int (*pa_compare_func_t)(const void *a, const void *b);
+typedef void *(*pa_copy_func_t)(const void *p);
 
 typedef struct pa_idxset pa_idxset;
 
@@ -73,6 +72,9 @@ void* pa_idxset_remove_by_index(pa_idxset*s, uint32_t idx);
 /* Similar to pa_idxset_get_by_data(), but removes the entry from the idxset */
 void* pa_idxset_remove_by_data(pa_idxset*s, const void *p, uint32_t *idx);
 
+/* If free_cb is not NULL, it's called for each entry. */
+void pa_idxset_remove_all(pa_idxset *s, pa_free_cb_t free_cb);
+
 /* This may be used to iterate through all entries. When called with
    an invalid index value it returns the first entry, otherwise the
    next following. The function is best called with *idx =
@@ -99,11 +101,18 @@ void *pa_idxset_next(pa_idxset *s, uint32_t *idx);
 /* Return the current number of entries in the idxset */
 unsigned pa_idxset_size(pa_idxset*s);
 
-/* Return TRUE of the idxset is empty */
-pa_bool_t pa_idxset_isempty(pa_idxset *s);
+/* Return true of the idxset is empty */
+bool pa_idxset_isempty(pa_idxset *s);
+
+/* Duplicate the idxset. This will not copy the actual indexes. If copy_func is
+ * set, each entry is copied using the provided function, otherwise a shallow
+ * copy will be made. */
+pa_idxset *pa_idxset_copy(pa_idxset *s, pa_copy_func_t copy_func);
 
-/* Duplicate the idxset. This will not copy the actual indexes */
-pa_idxset *pa_idxset_copy(pa_idxset *s);
+#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) \