diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-06-08 23:54:24 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-06-08 23:54:24 +0000 |
commit | 9cb0b933e260008c6a03e24a4a149f726b8d86b2 (patch) | |
tree | b54651bafe32d1a817e779f884d1628176465bf0 /src/protocol-native-unix.c | |
parent | b1c00dcd0ae51d201f772e7f5fa61acae436a2cf (diff) |
initial commit
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@3 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/protocol-native-unix.c')
-rw-r--r-- | src/protocol-native-unix.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/protocol-native-unix.c b/src/protocol-native-unix.c new file mode 100644 index 00000000..a18965cd --- /dev/null +++ b/src/protocol-native-unix.c @@ -0,0 +1,27 @@ +#include "module.h" + +int module_init(struct core *c, struct module*m) { + struct fn[PATH_MAX]; + struct socket_server *s; + char *t; + assert(c && m); + + if (!(t = getenv("TMP"))) + if (!(t = getenv("TEMP"))) + t = "/tmp"; + + snprintf(fn, sizeof(fn), "%s/foosock", t); + + if (!(s = socket_server_new_unix(c->mainloop, fn))) + return -1; + + m->userdata = protocol_native_new(s); + assert(m->userdata); + return 0; +} + +void module_done(struct core *c, struct module*m) { + assert(c && m); + + protocol_native_free(m->userdata); +} |