]>
code.delx.au - pulseaudio/blob - src/module-protocol-stub.c
5 #include "socket-server.h"
7 #ifdef USE_PROTOCOL_SIMPLE
8 #include "protocol-simple.h"
9 #define protocol_free protcol_simple_free
11 #ifdef USE_PROTOCOL_CLI
12 #include "protocol-cli.h"
13 #define protocol_new protocol_cli_new
14 #define protocol_free protocol_cli_free
16 #error "Broken build system"
20 int module_init(struct core
*c
, struct module
*m
) {
21 struct socket_server
*s
;
24 #ifdef USE_TCP_SOCKETS
25 if (!(s
= socket_server_new_ipv4(c
->mainloop
, INADDR_LOOPBACK
, 4712)))
28 if (!(s
= socket_server_new_unix(c
->mainloop
, "/tmp/polypsimple")))
32 #ifdef USE_PROTOCOL_SIMPLE
33 m
->userdata
= protocol_simple_new(c
, s
, PROTOCOL_SIMPLE_PLAYBACK
);
35 m
->userdata
= protocol_new(c
, s
);
42 void module_done(struct core
*c
, struct module
*m
) {
45 protocol_simple_free(m
->userdata
);