From 6eddcc2f856e2b8910046702e0a096e75942c2d6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 19 Jun 2004 18:51:46 +0000 Subject: rename module-simple-protocol to module-protocol-stub git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@27 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/module-protocol-stub.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ src/module-simple-protocol.c | 46 -------------------------------------------- 2 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 src/module-protocol-stub.c delete mode 100644 src/module-simple-protocol.c (limited to 'src') diff --git a/src/module-protocol-stub.c b/src/module-protocol-stub.c new file mode 100644 index 00000000..905594c6 --- /dev/null +++ b/src/module-protocol-stub.c @@ -0,0 +1,46 @@ +#include +#include + +#include "module.h" +#include "socket-server.h" + +#ifdef USE_PROTOCOL_SIMPLE + #include "protocol-simple.h" + #define protocol_free protcol_simple_free +#else + #ifdef USE_PROTOCOL_CLI + #include "protocol-cli.h" + #define protocol_new protocol_cli_new + #define protocol_free protocol_cli_free + #else + #error "Broken build system" + #endif +#endif + +int module_init(struct core *c, struct module*m) { + struct socket_server *s; + assert(c && m); + +#ifdef USE_TCP_SOCKETS + if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, 4712))) + return -1; +#else + if (!(s = socket_server_new_unix(c->mainloop, "/tmp/polypsimple"))) + return -1; +#endif + +#ifdef USE_PROTOCOL_SIMPLE + m->userdata = protocol_simple_new(c, s, PROTOCOL_SIMPLE_PLAYBACK); +#else + m->userdata = protocol_new(c, s); +#endif + + assert(m->userdata); + return 0; +} + +void module_done(struct core *c, struct module*m) { + assert(c && m); + + protocol_simple_free(m->userdata); +} diff --git a/src/module-simple-protocol.c b/src/module-simple-protocol.c deleted file mode 100644 index 905594c6..00000000 --- a/src/module-simple-protocol.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include - -#include "module.h" -#include "socket-server.h" - -#ifdef USE_PROTOCOL_SIMPLE - #include "protocol-simple.h" - #define protocol_free protcol_simple_free -#else - #ifdef USE_PROTOCOL_CLI - #include "protocol-cli.h" - #define protocol_new protocol_cli_new - #define protocol_free protocol_cli_free - #else - #error "Broken build system" - #endif -#endif - -int module_init(struct core *c, struct module*m) { - struct socket_server *s; - assert(c && m); - -#ifdef USE_TCP_SOCKETS - if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, 4712))) - return -1; -#else - if (!(s = socket_server_new_unix(c->mainloop, "/tmp/polypsimple"))) - return -1; -#endif - -#ifdef USE_PROTOCOL_SIMPLE - m->userdata = protocol_simple_new(c, s, PROTOCOL_SIMPLE_PLAYBACK); -#else - m->userdata = protocol_new(c, s); -#endif - - assert(m->userdata); - return 0; -} - -void module_done(struct core *c, struct module*m) { - assert(c && m); - - protocol_simple_free(m->userdata); -} -- cgit