From ba6ef67ce6217a0bf4675d31cff829001f69746b Mon Sep 17 00:00:00 2001 From: phintuka Date: Tue, 4 Nov 2008 12:08:59 +0000 Subject: Build single vdrdiscovery.o for both client and server --- Makefile | 8 +++----- tools/vdrdiscovery.c | 18 +++++------------- tools/vdrdiscovery.h | 7 +++---- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 4075ffaa..d9af1f33 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'xineliboutput.c' for copyright information and # how to reach the author. # -# $Id: Makefile,v 1.50 2008-11-01 12:30:47 phintuka Exp $ +# $Id: Makefile,v 1.51 2008-11-04 12:08:59 phintuka Exp $ # # The official name of this plugin. @@ -241,7 +241,7 @@ endif ifeq ($(XINELIBOUTPUT_X11), yes) OBJS_SXFE_SO = xine_sxfe_frontend.o xine/post.o - OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o tools/vdrdiscovery_standalone.o + OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o tools/vdrdiscovery.o else OBJS_SXFE_SO = OBJS_SXFE = @@ -249,7 +249,7 @@ endif ifeq ($(XINELIBOUTPUT_FB), yes) OBJS_FBFE_SO = xine_fbfe_frontend.o xine/post.o - OBJS_FBFE = xine_fbfe_frontend_standalone.o xine/post.o tools/vdrdiscovery_standalone.o + OBJS_FBFE = xine_fbfe_frontend_standalone.o xine/post.o tools/vdrdiscovery.o else OBJS_FBFE_SO = OBJS_FBFE = @@ -300,8 +300,6 @@ xine/post.o: xine/post.c xine/post.h $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine/post.c -o $@ tools/vdrdiscovery.o: tools/vdrdiscovery.c tools/vdrdiscovery.h $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) tools/vdrdiscovery.c -o $@ -tools/vdrdiscovery_standalone.o: tools/vdrdiscovery.c tools/vdrdiscovery.h - $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) tools/vdrdiscovery.c -o $@ xine_post_autocrop.o: xine_post_autocrop.c $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_post_autocrop.c xine_post_swscale.o: xine_post_swscale.c 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 }; -- cgit v1.2.3