]>
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 protocol_simple_free
10 #define IPV4_PORT 4712
12 #ifdef USE_PROTOCOL_CLI
13 #include "protocol-cli.h"
14 #define protocol_new protocol_cli_new
15 #define protocol_free protocol_cli_free
16 #define IPV4_PORT 4711
18 #error "Broken build system"
22 int module_init(struct core
*c
, struct module
*m
) {
23 struct socket_server
*s
;
26 #ifdef USE_TCP_SOCKETS
27 if (!(s
= socket_server_new_ipv4(c
->mainloop
, INADDR_LOOPBACK
, IPV4_PORT
)))
30 if (!(s
= socket_server_new_unix(c
->mainloop
, "/tmp/polypsimple")))
34 #ifdef USE_PROTOCOL_SIMPLE
35 m
->userdata
= protocol_simple_new(c
, s
, PROTOCOL_SIMPLE_PLAYBACK
);
37 m
->userdata
= protocol_new(c
, s
);
44 void module_done(struct core
*c
, struct module
*m
) {
47 protocol_free(m
->userdata
);