diff options
| author | phintuka <phintuka> | 2008-11-04 12:08:59 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2008-11-04 12:08:59 +0000 |
| commit | ba6ef67ce6217a0bf4675d31cff829001f69746b (patch) | |
| tree | 9bb1e51445481f8f70b78c9c8de712abf8d49582 /tools | |
| parent | 3d2265eec5b555a5a40c181a0a37c71c13a82d4b (diff) | |
| download | xineliboutput-ba6ef67ce6217a0bf4675d31cff829001f69746b.tar.gz xineliboutput-ba6ef67ce6217a0bf4675d31cff829001f69746b.tar.bz2 | |
Build single vdrdiscovery.o for both client and server
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/vdrdiscovery.c | 18 | ||||
| -rw-r--r-- | tools/vdrdiscovery.h | 7 |
2 files changed, 8 insertions, 17 deletions
diff --git a/tools/vdrdiscovery.c b/tools/vdrdiscovery.c index 82a9a109..370062a2 100644 --- a/tools/vdrdiscovery.c +++ b/tools/vdrdiscovery.c @@ -7,7 +7,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vdrdiscovery.c,v 1.5 2008-04-03 13:59:37 phintuka Exp $ + * $Id: vdrdiscovery.c,v 1.6 2008-11-04 12:08:59 phintuka Exp $ * */ @@ -79,12 +79,10 @@ static inline int discovery_init(int port) return -1; } -#ifndef FE_STANDALONE int udp_discovery_init(void) { return discovery_init(DISCOVERY_PORT); } -#endif static inline int udp_discovery_send(int fd_discovery, int port, char *msg) { @@ -105,7 +103,6 @@ static inline int udp_discovery_send(int fd_discovery, int port, char *msg) return 0; } -#ifndef FE_STANDALONE int udp_discovery_broadcast(int fd_discovery, int server_port, const char *server_address) { char *msg = NULL; @@ -132,7 +129,7 @@ int udp_discovery_broadcast(int fd_discovery, int server_port, const char *serve free(msg); return result; } -#else + static inline int udp_discovery_search(int fd_discovery, int port) { char *msg = NULL; @@ -150,11 +147,7 @@ static inline int udp_discovery_search(int fd_discovery, int port) free(msg); return result; } -#endif -#ifdef FE_STANDALONE -static -#endif int udp_discovery_recv(int fd_discovery, char *buf, int timeout, struct sockaddr_in *source) { @@ -185,10 +178,9 @@ int udp_discovery_recv(int fd_discovery, char *buf, int timeout, return err; } -#ifndef FE_STANDALONE int udp_discovery_is_valid_search(const char *buf) { - const char *id_string = DISCOVERY_1_0_HDR "Client:"; + static const char id_string[] = { DISCOVERY_1_0_HDR "Client:" }; if(!strncmp(id_string, buf, strlen(id_string))) { LOGMSG("Received valid discovery message %s", buf); @@ -198,7 +190,7 @@ int udp_discovery_is_valid_search(const char *buf) LOGDBG("BROADCAST: %s", buf); return 0; } -#else + int udp_discovery_find_server(int *port, char *address) { static const char mystring[] = DISCOVERY_1_0_HDR "Server port: "; @@ -276,5 +268,5 @@ int udp_discovery_find_server(int *port, char *address) close(fd_discovery); return 0; } -#endif + diff --git a/tools/vdrdiscovery.h b/tools/vdrdiscovery.h index 7c4d18ae..3db1bd1c 100644 --- a/tools/vdrdiscovery.h +++ b/tools/vdrdiscovery.h @@ -7,7 +7,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vdrdiscovery.h,v 1.3 2007-06-11 19:39:06 phintuka Exp $ + * $Id: vdrdiscovery.h,v 1.4 2008-11-04 12:08:59 phintuka Exp $ * */ @@ -20,15 +20,14 @@ extern "C" { #endif -#ifdef FE_STANDALONE +struct sockaddr_in; + int udp_discovery_find_server(int *port, char *address); -#else int udp_discovery_init(void); int udp_discovery_broadcast(int fd_discovery, int server_port, const char *server_address); int udp_discovery_recv(int fd_discovery, char *buf, int timeout, struct sockaddr_in *source); int udp_discovery_is_valid_search(const char *buf); -#endif #ifdef __cplusplus }; |
