mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-15 06:59:58 -05:00
Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
and:
sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
-e '181,194!s/\bTRUE\b/true/' -e \
'181,194!s/\bFALSE\b/false/' pulsecore/macro.h
This commit is contained in:
parent
e9822bfcb0
commit
d806b19714
288 changed files with 3360 additions and 3360 deletions
|
|
@ -66,7 +66,7 @@ pa_asyncmsgq *pa_asyncmsgq_new(unsigned size) {
|
|||
|
||||
PA_REFCNT_INIT(a);
|
||||
pa_assert_se(a->asyncq = pa_asyncq_new(size));
|
||||
pa_assert_se(a->mutex = pa_mutex_new(FALSE, TRUE));
|
||||
pa_assert_se(a->mutex = pa_mutex_new(false, true));
|
||||
a->current = NULL;
|
||||
|
||||
return a;
|
||||
|
|
@ -76,7 +76,7 @@ static void asyncmsgq_free(pa_asyncmsgq *a) {
|
|||
struct asyncmsgq_item *i;
|
||||
pa_assert(a);
|
||||
|
||||
while ((i = pa_asyncq_pop(a->asyncq, FALSE))) {
|
||||
while ((i = pa_asyncq_pop(a->asyncq, false))) {
|
||||
|
||||
pa_assert(!i->semaphore);
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ int pa_asyncmsgq_send(pa_asyncmsgq *a, pa_msgobject *object, int code, const voi
|
|||
|
||||
/* This mutex makes the queue multiple-writer safe. This lock is only used on the writing side */
|
||||
pa_mutex_lock(a->mutex);
|
||||
pa_assert_se(pa_asyncq_push(a->asyncq, &i, TRUE) == 0);
|
||||
pa_assert_se(pa_asyncq_push(a->asyncq, &i, true) == 0);
|
||||
pa_mutex_unlock(a->mutex);
|
||||
|
||||
pa_semaphore_wait(i.semaphore);
|
||||
|
|
@ -172,7 +172,7 @@ int pa_asyncmsgq_send(pa_asyncmsgq *a, pa_msgobject *object, int code, const voi
|
|||
return i.ret;
|
||||
}
|
||||
|
||||
int pa_asyncmsgq_get(pa_asyncmsgq *a, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *chunk, pa_bool_t wait_op) {
|
||||
int pa_asyncmsgq_get(pa_asyncmsgq *a, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *chunk, bool wait_op) {
|
||||
pa_assert(PA_REFCNT_VALUE(a) > 0);
|
||||
pa_assert(!a->current);
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ int pa_asyncmsgq_wait_for(pa_asyncmsgq *a, int code) {
|
|||
pa_memchunk chunk;
|
||||
int ret;
|
||||
|
||||
if (pa_asyncmsgq_get(a, &o, &c, &data, &offset, &chunk, TRUE) < 0)
|
||||
if (pa_asyncmsgq_get(a, &o, &c, &data, &offset, &chunk, true) < 0)
|
||||
return -1;
|
||||
|
||||
ret = pa_asyncmsgq_dispatch(o, c, data, offset, &chunk);
|
||||
|
|
@ -269,7 +269,7 @@ int pa_asyncmsgq_process_one(pa_asyncmsgq *a) {
|
|||
|
||||
pa_assert(PA_REFCNT_VALUE(a) > 0);
|
||||
|
||||
if (pa_asyncmsgq_get(a, &object, &code, &data, &offset, &chunk, FALSE) < 0)
|
||||
if (pa_asyncmsgq_get(a, &object, &code, &data, &offset, &chunk, false) < 0)
|
||||
return 0;
|
||||
|
||||
pa_asyncmsgq_ref(a);
|
||||
|
|
@ -324,7 +324,7 @@ int pa_asyncmsgq_dispatch(pa_msgobject *object, int code, void *userdata, int64_
|
|||
return 0;
|
||||
}
|
||||
|
||||
void pa_asyncmsgq_flush(pa_asyncmsgq *a, pa_bool_t run) {
|
||||
void pa_asyncmsgq_flush(pa_asyncmsgq *a, bool run) {
|
||||
pa_assert(PA_REFCNT_VALUE(a) > 0);
|
||||
|
||||
for (;;) {
|
||||
|
|
@ -335,7 +335,7 @@ void pa_asyncmsgq_flush(pa_asyncmsgq *a, pa_bool_t run) {
|
|||
pa_memchunk chunk;
|
||||
int ret;
|
||||
|
||||
if (pa_asyncmsgq_get(a, &object, &code, &data, &offset, &chunk, FALSE) < 0)
|
||||
if (pa_asyncmsgq_get(a, &object, &code, &data, &offset, &chunk, false) < 0)
|
||||
return;
|
||||
|
||||
if (!run) {
|
||||
|
|
@ -350,7 +350,7 @@ void pa_asyncmsgq_flush(pa_asyncmsgq *a, pa_bool_t run) {
|
|||
}
|
||||
}
|
||||
|
||||
pa_bool_t pa_asyncmsgq_dispatching(pa_asyncmsgq *a) {
|
||||
bool pa_asyncmsgq_dispatching(pa_asyncmsgq *a) {
|
||||
pa_assert(PA_REFCNT_VALUE(a) > 0);
|
||||
|
||||
return !!a->current;
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ void pa_asyncmsgq_unref(pa_asyncmsgq* q);
|
|||
void pa_asyncmsgq_post(pa_asyncmsgq *q, pa_msgobject *object, int code, const void *userdata, int64_t offset, const pa_memchunk *memchunk, pa_free_cb_t userdata_free_cb);
|
||||
int pa_asyncmsgq_send(pa_asyncmsgq *q, pa_msgobject *object, int code, const void *userdata, int64_t offset, const pa_memchunk *memchunk);
|
||||
|
||||
int pa_asyncmsgq_get(pa_asyncmsgq *q, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *memchunk, pa_bool_t wait);
|
||||
int pa_asyncmsgq_get(pa_asyncmsgq *q, pa_msgobject **object, int *code, void **userdata, int64_t *offset, pa_memchunk *memchunk, bool wait);
|
||||
int pa_asyncmsgq_dispatch(pa_msgobject *object, int code, void *userdata, int64_t offset, pa_memchunk *memchunk);
|
||||
void pa_asyncmsgq_done(pa_asyncmsgq *q, int ret);
|
||||
int pa_asyncmsgq_wait_for(pa_asyncmsgq *a, int code);
|
||||
int pa_asyncmsgq_process_one(pa_asyncmsgq *a);
|
||||
|
||||
void pa_asyncmsgq_flush(pa_asyncmsgq *a, pa_bool_t run);
|
||||
void pa_asyncmsgq_flush(pa_asyncmsgq *a, bool run);
|
||||
|
||||
/* For the reading side */
|
||||
int pa_asyncmsgq_read_fd(pa_asyncmsgq *q);
|
||||
|
|
@ -78,6 +78,6 @@ int pa_asyncmsgq_write_fd(pa_asyncmsgq *q);
|
|||
void pa_asyncmsgq_write_before_poll(pa_asyncmsgq *a);
|
||||
void pa_asyncmsgq_write_after_poll(pa_asyncmsgq *a);
|
||||
|
||||
pa_bool_t pa_asyncmsgq_dispatching(pa_asyncmsgq *a);
|
||||
bool pa_asyncmsgq_dispatching(pa_asyncmsgq *a);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ struct pa_asyncq {
|
|||
|
||||
PA_LLIST_HEAD(struct localq, localq);
|
||||
struct localq *last_localq;
|
||||
pa_bool_t waiting_for_post;
|
||||
bool waiting_for_post;
|
||||
};
|
||||
|
||||
PA_STATIC_FLIST_DECLARE(localq, 0, pa_xfree);
|
||||
|
|
@ -90,7 +90,7 @@ pa_asyncq *pa_asyncq_new(unsigned size) {
|
|||
|
||||
PA_LLIST_HEAD_INIT(struct localq, l->localq);
|
||||
l->last_localq = NULL;
|
||||
l->waiting_for_post = FALSE;
|
||||
l->waiting_for_post = false;
|
||||
|
||||
if (!(l->read_fdsem = pa_fdsem_new())) {
|
||||
pa_xfree(l);
|
||||
|
|
@ -132,7 +132,7 @@ void pa_asyncq_free(pa_asyncq *l, pa_free_cb_t free_cb) {
|
|||
pa_xfree(l);
|
||||
}
|
||||
|
||||
static int push(pa_asyncq*l, void *p, pa_bool_t wait_op) {
|
||||
static int push(pa_asyncq*l, void *p, bool wait_op) {
|
||||
unsigned idx;
|
||||
pa_atomic_ptr_t *cells;
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ static int push(pa_asyncq*l, void *p, pa_bool_t wait_op) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait_op) {
|
||||
static bool flush_postq(pa_asyncq *l, bool wait_op) {
|
||||
struct localq *q;
|
||||
|
||||
pa_assert(l);
|
||||
|
|
@ -172,7 +172,7 @@ static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait_op) {
|
|||
while ((q = l->last_localq)) {
|
||||
|
||||
if (push(l, q->data, wait_op) < 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
l->last_localq = q->prev;
|
||||
|
||||
|
|
@ -182,10 +182,10 @@ static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait_op) {
|
|||
pa_xfree(q);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int pa_asyncq_push(pa_asyncq*l, void *p, pa_bool_t wait_op) {
|
||||
int pa_asyncq_push(pa_asyncq*l, void *p, bool wait_op) {
|
||||
pa_assert(l);
|
||||
|
||||
if (!flush_postq(l, wait_op))
|
||||
|
|
@ -200,8 +200,8 @@ void pa_asyncq_post(pa_asyncq*l, void *p) {
|
|||
pa_assert(l);
|
||||
pa_assert(p);
|
||||
|
||||
if (flush_postq(l, FALSE))
|
||||
if (pa_asyncq_push(l, p, FALSE) >= 0)
|
||||
if (flush_postq(l, false))
|
||||
if (pa_asyncq_push(l, p, false) >= 0)
|
||||
return;
|
||||
|
||||
/* OK, we couldn't push anything in the queue. So let's queue it
|
||||
|
|
@ -222,7 +222,7 @@ void pa_asyncq_post(pa_asyncq*l, void *p) {
|
|||
return;
|
||||
}
|
||||
|
||||
void* pa_asyncq_pop(pa_asyncq*l, pa_bool_t wait_op) {
|
||||
void* pa_asyncq_pop(pa_asyncq*l, bool wait_op) {
|
||||
unsigned idx;
|
||||
void *ret;
|
||||
pa_atomic_ptr_t *cells;
|
||||
|
|
@ -302,11 +302,11 @@ void pa_asyncq_write_before_poll(pa_asyncq *l) {
|
|||
|
||||
for (;;) {
|
||||
|
||||
if (flush_postq(l, FALSE))
|
||||
if (flush_postq(l, false))
|
||||
break;
|
||||
|
||||
if (pa_fdsem_before_poll(l->read_fdsem) >= 0) {
|
||||
l->waiting_for_post = TRUE;
|
||||
l->waiting_for_post = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -317,6 +317,6 @@ void pa_asyncq_write_after_poll(pa_asyncq *l) {
|
|||
|
||||
if (l->waiting_for_post) {
|
||||
pa_fdsem_after_poll(l->read_fdsem);
|
||||
l->waiting_for_post = FALSE;
|
||||
l->waiting_for_post = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ typedef struct pa_asyncq pa_asyncq;
|
|||
pa_asyncq* pa_asyncq_new(unsigned size);
|
||||
void pa_asyncq_free(pa_asyncq* q, pa_free_cb_t free_cb);
|
||||
|
||||
void* pa_asyncq_pop(pa_asyncq *q, pa_bool_t wait);
|
||||
int pa_asyncq_push(pa_asyncq *q, void *p, pa_bool_t wait);
|
||||
void* pa_asyncq_pop(pa_asyncq *q, bool wait);
|
||||
int pa_asyncq_push(pa_asyncq *q, void *p, bool wait);
|
||||
|
||||
/* Similar to pa_asyncq_push(), but if the queue is full, postpone the
|
||||
* appending of the item locally and delay until
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return pa_atomic_sub(a, 1);
|
||||
}
|
||||
|
||||
/* Returns TRUE when the operation was successful. */
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
/* Returns true when the operation was successful. */
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
return __sync_bool_compare_and_swap(&a->value, old_i, new_i);
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
__sync_synchronize();
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
return __sync_bool_compare_and_swap(&a->value, (long) old_p, (long) new_p);
|
||||
}
|
||||
|
||||
|
|
@ -153,8 +153,8 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return nv + 1;
|
||||
}
|
||||
|
||||
/* Returns TRUE when the operation was successful. */
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
/* Returns true when the operation was successful. */
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
unsigned int r = atomic_cas_uint(&a->value, (unsigned int) old_i, (unsigned int) new_i);
|
||||
return (int) r == old_i;
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
membar_sync();
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
void *r = atomic_cas_ptr(&a->value, old_p, new_p);
|
||||
return r == old_p;
|
||||
}
|
||||
|
|
@ -326,7 +326,7 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return pa_atomic_sub(a, 1);
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
int result;
|
||||
|
||||
__asm__ __volatile__ ("lock; cmpxchgl %2, %1"
|
||||
|
|
@ -350,7 +350,7 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
a->value = (unsigned long) p;
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
void *result;
|
||||
|
||||
__asm__ __volatile__ ("lock; cmpxchgq %q2, %1"
|
||||
|
|
@ -434,7 +434,7 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return pa_atomic_sub(a, 1);
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
unsigned long not_equal, not_exclusive;
|
||||
|
||||
pa_memory_barrier();
|
||||
|
|
@ -468,7 +468,7 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
pa_memory_barrier();
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
unsigned long not_equal, not_exclusive;
|
||||
|
||||
pa_memory_barrier();
|
||||
|
|
@ -556,9 +556,9 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return pa_atomic_sub(a, 1);
|
||||
}
|
||||
|
||||
/* Returns TRUE when the operation was successful. */
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
pa_bool_t failed;
|
||||
/* Returns true when the operation was successful. */
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
bool failed;
|
||||
do {
|
||||
failed = !!__kernel_cmpxchg(old_i, new_i, &a->value);
|
||||
} while(failed && a->value == old_i);
|
||||
|
|
@ -581,8 +581,8 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
pa_memory_barrier();
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
pa_bool_t failed;
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
bool failed;
|
||||
do {
|
||||
failed = !!__kernel_cmpxchg_u((unsigned long) old_p, (unsigned long) new_p, &a->value);
|
||||
} while(failed && a->value == (unsigned long) old_p);
|
||||
|
|
@ -625,7 +625,7 @@ static inline int pa_atomic_dec(pa_atomic_t *a) {
|
|||
return (int) AO_fetch_and_sub1_full(&a->value);
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
static inline bool pa_atomic_cmpxchg(pa_atomic_t *a, int old_i, int new_i) {
|
||||
return AO_compare_and_swap_full(&a->value, (unsigned long) old_i, (unsigned long) new_i);
|
||||
}
|
||||
|
||||
|
|
@ -643,7 +643,7 @@ static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void *p) {
|
|||
AO_store_full(&a->value, (AO_t) p);
|
||||
}
|
||||
|
||||
static inline pa_bool_t pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
static inline bool pa_atomic_ptr_cmpxchg(pa_atomic_ptr_t *a, void *old_p, void* new_p) {
|
||||
return AO_compare_and_swap_full(&a->value, (AO_t) old_p, (AO_t) new_p);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct pa_aupdate {
|
|||
pa_atomic_t read_lock;
|
||||
pa_mutex *write_lock;
|
||||
pa_semaphore *semaphore;
|
||||
pa_bool_t swapped;
|
||||
bool swapped;
|
||||
};
|
||||
|
||||
pa_aupdate *pa_aupdate_new(void) {
|
||||
|
|
@ -47,7 +47,7 @@ pa_aupdate *pa_aupdate_new(void) {
|
|||
|
||||
a = pa_xnew(pa_aupdate, 1);
|
||||
pa_atomic_store(&a->read_lock, 0);
|
||||
a->write_lock = pa_mutex_new(FALSE, FALSE);
|
||||
a->write_lock = pa_mutex_new(false, false);
|
||||
a->semaphore = pa_semaphore_new(0);
|
||||
|
||||
return a;
|
||||
|
|
@ -102,7 +102,7 @@ unsigned pa_aupdate_write_begin(pa_aupdate *a) {
|
|||
|
||||
n = (unsigned) pa_atomic_load(&a->read_lock);
|
||||
|
||||
a->swapped = FALSE;
|
||||
a->swapped = false;
|
||||
|
||||
return !WHICH(n);
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ unsigned pa_aupdate_write_swap(pa_aupdate *a) {
|
|||
break;
|
||||
}
|
||||
|
||||
a->swapped = TRUE;
|
||||
a->swapped = true;
|
||||
|
||||
return WHICH(n);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct pa_auth_cookie {
|
|||
size_t size;
|
||||
};
|
||||
|
||||
pa_auth_cookie* pa_auth_cookie_get(pa_core *core, const char *cn, pa_bool_t create, size_t size) {
|
||||
pa_auth_cookie* pa_auth_cookie_get(pa_core *core, const char *cn, bool create, size_t size) {
|
||||
pa_auth_cookie *c;
|
||||
char *t;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
typedef struct pa_auth_cookie pa_auth_cookie;
|
||||
|
||||
pa_auth_cookie* pa_auth_cookie_get(pa_core *c, const char *cn, pa_bool_t create, size_t size);
|
||||
pa_auth_cookie* pa_auth_cookie_get(pa_core *c, const char *cn, bool create, size_t size);
|
||||
pa_auth_cookie* pa_auth_cookie_ref(pa_auth_cookie *c);
|
||||
void pa_auth_cookie_unref(pa_auth_cookie *c);
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ static int generate(int fd, void *ret_data, size_t length) {
|
|||
|
||||
/* Load an authorization cookie from file fn and store it in data. If
|
||||
* the cookie file doesn't exist, create it */
|
||||
static int load(const char *fn, pa_bool_t create, void *data, size_t length) {
|
||||
static int load(const char *fn, bool create, void *data, size_t length) {
|
||||
int fd = -1;
|
||||
int writable = 1;
|
||||
int unlock = 0, ret = -1;
|
||||
|
|
@ -83,7 +83,7 @@ static int load(const char *fn, pa_bool_t create, void *data, size_t length) {
|
|||
pa_assert(length > 0);
|
||||
|
||||
if (create)
|
||||
pa_make_secure_parent_dir(fn, pa_in_system_mode() ? 0755U : 0700U, -1, -1, FALSE);
|
||||
pa_make_secure_parent_dir(fn, pa_in_system_mode() ? 0755U : 0700U, -1, -1, false);
|
||||
|
||||
if ((fd = pa_open_cloexec(fn, (create ? O_RDWR|O_CREAT : O_RDONLY)|O_BINARY, S_IRUSR|S_IWUSR)) < 0) {
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ finish:
|
|||
}
|
||||
|
||||
/* Load a cookie from a cookie file. If the file doesn't exist, create it. */
|
||||
int pa_authkey_load(const char *path, pa_bool_t create, void *data, size_t length) {
|
||||
int pa_authkey_load(const char *path, bool create, void *data, size_t length) {
|
||||
int ret;
|
||||
|
||||
pa_assert(path);
|
||||
|
|
@ -172,7 +172,7 @@ static char *normalize_path(const char *fn) {
|
|||
|
||||
/* Load a cookie from a file in the home directory. If the specified
|
||||
* path starts with /, use it as absolute path instead. */
|
||||
int pa_authkey_load_auto(const char *fn, pa_bool_t create, void *data, size_t length) {
|
||||
int pa_authkey_load_auto(const char *fn, bool create, void *data, size_t length) {
|
||||
char *p;
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
int pa_authkey_load(const char *path, pa_bool_t create, void *data, size_t len);
|
||||
int pa_authkey_load_auto(const char *fn, pa_bool_t create, void *data, size_t length);
|
||||
int pa_authkey_load(const char *path, bool create, void *data, size_t len);
|
||||
int pa_authkey_load_auto(const char *fn, bool create, void *data, size_t length);
|
||||
|
||||
int pa_authkey_save(const char *path, const void *data, size_t length);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "bitset.h"
|
||||
|
||||
void pa_bitset_set(pa_bitset_t *b, unsigned k, pa_bool_t v) {
|
||||
void pa_bitset_set(pa_bitset_t *b, unsigned k, bool v) {
|
||||
pa_assert(b);
|
||||
|
||||
if (v)
|
||||
|
|
@ -38,14 +38,14 @@ void pa_bitset_set(pa_bitset_t *b, unsigned k, pa_bool_t v) {
|
|||
b[k >> 5] &= ~((uint32_t) (1 << (k & 31)));
|
||||
}
|
||||
|
||||
pa_bool_t pa_bitset_get(const pa_bitset_t *b, unsigned k) {
|
||||
bool pa_bitset_get(const pa_bitset_t *b, unsigned k) {
|
||||
return !!(b[k >> 5] & (1 << (k & 31)));
|
||||
}
|
||||
|
||||
pa_bool_t pa_bitset_equals(const pa_bitset_t *b, unsigned n, ...) {
|
||||
bool pa_bitset_equals(const pa_bitset_t *b, unsigned n, ...) {
|
||||
va_list ap;
|
||||
pa_bitset_t *a;
|
||||
pa_bool_t equal;
|
||||
bool equal;
|
||||
|
||||
a = pa_xnew0(pa_bitset_t, PA_BITSET_ELEMENTS(n));
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ pa_bool_t pa_bitset_equals(const pa_bitset_t *b, unsigned n, ...) {
|
|||
if (j < 0)
|
||||
break;
|
||||
|
||||
pa_bitset_set(a, j, TRUE);
|
||||
pa_bitset_set(a, j, true);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
typedef uint32_t pa_bitset_t;
|
||||
|
||||
void pa_bitset_set(pa_bitset_t *b, unsigned k, pa_bool_t v);
|
||||
pa_bool_t pa_bitset_get(const pa_bitset_t *b, unsigned k);
|
||||
pa_bool_t pa_bitset_equals(const pa_bitset_t *b, unsigned n, ...);
|
||||
void pa_bitset_set(pa_bitset_t *b, unsigned k, bool v);
|
||||
bool pa_bitset_get(const pa_bitset_t *b, unsigned k);
|
||||
bool pa_bitset_equals(const pa_bitset_t *b, unsigned n, ...);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
|
|||
port->card = c;
|
||||
|
||||
c->active_profile = NULL;
|
||||
c->save_profile = FALSE;
|
||||
c->save_profile = false;
|
||||
|
||||
if (data->active_profile)
|
||||
if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
|
||||
|
|
@ -204,7 +204,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
|
|||
c->set_profile = NULL;
|
||||
|
||||
pa_device_init_description(c->proplist);
|
||||
pa_device_init_icon(c->proplist, TRUE);
|
||||
pa_device_init_icon(c->proplist, true);
|
||||
pa_device_init_intended_roles(c->proplist);
|
||||
|
||||
pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
|
||||
|
|
@ -250,7 +250,7 @@ void pa_card_free(pa_card *c) {
|
|||
pa_xfree(c);
|
||||
}
|
||||
|
||||
int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save) {
|
||||
int pa_card_set_profile(pa_card *c, const char *name, bool save) {
|
||||
pa_card_profile *profile;
|
||||
int r;
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_card_suspend(pa_card *c, pa_bool_t suspend, pa_suspend_cause_t cause) {
|
||||
int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause) {
|
||||
pa_sink *sink;
|
||||
pa_source *source;
|
||||
uint32_t idx;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ struct pa_card {
|
|||
|
||||
pa_hashmap *ports;
|
||||
|
||||
pa_bool_t save_profile:1;
|
||||
bool save_profile:1;
|
||||
|
||||
void *userdata;
|
||||
|
||||
|
|
@ -94,9 +94,9 @@ typedef struct pa_card_new_data {
|
|||
|
||||
pa_hashmap *ports;
|
||||
|
||||
pa_bool_t namereg_fail:1;
|
||||
bool namereg_fail:1;
|
||||
|
||||
pa_bool_t save_profile:1;
|
||||
bool save_profile:1;
|
||||
} pa_card_new_data;
|
||||
|
||||
pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
|
||||
|
|
@ -115,8 +115,8 @@ void pa_card_free(pa_card *c);
|
|||
|
||||
void pa_card_add_profile(pa_card *c, pa_card_profile *profile);
|
||||
|
||||
int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save);
|
||||
int pa_card_set_profile(pa_card *c, const char *name, bool save);
|
||||
|
||||
int pa_card_suspend(pa_card *c, pa_bool_t suspend, pa_suspend_cause_t cause);
|
||||
int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
struct command {
|
||||
const char *name;
|
||||
int (*proc) (pa_core *c, pa_tokenizer*t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
int (*proc) (pa_core *c, pa_tokenizer*t, pa_strbuf *buf, bool *fail);
|
||||
const char *help;
|
||||
unsigned args;
|
||||
};
|
||||
|
|
@ -82,61 +82,61 @@ enum {
|
|||
};
|
||||
|
||||
/* Prototypes for all available commands */
|
||||
static int pa_cli_command_exit(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_outputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_describe(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_output_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_output_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_kill_client(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_kill_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_kill_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_scache_play(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_scache_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_scache_list(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_scache_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_scache_load_dir(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_log_target(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_port_offset(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
|
||||
static int pa_cli_command_exit(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_outputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_describe(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_output_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_output_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_kill_client(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_kill_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_kill_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_scache_play(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_scache_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_scache_list(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_scache_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_scache_load_dir(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_log_target(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_port_offset(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail);
|
||||
|
||||
/* A method table for all available commands */
|
||||
|
||||
|
|
@ -214,19 +214,19 @@ static uint32_t parse_index(const char *n) {
|
|||
return idx;
|
||||
}
|
||||
|
||||
static int pa_cli_command_exit(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_exit(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
pa_assert(buf);
|
||||
pa_assert(fail);
|
||||
|
||||
if (pa_core_exit(c, FALSE, 0) < 0)
|
||||
if (pa_core_exit(c, false, 0) < 0)
|
||||
pa_strbuf_puts(buf, "Not allowed to terminate daemon.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const struct command*command;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -242,7 +242,7 @@ static int pa_cli_command_help(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -256,7 +256,7 @@ static int pa_cli_command_modules(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, p
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -270,7 +270,7 @@ static int pa_cli_command_clients(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, p
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -284,7 +284,7 @@ static int pa_cli_command_cards(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -298,7 +298,7 @@ static int pa_cli_command_sinks(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -312,7 +312,7 @@ static int pa_cli_command_sources(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, p
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -326,7 +326,7 @@ static int pa_cli_command_sink_inputs(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_outputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_outputs(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -340,7 +340,7 @@ static int pa_cli_command_source_outputs(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
char bytes[PA_BYTES_SNPRINT_MAX];
|
||||
|
|
@ -407,7 +407,7 @@ static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
pa_assert(buf);
|
||||
|
|
@ -425,7 +425,7 @@ static int pa_cli_command_info(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *name;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -446,11 +446,11 @@ static int pa_cli_command_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_module *m;
|
||||
uint32_t idx;
|
||||
const char *i;
|
||||
pa_bool_t unloaded = FALSE;
|
||||
bool unloaded = false;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
|
|
@ -468,16 +468,16 @@ static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_module_unload_request(m, FALSE);
|
||||
pa_module_unload_request(m, false);
|
||||
|
||||
} else {
|
||||
PA_IDXSET_FOREACH(m, c->modules, idx)
|
||||
if (pa_streq(i, m->name)) {
|
||||
unloaded = TRUE;
|
||||
pa_module_unload_request(m, FALSE);
|
||||
unloaded = true;
|
||||
pa_module_unload_request(m, false);
|
||||
}
|
||||
|
||||
if (unloaded == FALSE) {
|
||||
if (unloaded == false) {
|
||||
pa_strbuf_printf(buf, "Module %s not loaded.\n", i);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -486,7 +486,7 @@ static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_describe(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_describe(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *name;
|
||||
pa_modinfo *i;
|
||||
|
||||
|
|
@ -527,7 +527,7 @@ static int pa_cli_command_describe(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_sink *sink;
|
||||
uint32_t volume;
|
||||
|
|
@ -564,11 +564,11 @@ static int pa_cli_command_sink_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
}
|
||||
|
||||
pa_cvolume_set(&cvolume, 1, volume);
|
||||
pa_sink_set_volume(sink, &cvolume, TRUE, TRUE);
|
||||
pa_sink_set_volume(sink, &cvolume, true, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_sink_input *si;
|
||||
pa_volume_t volume;
|
||||
|
|
@ -616,11 +616,11 @@ static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strb
|
|||
}
|
||||
|
||||
pa_cvolume_set(&cvolume, 1, volume);
|
||||
pa_sink_input_set_volume(si, &cvolume, TRUE, TRUE);
|
||||
pa_sink_input_set_volume(si, &cvolume, true, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_source *source;
|
||||
uint32_t volume;
|
||||
|
|
@ -657,11 +657,11 @@ static int pa_cli_command_source_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *
|
|||
}
|
||||
|
||||
pa_cvolume_set(&cvolume, 1, volume);
|
||||
pa_source_set_volume(source, &cvolume, TRUE, TRUE);
|
||||
pa_source_set_volume(source, &cvolume, true, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_output_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_output_volume(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_source_output *so;
|
||||
pa_volume_t volume;
|
||||
|
|
@ -709,11 +709,11 @@ static int pa_cli_command_source_output_volume(pa_core *c, pa_tokenizer *t, pa_s
|
|||
}
|
||||
|
||||
pa_cvolume_set(&cvolume, 1, volume);
|
||||
pa_source_output_set_volume(so, &cvolume, TRUE, TRUE);
|
||||
pa_source_output_set_volume(so, &cvolume, true, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *m;
|
||||
pa_sink *sink;
|
||||
int mute;
|
||||
|
|
@ -743,11 +743,11 @@ static int pa_cli_command_sink_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_sink_set_mute(sink, mute, TRUE);
|
||||
pa_sink_set_mute(sink, mute, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *m;
|
||||
pa_source *source;
|
||||
int mute;
|
||||
|
|
@ -777,11 +777,11 @@ static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_source_set_mute(source, mute, TRUE);
|
||||
pa_source_set_mute(source, mute, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *s;
|
||||
pa_sink *sink;
|
||||
pa_proplist *p;
|
||||
|
|
@ -818,7 +818,7 @@ static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_s
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *s;
|
||||
pa_source *source;
|
||||
pa_proplist *p;
|
||||
|
|
@ -855,7 +855,7 @@ static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *s;
|
||||
pa_sink_input *si;
|
||||
uint32_t idx;
|
||||
|
|
@ -898,7 +898,7 @@ static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *s;
|
||||
pa_source_output *so;
|
||||
uint32_t idx;
|
||||
|
|
@ -941,7 +941,7 @@ static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_sink_input *si;
|
||||
uint32_t idx;
|
||||
|
|
@ -977,11 +977,11 @@ static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_sink_input_set_mute(si, mute, TRUE);
|
||||
pa_sink_input_set_mute(si, mute, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_output_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_output_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *v;
|
||||
pa_source_output *so;
|
||||
uint32_t idx;
|
||||
|
|
@ -1017,11 +1017,11 @@ static int pa_cli_command_source_output_mute(pa_core *c, pa_tokenizer *t, pa_str
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_source_output_set_mute(so, mute, TRUE);
|
||||
pa_source_output_set_mute(so, mute, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
pa_sink *s;
|
||||
|
||||
|
|
@ -1043,7 +1043,7 @@ static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
pa_source *s;
|
||||
|
||||
|
|
@ -1064,7 +1064,7 @@ static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_kill_client(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_kill_client(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
pa_client *client;
|
||||
uint32_t idx;
|
||||
|
|
@ -1093,7 +1093,7 @@ static int pa_cli_command_kill_client(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_kill_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_kill_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
pa_sink_input *sink_input;
|
||||
uint32_t idx;
|
||||
|
|
@ -1122,7 +1122,7 @@ static int pa_cli_command_kill_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_kill_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_kill_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
pa_source_output *source_output;
|
||||
uint32_t idx;
|
||||
|
|
@ -1151,7 +1151,7 @@ static int pa_cli_command_kill_source_output(pa_core *c, pa_tokenizer *t, pa_str
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_scache_list(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_scache_list(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
char *s;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -1166,7 +1166,7 @@ static int pa_cli_command_scache_list(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_scache_play(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_scache_play(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *sink_name;
|
||||
pa_sink *sink;
|
||||
uint32_t idx;
|
||||
|
|
@ -1196,7 +1196,7 @@ static int pa_cli_command_scache_play(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_scache_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_scache_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -1217,7 +1217,7 @@ static int pa_cli_command_scache_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_scache_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_scache_load(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *fname, *n;
|
||||
int r;
|
||||
|
||||
|
|
@ -1242,7 +1242,7 @@ static int pa_cli_command_scache_load(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_scache_load_dir(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_scache_load_dir(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *pname;
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
|
|
@ -1263,7 +1263,7 @@ static int pa_cli_command_scache_load_dir(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *fname, *sink_name;
|
||||
pa_sink *sink;
|
||||
|
||||
|
|
@ -1285,7 +1285,7 @@ static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return pa_play_file(sink, fname, NULL);
|
||||
}
|
||||
|
||||
static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
pa_assert(buf);
|
||||
|
|
@ -1295,7 +1295,7 @@ static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strb
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
pa_assert(buf);
|
||||
|
|
@ -1306,7 +1306,7 @@ static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *k;
|
||||
pa_sink_input *si;
|
||||
pa_sink *sink;
|
||||
|
|
@ -1342,14 +1342,14 @@ static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_sink_input_move_to(si, sink, TRUE) < 0) {
|
||||
if (pa_sink_input_move_to(si, sink, true) < 0) {
|
||||
pa_strbuf_puts(buf, "Moved failed.\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *k;
|
||||
pa_source_output *so;
|
||||
pa_source *source;
|
||||
|
|
@ -1385,14 +1385,14 @@ static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_str
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_source_output_move_to(so, source, TRUE) < 0) {
|
||||
if (pa_source_output_move_to(so, source, true) < 0) {
|
||||
pa_strbuf_puts(buf, "Moved failed.\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *m;
|
||||
pa_sink *sink;
|
||||
int suspend, r;
|
||||
|
|
@ -1430,7 +1430,7 @@ static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *m;
|
||||
pa_source *source;
|
||||
int suspend, r;
|
||||
|
|
@ -1468,7 +1468,7 @@ static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
int suspend, r;
|
||||
|
||||
|
|
@ -1498,7 +1498,7 @@ static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, p
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_log_target(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_log_target(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
pa_log_target *log_target = NULL;
|
||||
|
||||
|
|
@ -1535,7 +1535,7 @@ static int pa_cli_command_log_target(pa_core *c, pa_tokenizer *t, pa_strbuf *buf
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
uint32_t level;
|
||||
|
||||
|
|
@ -1559,7 +1559,7 @@ static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
int b;
|
||||
|
||||
|
|
@ -1583,7 +1583,7 @@ static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
int b;
|
||||
|
||||
|
|
@ -1607,7 +1607,7 @@ static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *m;
|
||||
uint32_t nframes;
|
||||
|
||||
|
|
@ -1631,7 +1631,7 @@ static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *p;
|
||||
pa_card *card;
|
||||
|
||||
|
|
@ -1655,7 +1655,7 @@ static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *b
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_card_set_profile(card, p, TRUE) < 0) {
|
||||
if (pa_card_set_profile(card, p, true) < 0) {
|
||||
pa_strbuf_printf(buf, "Failed to set card profile to '%s'.\n", p);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1663,7 +1663,7 @@ static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *p;
|
||||
pa_sink *sink;
|
||||
|
||||
|
|
@ -1687,7 +1687,7 @@ static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_sink_set_port(sink, p, TRUE) < 0) {
|
||||
if (pa_sink_set_port(sink, p, true) < 0) {
|
||||
pa_strbuf_printf(buf, "Failed to set sink port to '%s'.\n", p);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1695,7 +1695,7 @@ static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *p;
|
||||
pa_source *source;
|
||||
|
||||
|
|
@ -1719,7 +1719,7 @@ static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_source_set_port(source, p, TRUE) < 0) {
|
||||
if (pa_source_set_port(source, p, true) < 0) {
|
||||
pa_strbuf_printf(buf, "Failed to set source port to '%s'.\n", p);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1727,7 +1727,7 @@ static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_port_offset(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_port_offset(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
const char *n, *p, *l;
|
||||
pa_device_port *port;
|
||||
pa_card *card;
|
||||
|
|
@ -1773,12 +1773,12 @@ static int pa_cli_command_port_offset(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_module *m;
|
||||
pa_sink *sink;
|
||||
pa_source *source;
|
||||
pa_card *card;
|
||||
pa_bool_t nl;
|
||||
bool nl;
|
||||
uint32_t idx;
|
||||
time_t now;
|
||||
#ifdef HAVE_CTIME_R
|
||||
|
|
@ -1808,48 +1808,48 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
pa_strbuf_puts(buf, "\n");
|
||||
}
|
||||
|
||||
nl = FALSE;
|
||||
nl = false;
|
||||
PA_IDXSET_FOREACH(sink, c->sinks, idx) {
|
||||
|
||||
if (!nl) {
|
||||
pa_strbuf_puts(buf, "\n");
|
||||
nl = TRUE;
|
||||
nl = true;
|
||||
}
|
||||
|
||||
pa_strbuf_printf(buf, "set-sink-volume %s 0x%03x\n", sink->name, pa_cvolume_max(pa_sink_get_volume(sink, FALSE)));
|
||||
pa_strbuf_printf(buf, "set-sink-mute %s %s\n", sink->name, pa_yes_no(pa_sink_get_mute(sink, FALSE)));
|
||||
pa_strbuf_printf(buf, "set-sink-volume %s 0x%03x\n", sink->name, pa_cvolume_max(pa_sink_get_volume(sink, false)));
|
||||
pa_strbuf_printf(buf, "set-sink-mute %s %s\n", sink->name, pa_yes_no(pa_sink_get_mute(sink, false)));
|
||||
pa_strbuf_printf(buf, "suspend-sink %s %s\n", sink->name, pa_yes_no(pa_sink_get_state(sink) == PA_SINK_SUSPENDED));
|
||||
}
|
||||
|
||||
nl = FALSE;
|
||||
nl = false;
|
||||
PA_IDXSET_FOREACH(source, c->sources, idx) {
|
||||
|
||||
if (!nl) {
|
||||
pa_strbuf_puts(buf, "\n");
|
||||
nl = TRUE;
|
||||
nl = true;
|
||||
}
|
||||
|
||||
pa_strbuf_printf(buf, "set-source-volume %s 0x%03x\n", source->name, pa_cvolume_max(pa_source_get_volume(source, FALSE)));
|
||||
pa_strbuf_printf(buf, "set-source-mute %s %s\n", source->name, pa_yes_no(pa_source_get_mute(source, FALSE)));
|
||||
pa_strbuf_printf(buf, "set-source-volume %s 0x%03x\n", source->name, pa_cvolume_max(pa_source_get_volume(source, false)));
|
||||
pa_strbuf_printf(buf, "set-source-mute %s %s\n", source->name, pa_yes_no(pa_source_get_mute(source, false)));
|
||||
pa_strbuf_printf(buf, "suspend-source %s %s\n", source->name, pa_yes_no(pa_source_get_state(source) == PA_SOURCE_SUSPENDED));
|
||||
}
|
||||
|
||||
nl = FALSE;
|
||||
nl = false;
|
||||
PA_IDXSET_FOREACH(card, c->cards, idx) {
|
||||
|
||||
if (!nl) {
|
||||
pa_strbuf_puts(buf, "\n");
|
||||
nl = TRUE;
|
||||
nl = true;
|
||||
}
|
||||
|
||||
pa_strbuf_printf(buf, "set-card-profile %s %s\n", card->name, card->active_profile->name);
|
||||
}
|
||||
|
||||
nl = FALSE;
|
||||
nl = false;
|
||||
if ((sink = pa_namereg_get_default_sink(c))) {
|
||||
if (!nl) {
|
||||
pa_strbuf_puts(buf, "\n");
|
||||
nl = TRUE;
|
||||
nl = true;
|
||||
}
|
||||
|
||||
pa_strbuf_printf(buf, "set-default-sink %s\n", sink->name);
|
||||
|
|
@ -1867,7 +1867,7 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {
|
||||
pa_sink *s;
|
||||
pa_source *so;
|
||||
pa_sink_input *i;
|
||||
|
|
@ -1923,7 +1923,7 @@ static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *b
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail, int *ifstate) {
|
||||
int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *buf, bool *fail, int *ifstate) {
|
||||
const char *cs;
|
||||
|
||||
pa_assert(c);
|
||||
|
|
@ -1955,9 +1955,9 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
|
|||
if (ifstate && *ifstate == IFSTATE_FALSE)
|
||||
return 0;
|
||||
if (!strcmp(cs, META_FAIL))
|
||||
*fail = TRUE;
|
||||
*fail = true;
|
||||
else if (!strcmp(cs, META_NOFAIL))
|
||||
*fail = FALSE;
|
||||
*fail = false;
|
||||
else {
|
||||
size_t l;
|
||||
l = strcspn(cs, whitespace);
|
||||
|
|
@ -1982,7 +1982,7 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
|
|||
unsigned i, count;
|
||||
char **sorted_files;
|
||||
struct dirent *de;
|
||||
pa_bool_t failed = FALSE;
|
||||
bool failed = false;
|
||||
pa_dynarray *files = pa_dynarray_new(NULL);
|
||||
|
||||
while ((de = readdir(d))) {
|
||||
|
|
@ -2018,7 +2018,7 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
|
|||
for (i = 0; i < count; ++i) {
|
||||
if (!failed) {
|
||||
if (pa_cli_command_execute_file(c, sorted_files[i], buf, fail) < 0 && *fail)
|
||||
failed = TRUE;
|
||||
failed = true;
|
||||
}
|
||||
|
||||
pa_xfree(sorted_files[i]);
|
||||
|
|
@ -2121,15 +2121,15 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_cli_command_execute_line(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
int pa_cli_command_execute_line(pa_core *c, const char *s, pa_strbuf *buf, bool *fail) {
|
||||
return pa_cli_command_execute_line_stateful(c, s, buf, fail, NULL);
|
||||
}
|
||||
|
||||
int pa_cli_command_execute_file_stream(pa_core *c, FILE *f, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
int pa_cli_command_execute_file_stream(pa_core *c, FILE *f, pa_strbuf *buf, bool *fail) {
|
||||
char line[2048];
|
||||
int ifstate = IFSTATE_NONE;
|
||||
int ret = -1;
|
||||
pa_bool_t _fail = TRUE;
|
||||
bool _fail = true;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(f);
|
||||
|
|
@ -2152,10 +2152,10 @@ fail:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int pa_cli_command_execute_file(pa_core *c, const char *fn, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
int pa_cli_command_execute_file(pa_core *c, const char *fn, pa_strbuf *buf, bool *fail) {
|
||||
FILE *f = NULL;
|
||||
int ret = -1;
|
||||
pa_bool_t _fail = TRUE;
|
||||
bool _fail = true;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(fn);
|
||||
|
|
@ -2181,10 +2181,10 @@ fail:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail) {
|
||||
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, bool *fail) {
|
||||
const char *p;
|
||||
int ifstate = IFSTATE_NONE;
|
||||
pa_bool_t _fail = TRUE;
|
||||
bool _fail = true;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(s);
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@
|
|||
* buffer *buf. If *fail is non-zero the function will return -1 when
|
||||
* one or more of the executed commands failed. *fail
|
||||
* may be modified by the function call. */
|
||||
int pa_cli_command_execute_line(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail);
|
||||
int pa_cli_command_execute_line(pa_core *c, const char *s, pa_strbuf *buf, bool *fail);
|
||||
|
||||
/* Execute a whole file of CLI commands */
|
||||
int pa_cli_command_execute_file(pa_core *c, const char *fn, pa_strbuf *buf, pa_bool_t *fail);
|
||||
int pa_cli_command_execute_file(pa_core *c, const char *fn, pa_strbuf *buf, bool *fail);
|
||||
|
||||
/* Execute a whole file of CLI commands */
|
||||
int pa_cli_command_execute_file_stream(pa_core *c, FILE *f, pa_strbuf *buf, pa_bool_t *fail);
|
||||
int pa_cli_command_execute_file_stream(pa_core *c, FILE *f, pa_strbuf *buf, bool *fail);
|
||||
|
||||
/* Split the specified string into lines and run pa_cli_command_execute_line() for each. */
|
||||
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail);
|
||||
int pa_cli_command_execute(pa_core *c, const char *s, pa_strbuf *buf, bool *fail);
|
||||
|
||||
/* Same as pa_cli_command_execute_line() but also take ifstate var. */
|
||||
int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail, int *ifstate);
|
||||
int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *buf, bool *fail, int *ifstate);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -295,15 +295,15 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
sink->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
|
||||
sink->suspend_cause & PA_SUSPEND_SESSION ? "SESSION" : "",
|
||||
sink->priority,
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, false)),
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_get_volume(sink, FALSE)) : "",
|
||||
pa_cvolume_get_balance(pa_sink_get_volume(sink, FALSE), &sink->channel_map),
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_sink_get_volume(sink, false)) : "",
|
||||
pa_cvolume_get_balance(pa_sink_get_volume(sink, false), &sink->channel_map),
|
||||
pa_volume_snprint(v, sizeof(v), sink->base_volume),
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), sink->base_volume) : "",
|
||||
sink->n_volume_steps,
|
||||
pa_yes_no(pa_sink_get_mute(sink, FALSE)),
|
||||
pa_yes_no(pa_sink_get_mute(sink, false)),
|
||||
(double) pa_sink_get_latency(sink) / (double) PA_USEC_PER_MSEC,
|
||||
(unsigned long) pa_sink_get_max_request(sink) / 1024,
|
||||
(unsigned long) pa_sink_get_max_rewind(sink) / 1024,
|
||||
|
|
@ -412,15 +412,15 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
source->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
|
||||
source->suspend_cause & PA_SUSPEND_SESSION ? "SESSION" : "",
|
||||
source->priority,
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, false)),
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_source_get_volume(source, FALSE)) : "",
|
||||
pa_cvolume_get_balance(pa_source_get_volume(source, FALSE), &source->channel_map),
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), pa_source_get_volume(source, false)) : "",
|
||||
pa_cvolume_get_balance(pa_source_get_volume(source, false), &source->channel_map),
|
||||
pa_volume_snprint(v, sizeof(v), source->base_volume),
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? pa_sw_volume_snprint_dB(vdb, sizeof(vdb), source->base_volume) : "",
|
||||
source->n_volume_steps,
|
||||
pa_yes_no(pa_source_get_mute(source, FALSE)),
|
||||
pa_yes_no(pa_source_get_mute(source, false)),
|
||||
(double) pa_source_get_latency(source) / PA_USEC_PER_MSEC,
|
||||
(unsigned long) pa_source_get_max_rewind(source) / 1024,
|
||||
pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
|
||||
|
|
@ -502,7 +502,7 @@ char *pa_source_output_list_to_string(pa_core *c) {
|
|||
pa_assert(o->source);
|
||||
|
||||
if (pa_source_output_is_volume_readable(o)) {
|
||||
pa_source_output_get_volume(o, &v, TRUE);
|
||||
pa_source_output_get_volume(o, &v, true);
|
||||
volume_str = pa_sprintf_malloc("%s\n\t %s\n\t balance %0.2f",
|
||||
pa_cvolume_snprint(cv, sizeof(cv), &v),
|
||||
pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &v),
|
||||
|
|
@ -601,7 +601,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
|
|||
pa_assert(i->sink);
|
||||
|
||||
if (pa_sink_input_is_volume_readable(i)) {
|
||||
pa_sink_input_get_volume(i, &v, TRUE);
|
||||
pa_sink_input_get_volume(i, &v, true);
|
||||
volume_str = pa_sprintf_malloc("%s\n\t %s\n\t balance %0.2f",
|
||||
pa_cvolume_snprint(cv, sizeof(cv), &v),
|
||||
pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &v),
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ struct pa_cli {
|
|||
|
||||
pa_client *client;
|
||||
|
||||
pa_bool_t fail, kill_requested;
|
||||
bool fail, kill_requested;
|
||||
int defer_kill;
|
||||
|
||||
char *last_line;
|
||||
|
|
@ -95,7 +95,7 @@ pa_cli* pa_cli_new(pa_core *core, pa_iochannel *io, pa_module *m) {
|
|||
pa_ioline_set_callback(c->line, line_callback, c);
|
||||
pa_ioline_puts(c->line, "Welcome to PulseAudio! Use \"help\" for usage information.\n"PROMPT);
|
||||
|
||||
c->fail = c->kill_requested = FALSE;
|
||||
c->fail = c->kill_requested = false;
|
||||
c->defer_kill = 0;
|
||||
|
||||
c->last_line = NULL;
|
||||
|
|
@ -122,7 +122,7 @@ static void client_kill(pa_client *client) {
|
|||
pa_log_debug("CLI client killed.");
|
||||
|
||||
if (c->defer_kill)
|
||||
c->kill_requested = TRUE;
|
||||
c->kill_requested = true;
|
||||
else if (c->eof_callback)
|
||||
c->eof_callback(c, c->userdata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ static int parse_line(pa_config_parser_state *state) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
state->in_proplist = TRUE;
|
||||
state->in_proplist = true;
|
||||
} else
|
||||
state->in_proplist = FALSE;
|
||||
state->in_proplist = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ static int parse_line(pa_config_parser_state *state) {
|
|||
/* Go through the file and parse each line */
|
||||
int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, void *userdata) {
|
||||
int r = -1;
|
||||
pa_bool_t do_close = !f;
|
||||
bool do_close = !f;
|
||||
pa_config_parser_state state;
|
||||
|
||||
pa_assert(filename);
|
||||
|
|
@ -268,7 +268,7 @@ int pa_config_parse_size(pa_config_parser_state *state) {
|
|||
|
||||
int pa_config_parse_bool(pa_config_parser_state *state) {
|
||||
int k;
|
||||
pa_bool_t *b;
|
||||
bool *b;
|
||||
|
||||
pa_assert(state);
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ int pa_config_parse_bool(pa_config_parser_state *state) {
|
|||
|
||||
int pa_config_parse_not_bool(pa_config_parser_state *state) {
|
||||
int k;
|
||||
pa_bool_t *b;
|
||||
bool *b;
|
||||
|
||||
pa_assert(state);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct pa_config_parser_state {
|
|||
const pa_config_item *item_table;
|
||||
char buf[4096];
|
||||
pa_proplist *proplist;
|
||||
pa_bool_t in_proplist;
|
||||
bool in_proplist;
|
||||
};
|
||||
|
||||
/* The configuration file parsing routine. Expects a table of
|
||||
|
|
|
|||
|
|
@ -84,11 +84,11 @@ struct timeval *pa_rtclock_get(struct timeval *tv) {
|
|||
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
/* No locking or atomic ops for no_monotonic here */
|
||||
static pa_bool_t no_monotonic = FALSE;
|
||||
static bool no_monotonic = false;
|
||||
|
||||
if (!no_monotonic)
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
|
||||
no_monotonic = TRUE;
|
||||
no_monotonic = true;
|
||||
|
||||
if (no_monotonic)
|
||||
#endif /* CLOCK_MONOTONIC */
|
||||
|
|
@ -116,7 +116,7 @@ struct timeval *pa_rtclock_get(struct timeval *tv) {
|
|||
return pa_gettimeofday(tv);
|
||||
}
|
||||
|
||||
pa_bool_t pa_rtclock_hrtimer(void) {
|
||||
bool pa_rtclock_hrtimer(void) {
|
||||
|
||||
#if defined (OS_IS_DARWIN)
|
||||
mach_timebase_info_data_t tbi;
|
||||
|
|
@ -148,7 +148,7 @@ pa_bool_t pa_rtclock_hrtimer(void) {
|
|||
|
||||
#endif /* HAVE_CLOCK_GETTIME */
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#define TIMER_SLACK_NS (int) ((500 * PA_NSEC_PER_USEC))
|
||||
|
|
@ -252,7 +252,7 @@ static struct timeval* wallclock_from_rtclock(struct timeval *tv) {
|
|||
return tv;
|
||||
}
|
||||
|
||||
struct timeval* pa_timeval_rtstore(struct timeval *tv, pa_usec_t v, pa_bool_t rtclock) {
|
||||
struct timeval* pa_timeval_rtstore(struct timeval *tv, pa_usec_t v, bool rtclock) {
|
||||
pa_assert(tv);
|
||||
|
||||
if (v == PA_USEC_INVALID)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ struct timeval;
|
|||
struct timeval *pa_rtclock_get(struct timeval *ts);
|
||||
|
||||
pa_usec_t pa_rtclock_age(const struct timeval *tv);
|
||||
pa_bool_t pa_rtclock_hrtimer(void);
|
||||
bool pa_rtclock_hrtimer(void);
|
||||
void pa_rtclock_hrtimer_enable(void);
|
||||
|
||||
/* timer with a resolution better than this are considered high-resolution */
|
||||
|
|
@ -48,6 +48,6 @@ pa_usec_t pa_timespec_load(const struct timespec *ts);
|
|||
struct timespec* pa_timespec_store(struct timespec *ts, pa_usec_t v);
|
||||
#endif
|
||||
|
||||
struct timeval* pa_timeval_rtstore(struct timeval *tv, pa_usec_t v, pa_bool_t rtclock);
|
||||
struct timeval* pa_timeval_rtstore(struct timeval *tv, pa_usec_t v, bool rtclock);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ static pa_scache_entry* scache_add_item(pa_core *c, const char *name) {
|
|||
} else {
|
||||
e = pa_xnew(pa_scache_entry, 1);
|
||||
|
||||
if (!pa_namereg_register(c, name, PA_NAMEREG_SAMPLE, e, TRUE)) {
|
||||
if (!pa_namereg_register(c, name, PA_NAMEREG_SAMPLE, e, true)) {
|
||||
pa_xfree(e);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -126,13 +126,13 @@ static pa_scache_entry* scache_add_item(pa_core *c, const char *name) {
|
|||
e->last_used_time = 0;
|
||||
pa_memchunk_reset(&e->memchunk);
|
||||
e->filename = NULL;
|
||||
e->lazy = FALSE;
|
||||
e->lazy = false;
|
||||
e->last_used_time = 0;
|
||||
|
||||
pa_sample_spec_init(&e->sample_spec);
|
||||
pa_channel_map_init(&e->channel_map);
|
||||
pa_cvolume_init(&e->volume);
|
||||
e->volume_is_set = FALSE;
|
||||
e->volume_is_set = false;
|
||||
|
||||
pa_proplist_sets(e->proplist, PA_PROP_MEDIA_ROLE, "event");
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ int pa_scache_add_item(
|
|||
pa_sample_spec_init(&e->sample_spec);
|
||||
pa_channel_map_init(&e->channel_map);
|
||||
pa_cvolume_init(&e->volume);
|
||||
e->volume_is_set = FALSE;
|
||||
e->volume_is_set = false;
|
||||
|
||||
if (ss) {
|
||||
e->sample_spec = *ss;
|
||||
|
|
@ -249,7 +249,7 @@ int pa_scache_add_file_lazy(pa_core *c, const char *name, const char *filename,
|
|||
if (!(e = scache_add_item(c, name)))
|
||||
return -1;
|
||||
|
||||
e->lazy = TRUE;
|
||||
e->lazy = true;
|
||||
e->filename = pa_xstrdup(filename);
|
||||
|
||||
pa_proplist_sets(e->proplist, PA_PROP_MEDIA_FILENAME, filename);
|
||||
|
|
@ -296,7 +296,7 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t
|
|||
pa_scache_entry *e;
|
||||
pa_cvolume r;
|
||||
pa_proplist *merged;
|
||||
pa_bool_t pass_volume;
|
||||
bool pass_volume;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(name);
|
||||
|
|
@ -330,7 +330,7 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t
|
|||
|
||||
pa_log_debug("Playing sample \"%s\" on \"%s\"", name, sink->name);
|
||||
|
||||
pass_volume = TRUE;
|
||||
pass_volume = true;
|
||||
|
||||
if (e->volume_is_set && PA_VOLUME_IS_VALID(volume)) {
|
||||
pa_cvolume_set(&r, e->sample_spec.channels, volume);
|
||||
|
|
@ -340,7 +340,7 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t
|
|||
else if (PA_VOLUME_IS_VALID(volume))
|
||||
pa_cvolume_set(&r, e->sample_spec.channels, volume);
|
||||
else
|
||||
pass_volume = FALSE;
|
||||
pass_volume = false;
|
||||
|
||||
pa_proplist_update(merged, PA_UPDATE_REPLACE, e->proplist);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@ typedef struct pa_scache_entry {
|
|||
char *name;
|
||||
|
||||
pa_cvolume volume;
|
||||
pa_bool_t volume_is_set;
|
||||
bool volume_is_set;
|
||||
pa_sample_spec sample_spec;
|
||||
pa_channel_map channel_map;
|
||||
pa_memchunk memchunk;
|
||||
|
||||
char *filename;
|
||||
|
||||
pa_bool_t lazy;
|
||||
bool lazy;
|
||||
time_t last_used_time;
|
||||
|
||||
pa_proplist *proplist;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
struct pa_subscription {
|
||||
pa_core *core;
|
||||
pa_bool_t dead;
|
||||
bool dead;
|
||||
|
||||
pa_subscription_cb_t callback;
|
||||
void *userdata;
|
||||
|
|
@ -71,7 +71,7 @@ pa_subscription* pa_subscription_new(pa_core *c, pa_subscription_mask_t m, pa_su
|
|||
|
||||
s = pa_xnew(pa_subscription, 1);
|
||||
s->core = c;
|
||||
s->dead = FALSE;
|
||||
s->dead = false;
|
||||
s->callback = callback;
|
||||
s->userdata = userdata;
|
||||
s->mask = m;
|
||||
|
|
@ -85,7 +85,7 @@ void pa_subscription_free(pa_subscription*s) {
|
|||
pa_assert(s);
|
||||
pa_assert(!s->dead);
|
||||
|
||||
s->dead = TRUE;
|
||||
s->dead = true;
|
||||
sched_event(s->core);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,10 +221,10 @@ void pa_make_fd_cloexec(int fd) {
|
|||
/** Creates a directory securely. Will create parent directories recursively if
|
||||
* required. This will not update permissions on parent directories if they
|
||||
* already exist, however. */
|
||||
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid, pa_bool_t update_perms) {
|
||||
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid, bool update_perms) {
|
||||
struct stat st;
|
||||
int r, saved_errno;
|
||||
pa_bool_t retry = TRUE;
|
||||
bool retry = true;
|
||||
|
||||
pa_assert(dir);
|
||||
|
||||
|
|
@ -243,8 +243,8 @@ again:
|
|||
if (r < 0 && errno == ENOENT && retry) {
|
||||
/* If a parent directory in the path doesn't exist, try to create that
|
||||
* first, then try again. */
|
||||
pa_make_secure_parent_dir(dir, m, uid, gid, FALSE);
|
||||
retry = FALSE;
|
||||
pa_make_secure_parent_dir(dir, m, uid, gid, false);
|
||||
retry = false;
|
||||
goto again;
|
||||
}
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ char *pa_parent_dir(const char *fn) {
|
|||
}
|
||||
|
||||
/* Creates a the parent directory of the specified path securely */
|
||||
int pa_make_secure_parent_dir(const char *fn, mode_t m, uid_t uid, gid_t gid, pa_bool_t update_perms) {
|
||||
int pa_make_secure_parent_dir(const char *fn, mode_t m, uid_t uid, gid_t gid, bool update_perms) {
|
||||
int ret = -1;
|
||||
char *dir;
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ static int set_scheduler(int rtprio) {
|
|||
/* We need to disable exit on disconnect because otherwise
|
||||
* dbus_shutdown will kill us. See
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=16924 */
|
||||
dbus_connection_set_exit_on_disconnect(bus, FALSE);
|
||||
dbus_connection_set_exit_on_disconnect(bus, false);
|
||||
|
||||
rttime = rtkit_get_rttime_usec_max(bus);
|
||||
if (rttime >= 0) {
|
||||
|
|
@ -860,7 +860,7 @@ static int set_nice(int nice_level) {
|
|||
/* We need to disable exit on disconnect because otherwise
|
||||
* dbus_shutdown will kill us. See
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=16924 */
|
||||
dbus_connection_set_exit_on_disconnect(bus, FALSE);
|
||||
dbus_connection_set_exit_on_disconnect(bus, false);
|
||||
|
||||
r = rtkit_make_high_priority(bus, 0, nice_level);
|
||||
dbus_connection_unref(bus);
|
||||
|
|
@ -1605,7 +1605,7 @@ char *pa_get_state_dir(void) {
|
|||
/* If PULSE_STATE_PATH and PULSE_RUNTIME_PATH point to the same
|
||||
* dir then this will break. */
|
||||
|
||||
if (pa_make_secure_dir(d, 0700U, (uid_t) -1, (gid_t) -1, TRUE) < 0) {
|
||||
if (pa_make_secure_dir(d, 0700U, (uid_t) -1, (gid_t) -1, true) < 0) {
|
||||
pa_log_error("Failed to create secure directory (%s): %s", d, pa_cstrerror(errno));
|
||||
pa_xfree(d);
|
||||
return NULL;
|
||||
|
|
@ -1747,7 +1747,7 @@ char *pa_get_runtime_dir(void) {
|
|||
d = getenv("PULSE_RUNTIME_PATH");
|
||||
if (d) {
|
||||
|
||||
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1, TRUE) < 0) {
|
||||
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1, true) < 0) {
|
||||
pa_log_error("Failed to create secure directory (%s): %s", d, pa_cstrerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -1760,7 +1760,7 @@ char *pa_get_runtime_dir(void) {
|
|||
if (d) {
|
||||
k = pa_sprintf_malloc("%s" PA_PATH_SEP "pulse", d);
|
||||
|
||||
if (pa_make_secure_dir(k, m, (uid_t) -1, (gid_t) -1, TRUE) < 0) {
|
||||
if (pa_make_secure_dir(k, m, (uid_t) -1, (gid_t) -1, true) < 0) {
|
||||
pa_log_error("Failed to create secure directory (%s): %s", k, pa_cstrerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -1773,7 +1773,7 @@ char *pa_get_runtime_dir(void) {
|
|||
if (!d)
|
||||
goto fail;
|
||||
|
||||
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1, TRUE) < 0) {
|
||||
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1, true) < 0) {
|
||||
pa_log_error("Failed to create secure directory (%s): %s", d, pa_cstrerror(errno));
|
||||
pa_xfree(d);
|
||||
goto fail;
|
||||
|
|
@ -2113,7 +2113,7 @@ size_t pa_parsehex(const char *p, uint8_t *d, size_t dlength) {
|
|||
}
|
||||
|
||||
/* Returns nonzero when *s starts with *pfx */
|
||||
pa_bool_t pa_startswith(const char *s, const char *pfx) {
|
||||
bool pa_startswith(const char *s, const char *pfx) {
|
||||
size_t l;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -2125,7 +2125,7 @@ pa_bool_t pa_startswith(const char *s, const char *pfx) {
|
|||
}
|
||||
|
||||
/* Returns nonzero when *s ends with *sfx */
|
||||
pa_bool_t pa_endswith(const char *s, const char *sfx) {
|
||||
bool pa_endswith(const char *s, const char *sfx) {
|
||||
size_t l1, l2;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -2137,7 +2137,7 @@ pa_bool_t pa_endswith(const char *s, const char *sfx) {
|
|||
return l1 >= l2 && pa_streq(s + l1 - l2, sfx);
|
||||
}
|
||||
|
||||
pa_bool_t pa_is_path_absolute(const char *fn) {
|
||||
bool pa_is_path_absolute(const char *fn) {
|
||||
pa_assert(fn);
|
||||
|
||||
#ifndef OS_IS_WIN32
|
||||
|
|
@ -2167,7 +2167,7 @@ char *pa_make_path_absolute(const char *p) {
|
|||
/* If fn is NULL, return the PulseAudio runtime or state dir (depending on the
|
||||
* rt parameter). If fn is non-NULL and starts with /, return fn. Otherwise,
|
||||
* append fn to the runtime/state dir and return it. */
|
||||
static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
|
||||
static char *get_path(const char *fn, bool prependmid, bool rt) {
|
||||
char *rtp;
|
||||
|
||||
rtp = rt ? pa_get_runtime_dir() : pa_get_state_dir();
|
||||
|
|
@ -2214,11 +2214,11 @@ static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
|
|||
}
|
||||
|
||||
char *pa_runtime_path(const char *fn) {
|
||||
return get_path(fn, FALSE, TRUE);
|
||||
return get_path(fn, false, true);
|
||||
}
|
||||
|
||||
char *pa_state_path(const char *fn, pa_bool_t appendmid) {
|
||||
return get_path(fn, appendmid, FALSE);
|
||||
char *pa_state_path(const char *fn, bool appendmid) {
|
||||
return get_path(fn, appendmid, false);
|
||||
}
|
||||
|
||||
/* Convert the string s to a signed integer in *ret_i */
|
||||
|
|
@ -2567,7 +2567,7 @@ int pa_close_allv(const int except_fds[]) {
|
|||
struct dirent *de;
|
||||
|
||||
while ((de = readdir(d))) {
|
||||
pa_bool_t found;
|
||||
bool found;
|
||||
long l;
|
||||
char *e = NULL;
|
||||
int i;
|
||||
|
|
@ -2597,10 +2597,10 @@ int pa_close_allv(const int except_fds[]) {
|
|||
if (fd == dirfd(d))
|
||||
continue;
|
||||
|
||||
found = FALSE;
|
||||
found = false;
|
||||
for (i = 0; except_fds[i] >= 0; i++)
|
||||
if (except_fds[i] == fd) {
|
||||
found = TRUE;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2629,12 +2629,12 @@ int pa_close_allv(const int except_fds[]) {
|
|||
|
||||
for (fd = 3; fd < maxfd; fd++) {
|
||||
int i;
|
||||
pa_bool_t found;
|
||||
bool found;
|
||||
|
||||
found = FALSE;
|
||||
found = false;
|
||||
for (i = 0; except_fds[i] >= 0; i++)
|
||||
if (except_fds[i] == fd) {
|
||||
found = TRUE;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2742,12 +2742,12 @@ int pa_reset_sigsv(const int except[]) {
|
|||
int sig;
|
||||
|
||||
for (sig = 1; sig < NSIG; sig++) {
|
||||
pa_bool_t reset = TRUE;
|
||||
bool reset = true;
|
||||
|
||||
switch (sig) {
|
||||
case SIGKILL:
|
||||
case SIGSTOP:
|
||||
reset = FALSE;
|
||||
reset = false;
|
||||
break;
|
||||
|
||||
default: {
|
||||
|
|
@ -2755,7 +2755,7 @@ int pa_reset_sigsv(const int except[]) {
|
|||
|
||||
for (i = 0; except[i] > 0; i++) {
|
||||
if (sig == except[i]) {
|
||||
reset = FALSE;
|
||||
reset = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2824,33 +2824,33 @@ void pa_unset_env_recorded(void) {
|
|||
}
|
||||
}
|
||||
|
||||
pa_bool_t pa_in_system_mode(void) {
|
||||
bool pa_in_system_mode(void) {
|
||||
const char *e;
|
||||
|
||||
if (!(e = getenv("PULSE_SYSTEM")))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return !!atoi(e);
|
||||
}
|
||||
|
||||
/* Checks a whitespace-separated list of words in haystack for needle */
|
||||
pa_bool_t pa_str_in_list_spaces(const char *haystack, const char *needle) {
|
||||
bool pa_str_in_list_spaces(const char *haystack, const char *needle) {
|
||||
char *s;
|
||||
const char *state = NULL;
|
||||
|
||||
if (!haystack || !needle)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
while ((s = pa_split_spaces(haystack, &state))) {
|
||||
if (pa_streq(needle, s)) {
|
||||
pa_xfree(s);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
pa_xfree(s);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
char *pa_get_user_name_malloc(void) {
|
||||
|
|
@ -2978,7 +2978,7 @@ char *pa_uname_string(void) {
|
|||
}
|
||||
|
||||
#ifdef HAVE_VALGRIND_MEMCHECK_H
|
||||
pa_bool_t pa_in_valgrind(void) {
|
||||
bool pa_in_valgrind(void) {
|
||||
static int b = 0;
|
||||
|
||||
/* To make heisenbugs a bit simpler to find we check for $VALGRIND
|
||||
|
|
@ -3079,16 +3079,16 @@ char *pa_escape(const char *p, const char *chars) {
|
|||
|
||||
char *pa_unescape(char *p) {
|
||||
char *s, *d;
|
||||
pa_bool_t escaped = FALSE;
|
||||
bool escaped = false;
|
||||
|
||||
for (s = p, d = p; *s; s++) {
|
||||
if (!escaped && *s == '\\') {
|
||||
escaped = TRUE;
|
||||
escaped = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
*(d++) = *s;
|
||||
escaped = FALSE;
|
||||
escaped = false;
|
||||
}
|
||||
|
||||
*d = 0;
|
||||
|
|
@ -3233,9 +3233,9 @@ void pa_reset_personality(void) {
|
|||
|
||||
}
|
||||
|
||||
pa_bool_t pa_run_from_build_tree(void) {
|
||||
bool pa_run_from_build_tree(void) {
|
||||
char *rp;
|
||||
static pa_bool_t b = FALSE;
|
||||
static bool b = false;
|
||||
|
||||
PA_ONCE_BEGIN {
|
||||
if ((rp = pa_readlink("/proc/self/exe"))) {
|
||||
|
|
@ -3419,7 +3419,7 @@ char *pa_read_line_from_file(const char *fn) {
|
|||
return pa_xstrdup(ln);
|
||||
}
|
||||
|
||||
pa_bool_t pa_running_in_vm(void) {
|
||||
bool pa_running_in_vm(void) {
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
|
|
@ -3454,7 +3454,7 @@ pa_bool_t pa_running_in_vm(void) {
|
|||
pa_startswith(s, "Xen")) {
|
||||
|
||||
pa_xfree(s);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
pa_xfree(s);
|
||||
|
|
@ -3483,9 +3483,9 @@ pa_bool_t pa_running_in_vm(void) {
|
|||
pa_streq(sig.text, "VMwareVMware") ||
|
||||
/* http://msdn.microsoft.com/en-us/library/bb969719.aspx */
|
||||
pa_streq(sig.text, "Microsoft Hv"))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ struct timeval;
|
|||
void pa_make_fd_nonblock(int fd);
|
||||
void pa_make_fd_cloexec(int fd);
|
||||
|
||||
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid, pa_bool_t update_perms);
|
||||
int pa_make_secure_parent_dir(const char *fn, mode_t, uid_t uid, gid_t gid, pa_bool_t update_perms);
|
||||
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid, bool update_perms);
|
||||
int pa_make_secure_parent_dir(const char *fn, mode_t, uid_t uid, gid_t gid, bool update_perms);
|
||||
|
||||
ssize_t pa_read(int fd, void *buf, size_t count, int *type);
|
||||
ssize_t pa_write(int fd, const void *buf, size_t count, int *type);
|
||||
|
|
@ -86,7 +86,7 @@ int pa_parse_boolean(const char *s) PA_GCC_PURE;
|
|||
|
||||
int pa_parse_volume(const char *s, pa_volume_t *volume);
|
||||
|
||||
static inline const char *pa_yes_no(pa_bool_t b) {
|
||||
static inline const char *pa_yes_no(bool b) {
|
||||
return b ? "yes" : "no";
|
||||
}
|
||||
|
||||
|
|
@ -124,8 +124,8 @@ int pa_unlock_lockfile(const char *fn, int fd);
|
|||
char *pa_hexstr(const uint8_t* d, size_t dlength, char *s, size_t slength);
|
||||
size_t pa_parsehex(const char *p, uint8_t *d, size_t dlength);
|
||||
|
||||
pa_bool_t pa_startswith(const char *s, const char *pfx) PA_GCC_PURE;
|
||||
pa_bool_t pa_endswith(const char *s, const char *sfx) PA_GCC_PURE;
|
||||
bool pa_startswith(const char *s, const char *pfx) PA_GCC_PURE;
|
||||
bool pa_endswith(const char *s, const char *sfx) PA_GCC_PURE;
|
||||
|
||||
FILE *pa_open_config_file(const char *global, const char *local, const char *env, char **result);
|
||||
char* pa_find_config_file(const char *global, const char *local, const char *env);
|
||||
|
|
@ -135,7 +135,7 @@ char *pa_get_state_dir(void);
|
|||
char *pa_get_home_dir_malloc(void);
|
||||
char *pa_get_binary_name_malloc(void);
|
||||
char *pa_runtime_path(const char *fn);
|
||||
char *pa_state_path(const char *fn, pa_bool_t prepend_machine_id);
|
||||
char *pa_state_path(const char *fn, bool prepend_machine_id);
|
||||
|
||||
int pa_atoi(const char *s, int32_t *ret_i);
|
||||
int pa_atou(const char *s, uint32_t *ret_u);
|
||||
|
|
@ -151,7 +151,7 @@ int pa_match(const char *expr, const char *v);
|
|||
|
||||
char *pa_getcwd(void);
|
||||
char *pa_make_path_absolute(const char *p);
|
||||
pa_bool_t pa_is_path_absolute(const char *p);
|
||||
bool pa_is_path_absolute(const char *p);
|
||||
|
||||
void *pa_will_need(const void *p, size_t l);
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ void pa_set_env(const char *key, const char *value);
|
|||
void pa_set_env_and_record(const char *key, const char *value);
|
||||
void pa_unset_env_recorded(void);
|
||||
|
||||
pa_bool_t pa_in_system_mode(void);
|
||||
bool pa_in_system_mode(void);
|
||||
|
||||
#define pa_streq(a,b) (!strcmp((a),(b)))
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ static inline bool pa_safe_streq(const char *a, const char *b) {
|
|||
return pa_streq(a, b);
|
||||
}
|
||||
|
||||
pa_bool_t pa_str_in_list_spaces(const char *needle, const char *haystack);
|
||||
bool pa_str_in_list_spaces(const char *needle, const char *haystack);
|
||||
|
||||
char *pa_get_host_name_malloc(void);
|
||||
char *pa_get_user_name_malloc(void);
|
||||
|
|
@ -226,10 +226,10 @@ char *pa_session_id(void);
|
|||
char *pa_uname_string(void);
|
||||
|
||||
#ifdef HAVE_VALGRIND_MEMCHECK_H
|
||||
pa_bool_t pa_in_valgrind(void);
|
||||
bool pa_in_valgrind(void);
|
||||
#else
|
||||
static inline pa_bool_t pa_in_valgrind(void) {
|
||||
return FALSE;
|
||||
static inline bool pa_in_valgrind(void) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ size_t pa_pipe_buf(int fd);
|
|||
|
||||
void pa_reset_personality(void);
|
||||
|
||||
pa_bool_t pa_run_from_build_tree(void) PA_GCC_CONST;
|
||||
bool pa_run_from_build_tree(void) PA_GCC_CONST;
|
||||
|
||||
const char *pa_get_temp_dir(void);
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ FILE* pa_fopen_cloexec(const char *path, const char *mode);
|
|||
void pa_nullify_stdfds(void);
|
||||
|
||||
char *pa_read_line_from_file(const char *fn);
|
||||
pa_bool_t pa_running_in_vm(void);
|
||||
bool pa_running_in_vm(void);
|
||||
|
||||
#ifdef OS_IS_WIN32
|
||||
char *pa_win32_get_toplevel(HANDLE handle);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static int core_process_msg(pa_msgobject *o, int code, void *userdata, int64_t o
|
|||
switch (code) {
|
||||
|
||||
case PA_CORE_MESSAGE_UNLOAD_MODULE:
|
||||
pa_module_unload(c, userdata, TRUE);
|
||||
pa_module_unload(c, userdata, true);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
|
@ -63,7 +63,7 @@ static int core_process_msg(pa_msgobject *o, int code, void *userdata, int64_t o
|
|||
|
||||
static void core_free(pa_object *o);
|
||||
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, bool shared, size_t shm_size) {
|
||||
pa_core* c;
|
||||
pa_mempool *pool;
|
||||
int j;
|
||||
|
|
@ -73,7 +73,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
|||
if (shared) {
|
||||
if (!(pool = pa_mempool_new(shared, shm_size))) {
|
||||
pa_log_warn("failed to allocate shared memory pool. Falling back to a normal memory pool.");
|
||||
shared = FALSE;
|
||||
shared = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,15 +132,15 @@ pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
|||
c->exit_idle_time = -1;
|
||||
c->scache_idle_time = 20;
|
||||
|
||||
c->flat_volumes = TRUE;
|
||||
c->disallow_module_loading = FALSE;
|
||||
c->disallow_exit = FALSE;
|
||||
c->running_as_daemon = FALSE;
|
||||
c->realtime_scheduling = FALSE;
|
||||
c->flat_volumes = true;
|
||||
c->disallow_module_loading = false;
|
||||
c->disallow_exit = false;
|
||||
c->running_as_daemon = false;
|
||||
c->realtime_scheduling = false;
|
||||
c->realtime_priority = 5;
|
||||
c->disable_remixing = FALSE;
|
||||
c->disable_lfe_remixing = FALSE;
|
||||
c->deferred_volume = TRUE;
|
||||
c->disable_remixing = false;
|
||||
c->disable_lfe_remixing = false;
|
||||
c->deferred_volume = true;
|
||||
c->resample_method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 1;
|
||||
|
||||
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
|
||||
|
|
@ -221,7 +221,7 @@ static void exit_callback(pa_mainloop_api *m, pa_time_event *e, const struct tim
|
|||
pa_assert(c->exit_event == e);
|
||||
|
||||
pa_log_info("We are idle, quitting...");
|
||||
pa_core_exit(c, TRUE, 0);
|
||||
pa_core_exit(c, true, 0);
|
||||
}
|
||||
|
||||
void pa_core_check_idle(pa_core *c) {
|
||||
|
|
@ -239,7 +239,7 @@ void pa_core_check_idle(pa_core *c) {
|
|||
}
|
||||
}
|
||||
|
||||
int pa_core_exit(pa_core *c, pa_bool_t force, int retval) {
|
||||
int pa_core_exit(pa_core *c, bool force, int retval) {
|
||||
pa_assert(c);
|
||||
|
||||
if (c->disallow_exit && !force)
|
||||
|
|
@ -281,7 +281,7 @@ pa_time_event* pa_core_rttime_new(pa_core *c, pa_usec_t usec, pa_time_event_cb_t
|
|||
pa_assert(c);
|
||||
pa_assert(c->mainloop);
|
||||
|
||||
return c->mainloop->time_new(c->mainloop, pa_timeval_rtstore(&tv, usec, TRUE), cb, userdata);
|
||||
return c->mainloop->time_new(c->mainloop, pa_timeval_rtstore(&tv, usec, true), cb, userdata);
|
||||
}
|
||||
|
||||
void pa_core_rttime_restart(pa_core *c, pa_time_event *e, pa_usec_t usec) {
|
||||
|
|
@ -290,5 +290,5 @@ void pa_core_rttime_restart(pa_core *c, pa_time_event *e, pa_usec_t usec) {
|
|||
pa_assert(c);
|
||||
pa_assert(c->mainloop);
|
||||
|
||||
c->mainloop->time_restart(e, pa_timeval_rtstore(&tv, usec, TRUE));
|
||||
c->mainloop->time_restart(e, pa_timeval_rtstore(&tv, usec, true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,14 +170,14 @@ struct pa_core {
|
|||
|
||||
int exit_idle_time, scache_idle_time;
|
||||
|
||||
pa_bool_t flat_volumes:1;
|
||||
pa_bool_t disallow_module_loading:1;
|
||||
pa_bool_t disallow_exit:1;
|
||||
pa_bool_t running_as_daemon:1;
|
||||
pa_bool_t realtime_scheduling:1;
|
||||
pa_bool_t disable_remixing:1;
|
||||
pa_bool_t disable_lfe_remixing:1;
|
||||
pa_bool_t deferred_volume:1;
|
||||
bool flat_volumes:1;
|
||||
bool disallow_module_loading:1;
|
||||
bool disallow_exit:1;
|
||||
bool running_as_daemon:1;
|
||||
bool realtime_scheduling:1;
|
||||
bool disable_remixing:1;
|
||||
bool disable_lfe_remixing:1;
|
||||
bool deferred_volume:1;
|
||||
|
||||
pa_resample_method_t resample_method;
|
||||
int realtime_priority;
|
||||
|
|
@ -197,12 +197,12 @@ enum {
|
|||
PA_CORE_MESSAGE_MAX
|
||||
};
|
||||
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size);
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, bool shared, size_t shm_size);
|
||||
|
||||
/* Check whether no one is connected to this core */
|
||||
void pa_core_check_idle(pa_core *c);
|
||||
|
||||
int pa_core_exit(pa_core *c, pa_bool_t force, int retval);
|
||||
int pa_core_exit(pa_core *c, bool force, int retval);
|
||||
|
||||
void pa_core_maybe_vacuum(pa_core *c);
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ void pa_cpu_get_arm_flags(pa_cpu_arm_flag_t *flags) {
|
|||
#endif
|
||||
}
|
||||
|
||||
pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
|
||||
bool pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
|
||||
#if defined (__arm__)
|
||||
#if defined (__linux__)
|
||||
pa_cpu_get_arm_flags(flags);
|
||||
|
|
@ -149,13 +149,13 @@ pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
|
|||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
#else /* defined (__linux__) */
|
||||
pa_log("Reading ARM CPU features not yet supported on this OS");
|
||||
#endif /* defined (__linux__) */
|
||||
|
||||
#else /* defined (__arm__) */
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif /* defined (__arm__) */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ typedef enum pa_cpu_arm_flag {
|
|||
} pa_cpu_arm_flag_t;
|
||||
|
||||
void pa_cpu_get_arm_flags(pa_cpu_arm_flag_t *flags);
|
||||
pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags);
|
||||
bool pa_cpu_init_arm(pa_cpu_arm_flag_t *flags);
|
||||
|
||||
/* some optimized functions */
|
||||
void pa_volume_func_init_arm(pa_cpu_arm_flag_t flags);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "cpu-orc.h"
|
||||
|
||||
pa_bool_t pa_cpu_init_orc(pa_cpu_info cpu_info) {
|
||||
bool pa_cpu_init_orc(pa_cpu_info cpu_info) {
|
||||
#ifndef DISABLE_ORC
|
||||
/* Update these as we test on more architectures */
|
||||
pa_cpu_x86_flag_t x86_want_flags = PA_CPU_X86_MMX | PA_CPU_X86_SSE | PA_CPU_X86_SSE2 | PA_CPU_X86_SSE3 | PA_CPU_X86_SSSE3 | PA_CPU_X86_SSE4_1 | PA_CPU_X86_SSE4_2;
|
||||
|
|
@ -33,9 +33,9 @@ pa_bool_t pa_cpu_init_orc(pa_cpu_info cpu_info) {
|
|||
/* Enable Orc svolume optimizations */
|
||||
if ((cpu_info.cpu_type == PA_CPU_X86) && (cpu_info.flags.x86 & x86_want_flags)) {
|
||||
pa_volume_func_init_orc();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
/* Orc-optimised bits */
|
||||
|
||||
pa_bool_t pa_cpu_init_orc(pa_cpu_info cpu_info);
|
||||
bool pa_cpu_init_orc(pa_cpu_info cpu_info);
|
||||
|
||||
void pa_volume_func_init_orc(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ void pa_cpu_get_x86_flags(pa_cpu_x86_flag_t *flags) {
|
|||
#endif /* defined (__i386__) || defined (__amd64__) */
|
||||
}
|
||||
|
||||
pa_bool_t pa_cpu_init_x86(pa_cpu_x86_flag_t *flags) {
|
||||
bool pa_cpu_init_x86(pa_cpu_x86_flag_t *flags) {
|
||||
#if defined (__i386__) || defined (__amd64__)
|
||||
pa_cpu_get_x86_flags(flags);
|
||||
|
||||
|
|
@ -130,8 +130,8 @@ pa_bool_t pa_cpu_init_x86(pa_cpu_x86_flag_t *flags) {
|
|||
pa_convert_func_init_sse(*flags);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
#else /* defined (__i386__) || defined (__amd64__) */
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif /* defined (__i386__) || defined (__amd64__) */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ typedef enum pa_cpu_x86_flag {
|
|||
} pa_cpu_x86_flag_t;
|
||||
|
||||
void pa_cpu_get_x86_flags(pa_cpu_x86_flag_t *flags);
|
||||
pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags);
|
||||
bool pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags);
|
||||
|
||||
#if defined (__i386__)
|
||||
typedef int32_t pa_reg_x86;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void pa_datum_free(pa_datum *d) {
|
|||
pa_zero(d);
|
||||
}
|
||||
|
||||
pa_database* pa_database_open(const char *fn, pa_bool_t for_write) {
|
||||
pa_database* pa_database_open(const char *fn, bool for_write) {
|
||||
GDBM_FILE f;
|
||||
int gdbm_cache_size;
|
||||
char *path;
|
||||
|
|
@ -117,7 +117,7 @@ pa_datum* pa_database_get(pa_database *db, const pa_datum *key, pa_datum* data)
|
|||
NULL;
|
||||
}
|
||||
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, pa_bool_t overwrite) {
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, bool overwrite) {
|
||||
datum gdbm_key, gdbm_data;
|
||||
|
||||
pa_assert(db);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ typedef struct simple_data {
|
|||
char *filename;
|
||||
char *tmp_filename;
|
||||
pa_hashmap *map;
|
||||
pa_bool_t read_only;
|
||||
bool read_only;
|
||||
} simple_data;
|
||||
|
||||
typedef struct entry {
|
||||
|
|
@ -175,7 +175,7 @@ static int fill_data(simple_data *db, FILE *f) {
|
|||
pa_datum data;
|
||||
void *d = NULL;
|
||||
ssize_t l = 0;
|
||||
pa_bool_t append = FALSE;
|
||||
bool append = false;
|
||||
enum { FIELD_KEY = 0, FIELD_DATA } field = FIELD_KEY;
|
||||
|
||||
pa_assert(db);
|
||||
|
|
@ -197,7 +197,7 @@ static int fill_data(simple_data *db, FILE *f) {
|
|||
case FIELD_DATA:
|
||||
data.data = d;
|
||||
data.size = l;
|
||||
append = TRUE;
|
||||
append = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ static int fill_data(simple_data *db, FILE *f) {
|
|||
e->data.data = data.data;
|
||||
e->data.size = data.size;
|
||||
pa_hashmap_put(db->map, &e->key, e);
|
||||
append = FALSE;
|
||||
append = false;
|
||||
field = FIELD_KEY;
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ static int fill_data(simple_data *db, FILE *f) {
|
|||
return pa_hashmap_size(db->map);
|
||||
}
|
||||
|
||||
pa_database* pa_database_open(const char *fn, pa_bool_t for_write) {
|
||||
pa_database* pa_database_open(const char *fn, bool for_write) {
|
||||
FILE *f;
|
||||
char *path;
|
||||
simple_data *db;
|
||||
|
|
@ -288,7 +288,7 @@ pa_datum* pa_database_get(pa_database *database, const pa_datum *key, pa_datum*
|
|||
return data;
|
||||
}
|
||||
|
||||
int pa_database_set(pa_database *database, const pa_datum *key, const pa_datum* data, pa_bool_t overwrite) {
|
||||
int pa_database_set(pa_database *database, const pa_datum *key, const pa_datum* data, bool overwrite) {
|
||||
simple_data *db = (simple_data*)database;
|
||||
entry *e;
|
||||
int ret = 0;
|
||||
|
|
@ -381,7 +381,7 @@ pa_datum* pa_database_next(pa_database *database, const pa_datum *key, pa_datum
|
|||
entry *e;
|
||||
entry *search;
|
||||
void *state;
|
||||
pa_bool_t pick_now;
|
||||
bool pick_now;
|
||||
|
||||
pa_assert(db);
|
||||
pa_assert(next);
|
||||
|
|
@ -392,14 +392,14 @@ pa_datum* pa_database_next(pa_database *database, const pa_datum *key, pa_datum
|
|||
search = pa_hashmap_get(db->map, key);
|
||||
|
||||
state = NULL;
|
||||
pick_now = FALSE;
|
||||
pick_now = false;
|
||||
|
||||
while ((e = pa_hashmap_iterate(db->map, &state, NULL))) {
|
||||
if (pick_now)
|
||||
break;
|
||||
|
||||
if (search == e)
|
||||
pick_now = TRUE;
|
||||
pick_now = true;
|
||||
}
|
||||
|
||||
if (!pick_now || !e)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ finish:
|
|||
return c;
|
||||
}
|
||||
|
||||
pa_database* pa_database_open(const char *fn, pa_bool_t for_write) {
|
||||
pa_database* pa_database_open(const char *fn, bool for_write) {
|
||||
struct tdb_context *c;
|
||||
char *path;
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ pa_datum* pa_database_get(pa_database *db, const pa_datum *key, pa_datum* data)
|
|||
NULL;
|
||||
}
|
||||
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, pa_bool_t overwrite) {
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, bool overwrite) {
|
||||
TDB_DATA tdb_key, tdb_data;
|
||||
|
||||
pa_assert(db);
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ typedef struct pa_datum {
|
|||
void pa_datum_free(pa_datum *d);
|
||||
|
||||
/* This will append a suffix to the filename */
|
||||
pa_database* pa_database_open(const char *fn, pa_bool_t for_write);
|
||||
pa_database* pa_database_open(const char *fn, bool for_write);
|
||||
void pa_database_close(pa_database *db);
|
||||
|
||||
pa_datum* pa_database_get(pa_database *db, const pa_datum *key, pa_datum* data);
|
||||
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, pa_bool_t overwrite);
|
||||
int pa_database_set(pa_database *db, const pa_datum *key, const pa_datum* data, bool overwrite);
|
||||
int pa_database_unset(pa_database *db, const pa_datum *key);
|
||||
|
||||
int pa_database_clear(pa_database *db);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ pa_dbus_connection* pa_dbus_bus_get(pa_core *c, DBusBusType type, DBusError *err
|
|||
if ((pconn = pa_shared_get(c, prop_name[type])))
|
||||
return pa_dbus_connection_ref(pconn);
|
||||
|
||||
if (!(conn = pa_dbus_wrap_connection_new(c->mainloop, TRUE, type, error)))
|
||||
if (!(conn = pa_dbus_wrap_connection_new(c->mainloop, true, type, error)))
|
||||
return NULL;
|
||||
|
||||
return dbus_connection_new(c, conn, prop_name[type]);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ struct pa_dbus_wrap_connection {
|
|||
pa_mainloop_api *mainloop;
|
||||
DBusConnection *connection;
|
||||
pa_defer_event* dispatch_event;
|
||||
pa_bool_t use_rtclock:1;
|
||||
bool use_rtclock:1;
|
||||
};
|
||||
|
||||
struct timeout_data {
|
||||
|
|
@ -164,7 +164,7 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *data) {
|
|||
|
||||
dbus_watch_set_data(watch, ev, NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* DBusRemoveWatchFunction callback for pa mainloop */
|
||||
|
|
@ -208,7 +208,7 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data) {
|
|||
pa_assert(c);
|
||||
|
||||
if (!dbus_timeout_get_enabled(timeout))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
d = pa_xnew(struct timeout_data, 1);
|
||||
d->connection = c;
|
||||
|
|
@ -218,7 +218,7 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data) {
|
|||
|
||||
dbus_timeout_set_data(timeout, ev, NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* DBusRemoveTimeoutFunction callback for pa mainloop */
|
||||
|
|
@ -261,7 +261,7 @@ static void wakeup_main(void *userdata) {
|
|||
c->mainloop->defer_enable(c->dispatch_event, 1);
|
||||
}
|
||||
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *m, pa_bool_t use_rtclock, DBusBusType type, DBusError *error) {
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *m, bool use_rtclock, DBusBusType type, DBusError *error) {
|
||||
DBusConnection *conn;
|
||||
pa_dbus_wrap_connection *pconn;
|
||||
char *id;
|
||||
|
|
@ -276,7 +276,7 @@ pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *m, pa_bool
|
|||
pconn->connection = conn;
|
||||
pconn->use_rtclock = use_rtclock;
|
||||
|
||||
dbus_connection_set_exit_on_disconnect(conn, FALSE);
|
||||
dbus_connection_set_exit_on_disconnect(conn, false);
|
||||
dbus_connection_set_dispatch_status_function(conn, dispatch_status, pconn, NULL);
|
||||
dbus_connection_set_watch_functions(conn, add_watch, remove_watch, toggle_watch, pconn, NULL);
|
||||
dbus_connection_set_timeout_functions(conn, add_timeout, remove_timeout, toggle_timeout, pconn, NULL);
|
||||
|
|
@ -296,7 +296,7 @@ pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *m, pa_bool
|
|||
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new_from_existing(
|
||||
pa_mainloop_api *m,
|
||||
pa_bool_t use_rtclock,
|
||||
bool use_rtclock,
|
||||
DBusConnection *conn) {
|
||||
pa_dbus_wrap_connection *pconn;
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ pa_dbus_wrap_connection* pa_dbus_wrap_connection_new_from_existing(
|
|||
pconn->connection = dbus_connection_ref(conn);
|
||||
pconn->use_rtclock = use_rtclock;
|
||||
|
||||
dbus_connection_set_exit_on_disconnect(conn, FALSE);
|
||||
dbus_connection_set_exit_on_disconnect(conn, false);
|
||||
dbus_connection_set_dispatch_status_function(conn, dispatch_status, pconn, NULL);
|
||||
dbus_connection_set_watch_functions(conn, add_watch, remove_watch, toggle_watch, pconn, NULL);
|
||||
dbus_connection_set_timeout_functions(conn, add_timeout, remove_timeout, toggle_timeout, pconn, NULL);
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@
|
|||
/* A wrap connection is not shared or refcounted, it is available in client side */
|
||||
typedef struct pa_dbus_wrap_connection pa_dbus_wrap_connection;
|
||||
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *mainloop, pa_bool_t use_rtclock, DBusBusType type, DBusError *error);
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new(pa_mainloop_api *mainloop, bool use_rtclock, DBusBusType type, DBusError *error);
|
||||
pa_dbus_wrap_connection* pa_dbus_wrap_connection_new_from_existing(
|
||||
pa_mainloop_api *mainloop,
|
||||
pa_bool_t use_rtclock,
|
||||
bool use_rtclock,
|
||||
DBusConnection *conn);
|
||||
void pa_dbus_wrap_connection_free(pa_dbus_wrap_connection* conn);
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ unsigned pa_hashmap_size(pa_hashmap *h) {
|
|||
return h->n_entries;
|
||||
}
|
||||
|
||||
pa_bool_t pa_hashmap_isempty(pa_hashmap *h) {
|
||||
bool pa_hashmap_isempty(pa_hashmap *h) {
|
||||
pa_assert(h);
|
||||
|
||||
return h->n_entries == 0;
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ void pa_hashmap_remove_all(pa_hashmap *h, pa_free_cb_t free_cb);
|
|||
/* Return the current number of entries of the hashmap */
|
||||
unsigned pa_hashmap_size(pa_hashmap *h);
|
||||
|
||||
/* Return TRUE if the hashmap is empty */
|
||||
pa_bool_t pa_hashmap_isempty(pa_hashmap *h);
|
||||
/* Return true if the hashmap is empty */
|
||||
bool pa_hashmap_isempty(pa_hashmap *h);
|
||||
|
||||
/* May be used to iterate through the hashmap. Initially the opaque
|
||||
pointer *state has to be set to NULL. The hashmap may not be
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ pa_hook_slot* pa_hook_connect(pa_hook *hook, pa_hook_priority_t prio, pa_hook_cb
|
|||
|
||||
slot = pa_xnew(pa_hook_slot, 1);
|
||||
slot->hook = hook;
|
||||
slot->dead = FALSE;
|
||||
slot->dead = false;
|
||||
slot->callback = cb;
|
||||
slot->data = data;
|
||||
slot->priority = prio;
|
||||
|
|
@ -85,7 +85,7 @@ void pa_hook_slot_free(pa_hook_slot *slot) {
|
|||
pa_assert(!slot->dead);
|
||||
|
||||
if (slot->hook->n_firing > 0) {
|
||||
slot->dead = TRUE;
|
||||
slot->dead = true;
|
||||
slot->hook->n_dead++;
|
||||
} else
|
||||
slot_free(slot->hook, slot);
|
||||
|
|
@ -124,7 +124,7 @@ pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data) {
|
|||
return result;
|
||||
}
|
||||
|
||||
pa_bool_t pa_hook_is_firing(pa_hook *hook) {
|
||||
bool pa_hook_is_firing(pa_hook *hook) {
|
||||
pa_assert(hook);
|
||||
|
||||
return hook->n_firing > 0;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ typedef pa_hook_result_t (*pa_hook_cb_t)(
|
|||
void *slot_data);
|
||||
|
||||
struct pa_hook_slot {
|
||||
pa_bool_t dead;
|
||||
bool dead;
|
||||
pa_hook *hook;
|
||||
pa_hook_priority_t priority;
|
||||
pa_hook_cb_t callback;
|
||||
|
|
@ -68,6 +68,6 @@ void pa_hook_slot_free(pa_hook_slot *slot);
|
|||
|
||||
pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data);
|
||||
|
||||
pa_bool_t pa_hook_is_firing(pa_hook *hook);
|
||||
bool pa_hook_is_firing(pa_hook *hook);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ unsigned pa_idxset_size(pa_idxset*s) {
|
|||
return s->n_entries;
|
||||
}
|
||||
|
||||
pa_bool_t pa_idxset_isempty(pa_idxset *s) {
|
||||
bool pa_idxset_isempty(pa_idxset *s) {
|
||||
pa_assert(s);
|
||||
|
||||
return s->n_entries == 0;
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@ 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 */
|
||||
pa_idxset *pa_idxset_copy(pa_idxset *s);
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ struct pa_iochannel {
|
|||
pa_iochannel_cb_t callback;
|
||||
void*userdata;
|
||||
|
||||
pa_bool_t readable:1;
|
||||
pa_bool_t writable:1;
|
||||
pa_bool_t hungup:1;
|
||||
pa_bool_t no_close:1;
|
||||
bool readable:1;
|
||||
bool writable:1;
|
||||
bool hungup:1;
|
||||
bool no_close:1;
|
||||
|
||||
pa_io_event* input_event, *output_event;
|
||||
};
|
||||
|
|
@ -129,7 +129,7 @@ static void enable_events(pa_iochannel *io) {
|
|||
|
||||
static void callback(pa_mainloop_api* m, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
|
||||
pa_iochannel *io = userdata;
|
||||
pa_bool_t changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
pa_assert(m);
|
||||
pa_assert(e);
|
||||
|
|
@ -137,19 +137,19 @@ static void callback(pa_mainloop_api* m, pa_io_event *e, int fd, pa_io_event_fla
|
|||
pa_assert(userdata);
|
||||
|
||||
if ((f & (PA_IO_EVENT_HANGUP|PA_IO_EVENT_ERROR)) && !io->hungup) {
|
||||
io->hungup = TRUE;
|
||||
changed = TRUE;
|
||||
io->hungup = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if ((f & PA_IO_EVENT_INPUT) && !io->readable) {
|
||||
io->readable = TRUE;
|
||||
changed = TRUE;
|
||||
io->readable = true;
|
||||
changed = true;
|
||||
pa_assert(e == io->input_event);
|
||||
}
|
||||
|
||||
if ((f & PA_IO_EVENT_OUTPUT) && !io->writable) {
|
||||
io->writable = TRUE;
|
||||
changed = TRUE;
|
||||
io->writable = true;
|
||||
changed = true;
|
||||
pa_assert(e == io->output_event);
|
||||
}
|
||||
|
||||
|
|
@ -197,19 +197,19 @@ void pa_iochannel_free(pa_iochannel*io) {
|
|||
pa_xfree(io);
|
||||
}
|
||||
|
||||
pa_bool_t pa_iochannel_is_readable(pa_iochannel*io) {
|
||||
bool pa_iochannel_is_readable(pa_iochannel*io) {
|
||||
pa_assert(io);
|
||||
|
||||
return io->readable || io->hungup;
|
||||
}
|
||||
|
||||
pa_bool_t pa_iochannel_is_writable(pa_iochannel*io) {
|
||||
bool pa_iochannel_is_writable(pa_iochannel*io) {
|
||||
pa_assert(io);
|
||||
|
||||
return io->writable && !io->hungup;
|
||||
}
|
||||
|
||||
pa_bool_t pa_iochannel_is_hungup(pa_iochannel*io) {
|
||||
bool pa_iochannel_is_hungup(pa_iochannel*io) {
|
||||
pa_assert(io);
|
||||
|
||||
return io->hungup;
|
||||
|
|
@ -236,7 +236,7 @@ ssize_t pa_iochannel_write(pa_iochannel*io, const void*data, size_t l) {
|
|||
}
|
||||
|
||||
/* Partial write - let's get a notification when we can write more */
|
||||
io->writable = io->hungup = FALSE;
|
||||
io->writable = io->hungup = false;
|
||||
enable_events(io);
|
||||
|
||||
return r;
|
||||
|
|
@ -254,7 +254,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
|
|||
/* We also reset the hangup flag here to ensure that another
|
||||
* IO callback is triggered so that we will again call into
|
||||
* user code */
|
||||
io->readable = io->hungup = FALSE;
|
||||
io->readable = io->hungup = false;
|
||||
enable_events(io);
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
|
|||
|
||||
#ifdef HAVE_CREDS
|
||||
|
||||
pa_bool_t pa_iochannel_creds_supported(pa_iochannel *io) {
|
||||
bool pa_iochannel_creds_supported(pa_iochannel *io) {
|
||||
struct {
|
||||
struct sockaddr sa;
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
|
|
@ -280,7 +280,7 @@ pa_bool_t pa_iochannel_creds_supported(pa_iochannel *io) {
|
|||
|
||||
l = sizeof(sa);
|
||||
if (getsockname(io->ifd, &sa.sa, &l) < 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return sa.sa.sa_family == AF_UNIX;
|
||||
}
|
||||
|
|
@ -341,14 +341,14 @@ ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l
|
|||
mh.msg_controllen = sizeof(cmsg);
|
||||
|
||||
if ((r = sendmsg(io->ofd, &mh, MSG_NOSIGNAL)) >= 0) {
|
||||
io->writable = io->hungup = FALSE;
|
||||
io->writable = io->hungup = false;
|
||||
enable_events(io);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_creds *creds, pa_bool_t *creds_valid) {
|
||||
ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_creds *creds, bool *creds_valid) {
|
||||
ssize_t r;
|
||||
struct msghdr mh;
|
||||
struct iovec iov;
|
||||
|
|
@ -378,7 +378,7 @@ ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_cr
|
|||
if ((r = recvmsg(io->ifd, &mh, 0)) >= 0) {
|
||||
struct cmsghdr *cmh;
|
||||
|
||||
*creds_valid = FALSE;
|
||||
*creds_valid = false;
|
||||
|
||||
for (cmh = CMSG_FIRSTHDR(&mh); cmh; cmh = CMSG_NXTHDR(&mh, cmh)) {
|
||||
|
||||
|
|
@ -389,12 +389,12 @@ ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_cr
|
|||
|
||||
creds->gid = u.gid;
|
||||
creds->uid = u.uid;
|
||||
*creds_valid = TRUE;
|
||||
*creds_valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
io->readable = io->hungup = FALSE;
|
||||
io->readable = io->hungup = false;
|
||||
enable_events(io);
|
||||
}
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ void pa_iochannel_set_callback(pa_iochannel*io, pa_iochannel_cb_t _callback, voi
|
|||
io->userdata = userdata;
|
||||
}
|
||||
|
||||
void pa_iochannel_set_noclose(pa_iochannel*io, pa_bool_t b) {
|
||||
void pa_iochannel_set_noclose(pa_iochannel*io, bool b) {
|
||||
pa_assert(io);
|
||||
|
||||
io->no_close = !!b;
|
||||
|
|
@ -454,15 +454,15 @@ int pa_iochannel_get_send_fd(pa_iochannel *io) {
|
|||
return io->ofd;
|
||||
}
|
||||
|
||||
pa_bool_t pa_iochannel_socket_is_local(pa_iochannel *io) {
|
||||
bool pa_iochannel_socket_is_local(pa_iochannel *io) {
|
||||
pa_assert(io);
|
||||
|
||||
if (pa_socket_is_local(io->ifd))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (io->ifd != io->ofd)
|
||||
if (pa_socket_is_local(io->ofd))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,20 +54,20 @@ ssize_t pa_iochannel_write(pa_iochannel*io, const void*data, size_t l);
|
|||
ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l);
|
||||
|
||||
#ifdef HAVE_CREDS
|
||||
pa_bool_t pa_iochannel_creds_supported(pa_iochannel *io);
|
||||
bool pa_iochannel_creds_supported(pa_iochannel *io);
|
||||
int pa_iochannel_creds_enable(pa_iochannel *io);
|
||||
|
||||
ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l, const pa_creds *ucred);
|
||||
ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_creds *ucred, pa_bool_t *creds_valid);
|
||||
ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, pa_creds *ucred, bool *creds_valid);
|
||||
#endif
|
||||
|
||||
pa_bool_t pa_iochannel_is_readable(pa_iochannel*io);
|
||||
pa_bool_t pa_iochannel_is_writable(pa_iochannel*io);
|
||||
pa_bool_t pa_iochannel_is_hungup(pa_iochannel*io);
|
||||
bool pa_iochannel_is_readable(pa_iochannel*io);
|
||||
bool pa_iochannel_is_writable(pa_iochannel*io);
|
||||
bool pa_iochannel_is_hungup(pa_iochannel*io);
|
||||
|
||||
/* Don't close the file descriptors when the io channel is freed. By
|
||||
* default the file descriptors are closed. */
|
||||
void pa_iochannel_set_noclose(pa_iochannel*io, pa_bool_t b);
|
||||
void pa_iochannel_set_noclose(pa_iochannel*io, bool b);
|
||||
|
||||
/* Set the callback function that is called whenever data becomes available for read or write */
|
||||
typedef void (*pa_iochannel_cb_t)(pa_iochannel*io, void *userdata);
|
||||
|
|
@ -80,7 +80,7 @@ void pa_iochannel_socket_peer_to_string(pa_iochannel*io, char*s, size_t l);
|
|||
int pa_iochannel_socket_set_rcvbuf(pa_iochannel*io, size_t l);
|
||||
int pa_iochannel_socket_set_sndbuf(pa_iochannel*io, size_t l);
|
||||
|
||||
pa_bool_t pa_iochannel_socket_is_local(pa_iochannel *io);
|
||||
bool pa_iochannel_socket_is_local(pa_iochannel *io);
|
||||
|
||||
pa_mainloop_api* pa_iochannel_get_mainloop_api(pa_iochannel *io);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ struct pa_ioline {
|
|||
pa_ioline_drain_cb_t drain_callback;
|
||||
void *drain_userdata;
|
||||
|
||||
pa_bool_t dead:1;
|
||||
pa_bool_t defer_close:1;
|
||||
bool dead:1;
|
||||
bool defer_close:1;
|
||||
};
|
||||
|
||||
static void io_callback(pa_iochannel*io, void *userdata);
|
||||
|
|
@ -93,8 +93,8 @@ pa_ioline* pa_ioline_new(pa_iochannel *io) {
|
|||
l->defer_event = l->mainloop->defer_new(l->mainloop, defer_callback, l);
|
||||
l->mainloop->defer_enable(l->defer_event, 0);
|
||||
|
||||
l->dead = FALSE;
|
||||
l->defer_close = FALSE;
|
||||
l->dead = false;
|
||||
l->defer_close = false;
|
||||
|
||||
pa_iochannel_set_callback(io, io_callback, l);
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ void pa_ioline_close(pa_ioline *l) {
|
|||
pa_assert(l);
|
||||
pa_assert(PA_REFCNT_VALUE(l) >= 1);
|
||||
|
||||
l->dead = TRUE;
|
||||
l->dead = true;
|
||||
|
||||
if (l->io) {
|
||||
pa_iochannel_free(l->io);
|
||||
|
|
@ -220,7 +220,7 @@ void pa_ioline_set_drain_callback(pa_ioline*l, pa_ioline_drain_cb_t callback, vo
|
|||
l->drain_userdata = userdata;
|
||||
}
|
||||
|
||||
static void failure(pa_ioline *l, pa_bool_t process_leftover) {
|
||||
static void failure(pa_ioline *l, bool process_leftover) {
|
||||
pa_assert(l);
|
||||
pa_assert(PA_REFCNT_VALUE(l) >= 1);
|
||||
pa_assert(!l->dead);
|
||||
|
|
@ -326,9 +326,9 @@ static int do_read(pa_ioline *l) {
|
|||
|
||||
if (r < 0 && errno != ECONNRESET) {
|
||||
pa_log("read(): %s", pa_cstrerror(errno));
|
||||
failure(l, FALSE);
|
||||
failure(l, false);
|
||||
} else
|
||||
failure(l, TRUE);
|
||||
failure(l, true);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ static int do_write(pa_ioline *l) {
|
|||
if (errno != EPIPE)
|
||||
pa_log("write(): %s", pa_cstrerror(errno));
|
||||
|
||||
failure(l, FALSE);
|
||||
failure(l, false);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -391,7 +391,7 @@ static void do_work(pa_ioline *l) {
|
|||
do_write(l);
|
||||
|
||||
if (l->defer_close && !l->wbuf_valid_length)
|
||||
failure(l, TRUE);
|
||||
failure(l, true);
|
||||
|
||||
pa_ioline_unref(l);
|
||||
}
|
||||
|
|
@ -421,7 +421,7 @@ void pa_ioline_defer_close(pa_ioline *l) {
|
|||
pa_assert(l);
|
||||
pa_assert(PA_REFCNT_VALUE(l) >= 1);
|
||||
|
||||
l->defer_close = TRUE;
|
||||
l->defer_close = true;
|
||||
|
||||
if (!l->wbuf_valid_length)
|
||||
l->mainloop->defer_enable(l->defer_event, 1);
|
||||
|
|
@ -458,7 +458,7 @@ pa_iochannel* pa_ioline_detach_iochannel(pa_ioline *l) {
|
|||
return r;
|
||||
}
|
||||
|
||||
pa_bool_t pa_ioline_is_drained(pa_ioline *l) {
|
||||
bool pa_ioline_is_drained(pa_ioline *l) {
|
||||
pa_assert(l);
|
||||
|
||||
return l->wbuf_valid_length <= 0;
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ void pa_ioline_set_drain_callback(pa_ioline*io, pa_ioline_drain_cb_t callback, v
|
|||
/* Make sure to close the ioline object as soon as the send buffer is emptied */
|
||||
void pa_ioline_defer_close(pa_ioline *io);
|
||||
|
||||
/* Returns TRUE when everything was written */
|
||||
pa_bool_t pa_ioline_is_drained(pa_ioline *io);
|
||||
/* Returns true when everything was written */
|
||||
bool pa_ioline_is_drained(pa_ioline *io);
|
||||
|
||||
/* Detaches from the iochannel and returns it. Data that has already
|
||||
* been read will not be available in the detached iochannel */
|
||||
|
|
|
|||
|
|
@ -96,13 +96,13 @@ static int ref(void) {
|
|||
pa_make_fd_nonblock(pipe_fd[1]);
|
||||
pa_make_fd_nonblock(pipe_fd[0]);
|
||||
|
||||
lock_fd_mutex = pa_mutex_new(FALSE, FALSE);
|
||||
lock_fd_mutex = pa_mutex_new(false, false);
|
||||
|
||||
n_ref = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void unref(pa_bool_t after_fork) {
|
||||
static void unref(bool after_fork) {
|
||||
|
||||
pa_assert(n_ref > 0);
|
||||
pa_assert(pipe_fd[0] >= 0);
|
||||
|
|
@ -257,7 +257,7 @@ static int start_thread(void) {
|
|||
|
||||
static void create_mutex(void) {
|
||||
PA_ONCE_BEGIN {
|
||||
mutex = pa_mutex_new(FALSE, FALSE);
|
||||
mutex = pa_mutex_new(false, false);
|
||||
} PA_ONCE_END;
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ int pa_autospawn_lock_init(void) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
int pa_autospawn_lock_acquire(pa_bool_t block) {
|
||||
int pa_autospawn_lock_acquire(bool block) {
|
||||
int ret = -1;
|
||||
|
||||
create_mutex();
|
||||
|
|
@ -345,7 +345,7 @@ void pa_autospawn_lock_release(void) {
|
|||
pa_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
void pa_autospawn_lock_done(pa_bool_t after_fork) {
|
||||
void pa_autospawn_lock_done(bool after_fork) {
|
||||
|
||||
create_mutex();
|
||||
pa_mutex_lock(mutex);
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
#include <pulsecore/macro.h>
|
||||
|
||||
int pa_autospawn_lock_init(void);
|
||||
int pa_autospawn_lock_acquire(pa_bool_t block);
|
||||
int pa_autospawn_lock_acquire(bool block);
|
||||
void pa_autospawn_lock_release(void);
|
||||
void pa_autospawn_lock_done(pa_bool_t after_fork);
|
||||
void pa_autospawn_lock_done(bool after_fork);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@
|
|||
static char *ident = NULL; /* in local charset format */
|
||||
static pa_log_target target = { PA_LOG_STDERR, NULL };
|
||||
static pa_log_target_type_t target_override;
|
||||
static pa_bool_t target_override_set = FALSE;
|
||||
static bool target_override_set = false;
|
||||
static pa_log_level_t maximum_level = PA_LOG_ERROR, maximum_level_override = PA_LOG_ERROR;
|
||||
static unsigned show_backtrace = 0, show_backtrace_override = 0, skip_backtrace = 0;
|
||||
static pa_log_flags_t flags = 0, flags_override = 0;
|
||||
static pa_bool_t no_rate_limit = FALSE;
|
||||
static bool no_rate_limit = false;
|
||||
static int log_fd = -1;
|
||||
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
|
|
@ -280,7 +280,7 @@ static void init_defaults(void) {
|
|||
|
||||
if (getenv(ENV_LOG_SYSLOG)) {
|
||||
target_override = PA_LOG_SYSLOG;
|
||||
target_override_set = TRUE;
|
||||
target_override_set = true;
|
||||
}
|
||||
|
||||
if ((e = getenv(ENV_LOG_LEVEL))) {
|
||||
|
|
@ -320,7 +320,7 @@ static void init_defaults(void) {
|
|||
}
|
||||
|
||||
if (getenv(ENV_LOG_NO_RATELIMIT))
|
||||
no_rate_limit = TRUE;
|
||||
no_rate_limit = true;
|
||||
|
||||
} PA_ONCE_END;
|
||||
}
|
||||
|
|
@ -524,14 +524,14 @@ void pa_log_level(pa_log_level_t level, const char *format, ...) {
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
pa_bool_t pa_log_ratelimit(pa_log_level_t level) {
|
||||
bool pa_log_ratelimit(pa_log_level_t level) {
|
||||
/* Not more than 10 messages every 5s */
|
||||
static PA_DEFINE_RATELIMIT(ratelimit, 5 * PA_USEC_PER_SEC, 10);
|
||||
|
||||
init_defaults();
|
||||
|
||||
if (no_rate_limit)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return pa_ratelimit_test(&ratelimit, level);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,6 +153,6 @@ LOG_FUNC(error, PA_LOG_ERROR)
|
|||
|
||||
#define pa_log pa_log_error
|
||||
|
||||
pa_bool_t pa_log_ratelimit(pa_log_level_t level);
|
||||
bool pa_log_ratelimit(pa_log_level_t level);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ typedef int pa_bool_t;
|
|||
pa_log_debug("Assertion '%s' failed at %s:%u, function %s.\n", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
|
||||
return; \
|
||||
} \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define pa_return_val_if_fail(expr, val) \
|
||||
do { \
|
||||
|
|
@ -212,7 +212,7 @@ typedef int pa_bool_t;
|
|||
pa_log_debug("Assertion '%s' failed at %s:%u, function %s.\n", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
|
||||
return (val); \
|
||||
} \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define pa_return_null_if_fail(expr) pa_return_val_if_fail(expr, NULL)
|
||||
|
||||
|
|
@ -224,10 +224,10 @@ typedef int pa_bool_t;
|
|||
pa_log_error("Assertion '%s' failed at %s:%u, function %s(). Aborting.", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
|
||||
abort(); \
|
||||
} \
|
||||
} while (FALSE)
|
||||
} while (false)
|
||||
|
||||
/* Does exactly nothing */
|
||||
#define pa_nop() do {} while (FALSE)
|
||||
#define pa_nop() do {} while (false)
|
||||
|
||||
/* pa_assert() is an assert that may be optimized away by defining
|
||||
* NDEBUG. pa_assert_fp() is an assert that may be optimized away by
|
||||
|
|
@ -252,7 +252,7 @@ typedef int pa_bool_t;
|
|||
do { \
|
||||
pa_log_error("Code should not be reached at %s:%u, function %s(). Aborting.", __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
|
||||
abort(); \
|
||||
} while (FALSE)
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
/* A compile time assertion */
|
||||
|
|
@ -263,7 +263,7 @@ typedef int pa_bool_t;
|
|||
case !!(expr): \
|
||||
; \
|
||||
} \
|
||||
} while (FALSE)
|
||||
} while (false)
|
||||
|
||||
#define PA_PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
|
||||
#define PA_UINT_TO_PTR(u) ((void*) ((uintptr_t) (u)))
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ struct pa_memblock {
|
|||
|
||||
pa_memblock_type_t type;
|
||||
|
||||
pa_bool_t read_only:1;
|
||||
pa_bool_t is_silence:1;
|
||||
bool read_only:1;
|
||||
bool is_silence:1;
|
||||
|
||||
pa_atomic_ptr_t data;
|
||||
size_t length;
|
||||
|
|
@ -235,7 +235,7 @@ static pa_memblock *memblock_new_appended(pa_mempool *p, size_t length) {
|
|||
PA_REFCNT_INIT(b);
|
||||
b->pool = p;
|
||||
b->type = PA_MEMBLOCK_APPENDED;
|
||||
b->read_only = b->is_silence = FALSE;
|
||||
b->read_only = b->is_silence = false;
|
||||
pa_atomic_ptr_store(&b->data, (uint8_t*) b + PA_ALIGN(sizeof(pa_memblock)));
|
||||
b->length = length;
|
||||
pa_atomic_store(&b->n_acquired, 0);
|
||||
|
|
@ -351,7 +351,7 @@ pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) {
|
|||
|
||||
PA_REFCNT_INIT(b);
|
||||
b->pool = p;
|
||||
b->read_only = b->is_silence = FALSE;
|
||||
b->read_only = b->is_silence = false;
|
||||
b->length = length;
|
||||
pa_atomic_store(&b->n_acquired, 0);
|
||||
pa_atomic_store(&b->please_signal, 0);
|
||||
|
|
@ -361,7 +361,7 @@ pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) {
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_memblock *pa_memblock_new_fixed(pa_mempool *p, void *d, size_t length, pa_bool_t read_only) {
|
||||
pa_memblock *pa_memblock_new_fixed(pa_mempool *p, void *d, size_t length, bool read_only) {
|
||||
pa_memblock *b;
|
||||
|
||||
pa_assert(p);
|
||||
|
|
@ -376,7 +376,7 @@ pa_memblock *pa_memblock_new_fixed(pa_mempool *p, void *d, size_t length, pa_boo
|
|||
b->pool = p;
|
||||
b->type = PA_MEMBLOCK_FIXED;
|
||||
b->read_only = read_only;
|
||||
b->is_silence = FALSE;
|
||||
b->is_silence = false;
|
||||
pa_atomic_ptr_store(&b->data, d);
|
||||
b->length = length;
|
||||
pa_atomic_store(&b->n_acquired, 0);
|
||||
|
|
@ -387,7 +387,7 @@ pa_memblock *pa_memblock_new_fixed(pa_mempool *p, void *d, size_t length, pa_boo
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_memblock *pa_memblock_new_user(pa_mempool *p, void *d, size_t length, pa_free_cb_t free_cb, pa_bool_t read_only) {
|
||||
pa_memblock *pa_memblock_new_user(pa_mempool *p, void *d, size_t length, pa_free_cb_t free_cb, bool read_only) {
|
||||
pa_memblock *b;
|
||||
|
||||
pa_assert(p);
|
||||
|
|
@ -403,7 +403,7 @@ pa_memblock *pa_memblock_new_user(pa_mempool *p, void *d, size_t length, pa_free
|
|||
b->pool = p;
|
||||
b->type = PA_MEMBLOCK_USER;
|
||||
b->read_only = read_only;
|
||||
b->is_silence = FALSE;
|
||||
b->is_silence = false;
|
||||
pa_atomic_ptr_store(&b->data, d);
|
||||
b->length = length;
|
||||
pa_atomic_store(&b->n_acquired, 0);
|
||||
|
|
@ -416,7 +416,7 @@ pa_memblock *pa_memblock_new_user(pa_mempool *p, void *d, size_t length, pa_free
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_bool_t pa_memblock_is_read_only(pa_memblock *b) {
|
||||
bool pa_memblock_is_read_only(pa_memblock *b) {
|
||||
pa_assert(b);
|
||||
pa_assert(PA_REFCNT_VALUE(b) > 0);
|
||||
|
||||
|
|
@ -424,7 +424,7 @@ pa_bool_t pa_memblock_is_read_only(pa_memblock *b) {
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_bool_t pa_memblock_is_silence(pa_memblock *b) {
|
||||
bool pa_memblock_is_silence(pa_memblock *b) {
|
||||
pa_assert(b);
|
||||
pa_assert(PA_REFCNT_VALUE(b) > 0);
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ pa_bool_t pa_memblock_is_silence(pa_memblock *b) {
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
void pa_memblock_set_is_silence(pa_memblock *b, pa_bool_t v) {
|
||||
void pa_memblock_set_is_silence(pa_memblock *b, bool v) {
|
||||
pa_assert(b);
|
||||
pa_assert(PA_REFCNT_VALUE(b) > 0);
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ void pa_memblock_set_is_silence(pa_memblock *b, pa_bool_t v) {
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_bool_t pa_memblock_ref_is_one(pa_memblock *b) {
|
||||
bool pa_memblock_ref_is_one(pa_memblock *b) {
|
||||
int r;
|
||||
pa_assert(b);
|
||||
|
||||
|
|
@ -560,7 +560,7 @@ static void memblock_free(pa_memblock *b) {
|
|||
case PA_MEMBLOCK_POOL_EXTERNAL:
|
||||
case PA_MEMBLOCK_POOL: {
|
||||
struct mempool_slot *slot;
|
||||
pa_bool_t call_free;
|
||||
bool call_free;
|
||||
|
||||
pa_assert_se(slot = mempool_slot_by_ptr(b->pool, pa_atomic_ptr_load(&b->data)));
|
||||
|
||||
|
|
@ -638,7 +638,7 @@ static void memblock_make_local(pa_memblock *b) {
|
|||
pa_atomic_ptr_store(&b->data, new_data);
|
||||
|
||||
b->type = PA_MEMBLOCK_POOL_EXTERNAL;
|
||||
b->read_only = FALSE;
|
||||
b->read_only = false;
|
||||
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -649,7 +649,7 @@ static void memblock_make_local(pa_memblock *b) {
|
|||
pa_atomic_ptr_store(&b->data, pa_xmemdup(pa_atomic_ptr_load(&b->data), b->length));
|
||||
|
||||
b->type = PA_MEMBLOCK_USER;
|
||||
b->read_only = FALSE;
|
||||
b->read_only = false;
|
||||
|
||||
finish:
|
||||
pa_atomic_inc(&b->pool->stat.n_allocated_by_type[b->type]);
|
||||
|
|
@ -712,7 +712,7 @@ static void memblock_replace_import(pa_memblock *b) {
|
|||
pa_mutex_unlock(import->mutex);
|
||||
}
|
||||
|
||||
pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size) {
|
||||
pa_mempool* pa_mempool_new(bool shared, size_t size) {
|
||||
pa_mempool *p;
|
||||
char t1[PA_BYTES_SNPRINT_MAX], t2[PA_BYTES_SNPRINT_MAX];
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size) {
|
|||
PA_LLIST_HEAD_INIT(pa_memimport, p->imports);
|
||||
PA_LLIST_HEAD_INIT(pa_memexport, p->exports);
|
||||
|
||||
p->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
p->mutex = pa_mutex_new(true, true);
|
||||
p->semaphore = pa_semaphore_new(0);
|
||||
|
||||
p->free_slots = pa_flist_new(p->n_blocks);
|
||||
|
|
@ -874,7 +874,7 @@ int pa_mempool_get_shm_id(pa_mempool *p, uint32_t *id) {
|
|||
}
|
||||
|
||||
/* No lock necessary */
|
||||
pa_bool_t pa_mempool_is_shared(pa_mempool *p) {
|
||||
bool pa_mempool_is_shared(pa_mempool *p) {
|
||||
pa_assert(p);
|
||||
|
||||
return !!p->memory.shared;
|
||||
|
|
@ -888,7 +888,7 @@ pa_memimport* pa_memimport_new(pa_mempool *p, pa_memimport_release_cb_t cb, void
|
|||
pa_assert(cb);
|
||||
|
||||
i = pa_xnew(pa_memimport, 1);
|
||||
i->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
i->mutex = pa_mutex_new(true, true);
|
||||
i->pool = p;
|
||||
i->segments = pa_hashmap_new(NULL, NULL);
|
||||
i->blocks = pa_hashmap_new(NULL, NULL);
|
||||
|
|
@ -1002,8 +1002,8 @@ pa_memblock* pa_memimport_get(pa_memimport *i, uint32_t block_id, uint32_t shm_i
|
|||
PA_REFCNT_INIT(b);
|
||||
b->pool = i->pool;
|
||||
b->type = PA_MEMBLOCK_IMPORTED;
|
||||
b->read_only = TRUE;
|
||||
b->is_silence = FALSE;
|
||||
b->read_only = true;
|
||||
b->is_silence = false;
|
||||
pa_atomic_ptr_store(&b->data, (uint8_t*) seg->memory.ptr + offset);
|
||||
b->length = size;
|
||||
pa_atomic_store(&b->n_acquired, 0);
|
||||
|
|
@ -1054,7 +1054,7 @@ pa_memexport* pa_memexport_new(pa_mempool *p, pa_memexport_revoke_cb_t cb, void
|
|||
return NULL;
|
||||
|
||||
e = pa_xnew(pa_memexport, 1);
|
||||
e->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
e->mutex = pa_mutex_new(true, true);
|
||||
e->pool = p;
|
||||
PA_LLIST_HEAD_INIT(struct memexport_slot, e->free_slots);
|
||||
PA_LLIST_HEAD_INIT(struct memexport_slot, e->used_slots);
|
||||
|
|
|
|||
|
|
@ -85,13 +85,13 @@ pa_memblock *pa_memblock_new(pa_mempool *, size_t length);
|
|||
pa_memblock *pa_memblock_new_pool(pa_mempool *, size_t length);
|
||||
|
||||
/* Allocate a new memory block of type PA_MEMBLOCK_USER */
|
||||
pa_memblock *pa_memblock_new_user(pa_mempool *, void *data, size_t length, pa_free_cb_t free_cb, pa_bool_t read_only);
|
||||
pa_memblock *pa_memblock_new_user(pa_mempool *, void *data, size_t length, pa_free_cb_t free_cb, bool read_only);
|
||||
|
||||
/* A special case of pa_memblock_new_user: take a memory buffer previously allocated with pa_xmalloc() */
|
||||
#define pa_memblock_new_malloced(p,data,length) pa_memblock_new_user(p, data, length, pa_xfree, 0)
|
||||
|
||||
/* Allocate a new memory block of type PA_MEMBLOCK_FIXED */
|
||||
pa_memblock *pa_memblock_new_fixed(pa_mempool *, void *data, size_t length, pa_bool_t read_only);
|
||||
pa_memblock *pa_memblock_new_fixed(pa_mempool *, void *data, size_t length, bool read_only);
|
||||
|
||||
void pa_memblock_unref(pa_memblock*b);
|
||||
pa_memblock* pa_memblock_ref(pa_memblock*b);
|
||||
|
|
@ -104,10 +104,10 @@ function is not multiple caller safe, i.e. needs to be locked
|
|||
manually if called from more than one thread at the same time. */
|
||||
void pa_memblock_unref_fixed(pa_memblock*b);
|
||||
|
||||
pa_bool_t pa_memblock_is_read_only(pa_memblock *b);
|
||||
pa_bool_t pa_memblock_is_silence(pa_memblock *b);
|
||||
pa_bool_t pa_memblock_ref_is_one(pa_memblock *b);
|
||||
void pa_memblock_set_is_silence(pa_memblock *b, pa_bool_t v);
|
||||
bool pa_memblock_is_read_only(pa_memblock *b);
|
||||
bool pa_memblock_is_silence(pa_memblock *b);
|
||||
bool pa_memblock_ref_is_one(pa_memblock *b);
|
||||
void pa_memblock_set_is_silence(pa_memblock *b, bool v);
|
||||
|
||||
void* pa_memblock_acquire(pa_memblock *b);
|
||||
void *pa_memblock_acquire_chunk(const pa_memchunk *c);
|
||||
|
|
@ -119,12 +119,12 @@ pa_mempool * pa_memblock_get_pool(pa_memblock *b);
|
|||
pa_memblock *pa_memblock_will_need(pa_memblock *b);
|
||||
|
||||
/* The memory block manager */
|
||||
pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size);
|
||||
pa_mempool* pa_mempool_new(bool shared, size_t size);
|
||||
void pa_mempool_free(pa_mempool *p);
|
||||
const pa_mempool_stat* pa_mempool_get_stat(pa_mempool *p);
|
||||
void pa_mempool_vacuum(pa_mempool *p);
|
||||
int pa_mempool_get_shm_id(pa_mempool *p, uint32_t *id);
|
||||
pa_bool_t pa_mempool_is_shared(pa_mempool *p);
|
||||
bool pa_mempool_is_shared(pa_mempool *p);
|
||||
size_t pa_mempool_block_size_max(pa_mempool *p);
|
||||
|
||||
/* For receiving blocks from other nodes */
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ struct pa_memblockq {
|
|||
unsigned n_blocks;
|
||||
size_t maxlength, tlength, base, prebuf, minreq, maxrewind;
|
||||
int64_t read_index, write_index;
|
||||
pa_bool_t in_prebuf;
|
||||
bool in_prebuf;
|
||||
pa_memchunk silence;
|
||||
pa_mcalign *mcalign;
|
||||
int64_t missing, requested;
|
||||
|
|
@ -86,7 +86,7 @@ pa_memblockq* pa_memblockq_new(
|
|||
pa_log_debug("memblockq requested: maxlength=%lu, tlength=%lu, base=%lu, prebuf=%lu, minreq=%lu maxrewind=%lu",
|
||||
(unsigned long) maxlength, (unsigned long) tlength, (unsigned long) bq->base, (unsigned long) prebuf, (unsigned long) minreq, (unsigned long) maxrewind);
|
||||
|
||||
bq->in_prebuf = TRUE;
|
||||
bq->in_prebuf = true;
|
||||
|
||||
pa_memblockq_set_maxlength(bq, maxlength);
|
||||
pa_memblockq_set_tlength(bq, tlength);
|
||||
|
|
@ -222,7 +222,7 @@ static void drop_backlog(pa_memblockq *bq) {
|
|||
drop_block(bq, bq->blocks);
|
||||
}
|
||||
|
||||
static pa_bool_t can_push(pa_memblockq *bq, size_t l) {
|
||||
static bool can_push(pa_memblockq *bq, size_t l) {
|
||||
int64_t end;
|
||||
|
||||
pa_assert(bq);
|
||||
|
|
@ -233,7 +233,7 @@ static pa_bool_t can_push(pa_memblockq *bq, size_t l) {
|
|||
if ((int64_t) l > d)
|
||||
l -= (size_t) d;
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
end = bq->blocks_tail ? bq->blocks_tail->index + (int64_t) bq->blocks_tail->chunk.length : bq->write_index;
|
||||
|
|
@ -241,12 +241,12 @@ static pa_bool_t can_push(pa_memblockq *bq, size_t l) {
|
|||
/* Make sure that the list doesn't get too long */
|
||||
if (bq->write_index + (int64_t) l > end)
|
||||
if (bq->write_index + (int64_t) l - bq->read_index > (int64_t) bq->maxlength)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void write_index_changed(pa_memblockq *bq, int64_t old_write_index, pa_bool_t account) {
|
||||
static void write_index_changed(pa_memblockq *bq, int64_t old_write_index, bool account) {
|
||||
int64_t delta;
|
||||
|
||||
pa_assert(bq);
|
||||
|
|
@ -438,11 +438,11 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
|
|||
|
||||
finish:
|
||||
|
||||
write_index_changed(bq, old, TRUE);
|
||||
write_index_changed(bq, old, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pa_bool_t pa_memblockq_prebuf_active(pa_memblockq *bq) {
|
||||
bool pa_memblockq_prebuf_active(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
if (bq->in_prebuf)
|
||||
|
|
@ -451,24 +451,24 @@ pa_bool_t pa_memblockq_prebuf_active(pa_memblockq *bq) {
|
|||
return bq->prebuf > 0 && bq->read_index >= bq->write_index;
|
||||
}
|
||||
|
||||
static pa_bool_t update_prebuf(pa_memblockq *bq) {
|
||||
static bool update_prebuf(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
if (bq->in_prebuf) {
|
||||
|
||||
if (pa_memblockq_get_length(bq) < bq->prebuf)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
bq->in_prebuf = FALSE;
|
||||
return FALSE;
|
||||
bq->in_prebuf = false;
|
||||
return false;
|
||||
} else {
|
||||
|
||||
if (bq->prebuf > 0 && bq->read_index >= bq->write_index) {
|
||||
bq->in_prebuf = TRUE;
|
||||
return TRUE;
|
||||
bq->in_prebuf = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -657,16 +657,16 @@ void pa_memblockq_rewind(pa_memblockq *bq, size_t length) {
|
|||
read_index_changed(bq, old);
|
||||
}
|
||||
|
||||
pa_bool_t pa_memblockq_is_readable(pa_memblockq *bq) {
|
||||
bool pa_memblockq_is_readable(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
if (pa_memblockq_prebuf_active(bq))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (pa_memblockq_get_length(bq) <= 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t pa_memblockq_get_length(pa_memblockq *bq) {
|
||||
|
|
@ -690,7 +690,7 @@ size_t pa_memblockq_missing(pa_memblockq *bq) {
|
|||
return l >= bq->minreq ? l : 0;
|
||||
}
|
||||
|
||||
void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, pa_bool_t account) {
|
||||
void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, bool account) {
|
||||
int64_t old;
|
||||
pa_assert(bq);
|
||||
|
||||
|
|
@ -717,7 +717,7 @@ void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, pa
|
|||
write_index_changed(bq, old, account);
|
||||
}
|
||||
|
||||
void pa_memblockq_flush_write(pa_memblockq *bq, pa_bool_t account) {
|
||||
void pa_memblockq_flush_write(pa_memblockq *bq, bool account) {
|
||||
int64_t old;
|
||||
pa_assert(bq);
|
||||
|
||||
|
|
@ -804,14 +804,14 @@ int pa_memblockq_push_align(pa_memblockq* bq, const pa_memchunk *chunk) {
|
|||
void pa_memblockq_prebuf_disable(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
bq->in_prebuf = FALSE;
|
||||
bq->in_prebuf = false;
|
||||
}
|
||||
|
||||
void pa_memblockq_prebuf_force(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
if (bq->prebuf > 0)
|
||||
bq->in_prebuf = TRUE;
|
||||
bq->in_prebuf = true;
|
||||
}
|
||||
|
||||
size_t pa_memblockq_get_maxlength(pa_memblockq *bq) {
|
||||
|
|
@ -914,7 +914,7 @@ void pa_memblockq_set_prebuf(pa_memblockq *bq, size_t prebuf) {
|
|||
bq->prebuf = bq->tlength+bq->base-bq->minreq;
|
||||
|
||||
if (bq->prebuf <= 0 || pa_memblockq_get_length(bq) >= bq->prebuf)
|
||||
bq->in_prebuf = FALSE;
|
||||
bq->in_prebuf = false;
|
||||
}
|
||||
|
||||
void pa_memblockq_set_maxrewind(pa_memblockq *bq, size_t maxrewind) {
|
||||
|
|
@ -967,7 +967,7 @@ int pa_memblockq_splice(pa_memblockq *bq, pa_memblockq *source) {
|
|||
|
||||
pa_memblock_unref(chunk.memblock);
|
||||
} else
|
||||
pa_memblockq_seek(bq, (int64_t) chunk.length, PA_SEEK_RELATIVE, TRUE);
|
||||
pa_memblockq_seek(bq, (int64_t) chunk.length, PA_SEEK_RELATIVE, true);
|
||||
|
||||
pa_memblockq_drop(bq, chunk.length);
|
||||
}
|
||||
|
|
@ -997,7 +997,7 @@ void pa_memblockq_set_silence(pa_memblockq *bq, pa_memchunk *silence) {
|
|||
pa_memchunk_reset(&bq->silence);
|
||||
}
|
||||
|
||||
pa_bool_t pa_memblockq_is_empty(pa_memblockq *bq) {
|
||||
bool pa_memblockq_is_empty(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
return !bq->blocks;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *chunk);
|
|||
int pa_memblockq_push_align(pa_memblockq* bq, const pa_memchunk *chunk);
|
||||
|
||||
/* Manipulate the write pointer */
|
||||
void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, pa_bool_t account);
|
||||
void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek, bool account);
|
||||
|
||||
/* Return a copy of the next memory chunk in the queue. It is not
|
||||
* removed from the queue. There are two reasons this function might
|
||||
|
|
@ -109,7 +109,7 @@ void pa_memblockq_drop(pa_memblockq *bq, size_t length);
|
|||
void pa_memblockq_rewind(pa_memblockq *bq, size_t length);
|
||||
|
||||
/* Test if the pa_memblockq is currently readable, that is, more data than base */
|
||||
pa_bool_t pa_memblockq_is_readable(pa_memblockq *bq);
|
||||
bool pa_memblockq_is_readable(pa_memblockq *bq);
|
||||
|
||||
/* Return the length of the queue in bytes */
|
||||
size_t pa_memblockq_get_length(pa_memblockq *bq);
|
||||
|
|
@ -125,7 +125,7 @@ size_t pa_memblockq_pop_missing(pa_memblockq *bq);
|
|||
int pa_memblockq_splice(pa_memblockq *bq, pa_memblockq *source);
|
||||
|
||||
/* Set the queue to silence, set write index to read index */
|
||||
void pa_memblockq_flush_write(pa_memblockq *bq, pa_bool_t account);
|
||||
void pa_memblockq_flush_write(pa_memblockq *bq, bool account);
|
||||
|
||||
/* Set the queue to silence, set write read index to write index*/
|
||||
void pa_memblockq_flush_read(pa_memblockq *bq);
|
||||
|
|
@ -178,13 +178,13 @@ void pa_memblockq_willneed(pa_memblockq *bq);
|
|||
/* Check whether the memblockq is completely empty, i.e. no data
|
||||
* neither left nor right of the read pointer, and hence no buffered
|
||||
* data for the future nor data in the backlog. */
|
||||
pa_bool_t pa_memblockq_is_empty(pa_memblockq *bq);
|
||||
bool pa_memblockq_is_empty(pa_memblockq *bq);
|
||||
|
||||
/* Drop everything in the queue, but don't modify the indexes */
|
||||
void pa_memblockq_silence(pa_memblockq *bq);
|
||||
|
||||
/* Check whether we currently are in prebuf state */
|
||||
pa_bool_t pa_memblockq_prebuf_active(pa_memblockq *bq);
|
||||
bool pa_memblockq_prebuf_active(pa_memblockq *bq);
|
||||
|
||||
/* Return how many items are currently stored in the queue */
|
||||
unsigned pa_memblockq_get_nblocks(pa_memblockq *bq);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src) {
|
|||
return dst;
|
||||
}
|
||||
|
||||
pa_bool_t pa_memchunk_isset(pa_memchunk *chunk) {
|
||||
bool pa_memchunk_isset(pa_memchunk *chunk) {
|
||||
assert(chunk);
|
||||
|
||||
return
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ pa_memchunk *pa_memchunk_will_need(const pa_memchunk *c);
|
|||
/* Copy the data in the src memchunk to the dst memchunk */
|
||||
pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src);
|
||||
|
||||
/* Return TRUE if any field is set != 0 */
|
||||
pa_bool_t pa_memchunk_isset(pa_memchunk *c);
|
||||
/* Return true if any field is set != 0 */
|
||||
bool pa_memchunk_isset(pa_memchunk *c);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static void allocate_aupdate(void) {
|
|||
} PA_ONCE_END;
|
||||
}
|
||||
|
||||
pa_bool_t pa_memtrap_is_good(pa_memtrap *m) {
|
||||
bool pa_memtrap_is_good(pa_memtrap *m) {
|
||||
pa_assert(m);
|
||||
|
||||
return !pa_atomic_load(&m->bad);
|
||||
|
|
@ -150,7 +150,7 @@ pa_memtrap* pa_memtrap_add(const void *start, size_t size) {
|
|||
|
||||
allocate_aupdate();
|
||||
|
||||
mx = pa_static_mutex_get(&mutex, FALSE, TRUE);
|
||||
mx = pa_static_mutex_get(&mutex, false, true);
|
||||
pa_mutex_lock(mx);
|
||||
|
||||
j = pa_aupdate_write_begin(aupdate);
|
||||
|
|
@ -172,7 +172,7 @@ void pa_memtrap_remove(pa_memtrap *m) {
|
|||
|
||||
allocate_aupdate();
|
||||
|
||||
mx = pa_static_mutex_get(&mutex, FALSE, TRUE);
|
||||
mx = pa_static_mutex_get(&mutex, false, true);
|
||||
pa_mutex_lock(mx);
|
||||
|
||||
j = pa_aupdate_write_begin(aupdate);
|
||||
|
|
@ -200,7 +200,7 @@ pa_memtrap *pa_memtrap_update(pa_memtrap *m, const void *start, size_t size) {
|
|||
|
||||
allocate_aupdate();
|
||||
|
||||
mx = pa_static_mutex_get(&mutex, FALSE, TRUE);
|
||||
mx = pa_static_mutex_get(&mutex, false, true);
|
||||
pa_mutex_lock(mx);
|
||||
|
||||
j = pa_aupdate_write_begin(aupdate);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ pa_memtrap *pa_memtrap_update(pa_memtrap *m, const void *start, size_t size);
|
|||
|
||||
void pa_memtrap_remove(pa_memtrap *m);
|
||||
|
||||
pa_bool_t pa_memtrap_is_good(pa_memtrap *m);
|
||||
bool pa_memtrap_is_good(pa_memtrap *m);
|
||||
|
||||
void pa_memtrap_install(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mime-type.h"
|
||||
|
||||
pa_bool_t pa_sample_spec_is_mime(const pa_sample_spec *ss, const pa_channel_map *cm) {
|
||||
bool pa_sample_spec_is_mime(const pa_sample_spec *ss, const pa_channel_map *cm) {
|
||||
|
||||
pa_assert(pa_channel_map_compatible(cm, ss));
|
||||
|
||||
|
|
@ -45,33 +45,33 @@ pa_bool_t pa_sample_spec_is_mime(const pa_sample_spec *ss, const pa_channel_map
|
|||
ss->rate != 32000 &&
|
||||
ss->rate != 44100 &&
|
||||
ss->rate != 48000)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (ss->channels != 1 &&
|
||||
ss->channels != 2)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if ((cm->channels == 1 && cm->map[0] != PA_CHANNEL_POSITION_MONO) ||
|
||||
(cm->channels == 2 && (cm->map[0] != PA_CHANNEL_POSITION_LEFT || cm->map[1] != PA_CHANNEL_POSITION_RIGHT)))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case PA_SAMPLE_ULAW:
|
||||
|
||||
if (ss->rate != 8000)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (ss->channels != 1)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (cm->map[0] != PA_CHANNEL_POSITION_MONO)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <pulse/sample.h>
|
||||
#include <pulse/channelmap.h>
|
||||
|
||||
pa_bool_t pa_sample_spec_is_mime(const pa_sample_spec *ss, const pa_channel_map *cm);
|
||||
bool pa_sample_spec_is_mime(const pa_sample_spec *ss, const pa_channel_map *cm);
|
||||
void pa_sample_spec_mimefy(pa_sample_spec *ss, pa_channel_map *cm);
|
||||
char *pa_sample_spec_to_mime_type(const pa_sample_spec *ss, const pa_channel_map *cm);
|
||||
char *pa_sample_spec_to_mime_type_mimefy(const pa_sample_spec *_ss, const pa_channel_map *_cm);
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ size_t pa_mix(
|
|||
size_t length,
|
||||
const pa_sample_spec *spec,
|
||||
const pa_cvolume *volume,
|
||||
pa_bool_t mute) {
|
||||
bool mute) {
|
||||
|
||||
pa_cvolume full_volume;
|
||||
unsigned k;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ size_t pa_mix(
|
|||
size_t length,
|
||||
const pa_sample_spec *spec,
|
||||
const pa_cvolume *volume,
|
||||
pa_bool_t mute);
|
||||
bool mute);
|
||||
|
||||
typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, unsigned length);
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ int pa_modargs_get_value_s32(pa_modargs *ma, const char *key, int32_t *value) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, pa_bool_t *value) {
|
||||
int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, bool *value) {
|
||||
const char *v;
|
||||
int r;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const char *pa_modargs_get_value(pa_modargs *ma, const char *key, const char *de
|
|||
/* Return a module argument as unsigned 32bit value in *value */
|
||||
int pa_modargs_get_value_u32(pa_modargs *ma, const char *key, uint32_t *value);
|
||||
int pa_modargs_get_value_s32(pa_modargs *ma, const char *key, int32_t *value);
|
||||
int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, pa_bool_t *value);
|
||||
int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, bool *value);
|
||||
|
||||
/* Return a module argument as double value in *value */
|
||||
int pa_modargs_get_value_double(pa_modargs *ma, const char *key, double *value);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl, const char *module_name) {
|
||||
pa_modinfo *i;
|
||||
const char* (*func)(void);
|
||||
pa_bool_t (*func2) (void);
|
||||
bool (*func2) (void);
|
||||
|
||||
pa_assert(dl);
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl, const char *module_name) {
|
|||
if ((func = (const char* (*)(void)) pa_load_sym(dl, module_name, PA_SYMBOL_DEPRECATED)))
|
||||
i->deprecated = pa_xstrdup(func());
|
||||
|
||||
if ((func2 = (pa_bool_t (*)(void)) pa_load_sym(dl, module_name, PA_SYMBOL_LOAD_ONCE)))
|
||||
if ((func2 = (bool (*)(void)) pa_load_sym(dl, module_name, PA_SYMBOL_LOAD_ONCE)))
|
||||
i->load_once = func2();
|
||||
|
||||
return i;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ typedef struct pa_modinfo {
|
|||
char *usage;
|
||||
char *version;
|
||||
char *deprecated;
|
||||
pa_bool_t load_once;
|
||||
bool load_once;
|
||||
} pa_modinfo;
|
||||
|
||||
/* Read meta data from an libtool handle */
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
|
||||
pa_module *m = NULL;
|
||||
pa_bool_t (*load_once)(void);
|
||||
bool (*load_once)(void);
|
||||
const char* (*get_deprecated)(void);
|
||||
pa_modinfo *mi;
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
|
|||
m = pa_xnew(pa_module, 1);
|
||||
m->name = pa_xstrdup(name);
|
||||
m->argument = pa_xstrdup(argument);
|
||||
m->load_once = FALSE;
|
||||
m->load_once = false;
|
||||
m->proplist = pa_proplist_new();
|
||||
m->index = PA_IDXSET_INVALID;
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if ((load_once = (pa_bool_t (*)(void)) pa_load_sym(m->dl, name, PA_SYMBOL_LOAD_ONCE))) {
|
||||
if ((load_once = (bool (*)(void)) pa_load_sym(m->dl, name, PA_SYMBOL_LOAD_ONCE))) {
|
||||
|
||||
m->load_once = load_once();
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
|
|||
m->get_n_used = (int (*)(pa_module*_m)) pa_load_sym(m->dl, name, PA_SYMBOL_GET_N_USED);
|
||||
m->userdata = NULL;
|
||||
m->core = c;
|
||||
m->unload_requested = FALSE;
|
||||
m->unload_requested = false;
|
||||
|
||||
pa_assert_se(pa_idxset_put(c->modules, m, &m->index) >= 0);
|
||||
pa_assert(m->index != PA_IDXSET_INVALID);
|
||||
|
|
@ -185,7 +185,7 @@ static void pa_module_free(pa_module *m) {
|
|||
pa_xfree(m);
|
||||
}
|
||||
|
||||
void pa_module_unload(pa_core *c, pa_module *m, pa_bool_t force) {
|
||||
void pa_module_unload(pa_core *c, pa_module *m, bool force) {
|
||||
pa_assert(c);
|
||||
pa_assert(m);
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ void pa_module_unload(pa_core *c, pa_module *m, pa_bool_t force) {
|
|||
pa_module_free(m);
|
||||
}
|
||||
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, pa_bool_t force) {
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, bool force) {
|
||||
pa_module *m;
|
||||
pa_assert(c);
|
||||
pa_assert(idx != PA_IDXSET_INVALID);
|
||||
|
|
@ -254,16 +254,16 @@ static void defer_cb(pa_mainloop_api*api, pa_defer_event *e, void *userdata) {
|
|||
|
||||
while ((m = pa_idxset_iterate(c->modules, &state, NULL)))
|
||||
if (m->unload_requested)
|
||||
pa_module_unload(c, m, TRUE);
|
||||
pa_module_unload(c, m, true);
|
||||
}
|
||||
|
||||
void pa_module_unload_request(pa_module *m, pa_bool_t force) {
|
||||
void pa_module_unload_request(pa_module *m, bool force) {
|
||||
pa_assert(m);
|
||||
|
||||
if (m->core->disallow_module_loading && !force)
|
||||
return;
|
||||
|
||||
m->unload_requested = TRUE;
|
||||
m->unload_requested = true;
|
||||
|
||||
if (!m->core->module_defer_unload_event)
|
||||
m->core->module_defer_unload_event = m->core->mainloop->defer_new(m->core->mainloop, defer_cb, m->core);
|
||||
|
|
@ -271,7 +271,7 @@ void pa_module_unload_request(pa_module *m, pa_bool_t force) {
|
|||
m->core->mainloop->defer_enable(m->core->module_defer_unload_event, 1);
|
||||
}
|
||||
|
||||
void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, pa_bool_t force) {
|
||||
void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, bool force) {
|
||||
pa_module *m;
|
||||
pa_assert(c);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,19 +44,19 @@ struct pa_module {
|
|||
|
||||
void *userdata;
|
||||
|
||||
pa_bool_t load_once:1;
|
||||
pa_bool_t unload_requested:1;
|
||||
bool load_once:1;
|
||||
bool unload_requested:1;
|
||||
|
||||
pa_proplist *proplist;
|
||||
};
|
||||
|
||||
pa_module* pa_module_load(pa_core *c, const char *name, const char*argument);
|
||||
|
||||
void pa_module_unload(pa_core *c, pa_module *m, pa_bool_t force);
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, pa_bool_t force);
|
||||
void pa_module_unload(pa_core *c, pa_module *m, bool force);
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, bool force);
|
||||
|
||||
void pa_module_unload_request(pa_module *m, pa_bool_t force);
|
||||
void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, pa_bool_t force);
|
||||
void pa_module_unload_request(pa_module *m, bool force);
|
||||
void pa_module_unload_request_by_index(pa_core *c, uint32_t idx, bool force);
|
||||
|
||||
void pa_module_unload_all(pa_core *c);
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ void pa_module_update_proplist(pa_module *m, pa_update_mode_t mode, pa_proplist
|
|||
struct __stupid_useless_struct_to_allow_trailing_semicolon
|
||||
|
||||
#define PA_MODULE_LOAD_ONCE(b) \
|
||||
pa_bool_t pa__load_once(void) { return b; } \
|
||||
bool pa__load_once(void) { return b; } \
|
||||
struct __stupid_useless_struct_to_allow_trailing_semicolon
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
PA_DEFINE_PUBLIC_CLASS(pa_msgobject, pa_object);
|
||||
|
||||
pa_msgobject *pa_msgobject_new_internal(size_t size, const char *type_id, pa_bool_t (*check_type)(const char *type_name)) {
|
||||
pa_msgobject *pa_msgobject_new_internal(size_t size, const char *type_id, bool (*check_type)(const char *type_name)) {
|
||||
pa_msgobject *o;
|
||||
|
||||
pa_assert(size >= sizeof(pa_msgobject));
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct pa_msgobject {
|
|||
int (*process_msg)(pa_msgobject *o, int code, void *userdata, int64_t offset, pa_memchunk *chunk);
|
||||
};
|
||||
|
||||
pa_msgobject *pa_msgobject_new_internal(size_t size, const char *type_id, pa_bool_t (*check_type)(const char *type_name));
|
||||
pa_msgobject *pa_msgobject_new_internal(size_t size, const char *type_id, bool (*check_type)(const char *type_name));
|
||||
|
||||
#define pa_msgobject_new(type) ((type*) pa_msgobject_new_internal(sizeof(type), type##_type_id, type##_check_type))
|
||||
#define pa_msgobject_free ((void (*) (pa_msgobject* o)) pa_object_free)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct pa_cond {
|
|||
pthread_cond_t cond;
|
||||
};
|
||||
|
||||
pa_mutex* pa_mutex_new(pa_bool_t recursive, pa_bool_t inherit_priority) {
|
||||
pa_mutex* pa_mutex_new(bool recursive, bool inherit_priority) {
|
||||
pa_mutex *m;
|
||||
pthread_mutexattr_t attr;
|
||||
int r;
|
||||
|
|
@ -90,16 +90,16 @@ void pa_mutex_lock(pa_mutex *m) {
|
|||
pa_assert_se(pthread_mutex_lock(&m->mutex) == 0);
|
||||
}
|
||||
|
||||
pa_bool_t pa_mutex_try_lock(pa_mutex *m) {
|
||||
bool pa_mutex_try_lock(pa_mutex *m) {
|
||||
int r;
|
||||
pa_assert(m);
|
||||
|
||||
if ((r = pthread_mutex_trylock(&m->mutex)) != 0) {
|
||||
pa_assert(r == EBUSY);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void pa_mutex_unlock(pa_mutex *m) {
|
||||
|
|
@ -139,7 +139,7 @@ int pa_cond_wait(pa_cond *c, pa_mutex *m) {
|
|||
return pthread_cond_wait(&c->cond, &m->mutex);
|
||||
}
|
||||
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *s, pa_bool_t recursive, pa_bool_t inherit_priority) {
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *s, bool recursive, bool inherit_priority) {
|
||||
pa_mutex *m;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ struct pa_cond {
|
|||
pa_hashmap *wait_events;
|
||||
};
|
||||
|
||||
pa_mutex* pa_mutex_new(pa_bool_t recursive, pa_bool_t inherit_priority) {
|
||||
pa_mutex* pa_mutex_new(bool recursive, bool inherit_priority) {
|
||||
pa_mutex *m;
|
||||
|
||||
m = pa_xnew(pa_mutex, 1);
|
||||
|
|
@ -114,7 +114,7 @@ int pa_cond_wait(pa_cond *c, pa_mutex *m) {
|
|||
assert(c);
|
||||
assert(m);
|
||||
|
||||
event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
event = CreateEvent(NULL, false, false, NULL);
|
||||
assert(event);
|
||||
|
||||
pa_hashmap_put(c->wait_events, event, event);
|
||||
|
|
@ -133,7 +133,7 @@ int pa_cond_wait(pa_cond *c, pa_mutex *m) {
|
|||
}
|
||||
|
||||
/* This is a copy of the function in mutex-posix.c */
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *s, pa_bool_t recursive, pa_bool_t inherit_priority) {
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *s, bool recursive, bool inherit_priority) {
|
||||
pa_mutex *m;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ typedef struct pa_mutex pa_mutex;
|
|||
* good candidates for it. Don't use this blindly! Also, note that
|
||||
* only very few operating systems actually implement this, hence this
|
||||
* is merely a hint. */
|
||||
pa_mutex* pa_mutex_new(pa_bool_t recursive, pa_bool_t inherit_priority);
|
||||
pa_mutex* pa_mutex_new(bool recursive, bool inherit_priority);
|
||||
|
||||
void pa_mutex_free(pa_mutex *m);
|
||||
void pa_mutex_lock(pa_mutex *m);
|
||||
pa_bool_t pa_mutex_try_lock(pa_mutex *m);
|
||||
bool pa_mutex_try_lock(pa_mutex *m);
|
||||
void pa_mutex_unlock(pa_mutex *m);
|
||||
|
||||
typedef struct pa_cond pa_cond;
|
||||
|
|
@ -54,6 +54,6 @@ typedef struct pa_static_mutex {
|
|||
|
||||
#define PA_STATIC_MUTEX_INIT { PA_ATOMIC_PTR_INIT(NULL) }
|
||||
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *m, pa_bool_t recursive, pa_bool_t inherit_priority);
|
||||
pa_mutex* pa_static_mutex_get(pa_static_mutex *m, bool recursive, bool inherit_priority);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ struct namereg_entry {
|
|||
void *data;
|
||||
};
|
||||
|
||||
static pa_bool_t is_valid_char(char c) {
|
||||
static bool is_valid_char(char c) {
|
||||
return
|
||||
(c >= 'a' && c <= 'z') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
|
|
@ -54,41 +54,41 @@ static pa_bool_t is_valid_char(char c) {
|
|||
c == '_';
|
||||
}
|
||||
|
||||
pa_bool_t pa_namereg_is_valid_name(const char *name) {
|
||||
bool pa_namereg_is_valid_name(const char *name) {
|
||||
const char *c;
|
||||
|
||||
pa_assert(name);
|
||||
|
||||
if (*name == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
for (c = name; *c && (c-name < PA_NAME_MAX); c++)
|
||||
if (!is_valid_char(*c))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (*c)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
pa_bool_t pa_namereg_is_valid_name_or_wildcard(const char *name, pa_namereg_type_t type) {
|
||||
bool pa_namereg_is_valid_name_or_wildcard(const char *name, pa_namereg_type_t type) {
|
||||
|
||||
pa_assert(name);
|
||||
|
||||
if (pa_namereg_is_valid_name(name))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (type == PA_NAMEREG_SINK &&
|
||||
pa_streq(name, "@DEFAULT_SINK@"))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (type == PA_NAMEREG_SOURCE &&
|
||||
(pa_streq(name, "@DEFAULT_SOURCE@") ||
|
||||
pa_streq(name, "@DEFAULT_MONITOR@")))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
char* pa_namereg_make_valid_name(const char *name) {
|
||||
|
|
@ -108,7 +108,7 @@ char* pa_namereg_make_valid_name(const char *name) {
|
|||
return n;
|
||||
}
|
||||
|
||||
const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t type, void *data, pa_bool_t fail) {
|
||||
const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t type, void *data, bool fail) {
|
||||
struct namereg_entry *e;
|
||||
char *n = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ typedef enum pa_namereg_type {
|
|||
PA_NAMEREG_CARD
|
||||
} pa_namereg_type_t;
|
||||
|
||||
const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t type, void *data, pa_bool_t fail);
|
||||
const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t type, void *data, bool fail);
|
||||
void pa_namereg_unregister(pa_core *c, const char *name);
|
||||
void* pa_namereg_get(pa_core *c, const char *name, pa_namereg_type_t type);
|
||||
|
||||
|
|
@ -44,8 +44,8 @@ pa_source* pa_namereg_set_default_source(pa_core*c, pa_source *s);
|
|||
pa_sink *pa_namereg_get_default_sink(pa_core *c);
|
||||
pa_source *pa_namereg_get_default_source(pa_core *c);
|
||||
|
||||
pa_bool_t pa_namereg_is_valid_name(const char *name);
|
||||
pa_bool_t pa_namereg_is_valid_name_or_wildcard(const char *name, pa_namereg_type_t type);
|
||||
bool pa_namereg_is_valid_name(const char *name);
|
||||
bool pa_namereg_is_valid_name_or_wildcard(const char *name, pa_namereg_type_t type);
|
||||
char* pa_namereg_make_valid_name(const char *name);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
const char pa_object_type_id[] = "pa_object";
|
||||
|
||||
pa_object *pa_object_new_internal(size_t size, const char *type_id, pa_bool_t (*check_type)(const char *type_id)) {
|
||||
pa_object *pa_object_new_internal(size_t size, const char *type_id, bool (*check_type)(const char *type_id)) {
|
||||
pa_object *o;
|
||||
|
||||
pa_assert(size > sizeof(pa_object));
|
||||
|
|
@ -65,7 +65,7 @@ void pa_object_unref(pa_object *o) {
|
|||
}
|
||||
}
|
||||
|
||||
pa_bool_t pa_object_check_type(const char *type_id) {
|
||||
bool pa_object_check_type(const char *type_id) {
|
||||
pa_assert(type_id);
|
||||
|
||||
return type_id == pa_object_type_id;
|
||||
|
|
|
|||
|
|
@ -35,21 +35,21 @@ struct pa_object {
|
|||
PA_REFCNT_DECLARE;
|
||||
const char *type_id;
|
||||
void (*free)(pa_object *o);
|
||||
pa_bool_t (*check_type)(const char *type_name);
|
||||
bool (*check_type)(const char *type_name);
|
||||
};
|
||||
|
||||
pa_object *pa_object_new_internal(size_t size, const char *type_id, pa_bool_t (*check_type)(const char *type_id));
|
||||
pa_object *pa_object_new_internal(size_t size, const char *type_id, bool (*check_type)(const char *type_id));
|
||||
#define pa_object_new(type) ((type*) pa_object_new_internal(sizeof(type), type##_type_id, type##_check_type)
|
||||
|
||||
#define pa_object_free ((void (*) (pa_object* _obj)) pa_xfree)
|
||||
|
||||
pa_bool_t pa_object_check_type(const char *type_id);
|
||||
bool pa_object_check_type(const char *type_id);
|
||||
|
||||
extern const char pa_object_type_id[];
|
||||
|
||||
static inline pa_bool_t pa_object_isinstance(void *o) {
|
||||
static inline bool pa_object_isinstance(void *o) {
|
||||
pa_object *obj = (pa_object*) o;
|
||||
return obj ? obj->check_type(pa_object_type_id) : TRUE;
|
||||
return obj ? obj->check_type(pa_object_type_id) : true;
|
||||
}
|
||||
|
||||
pa_object *pa_object_ref(pa_object *o);
|
||||
|
|
@ -70,9 +70,9 @@ static inline pa_object* pa_object_cast(void *o) {
|
|||
#define PA_OBJECT(o) pa_object_cast(o)
|
||||
|
||||
#define PA_DECLARE_CLASS_COMMON(c) \
|
||||
static inline pa_bool_t c##_isinstance(void *o) { \
|
||||
static inline bool c##_isinstance(void *o) { \
|
||||
pa_object *obj = (pa_object*) o; \
|
||||
return obj ? obj->check_type(c##_type_id) : TRUE; \
|
||||
return obj ? obj->check_type(c##_type_id) : true; \
|
||||
} \
|
||||
static inline c* c##_cast(void *o) { \
|
||||
pa_assert(c##_isinstance(o)); \
|
||||
|
|
@ -95,13 +95,13 @@ static inline pa_object* pa_object_cast(void *o) {
|
|||
#define PA_DECLARE_PUBLIC_CLASS(c) \
|
||||
extern const char c##_type_id[]; \
|
||||
PA_DECLARE_CLASS_COMMON(c); \
|
||||
pa_bool_t c##_check_type(const char *type_id)
|
||||
bool c##_check_type(const char *type_id)
|
||||
|
||||
#define PA_DEFINE_PUBLIC_CLASS(c, parent) \
|
||||
const char c##_type_id[] = #c; \
|
||||
pa_bool_t c##_check_type(const char *type_id) { \
|
||||
bool c##_check_type(const char *type_id) { \
|
||||
if (type_id == c##_type_id) \
|
||||
return TRUE; \
|
||||
return true; \
|
||||
return parent##_check_type(type_id); \
|
||||
} \
|
||||
struct __stupid_useless_struct_to_allow_trailing_semicolon
|
||||
|
|
@ -109,9 +109,9 @@ static inline pa_object* pa_object_cast(void *o) {
|
|||
#define PA_DEFINE_PRIVATE_CLASS(c, parent) \
|
||||
static const char c##_type_id[] = #c; \
|
||||
PA_DECLARE_CLASS_COMMON(c); \
|
||||
static pa_bool_t c##_check_type(const char *type_id) { \
|
||||
static bool c##_check_type(const char *type_id) { \
|
||||
if (type_id == c##_type_id) \
|
||||
return TRUE; \
|
||||
return true; \
|
||||
return parent##_check_type(type_id); \
|
||||
} \
|
||||
struct __stupid_useless_struct_to_allow_trailing_semicolon
|
||||
|
|
|
|||
|
|
@ -30,27 +30,27 @@
|
|||
/* See http://www.hpl.hp.com/research/linux/atomic_ops/example.php4 for the
|
||||
* reference algorithm used here. */
|
||||
|
||||
pa_bool_t pa_once_begin(pa_once *control) {
|
||||
bool pa_once_begin(pa_once *control) {
|
||||
pa_mutex *m;
|
||||
|
||||
pa_assert(control);
|
||||
|
||||
if (pa_atomic_load(&control->done))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* Caveat: We have to make sure that the once func has completed
|
||||
* before returning, even if the once func is not actually
|
||||
* executed by us. Hence the awkward locking. */
|
||||
|
||||
m = pa_static_mutex_get(&control->mutex, FALSE, FALSE);
|
||||
m = pa_static_mutex_get(&control->mutex, false, false);
|
||||
pa_mutex_lock(m);
|
||||
|
||||
if (pa_atomic_load(&control->done)) {
|
||||
pa_mutex_unlock(m);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void pa_once_end(pa_once *control) {
|
||||
|
|
@ -61,7 +61,7 @@ void pa_once_end(pa_once *control) {
|
|||
pa_assert(!pa_atomic_load(&control->done));
|
||||
pa_atomic_store(&control->done, 1);
|
||||
|
||||
m = pa_static_mutex_get(&control->mutex, FALSE, FALSE);
|
||||
m = pa_static_mutex_get(&control->mutex, false, false);
|
||||
pa_mutex_unlock(m);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ typedef struct pa_once {
|
|||
}
|
||||
|
||||
/* Not to be called directly, use the macros defined below instead */
|
||||
pa_bool_t pa_once_begin(pa_once *o);
|
||||
bool pa_once_begin(pa_once *o);
|
||||
void pa_once_end(pa_once *o);
|
||||
|
||||
#define PA_ONCE_BEGIN \
|
||||
|
|
|
|||
|
|
@ -132,16 +132,16 @@ int pa_parse_address(const char *name, pa_parsed_address *ret_p) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
pa_bool_t pa_is_ip_address(const char *a) {
|
||||
bool pa_is_ip_address(const char *a) {
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
|
||||
pa_assert(a);
|
||||
|
||||
if (inet_pton(AF_INET6, a, buf) >= 1)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (inet_pton(AF_INET, a, buf) >= 1)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,6 @@ typedef struct pa_parsed_address {
|
|||
|
||||
int pa_parse_address(const char *a, pa_parsed_address *ret_p);
|
||||
|
||||
pa_bool_t pa_is_ip_address(const char *a);
|
||||
bool pa_is_ip_address(const char *a);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ struct pa_pdispatch {
|
|||
pa_pdispatch_drain_cb_t drain_callback;
|
||||
void *drain_userdata;
|
||||
const pa_creds *creds;
|
||||
pa_bool_t use_rtclock;
|
||||
bool use_rtclock;
|
||||
};
|
||||
|
||||
static void reply_info_free(struct reply_info *r) {
|
||||
|
|
@ -232,7 +232,7 @@ static void reply_info_free(struct reply_info *r) {
|
|||
pa_xfree(r);
|
||||
}
|
||||
|
||||
pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *mainloop, pa_bool_t use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries) {
|
||||
pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *mainloop, bool use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries) {
|
||||
pa_pdispatch *pd;
|
||||
|
||||
pa_assert(mainloop);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ typedef struct pa_pdispatch pa_pdispatch;
|
|||
typedef void (*pa_pdispatch_cb_t)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
|
||||
typedef void (*pa_pdispatch_drain_cb_t)(pa_pdispatch *pd, void *userdata);
|
||||
|
||||
pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *m, pa_bool_t use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries);
|
||||
pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *m, bool use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries);
|
||||
void pa_pdispatch_unref(pa_pdispatch *pd);
|
||||
pa_pdispatch* pa_pdispatch_ref(pa_pdispatch *pd);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ static int proc_name_ours(pid_t pid, const char *procname) {
|
|||
return -1;
|
||||
} else {
|
||||
char *expected;
|
||||
pa_bool_t good;
|
||||
bool good;
|
||||
char stored[64];
|
||||
|
||||
if (!(fgets(stored, sizeof(stored), f))) {
|
||||
|
|
@ -208,7 +208,7 @@ int pa_pid_file_create(const char *procname) {
|
|||
int ours = 1;
|
||||
|
||||
#ifdef OS_IS_WIN32
|
||||
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL) {
|
||||
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid)) != NULL) {
|
||||
CloseHandle(process);
|
||||
#else
|
||||
if (kill(pid, 0) >= 0 || errno != ESRCH) {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ static void sink_input_state_change_cb(pa_sink_input *i, pa_sink_input_state_t s
|
|||
* we are heard right-away. */
|
||||
if (PA_SINK_INPUT_IS_LINKED(state) &&
|
||||
i->thread_info.state == PA_SINK_INPUT_INIT)
|
||||
pa_sink_input_request_rewind(i, 0, FALSE, TRUE, TRUE);
|
||||
pa_sink_input_request_rewind(i, 0, false, true, true);
|
||||
}
|
||||
|
||||
static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk) {
|
||||
|
|
@ -199,7 +199,7 @@ pa_sink_input* pa_memblockq_sink_input_new(
|
|||
u->memblockq = NULL;
|
||||
|
||||
pa_sink_input_new_data_init(&data);
|
||||
pa_sink_input_new_data_set_sink(&data, sink, FALSE);
|
||||
pa_sink_input_new_data_set_sink(&data, sink, false);
|
||||
data.driver = __FILE__;
|
||||
pa_sink_input_new_data_set_sample_spec(&data, ss);
|
||||
pa_sink_input_new_data_set_channel_map(&data, map);
|
||||
|
|
|
|||
|
|
@ -121,14 +121,14 @@ void pa_init_proplist(pa_proplist *p) {
|
|||
if (pa_startswith(*e, "PULSE_PROP_")) {
|
||||
size_t kl, skip;
|
||||
char *k;
|
||||
pa_bool_t override;
|
||||
bool override;
|
||||
|
||||
if (pa_startswith(*e, "PULSE_PROP_OVERRIDE_")) {
|
||||
skip = 20;
|
||||
override = TRUE;
|
||||
override = true;
|
||||
} else {
|
||||
skip = 11;
|
||||
override = FALSE;
|
||||
override = false;
|
||||
}
|
||||
|
||||
kl = strcspn(*e+skip, "=");
|
||||
|
|
|
|||
|
|
@ -57,15 +57,15 @@ struct connection_entry {
|
|||
DBusConnection *connection;
|
||||
pa_client *client;
|
||||
|
||||
pa_bool_t listening_for_all_signals;
|
||||
bool listening_for_all_signals;
|
||||
|
||||
/* Contains object paths. If this is empty, then signals from all objects
|
||||
* are accepted. Only used when listening_for_all_signals == TRUE. */
|
||||
* are accepted. Only used when listening_for_all_signals == true. */
|
||||
pa_idxset *all_signals_objects;
|
||||
|
||||
/* Signal name -> signal paths entry. The entries contain object paths. If
|
||||
* a path set is empty, then that signal is accepted from all objects. This
|
||||
* variable is only used when listening_for_all_signals == FALSE. */
|
||||
* variable is only used when listening_for_all_signals == false. */
|
||||
pa_hashmap *listening_signals;
|
||||
};
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ int pa_dbus_protocol_add_interface(pa_dbus_protocol *p,
|
|||
void *userdata) {
|
||||
struct object_entry *obj_entry;
|
||||
struct interface_entry *iface_entry;
|
||||
pa_bool_t obj_entry_created = FALSE;
|
||||
bool obj_entry_created = false;
|
||||
|
||||
pa_assert(p);
|
||||
pa_assert(path);
|
||||
|
|
@ -748,7 +748,7 @@ int pa_dbus_protocol_add_interface(pa_dbus_protocol *p,
|
|||
obj_entry->introspection = NULL;
|
||||
|
||||
pa_hashmap_put(p->objects, obj_entry->path, obj_entry);
|
||||
obj_entry_created = TRUE;
|
||||
obj_entry_created = true;
|
||||
}
|
||||
|
||||
if (pa_hashmap_get(obj_entry->interfaces, info->name) != NULL)
|
||||
|
|
@ -895,7 +895,7 @@ int pa_dbus_protocol_register_connection(pa_dbus_protocol *p, DBusConnection *co
|
|||
conn_entry = pa_xnew(struct connection_entry, 1);
|
||||
conn_entry->connection = dbus_connection_ref(conn);
|
||||
conn_entry->client = client;
|
||||
conn_entry->listening_for_all_signals = FALSE;
|
||||
conn_entry->listening_for_all_signals = false;
|
||||
conn_entry->all_signals_objects = pa_idxset_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
conn_entry->listening_signals = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
|
||||
|
|
@ -984,11 +984,11 @@ void pa_dbus_protocol_add_signal_listener(
|
|||
|
||||
/* all_signals_objects will either be emptied or replaced with new objects,
|
||||
* so we empty it here unconditionally. If listening_for_all_signals is
|
||||
* currently FALSE, the idxset is empty already so this does nothing. */
|
||||
* currently false, the idxset is empty already so this does nothing. */
|
||||
pa_idxset_remove_all(conn_entry->all_signals_objects, pa_xfree);
|
||||
|
||||
if (signal_name) {
|
||||
conn_entry->listening_for_all_signals = FALSE;
|
||||
conn_entry->listening_for_all_signals = false;
|
||||
|
||||
/* Replace the old signal paths entry for this signal with a new
|
||||
* one. */
|
||||
|
|
@ -1002,7 +1002,7 @@ void pa_dbus_protocol_add_signal_listener(
|
|||
pa_hashmap_put(conn_entry->listening_signals, signal_paths_entry->signal, signal_paths_entry);
|
||||
|
||||
} else {
|
||||
conn_entry->listening_for_all_signals = TRUE;
|
||||
conn_entry->listening_for_all_signals = true;
|
||||
|
||||
/* We're not interested in individual signals anymore, so let's empty
|
||||
* listening_signals. */
|
||||
|
|
@ -1027,7 +1027,7 @@ void pa_dbus_protocol_remove_signal_listener(pa_dbus_protocol *p, DBusConnection
|
|||
signal_paths_entry_free(signal_paths_entry);
|
||||
|
||||
} else {
|
||||
conn_entry->listening_for_all_signals = FALSE;
|
||||
conn_entry->listening_for_all_signals = false;
|
||||
pa_idxset_remove_all(conn_entry->all_signals_objects, pa_xfree);
|
||||
pa_hashmap_remove_all(conn_entry->listening_signals, (pa_free_cb_t) signal_paths_entry_free);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ typedef struct connection {
|
|||
pa_msgobject parent;
|
||||
|
||||
uint32_t index;
|
||||
pa_bool_t dead;
|
||||
bool dead;
|
||||
pa_esound_protocol *protocol;
|
||||
pa_esound_options *options;
|
||||
pa_iochannel *io;
|
||||
pa_client *client;
|
||||
pa_bool_t authorized, swap_byte_order;
|
||||
bool authorized, swap_byte_order;
|
||||
void *write_data;
|
||||
size_t write_data_alloc, write_data_index, write_data_length;
|
||||
void *read_data;
|
||||
|
|
@ -105,7 +105,7 @@ typedef struct connection {
|
|||
pa_memblock *current_memblock;
|
||||
size_t memblock_index;
|
||||
pa_atomic_t missing;
|
||||
pa_bool_t underrun;
|
||||
bool underrun;
|
||||
} playback;
|
||||
|
||||
struct {
|
||||
|
|
@ -306,7 +306,7 @@ static void connection_write(connection *c, const void *data, size_t length) {
|
|||
memcpy((uint8_t*) c->write_data + i, data, length);
|
||||
}
|
||||
|
||||
static void format_esd2native(int format, pa_bool_t swap_bytes, pa_sample_spec *ss) {
|
||||
static void format_esd2native(int format, bool swap_bytes, pa_sample_spec *ss) {
|
||||
pa_assert(ss);
|
||||
|
||||
ss->channels = (uint8_t) (((format & ESD_MASK_CHAN) == ESD_STEREO) ? 2 : 1);
|
||||
|
|
@ -347,7 +347,7 @@ static int esd_proto_connect(connection *c, esd_proto_t request, const void *dat
|
|||
|
||||
if ((key = pa_auth_cookie_read(c->options->auth_cookie, ESD_KEY_LEN)))
|
||||
if (memcmp(data, key, ESD_KEY_LEN) == 0)
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
}
|
||||
|
||||
if (!c->authorized) {
|
||||
|
|
@ -364,9 +364,9 @@ static int esd_proto_connect(connection *c, esd_proto_t request, const void *dat
|
|||
|
||||
memcpy(&ekey, data, sizeof(uint32_t));
|
||||
if (ekey == ESD_ENDIAN_KEY)
|
||||
c->swap_byte_order = FALSE;
|
||||
c->swap_byte_order = false;
|
||||
else if (ekey == ESD_SWAP_ENDIAN_KEY)
|
||||
c->swap_byte_order = TRUE;
|
||||
c->swap_byte_order = true;
|
||||
else {
|
||||
pa_log_warn("Client sent invalid endian key");
|
||||
return -1;
|
||||
|
|
@ -425,7 +425,7 @@ static int esd_proto_stream_play(connection *c, esd_proto_t request, const void
|
|||
sdata.module = c->options->module;
|
||||
sdata.client = c->client;
|
||||
if (sink)
|
||||
pa_sink_input_new_data_set_sink(&sdata, sink, FALSE);
|
||||
pa_sink_input_new_data_set_sink(&sdata, sink, false);
|
||||
pa_sink_input_new_data_set_sample_spec(&sdata, &ss);
|
||||
|
||||
pa_sink_input_new(&c->sink_input, c->protocol->core, &sdata);
|
||||
|
|
@ -525,7 +525,7 @@ static int esd_proto_stream_record(connection *c, esd_proto_t request, const voi
|
|||
sdata.module = c->options->module;
|
||||
sdata.client = c->client;
|
||||
if (source)
|
||||
pa_source_output_new_data_set_source(&sdata, source, FALSE);
|
||||
pa_source_output_new_data_set_source(&sdata, source, false);
|
||||
pa_source_output_new_data_set_sample_spec(&sdata, &ss);
|
||||
|
||||
pa_source_output_new(&c->source_output, c->protocol->core, &sdata);
|
||||
|
|
@ -643,7 +643,7 @@ static int esd_proto_all_info(connection *c, esd_proto_t request, const void *da
|
|||
|
||||
if (conn->sink_input) {
|
||||
pa_cvolume volume;
|
||||
pa_sink_input_get_volume(conn->sink_input, &volume, TRUE);
|
||||
pa_sink_input_get_volume(conn->sink_input, &volume, true);
|
||||
rate = (int32_t) conn->sink_input->sample_spec.rate;
|
||||
lvolume = (int32_t) ((volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
|
||||
rvolume = (int32_t) ((volume.values[volume.channels == 2 ? 1 : 0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
|
||||
|
|
@ -783,7 +783,7 @@ static int esd_proto_stream_pan(connection *c, esd_proto_t request, const void *
|
|||
volume.values[1] = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
|
||||
volume.channels = conn->sink_input->sample_spec.channels;
|
||||
|
||||
pa_sink_input_set_volume(conn->sink_input, &volume, TRUE, TRUE);
|
||||
pa_sink_input_set_volume(conn->sink_input, &volume, true, true);
|
||||
ok = 1;
|
||||
} else
|
||||
ok = 0;
|
||||
|
|
@ -823,7 +823,7 @@ static int esd_proto_sample_pan(connection *c, esd_proto_t request, const void *
|
|||
|
||||
pa_cvolume_remap(&volume, &stereo, &ce->channel_map);
|
||||
ce->volume = volume;
|
||||
ce->volume_is_set = TRUE;
|
||||
ce->volume_is_set = true;
|
||||
ok = 1;
|
||||
}
|
||||
|
||||
|
|
@ -1266,7 +1266,7 @@ static void do_work(connection *c) {
|
|||
fail:
|
||||
|
||||
if (c->state == ESD_STREAMING_DATA && c->sink_input) {
|
||||
c->dead = TRUE;
|
||||
c->dead = true;
|
||||
|
||||
pa_iochannel_free(c->io);
|
||||
c->io = NULL;
|
||||
|
|
@ -1341,7 +1341,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
|
|||
|
||||
if (pa_memblockq_is_readable(c->input_memblockq) && c->playback.underrun) {
|
||||
pa_log_debug("Requesting rewind due to end of underrun.");
|
||||
pa_sink_input_request_rewind(c->sink_input, 0, FALSE, TRUE, FALSE);
|
||||
pa_sink_input_request_rewind(c->sink_input, 0, false, true, false);
|
||||
}
|
||||
|
||||
/* pa_log("got data, %u", pa_memblockq_get_length(c->input_memblockq)); */
|
||||
|
|
@ -1378,7 +1378,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
|
|||
|
||||
if (pa_memblockq_peek(c->input_memblockq, chunk) < 0) {
|
||||
|
||||
c->playback.underrun = TRUE;
|
||||
c->playback.underrun = true;
|
||||
|
||||
if (c->dead && pa_sink_input_safe_to_remove(i))
|
||||
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(c), CONNECTION_MESSAGE_UNLINK_CONNECTION, NULL, 0, NULL, NULL);
|
||||
|
|
@ -1387,7 +1387,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
|
|||
} else {
|
||||
size_t m;
|
||||
|
||||
c->playback.underrun = FALSE;
|
||||
c->playback.underrun = false;
|
||||
|
||||
chunk->length = PA_MIN(length, chunk->length);
|
||||
pa_memblockq_drop(c->input_memblockq, chunk->length);
|
||||
|
|
@ -1516,9 +1516,9 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
|
|||
c->client->userdata = c;
|
||||
|
||||
c->options = pa_esound_options_ref(o);
|
||||
c->authorized = FALSE;
|
||||
c->swap_byte_order = FALSE;
|
||||
c->dead = FALSE;
|
||||
c->authorized = false;
|
||||
c->swap_byte_order = false;
|
||||
c->dead = false;
|
||||
|
||||
c->read_data_length = 0;
|
||||
c->read_data = pa_xmalloc(c->read_data_alloc = proto_map[ESD_PROTO_CONNECT].data_length);
|
||||
|
|
@ -1537,7 +1537,7 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
|
|||
|
||||
c->playback.current_memblock = NULL;
|
||||
c->playback.memblock_index = 0;
|
||||
c->playback.underrun = TRUE;
|
||||
c->playback.underrun = true;
|
||||
pa_atomic_store(&c->playback.missing, 0);
|
||||
|
||||
pa_memchunk_reset(&c->scache.memchunk);
|
||||
|
|
@ -1547,7 +1547,7 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
|
|||
|
||||
if (o->auth_anonymous) {
|
||||
pa_log_info("Client authenticated anonymously.");
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
}
|
||||
|
||||
if (!c->authorized &&
|
||||
|
|
@ -1555,7 +1555,7 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
|
|||
pa_ip_acl_check(o->auth_ip_acl, pa_iochannel_get_recv_fd(io)) > 0) {
|
||||
|
||||
pa_log_info("Client authenticated by IP ACL.");
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
}
|
||||
|
||||
if (!c->authorized)
|
||||
|
|
@ -1671,7 +1671,7 @@ void pa_esound_options_unref(pa_esound_options *o) {
|
|||
}
|
||||
|
||||
int pa_esound_options_parse(pa_esound_options *o, pa_core *c, pa_modargs *ma) {
|
||||
pa_bool_t enabled;
|
||||
bool enabled;
|
||||
const char *acl;
|
||||
|
||||
pa_assert(o);
|
||||
|
|
@ -1697,7 +1697,7 @@ int pa_esound_options_parse(pa_esound_options *o, pa_core *c, pa_modargs *ma) {
|
|||
o->auth_ip_acl = ipa;
|
||||
}
|
||||
|
||||
enabled = TRUE;
|
||||
enabled = true;
|
||||
if (pa_modargs_get_value_boolean(ma, "auth-cookie-enabled", &enabled) < 0) {
|
||||
pa_log("auth-cookie-enabled= expects a boolean argument.");
|
||||
return -1;
|
||||
|
|
@ -1715,7 +1715,7 @@ int pa_esound_options_parse(pa_esound_options *o, pa_core *c, pa_modargs *ma) {
|
|||
if (!(cn = pa_modargs_get_value(ma, "cookie", NULL)))
|
||||
cn = DEFAULT_COOKIE_FILE;
|
||||
|
||||
if (!(o->auth_cookie = pa_auth_cookie_get(c, cn, TRUE, ESD_KEY_LEN)))
|
||||
if (!(o->auth_cookie = pa_auth_cookie_get(c, cn, true, ESD_KEY_LEN)))
|
||||
return -1;
|
||||
|
||||
} else
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ typedef struct pa_esound_options {
|
|||
|
||||
pa_module *module;
|
||||
|
||||
pa_bool_t auth_anonymous;
|
||||
bool auth_anonymous;
|
||||
pa_ip_acl *auth_ip_acl;
|
||||
pa_auth_cookie *auth_cookie;
|
||||
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ static void handle_listen_prefix(struct connection *c, const char *source_name)
|
|||
data.driver = __FILE__;
|
||||
data.module = c->module;
|
||||
data.client = c->client;
|
||||
pa_source_output_new_data_set_source(&data, source, FALSE);
|
||||
pa_source_output_new_data_set_source(&data, source, false);
|
||||
pa_proplist_update(data.proplist, PA_UPDATE_MERGE, c->client->proplist);
|
||||
pa_source_output_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_output_new_data_set_channel_map(&data, &cm);
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ typedef struct record_stream {
|
|||
pa_source_output *source_output;
|
||||
pa_memblockq *memblockq;
|
||||
|
||||
pa_bool_t adjust_latency:1;
|
||||
pa_bool_t early_requests:1;
|
||||
bool adjust_latency:1;
|
||||
bool early_requests:1;
|
||||
|
||||
/* Requested buffer attributes */
|
||||
pa_buffer_attr buffer_attr_req;
|
||||
|
|
@ -121,11 +121,11 @@ typedef struct playback_stream {
|
|||
pa_sink_input *sink_input;
|
||||
pa_memblockq *memblockq;
|
||||
|
||||
pa_bool_t adjust_latency:1;
|
||||
pa_bool_t early_requests:1;
|
||||
bool adjust_latency:1;
|
||||
bool early_requests:1;
|
||||
|
||||
pa_bool_t is_underrun:1;
|
||||
pa_bool_t drain_request:1;
|
||||
bool is_underrun:1;
|
||||
bool drain_request:1;
|
||||
uint32_t drain_tag;
|
||||
uint32_t syncid;
|
||||
|
||||
|
|
@ -171,8 +171,8 @@ struct pa_native_connection {
|
|||
pa_msgobject parent;
|
||||
pa_native_protocol *protocol;
|
||||
pa_native_options *options;
|
||||
pa_bool_t authorized:1;
|
||||
pa_bool_t is_local:1;
|
||||
bool authorized:1;
|
||||
bool is_local:1;
|
||||
uint32_t version;
|
||||
pa_client *client;
|
||||
pa_pstream *pstream;
|
||||
|
|
@ -234,7 +234,7 @@ enum {
|
|||
static bool sink_input_process_underrun_cb(pa_sink_input *i);
|
||||
static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk);
|
||||
static void sink_input_kill_cb(pa_sink_input *i);
|
||||
static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend);
|
||||
static void sink_input_suspend_cb(pa_sink_input *i, bool suspend);
|
||||
static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest);
|
||||
static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes);
|
||||
static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes);
|
||||
|
|
@ -246,7 +246,7 @@ static void playback_stream_request_bytes(struct playback_stream*s);
|
|||
|
||||
static void source_output_kill_cb(pa_source_output *o);
|
||||
static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk);
|
||||
static void source_output_suspend_cb(pa_source_output *o, pa_bool_t suspend);
|
||||
static void source_output_suspend_cb(pa_source_output *o, bool suspend);
|
||||
static void source_output_moving_cb(pa_source_output *o, pa_source *dest);
|
||||
static pa_usec_t source_output_get_latency_cb(pa_source_output *o);
|
||||
static void source_output_send_event_cb(pa_source_output *o, const char *event, pa_proplist *pl);
|
||||
|
|
@ -638,14 +638,14 @@ static record_stream* record_stream_new(
|
|||
pa_idxset *formats,
|
||||
pa_buffer_attr *attr,
|
||||
pa_cvolume *volume,
|
||||
pa_bool_t muted,
|
||||
pa_bool_t muted_set,
|
||||
bool muted,
|
||||
bool muted_set,
|
||||
pa_source_output_flags_t flags,
|
||||
pa_proplist *p,
|
||||
pa_bool_t adjust_latency,
|
||||
pa_bool_t early_requests,
|
||||
pa_bool_t relative_volume,
|
||||
pa_bool_t peak_detect,
|
||||
bool adjust_latency,
|
||||
bool early_requests,
|
||||
bool relative_volume,
|
||||
bool peak_detect,
|
||||
pa_sink_input *direct_on_input,
|
||||
int *ret) {
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ static record_stream* record_stream_new(
|
|||
data.module = c->options->module;
|
||||
data.client = c->client;
|
||||
if (source)
|
||||
pa_source_output_new_data_set_source(&data, source, FALSE);
|
||||
pa_source_output_new_data_set_source(&data, source, false);
|
||||
if (pa_sample_spec_valid(ss))
|
||||
pa_source_output_new_data_set_sample_spec(&data, ss);
|
||||
if (pa_channel_map_valid(map))
|
||||
|
|
@ -677,11 +677,11 @@ static record_stream* record_stream_new(
|
|||
if (volume) {
|
||||
pa_source_output_new_data_set_volume(&data, volume);
|
||||
data.volume_is_absolute = !relative_volume;
|
||||
data.save_volume = FALSE;
|
||||
data.save_volume = false;
|
||||
}
|
||||
if (muted_set) {
|
||||
pa_source_output_new_data_set_muted(&data, muted);
|
||||
data.save_muted = FALSE;
|
||||
data.save_muted = false;
|
||||
}
|
||||
if (peak_detect)
|
||||
data.resample_method = PA_RESAMPLER_PEAKS;
|
||||
|
|
@ -1077,13 +1077,13 @@ static playback_stream* playback_stream_new(
|
|||
pa_idxset *formats,
|
||||
pa_buffer_attr *a,
|
||||
pa_cvolume *volume,
|
||||
pa_bool_t muted,
|
||||
pa_bool_t muted_set,
|
||||
bool muted,
|
||||
bool muted_set,
|
||||
pa_sink_input_flags_t flags,
|
||||
pa_proplist *p,
|
||||
pa_bool_t adjust_latency,
|
||||
pa_bool_t early_requests,
|
||||
pa_bool_t relative_volume,
|
||||
bool adjust_latency,
|
||||
bool early_requests,
|
||||
bool relative_volume,
|
||||
uint32_t syncid,
|
||||
uint32_t *missing,
|
||||
int *ret) {
|
||||
|
|
@ -1134,7 +1134,7 @@ static playback_stream* playback_stream_new(
|
|||
data.module = c->options->module;
|
||||
data.client = c->client;
|
||||
if (sink)
|
||||
pa_sink_input_new_data_set_sink(&data, sink, FALSE);
|
||||
pa_sink_input_new_data_set_sink(&data, sink, false);
|
||||
if (pa_sample_spec_valid(ss))
|
||||
pa_sink_input_new_data_set_sample_spec(&data, ss);
|
||||
if (pa_channel_map_valid(map))
|
||||
|
|
@ -1147,11 +1147,11 @@ static playback_stream* playback_stream_new(
|
|||
if (volume) {
|
||||
pa_sink_input_new_data_set_volume(&data, volume);
|
||||
data.volume_is_absolute = !relative_volume;
|
||||
data.save_volume = FALSE;
|
||||
data.save_volume = false;
|
||||
}
|
||||
if (muted_set) {
|
||||
pa_sink_input_new_data_set_muted(&data, muted);
|
||||
data.save_muted = FALSE;
|
||||
data.save_muted = false;
|
||||
}
|
||||
data.sync_base = ssync ? ssync->sink_input : NULL;
|
||||
data.flags = flags;
|
||||
|
|
@ -1169,8 +1169,8 @@ static playback_stream* playback_stream_new(
|
|||
s->connection = c;
|
||||
s->syncid = syncid;
|
||||
s->sink_input = sink_input;
|
||||
s->is_underrun = TRUE;
|
||||
s->drain_request = FALSE;
|
||||
s->is_underrun = true;
|
||||
s->drain_request = false;
|
||||
pa_atomic_store(&s->missing, 0);
|
||||
s->buffer_attr_req = *a;
|
||||
s->adjust_latency = adjust_latency;
|
||||
|
|
@ -1414,7 +1414,7 @@ static void handle_seek(playback_stream *s, int64_t indexw) {
|
|||
pa_sink_input_request_rewind(s->sink_input,
|
||||
(size_t) (s->sink_input->thread_info.underrun_for == (uint64_t) -1 ? 0 :
|
||||
s->sink_input->thread_info.underrun_for),
|
||||
FALSE, TRUE, FALSE);
|
||||
false, true, false);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -1427,7 +1427,7 @@ static void handle_seek(playback_stream *s, int64_t indexw) {
|
|||
* let's have it ask us again */
|
||||
|
||||
pa_log_debug("Requesting rewind due to rewrite.");
|
||||
pa_sink_input_request_rewind(s->sink_input, (size_t) (indexr - indexw), TRUE, FALSE, FALSE);
|
||||
pa_sink_input_request_rewind(s->sink_input, (size_t) (indexr - indexw), true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1435,7 +1435,7 @@ static void handle_seek(playback_stream *s, int64_t indexw) {
|
|||
}
|
||||
|
||||
static void flush_write_no_account(pa_memblockq *q) {
|
||||
pa_memblockq_flush_write(q, FALSE);
|
||||
pa_memblockq_flush_write(q, false);
|
||||
}
|
||||
|
||||
/* Called from thread context */
|
||||
|
|
@ -1466,7 +1466,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
|
|||
if (pa_log_ratelimit(PA_LOG_WARN))
|
||||
pa_log_warn("Failed to push data into queue");
|
||||
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_OVERFLOW, NULL, 0, NULL, NULL);
|
||||
pa_memblockq_seek(s->memblockq, (int64_t) chunk->length, PA_SEEK_RELATIVE, TRUE);
|
||||
pa_memblockq_seek(s->memblockq, (int64_t) chunk->length, PA_SEEK_RELATIVE, true);
|
||||
}
|
||||
|
||||
/* If more data is in queue, we rewind later instead. */
|
||||
|
|
@ -1532,7 +1532,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
|
|||
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_DRAIN_ACK, userdata, 0, NULL, NULL);
|
||||
else {
|
||||
s->drain_tag = PA_PTR_TO_UINT(userdata);
|
||||
s->drain_request = TRUE;
|
||||
s->drain_request = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1742,7 +1742,7 @@ static void sink_input_send_event_cb(pa_sink_input *i, const char *event, pa_pro
|
|||
}
|
||||
|
||||
/* Called from main context */
|
||||
static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend) {
|
||||
static void sink_input_suspend_cb(pa_sink_input *i, bool suspend) {
|
||||
playback_stream *s;
|
||||
pa_tagstruct *t;
|
||||
|
||||
|
|
@ -1880,7 +1880,7 @@ static void source_output_send_event_cb(pa_source_output *o, const char *event,
|
|||
}
|
||||
|
||||
/* Called from main context */
|
||||
static void source_output_suspend_cb(pa_source_output *o, pa_bool_t suspend) {
|
||||
static void source_output_suspend_cb(pa_source_output *o, bool suspend) {
|
||||
record_stream *s;
|
||||
pa_tagstruct *t;
|
||||
|
||||
|
|
@ -1977,24 +1977,24 @@ static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, u
|
|||
pa_tagstruct *reply;
|
||||
pa_sink *sink = NULL;
|
||||
pa_cvolume volume;
|
||||
pa_bool_t
|
||||
corked = FALSE,
|
||||
no_remap = FALSE,
|
||||
no_remix = FALSE,
|
||||
fix_format = FALSE,
|
||||
fix_rate = FALSE,
|
||||
fix_channels = FALSE,
|
||||
no_move = FALSE,
|
||||
variable_rate = FALSE,
|
||||
muted = FALSE,
|
||||
adjust_latency = FALSE,
|
||||
early_requests = FALSE,
|
||||
dont_inhibit_auto_suspend = FALSE,
|
||||
volume_set = TRUE,
|
||||
muted_set = FALSE,
|
||||
fail_on_suspend = FALSE,
|
||||
relative_volume = FALSE,
|
||||
passthrough = FALSE;
|
||||
bool
|
||||
corked = false,
|
||||
no_remap = false,
|
||||
no_remix = false,
|
||||
fix_format = false,
|
||||
fix_rate = false,
|
||||
fix_channels = false,
|
||||
no_move = false,
|
||||
variable_rate = false,
|
||||
muted = false,
|
||||
adjust_latency = false,
|
||||
early_requests = false,
|
||||
dont_inhibit_auto_suspend = false,
|
||||
volume_set = true,
|
||||
muted_set = false,
|
||||
fail_on_suspend = false,
|
||||
relative_volume = false,
|
||||
passthrough = false;
|
||||
|
||||
pa_sink_input_flags_t flags = 0;
|
||||
pa_proplist *p = NULL;
|
||||
|
|
@ -2302,25 +2302,25 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin
|
|||
pa_tagstruct *reply;
|
||||
pa_source *source = NULL;
|
||||
pa_cvolume volume;
|
||||
pa_bool_t
|
||||
corked = FALSE,
|
||||
no_remap = FALSE,
|
||||
no_remix = FALSE,
|
||||
fix_format = FALSE,
|
||||
fix_rate = FALSE,
|
||||
fix_channels = FALSE,
|
||||
no_move = FALSE,
|
||||
variable_rate = FALSE,
|
||||
muted = FALSE,
|
||||
adjust_latency = FALSE,
|
||||
peak_detect = FALSE,
|
||||
early_requests = FALSE,
|
||||
dont_inhibit_auto_suspend = FALSE,
|
||||
volume_set = FALSE,
|
||||
muted_set = FALSE,
|
||||
fail_on_suspend = FALSE,
|
||||
relative_volume = FALSE,
|
||||
passthrough = FALSE;
|
||||
bool
|
||||
corked = false,
|
||||
no_remap = false,
|
||||
no_remix = false,
|
||||
fix_format = false,
|
||||
fix_rate = false,
|
||||
fix_channels = false,
|
||||
no_move = false,
|
||||
variable_rate = false,
|
||||
muted = false,
|
||||
adjust_latency = false,
|
||||
peak_detect = false,
|
||||
early_requests = false,
|
||||
dont_inhibit_auto_suspend = false,
|
||||
volume_set = false,
|
||||
muted_set = false,
|
||||
fail_on_suspend = false,
|
||||
relative_volume = false,
|
||||
passthrough = false;
|
||||
|
||||
pa_source_output_flags_t flags = 0;
|
||||
pa_proplist *p = NULL;
|
||||
|
|
@ -2409,7 +2409,7 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin
|
|||
if (c->version >= 22) {
|
||||
/* For newer client versions (with per-source-output volumes), we try
|
||||
* to make the behaviour for playback and record streams the same. */
|
||||
volume_set = TRUE;
|
||||
volume_set = true;
|
||||
|
||||
if (pa_tagstruct_getu8(t, &n_formats) < 0) {
|
||||
protocol_error(c);
|
||||
|
|
@ -2560,7 +2560,7 @@ static void command_exit(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
}
|
||||
|
||||
CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS);
|
||||
ret = pa_core_exit(c->protocol->core, FALSE, 0);
|
||||
ret = pa_core_exit(c->protocol->core, false, 0);
|
||||
CHECK_VALIDITY(c->pstream, ret >= 0, tag, PA_ERR_ACCESS);
|
||||
|
||||
pa_log_debug("Client %s asks us to terminate.", pa_strnull(pa_proplist_gets(c->client->proplist, PA_PROP_APPLICATION_PROCESS_BINARY)));
|
||||
|
|
@ -2572,7 +2572,7 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
|
||||
const void*cookie;
|
||||
pa_tagstruct *reply;
|
||||
pa_bool_t shm_on_remote = FALSE, do_shm;
|
||||
bool shm_on_remote = false, do_shm;
|
||||
|
||||
pa_native_connection_assert_ref(c);
|
||||
pa_assert(t);
|
||||
|
|
@ -2603,14 +2603,14 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
pa_proplist_setf(c->client->proplist, "native-protocol.version", "%u", c->version);
|
||||
|
||||
if (!c->authorized) {
|
||||
pa_bool_t success = FALSE;
|
||||
bool success = false;
|
||||
|
||||
#ifdef HAVE_CREDS
|
||||
const pa_creds *creds;
|
||||
|
||||
if ((creds = pa_pdispatch_creds(pd))) {
|
||||
if (creds->uid == getuid())
|
||||
success = TRUE;
|
||||
success = true;
|
||||
else if (c->options->auth_group) {
|
||||
int r;
|
||||
gid_t gid;
|
||||
|
|
@ -2618,13 +2618,13 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
if ((gid = pa_get_gid_of_group(c->options->auth_group)) == (gid_t) -1)
|
||||
pa_log_warn("Failed to get GID of group '%s'", c->options->auth_group);
|
||||
else if (gid == creds->gid)
|
||||
success = TRUE;
|
||||
success = true;
|
||||
|
||||
if (!success) {
|
||||
if ((r = pa_uid_in_group(creds->uid, c->options->auth_group)) < 0)
|
||||
pa_log_warn("Failed to check group membership.");
|
||||
else if (r > 0)
|
||||
success = TRUE;
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2640,7 +2640,7 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
|
||||
if ((ac = pa_auth_cookie_read(c->options->auth_cookie, PA_NATIVE_COOKIE_LENGTH)))
|
||||
if (memcmp(ac, cookie, PA_NATIVE_COOKIE_LENGTH) == 0)
|
||||
success = TRUE;
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
|
|
@ -2649,7 +2649,7 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
return;
|
||||
}
|
||||
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
if (c->auth_timeout_event) {
|
||||
c->protocol->core->mainloop->time_free(c->auth_timeout_event);
|
||||
c->auth_timeout_event = NULL;
|
||||
|
|
@ -2665,7 +2665,7 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
|
||||
if (do_shm)
|
||||
if (c->version < 10 || (c->version >= 13 && !shm_on_remote))
|
||||
do_shm = FALSE;
|
||||
do_shm = false;
|
||||
|
||||
#ifdef HAVE_CREDS
|
||||
if (do_shm) {
|
||||
|
|
@ -2675,7 +2675,7 @@ static void command_auth(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_ta
|
|||
|
||||
const pa_creds *creds;
|
||||
if (!(creds = pa_pdispatch_creds(pd)) || getuid() != creds->uid)
|
||||
do_shm = FALSE;
|
||||
do_shm = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -2957,7 +2957,7 @@ static void command_create_upload_stream(pa_pdispatch *pd, uint32_t command, uin
|
|||
|
||||
if (!name || !pa_namereg_is_valid_name(name)) {
|
||||
pa_proplist_free(p);
|
||||
CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_INVALID);
|
||||
CHECK_VALIDITY(c->pstream, false, tag, PA_ERR_INVALID);
|
||||
}
|
||||
|
||||
s = upload_stream_new(c, &ss, &map, name, length, p);
|
||||
|
|
@ -3129,8 +3129,8 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
|
|||
PA_TAG_SAMPLE_SPEC, &fixed_ss,
|
||||
PA_TAG_CHANNEL_MAP, &sink->channel_map,
|
||||
PA_TAG_U32, sink->module ? sink->module->index : PA_INVALID_INDEX,
|
||||
PA_TAG_CVOLUME, pa_sink_get_volume(sink, FALSE),
|
||||
PA_TAG_BOOLEAN, pa_sink_get_mute(sink, FALSE),
|
||||
PA_TAG_CVOLUME, pa_sink_get_volume(sink, false),
|
||||
PA_TAG_BOOLEAN, pa_sink_get_mute(sink, false),
|
||||
PA_TAG_U32, sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
|
||||
PA_TAG_STRING, sink->monitor_source ? sink->monitor_source->name : NULL,
|
||||
PA_TAG_USEC, pa_sink_get_latency(sink),
|
||||
|
|
@ -3199,8 +3199,8 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
|
|||
PA_TAG_SAMPLE_SPEC, &fixed_ss,
|
||||
PA_TAG_CHANNEL_MAP, &source->channel_map,
|
||||
PA_TAG_U32, source->module ? source->module->index : PA_INVALID_INDEX,
|
||||
PA_TAG_CVOLUME, pa_source_get_volume(source, FALSE),
|
||||
PA_TAG_BOOLEAN, pa_source_get_mute(source, FALSE),
|
||||
PA_TAG_CVOLUME, pa_source_get_volume(source, false),
|
||||
PA_TAG_BOOLEAN, pa_source_get_mute(source, false),
|
||||
PA_TAG_U32, source->monitor_of ? source->monitor_of->index : PA_INVALID_INDEX,
|
||||
PA_TAG_STRING, source->monitor_of ? source->monitor_of->name : NULL,
|
||||
PA_TAG_USEC, pa_source_get_latency(source),
|
||||
|
|
@ -3327,7 +3327,7 @@ static void module_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_m
|
|||
pa_tagstruct_putu32(t, (uint32_t) pa_module_get_n_used(module));
|
||||
|
||||
if (c->version < 15)
|
||||
pa_tagstruct_put_boolean(t, FALSE); /* autoload is obsolete */
|
||||
pa_tagstruct_put_boolean(t, false); /* autoload is obsolete */
|
||||
|
||||
if (c->version >= 15)
|
||||
pa_tagstruct_put_proplist(t, module->proplist);
|
||||
|
|
@ -3337,7 +3337,7 @@ static void sink_input_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t,
|
|||
pa_sample_spec fixed_ss;
|
||||
pa_usec_t sink_latency;
|
||||
pa_cvolume v;
|
||||
pa_bool_t has_volume = FALSE;
|
||||
bool has_volume = false;
|
||||
|
||||
pa_assert(t);
|
||||
pa_sink_input_assert_ref(s);
|
||||
|
|
@ -3346,7 +3346,7 @@ static void sink_input_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t,
|
|||
|
||||
has_volume = pa_sink_input_is_volume_readable(s);
|
||||
if (has_volume)
|
||||
pa_sink_input_get_volume(s, &v, TRUE);
|
||||
pa_sink_input_get_volume(s, &v, true);
|
||||
else
|
||||
pa_cvolume_reset(&v, fixed_ss.channels);
|
||||
|
||||
|
|
@ -3380,7 +3380,7 @@ static void source_output_fill_tagstruct(pa_native_connection *c, pa_tagstruct *
|
|||
pa_sample_spec fixed_ss;
|
||||
pa_usec_t source_latency;
|
||||
pa_cvolume v;
|
||||
pa_bool_t has_volume = FALSE;
|
||||
bool has_volume = false;
|
||||
|
||||
pa_assert(t);
|
||||
pa_source_output_assert_ref(s);
|
||||
|
|
@ -3389,7 +3389,7 @@ static void source_output_fill_tagstruct(pa_native_connection *c, pa_tagstruct *
|
|||
|
||||
has_volume = pa_source_output_is_volume_readable(s);
|
||||
if (has_volume)
|
||||
pa_source_output_get_volume(s, &v, TRUE);
|
||||
pa_source_output_get_volume(s, &v, true);
|
||||
else
|
||||
pa_cvolume_reset(&v, fixed_ss.channels);
|
||||
|
||||
|
|
@ -3770,12 +3770,12 @@ static void command_set_volume(
|
|||
CHECK_VALIDITY(c->pstream, volume.channels == 1 || pa_cvolume_compatible(&volume, &sink->sample_spec), tag, PA_ERR_INVALID);
|
||||
|
||||
pa_log_debug("Client %s changes volume of sink %s.", client_name, sink->name);
|
||||
pa_sink_set_volume(sink, &volume, TRUE, TRUE);
|
||||
pa_sink_set_volume(sink, &volume, true, true);
|
||||
} else if (source) {
|
||||
CHECK_VALIDITY(c->pstream, volume.channels == 1 || pa_cvolume_compatible(&volume, &source->sample_spec), tag, PA_ERR_INVALID);
|
||||
|
||||
pa_log_debug("Client %s changes volume of source %s.", client_name, source->name);
|
||||
pa_source_set_volume(source, &volume, TRUE, TRUE);
|
||||
pa_source_set_volume(source, &volume, true, true);
|
||||
} else if (si) {
|
||||
CHECK_VALIDITY(c->pstream, si->volume_writable, tag, PA_ERR_BADSTATE);
|
||||
CHECK_VALIDITY(c->pstream, volume.channels == 1 || pa_cvolume_compatible(&volume, &si->sample_spec), tag, PA_ERR_INVALID);
|
||||
|
|
@ -3783,14 +3783,14 @@ static void command_set_volume(
|
|||
pa_log_debug("Client %s changes volume of sink input %s.",
|
||||
client_name,
|
||||
pa_strnull(pa_proplist_gets(si->proplist, PA_PROP_MEDIA_NAME)));
|
||||
pa_sink_input_set_volume(si, &volume, TRUE, TRUE);
|
||||
pa_sink_input_set_volume(si, &volume, true, true);
|
||||
} else if (so) {
|
||||
CHECK_VALIDITY(c->pstream, volume.channels == 1 || pa_cvolume_compatible(&volume, &so->sample_spec), tag, PA_ERR_INVALID);
|
||||
|
||||
pa_log_debug("Client %s changes volume of source output %s.",
|
||||
client_name,
|
||||
pa_strnull(pa_proplist_gets(so->proplist, PA_PROP_MEDIA_NAME)));
|
||||
pa_source_output_set_volume(so, &volume, TRUE, TRUE);
|
||||
pa_source_output_set_volume(so, &volume, true, true);
|
||||
}
|
||||
|
||||
pa_pstream_send_simple_ack(c->pstream, tag);
|
||||
|
|
@ -3805,7 +3805,7 @@ static void command_set_mute(
|
|||
|
||||
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
|
||||
uint32_t idx;
|
||||
pa_bool_t mute;
|
||||
bool mute;
|
||||
pa_sink *sink = NULL;
|
||||
pa_source *source = NULL;
|
||||
pa_sink_input *si = NULL;
|
||||
|
|
@ -3866,20 +3866,20 @@ static void command_set_mute(
|
|||
|
||||
if (sink) {
|
||||
pa_log_debug("Client %s changes mute of sink %s.", client_name, sink->name);
|
||||
pa_sink_set_mute(sink, mute, TRUE);
|
||||
pa_sink_set_mute(sink, mute, true);
|
||||
} else if (source) {
|
||||
pa_log_debug("Client %s changes mute of source %s.", client_name, source->name);
|
||||
pa_source_set_mute(source, mute, TRUE);
|
||||
pa_source_set_mute(source, mute, true);
|
||||
} else if (si) {
|
||||
pa_log_debug("Client %s changes mute of sink input %s.",
|
||||
client_name,
|
||||
pa_strnull(pa_proplist_gets(si->proplist, PA_PROP_MEDIA_NAME)));
|
||||
pa_sink_input_set_mute(si, mute, TRUE);
|
||||
pa_sink_input_set_mute(si, mute, true);
|
||||
} else if (so) {
|
||||
pa_log_debug("Client %s changes mute of source output %s.",
|
||||
client_name,
|
||||
pa_strnull(pa_proplist_gets(so->proplist, PA_PROP_MEDIA_NAME)));
|
||||
pa_source_output_set_mute(so, mute, TRUE);
|
||||
pa_source_output_set_mute(so, mute, true);
|
||||
}
|
||||
|
||||
pa_pstream_send_simple_ack(c->pstream, tag);
|
||||
|
|
@ -3888,7 +3888,7 @@ static void command_set_mute(
|
|||
static void command_cork_playback_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
|
||||
uint32_t idx;
|
||||
pa_bool_t b;
|
||||
bool b;
|
||||
playback_stream *s;
|
||||
|
||||
pa_native_connection_assert_ref(c);
|
||||
|
|
@ -3910,7 +3910,7 @@ static void command_cork_playback_stream(pa_pdispatch *pd, uint32_t command, uin
|
|||
pa_sink_input_cork(s->sink_input, b);
|
||||
|
||||
if (b)
|
||||
s->is_underrun = TRUE;
|
||||
s->is_underrun = true;
|
||||
|
||||
pa_pstream_send_simple_ack(c->pstream, tag);
|
||||
}
|
||||
|
|
@ -3959,7 +3959,7 @@ static void command_cork_record_stream(pa_pdispatch *pd, uint32_t command, uint3
|
|||
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
|
||||
uint32_t idx;
|
||||
record_stream *s;
|
||||
pa_bool_t b;
|
||||
bool b;
|
||||
|
||||
pa_native_connection_assert_ref(c);
|
||||
pa_assert(t);
|
||||
|
|
@ -4022,7 +4022,7 @@ static void command_set_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, u
|
|||
|
||||
if (command == PA_COMMAND_SET_PLAYBACK_STREAM_BUFFER_ATTR) {
|
||||
playback_stream *s;
|
||||
pa_bool_t adjust_latency = FALSE, early_requests = FALSE;
|
||||
bool adjust_latency = false, early_requests = false;
|
||||
|
||||
s = pa_idxset_get_by_index(c->output_streams, idx);
|
||||
CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY);
|
||||
|
|
@ -4060,7 +4060,7 @@ static void command_set_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, u
|
|||
|
||||
} else {
|
||||
record_stream *s;
|
||||
pa_bool_t adjust_latency = FALSE, early_requests = FALSE;
|
||||
bool adjust_latency = false, early_requests = false;
|
||||
pa_assert(command == PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR);
|
||||
|
||||
s = pa_idxset_get_by_index(c->record_streams, idx);
|
||||
|
|
@ -4175,7 +4175,7 @@ static void command_update_proplist(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
|
||||
if (!(mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE)) {
|
||||
pa_proplist_free(p);
|
||||
CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_INVALID);
|
||||
CHECK_VALIDITY(c->pstream, false, tag, PA_ERR_INVALID);
|
||||
}
|
||||
|
||||
if (command == PA_COMMAND_UPDATE_PLAYBACK_STREAM_PROPLIST) {
|
||||
|
|
@ -4184,7 +4184,7 @@ static void command_update_proplist(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
s = pa_idxset_get_by_index(c->output_streams, idx);
|
||||
if (!s || !playback_stream_isinstance(s)) {
|
||||
pa_proplist_free(p);
|
||||
CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_NOENTITY);
|
||||
CHECK_VALIDITY(c->pstream, false, tag, PA_ERR_NOENTITY);
|
||||
}
|
||||
pa_sink_input_update_proplist(s->sink_input, mode, p);
|
||||
|
||||
|
|
@ -4193,7 +4193,7 @@ static void command_update_proplist(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
|
||||
if (!(s = pa_idxset_get_by_index(c->record_streams, idx))) {
|
||||
pa_proplist_free(p);
|
||||
CHECK_VALIDITY(c->pstream, FALSE, tag, PA_ERR_NOENTITY);
|
||||
CHECK_VALIDITY(c->pstream, false, tag, PA_ERR_NOENTITY);
|
||||
}
|
||||
pa_source_output_update_proplist(s->source_output, mode, p);
|
||||
|
||||
|
|
@ -4476,7 +4476,7 @@ static void command_unload_module(pa_pdispatch *pd, uint32_t command, uint32_t t
|
|||
m = pa_idxset_get_by_index(c->protocol->core->modules, idx);
|
||||
CHECK_VALIDITY(c->pstream, m, tag, PA_ERR_NOENTITY);
|
||||
|
||||
pa_module_unload_request(m, FALSE);
|
||||
pa_module_unload_request(m, false);
|
||||
pa_pstream_send_simple_ack(c->pstream, tag);
|
||||
}
|
||||
|
||||
|
|
@ -4517,7 +4517,7 @@ static void command_move_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag
|
|||
|
||||
CHECK_VALIDITY(c->pstream, si && sink, tag, PA_ERR_NOENTITY);
|
||||
|
||||
if (pa_sink_input_move_to(si, sink, TRUE) < 0) {
|
||||
if (pa_sink_input_move_to(si, sink, true) < 0) {
|
||||
pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4536,7 +4536,7 @@ static void command_move_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag
|
|||
|
||||
CHECK_VALIDITY(c->pstream, so && source, tag, PA_ERR_NOENTITY);
|
||||
|
||||
if (pa_source_output_move_to(so, source, TRUE) < 0) {
|
||||
if (pa_source_output_move_to(so, source, true) < 0) {
|
||||
pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4549,7 +4549,7 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
|
|||
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
|
||||
uint32_t idx = PA_INVALID_INDEX;
|
||||
const char *name = NULL;
|
||||
pa_bool_t b;
|
||||
bool b;
|
||||
|
||||
pa_native_connection_assert_ref(c);
|
||||
pa_assert(t);
|
||||
|
|
@ -4702,7 +4702,7 @@ static void command_set_card_profile(pa_pdispatch *pd, uint32_t command, uint32_
|
|||
|
||||
CHECK_VALIDITY(c->pstream, card, tag, PA_ERR_NOENTITY);
|
||||
|
||||
if ((ret = pa_card_set_profile(card, profile, TRUE)) < 0) {
|
||||
if ((ret = pa_card_set_profile(card, profile, true)) < 0) {
|
||||
pa_pstream_send_error(c->pstream, tag, -ret);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4742,7 +4742,7 @@ static void command_set_sink_or_source_port(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
|
||||
|
||||
if ((ret = pa_sink_set_port(sink, port, TRUE)) < 0) {
|
||||
if ((ret = pa_sink_set_port(sink, port, true)) < 0) {
|
||||
pa_pstream_send_error(c->pstream, tag, -ret);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4758,7 +4758,7 @@ static void command_set_sink_or_source_port(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
CHECK_VALIDITY(c->pstream, source, tag, PA_ERR_NOENTITY);
|
||||
|
||||
if ((ret = pa_source_set_port(source, port, TRUE)) < 0) {
|
||||
if ((ret = pa_source_set_port(source, port, true)) < 0) {
|
||||
pa_pstream_send_error(c->pstream, tag, -ret);
|
||||
return;
|
||||
}
|
||||
|
|
@ -5009,11 +5009,11 @@ void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_nati
|
|||
c->parent.process_msg = native_connection_process_msg;
|
||||
c->protocol = p;
|
||||
c->options = pa_native_options_ref(o);
|
||||
c->authorized = FALSE;
|
||||
c->authorized = false;
|
||||
|
||||
if (o->auth_anonymous) {
|
||||
pa_log_info("Client authenticated anonymously.");
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
}
|
||||
|
||||
if (!c->authorized &&
|
||||
|
|
@ -5021,7 +5021,7 @@ void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_nati
|
|||
pa_ip_acl_check(o->auth_ip_acl, pa_iochannel_get_recv_fd(io)) > 0) {
|
||||
|
||||
pa_log_info("Client authenticated by IP ACL.");
|
||||
c->authorized = TRUE;
|
||||
c->authorized = true;
|
||||
}
|
||||
|
||||
if (!c->authorized)
|
||||
|
|
@ -5045,7 +5045,7 @@ void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_nati
|
|||
pa_pstream_set_revoke_callback(c->pstream, pstream_revoke_callback, c);
|
||||
pa_pstream_set_release_callback(c->pstream, pstream_release_callback, c);
|
||||
|
||||
c->pdispatch = pa_pdispatch_new(p->core->mainloop, TRUE, command_table, PA_COMMAND_MAX);
|
||||
c->pdispatch = pa_pdispatch_new(p->core->mainloop, true, command_table, PA_COMMAND_MAX);
|
||||
|
||||
c->record_streams = pa_idxset_new(NULL, NULL);
|
||||
c->output_streams = pa_idxset_new(NULL, NULL);
|
||||
|
|
@ -5233,7 +5233,7 @@ void pa_native_options_unref(pa_native_options *o) {
|
|||
}
|
||||
|
||||
int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma) {
|
||||
pa_bool_t enabled;
|
||||
bool enabled;
|
||||
const char *acl;
|
||||
|
||||
pa_assert(o);
|
||||
|
|
@ -5245,7 +5245,7 @@ int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
enabled = TRUE;
|
||||
enabled = true;
|
||||
if (pa_modargs_get_value_boolean(ma, "auth-group-enable", &enabled) < 0) {
|
||||
pa_log("auth-group-enable= expects a boolean argument.");
|
||||
return -1;
|
||||
|
|
@ -5273,7 +5273,7 @@ int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma) {
|
|||
o->auth_ip_acl = ipa;
|
||||
}
|
||||
|
||||
enabled = TRUE;
|
||||
enabled = true;
|
||||
if (pa_modargs_get_value_boolean(ma, "auth-cookie-enabled", &enabled) < 0) {
|
||||
pa_log("auth-cookie-enabled= expects a boolean argument.");
|
||||
return -1;
|
||||
|
|
@ -5292,14 +5292,14 @@ int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma) {
|
|||
cn = pa_modargs_get_value(ma, "cookie", NULL);
|
||||
|
||||
if (cn)
|
||||
o->auth_cookie = pa_auth_cookie_get(c, cn, TRUE, PA_NATIVE_COOKIE_LENGTH);
|
||||
o->auth_cookie = pa_auth_cookie_get(c, cn, true, PA_NATIVE_COOKIE_LENGTH);
|
||||
else {
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE, FALSE, PA_NATIVE_COOKIE_LENGTH);
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE, false, PA_NATIVE_COOKIE_LENGTH);
|
||||
if (!o->auth_cookie) {
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE_FALLBACK, FALSE, PA_NATIVE_COOKIE_LENGTH);
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE_FALLBACK, false, PA_NATIVE_COOKIE_LENGTH);
|
||||
|
||||
if (!o->auth_cookie)
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE, TRUE, PA_NATIVE_COOKIE_LENGTH);
|
||||
o->auth_cookie = pa_auth_cookie_get(c, PA_NATIVE_COOKIE_FILE, true, PA_NATIVE_COOKIE_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ typedef struct pa_native_options {
|
|||
|
||||
pa_module *module;
|
||||
|
||||
pa_bool_t auth_anonymous;
|
||||
bool auth_anonymous;
|
||||
char *auth_group;
|
||||
pa_ip_acl *auth_ip_acl;
|
||||
pa_auth_cookie *auth_cookie;
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ typedef struct connection {
|
|||
pa_client *client;
|
||||
pa_memblockq *input_memblockq, *output_memblockq;
|
||||
|
||||
pa_bool_t dead;
|
||||
bool dead;
|
||||
|
||||
struct {
|
||||
pa_memblock *current_memblock;
|
||||
size_t memblock_index;
|
||||
pa_atomic_t missing;
|
||||
pa_bool_t underrun;
|
||||
bool underrun;
|
||||
} playback;
|
||||
} connection;
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ fail:
|
|||
if (c->sink_input) {
|
||||
|
||||
/* If there is a sink input, we first drain what we already have read before shutting down the connection */
|
||||
c->dead = TRUE;
|
||||
c->dead = true;
|
||||
|
||||
pa_iochannel_free(c->io);
|
||||
c->io = NULL;
|
||||
|
|
@ -323,7 +323,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
|
|||
|
||||
if (pa_memblockq_is_readable(c->input_memblockq) && c->playback.underrun) {
|
||||
pa_log_debug("Requesting rewind due to end of underrun.");
|
||||
pa_sink_input_request_rewind(c->sink_input, 0, FALSE, TRUE, FALSE);
|
||||
pa_sink_input_request_rewind(c->sink_input, 0, false, true, false);
|
||||
}
|
||||
|
||||
/* pa_log("got data, %u", pa_memblockq_get_length(c->input_memblockq)); */
|
||||
|
|
@ -360,7 +360,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
|
|||
|
||||
if (pa_memblockq_peek(c->input_memblockq, chunk) < 0) {
|
||||
|
||||
c->playback.underrun = TRUE;
|
||||
c->playback.underrun = true;
|
||||
|
||||
if (c->dead && pa_sink_input_safe_to_remove(i))
|
||||
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(c), CONNECTION_MESSAGE_UNLINK_CONNECTION, NULL, 0, NULL, NULL);
|
||||
|
|
@ -371,7 +371,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
|
|||
|
||||
chunk->length = PA_MIN(length, chunk->length);
|
||||
|
||||
c->playback.underrun = FALSE;
|
||||
c->playback.underrun = false;
|
||||
|
||||
pa_memblockq_drop(c->input_memblockq, chunk->length);
|
||||
m = pa_memblockq_pop_missing(c->input_memblockq);
|
||||
|
|
@ -502,8 +502,8 @@ void pa_simple_protocol_connect(pa_simple_protocol *p, pa_iochannel *io, pa_simp
|
|||
c->options = pa_simple_options_ref(o);
|
||||
c->playback.current_memblock = NULL;
|
||||
c->playback.memblock_index = 0;
|
||||
c->dead = FALSE;
|
||||
c->playback.underrun = TRUE;
|
||||
c->dead = false;
|
||||
c->playback.underrun = true;
|
||||
pa_atomic_store(&c->playback.missing, 0);
|
||||
|
||||
pa_client_new_data_init(&client_data);
|
||||
|
|
@ -536,7 +536,7 @@ void pa_simple_protocol_connect(pa_simple_protocol *p, pa_iochannel *io, pa_simp
|
|||
data.driver = __FILE__;
|
||||
data.module = o->module;
|
||||
data.client = c->client;
|
||||
pa_sink_input_new_data_set_sink(&data, sink, FALSE);
|
||||
pa_sink_input_new_data_set_sink(&data, sink, false);
|
||||
pa_proplist_update(data.proplist, PA_UPDATE_MERGE, c->client->proplist);
|
||||
pa_sink_input_new_data_set_sample_spec(&data, &o->sample_spec);
|
||||
|
||||
|
|
@ -592,7 +592,7 @@ void pa_simple_protocol_connect(pa_simple_protocol *p, pa_iochannel *io, pa_simp
|
|||
data.driver = __FILE__;
|
||||
data.module = o->module;
|
||||
data.client = c->client;
|
||||
pa_source_output_new_data_set_source(&data, source, FALSE);
|
||||
pa_source_output_new_data_set_source(&data, source, false);
|
||||
pa_proplist_update(data.proplist, PA_UPDATE_MERGE, c->client->proplist);
|
||||
pa_source_output_new_data_set_sample_spec(&data, &o->sample_spec);
|
||||
|
||||
|
|
@ -703,8 +703,8 @@ pa_simple_options* pa_simple_options_new(void) {
|
|||
o = pa_xnew0(pa_simple_options, 1);
|
||||
PA_REFCNT_INIT(o);
|
||||
|
||||
o->record = FALSE;
|
||||
o->playback = TRUE;
|
||||
o->record = false;
|
||||
o->playback = true;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
@ -732,7 +732,7 @@ void pa_simple_options_unref(pa_simple_options *o) {
|
|||
}
|
||||
|
||||
int pa_simple_options_parse(pa_simple_options *o, pa_core *c, pa_modargs *ma) {
|
||||
pa_bool_t enabled;
|
||||
bool enabled;
|
||||
|
||||
pa_assert(o);
|
||||
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue