5 #include <pulsecore/prioq.h>
6 #include <pulsecore/macro.h>
10 int main(int argc
, char *argv
[]) {
16 q
= pa_prioq_new(pa_idxset_trivial_compare_func
);
19 for (i
= 0; i
< N
; i
++)
20 pa_prioq_put(q
, PA_UINT_TO_PTR((unsigned) rand()));
22 /* Remove half of it again */
23 for (i
= 0; i
< N
/2; i
++){
24 unsigned u
= PA_PTR_TO_UINT(pa_prioq_pop(q
));
30 /* Fill in another 1024 */
31 for (i
= 0; i
< N
; i
++)
32 pa_prioq_put(q
, PA_UINT_TO_PTR((unsigned) rand()));
35 /* Remove everything */
36 while (!pa_prioq_isempty(q
)) {
37 unsigned u
= PA_PTR_TO_UINT(pa_prioq_pop(q
));
41 pa_prioq_free(q
, NULL
, NULL
);