introduce pa_xmalloc() and friends

implement module auto loading


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@103 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-08-04 16:39:30 +00:00
parent 24291aff27
commit 46091a9237
61 changed files with 700 additions and 631 deletions

View file

@ -36,6 +36,7 @@
#include "socket-client.h"
#include "socket-util.h"
#include "util.h"
#include "xmalloc.h"
struct pa_socket_client {
struct pa_mainloop_api *mainloop;
@ -50,8 +51,7 @@ static struct pa_socket_client*pa_socket_client_new(struct pa_mainloop_api *m) {
struct pa_socket_client *c;
assert(m);
c = malloc(sizeof(struct pa_socket_client));
assert(c);
c = pa_xmalloc(sizeof(struct pa_socket_client));
c->mainloop = m;
c->fd = -1;
c->io_source = c->fixed_source = NULL;
@ -226,7 +226,7 @@ void pa_socket_client_free(struct pa_socket_client *c) {
c->mainloop->cancel_fixed(c->mainloop, c->fixed_source);
if (c->fd >= 0)
close(c->fd);
free(c);
pa_xfree(c);
}
void pa_socket_client_set_callback(struct pa_socket_client *c, void (*on_connection)(struct pa_socket_client *c, struct pa_iochannel*io, void *userdata), void *userdata) {