sorted_files = pa_xnew(char*, count);
for (i = 0; i < count; ++i)
sorted_files[i] = pa_dynarray_get(files, i);
- pa_dynarray_free(files, NULL, NULL);
+ pa_dynarray_free(files, NULL);
for (i = 0; i < count; ++i) {
for (unsigned j = 0; j < count; ++j) {
return a;
}
-void pa_dynarray_free(pa_dynarray* a, pa_free2_cb_t free_func, void *userdata) {
+void pa_dynarray_free(pa_dynarray *a, pa_free_cb_t free_func) {
unsigned i;
pa_assert(a);
if (free_func)
for (i = 0; i < a->n_entries; i++)
if (a->data[i])
- free_func(a->data[i], userdata);
+ free_func(a->data[i]);
pa_xfree(a->data);
pa_xfree(a);
USA.
***/
-#include <pulsecore/idxset.h>
+#include <pulse/def.h>
typedef struct pa_dynarray pa_dynarray;
/* Free the array calling the specified function for every entry in
* the array. The function may be NULL. */
-void pa_dynarray_free(pa_dynarray* a, pa_free2_cb_t free_func, void *userdata);
+void pa_dynarray_free(pa_dynarray *a, pa_free_cb_t free_func);
/* Store p at position i in the array */
void pa_dynarray_put(pa_dynarray*a, unsigned i, void *p);
#include "tokenizer.h"
-static void token_free(void *p, void *userdata) {
- pa_xfree(p);
-}
-
static void parse(pa_dynarray*a, const char *s, unsigned args) {
int infty = 0;
const char delimiter[] = " \t\n\r";
pa_dynarray *a = (pa_dynarray*) t;
pa_assert(a);
- pa_dynarray_free(a, token_free, NULL);
+ pa_dynarray_free(a, pa_xfree);
}
const char *pa_tokenizer_get(pa_tokenizer *t, unsigned i) {