diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/raop_play/Makefile | 4 | ||||
-rw-r--r-- | audio/raop_play/files/getline.c | 174 | ||||
-rw-r--r-- | audio/raop_play/files/getline.h | 24 | ||||
-rw-r--r-- | audio/raop_play/files/patch-aexcl_Makefile.in | 6 | ||||
-rw-r--r-- | audio/raop_play/files/patch-aexcl_aexcl__play.cxx | 12 | ||||
-rw-r--r-- | audio/raop_play/files/patch-raop__play_Makefile.in | 7 | ||||
-rw-r--r-- | audio/raop_play/files/patch-rendezvous_Client.c | 4 | ||||
-rw-r--r-- | audio/raop_play/files/patch-rendezvous_Makefile.in | 8 |
8 files changed, 10 insertions, 229 deletions
diff --git a/audio/raop_play/Makefile b/audio/raop_play/Makefile index b8057963706a..18be65d28f9e 100644 --- a/audio/raop_play/Makefile +++ b/audio/raop_play/Makefile @@ -22,6 +22,7 @@ RUN_DEPENDS= mpg321:audio/mpg321 \ flac:audio/flac GNU_CONFIGURE= yes +CFLAGS+= -D_WITH_GETLINE LDFLAGS+= `fltk-config --ldflags` USES= gmake USE_GNOME= glib20 @@ -30,7 +31,4 @@ post-patch: @${REINPLACE_CMD} 's/-lssl/-lcrypto/' \ ${WRKSRC}/configure ${WRKSRC}/raop_play/Makefile.in -pre-build: - ${CP} ${FILESDIR}/getline.c ${FILESDIR}/getline.h ${WRKSRC}/rendezvous/ - .include <bsd.port.mk> diff --git a/audio/raop_play/files/getline.c b/audio/raop_play/files/getline.c deleted file mode 100644 index 2c5e20e4f2aa..000000000000 --- a/audio/raop_play/files/getline.c +++ /dev/null @@ -1,174 +0,0 @@ -/* getline.c -- Replacement for GNU C library function getline - -Copyright (C) 1993 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. */ - -/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <sys/types.h> -#include <stdio.h> -#include <assert.h> -#include <errno.h> -#include "getline.h" - -#if STDC_HEADERS -#include <stdlib.h> -#else -char *malloc (), *realloc (); -#endif - -/* Always add at least this many bytes when extending the buffer. */ -#define MIN_CHUNK 64 - -/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR - + OFFSET (and null-terminate it). If LIMIT is non-negative, then - read no more than LIMIT chars. - - *LINEPTR is a pointer returned from malloc (or NULL), pointing to - *N characters of space. It is realloc'd as necessary. - - Return the number of characters read (not including the null - terminator), or -1 on error or EOF. On a -1 return, the caller - should check feof(), if not then errno has been set to indicate the - error. */ - -int -getstr (lineptr, n, stream, terminator, offset, limit) - char **lineptr; - size_t *n; - FILE *stream; - int terminator; - int offset; - int limit; -{ - int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ - char *read_pos; /* Where we're reading into *LINEPTR. */ - int ret; - - if (!lineptr || !n || !stream) - { - errno = EINVAL; - return -1; - } - - if (!*lineptr) - { - *n = MIN_CHUNK; - *lineptr = malloc (*n); - if (!*lineptr) - { - errno = ENOMEM; - return -1; - } - *lineptr[0] = '\0'; - } - - nchars_avail = *n - offset; - read_pos = *lineptr + offset; - - for (;;) - { - int save_errno; - register int c; - - if (limit == 0) - break; - else - { - c = getc (stream); - - /* If limit is negative, then we shouldn't pay attention to - it, so decrement only if positive. */ - if (limit > 0) - limit--; - } - - save_errno = errno; - - /* We always want at least one char left in the buffer, since we - always (unless we get an error while reading the first char) - NUL-terminate the line buffer. */ - - assert((*lineptr + *n) == (read_pos + nchars_avail)); - if (nchars_avail < 2) - { - if (*n > MIN_CHUNK) - *n *= 2; - else - *n += MIN_CHUNK; - - nchars_avail = *n + *lineptr - read_pos; - *lineptr = realloc (*lineptr, *n); - if (!*lineptr) - { - errno = ENOMEM; - return -1; - } - read_pos = *n - nchars_avail + *lineptr; - assert((*lineptr + *n) == (read_pos + nchars_avail)); - } - - if (ferror (stream)) - { - /* Might like to return partial line, but there is no - place for us to store errno. And we don't want to just - lose errno. */ - errno = save_errno; - return -1; - } - - if (c == EOF) - { - /* Return partial line, if any. */ - if (read_pos == *lineptr) - return -1; - else - break; - } - - *read_pos++ = c; - nchars_avail--; - - if (c == terminator) - /* Return the line. */ - break; - } - - /* Done - NUL terminate and return the number of chars read. */ - *read_pos = '\0'; - - ret = read_pos - (*lineptr + offset); - return ret; -} - -int -get_line (lineptr, n, stream) - char **lineptr; - size_t *n; - FILE *stream; -{ - return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT); -} - -int -getline_safe (lineptr, n, stream, limit) - char **lineptr; - size_t *n; - FILE *stream; - int limit; -{ - return getstr (lineptr, n, stream, '\n', 0, limit); -} diff --git a/audio/raop_play/files/getline.h b/audio/raop_play/files/getline.h deleted file mode 100644 index 3b5ccc2135e8..000000000000 --- a/audio/raop_play/files/getline.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _getline_h_ -#define _getline_h_ 1 - -#include <stdio.h> - -#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -#define __PROTO(args) args -#else -#define __PROTO(args) () -#endif /* GCC. */ - -#define GETLINE_NO_LIMIT -1 - -#ifndef _WITH_GETLINE -int - get_line __PROTO ((char **_lineptr, size_t *_n, FILE *_stream)); -int - getline_safe __PROTO ((char **_lineptr, size_t *_n, FILE *_stream, - int limit)); -int - getstr __PROTO ((char **_lineptr, size_t *_n, FILE *_stream, - int _terminator, int _offset, int limit)); -#endif -#endif /* _getline_h_ */ diff --git a/audio/raop_play/files/patch-aexcl_Makefile.in b/audio/raop_play/files/patch-aexcl_Makefile.in index 18926dc10ec0..7da51fdca7cb 100644 --- a/audio/raop_play/files/patch-aexcl_Makefile.in +++ b/audio/raop_play/files/patch-aexcl_Makefile.in @@ -25,13 +25,11 @@ ifdef GLIB_SUBST GLIB_SUBST_OBJ = ipod/glibsubst.o -@@ -29,8 +29,8 @@ endif - +@@ -30,7 +30,7 @@ endif all: $(TARGET) --$(TARGET): aexcl_gui.o aexcl_play.o ipod_browser.o ../raop_play/aexcl_lib.o ipod/itunesdb.o $(GLIB_SUBST_OBJ) + $(TARGET): aexcl_gui.o aexcl_play.o ipod_browser.o ../raop_play/aexcl_lib.o ipod/itunesdb.o $(GLIB_SUBST_OBJ) - $(CXX) -o $@ $^ -lfltk $(GLIB_LINK) -+$(TARGET): aexcl_gui.o aexcl_play.o ipod_browser.o ../raop_play/aexcl_lib.o ipod/itunesdb.o ../rendezvous/getline.o $(GLIB_SUBST_OBJ) + $(CXX) $(LDFLAGS) -o $@ $^ -lfltk $(GLIB_LINK) install: diff --git a/audio/raop_play/files/patch-aexcl_aexcl__play.cxx b/audio/raop_play/files/patch-aexcl_aexcl__play.cxx deleted file mode 100644 index 5c363dd0e4b5..000000000000 --- a/audio/raop_play/files/patch-aexcl_aexcl__play.cxx +++ /dev/null @@ -1,12 +0,0 @@ ---- aexcl/aexcl_play.cxx.orig 2005-12-16 14:17:00 UTC -+++ aexcl/aexcl_play.cxx -@@ -23,6 +23,9 @@ - #include <signal.h> - #include <sys/wait.h> - #include <getopt.h> -+extern "C" { -+#include "getline.h" -+}; - #include "aexcl_gui.h" - #include "aexcl_lib.h" - #include "mDNS.h" diff --git a/audio/raop_play/files/patch-raop__play_Makefile.in b/audio/raop_play/files/patch-raop__play_Makefile.in index 088f2d93a8ca..1a1e4f43b8eb 100644 --- a/audio/raop_play/files/patch-raop__play_Makefile.in +++ b/audio/raop_play/files/patch-raop__play_Makefile.in @@ -8,7 +8,7 @@ LIBS = @LIBS@ prefix = @prefix@ exec_prefix = @exec_prefix@ -@@ -12,15 +13,15 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/m +@@ -12,7 +13,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/m TARGET=raop_play DESTDIR = @@ -16,9 +16,8 @@ +CFLAGS=-Wall -I$(prefix)/include/ OBJS := raop_play.o raop_client.o rtsp_client.o aexcl_lib.o base64.o aes.o m4a_stream.o \ audio_stream.o wav_stream.o mp3_stream.o flac_stream.o ogg_stream.o aac_stream.o pls_stream.o \ --pcm_stream.o flac_stream.o -+pcm_stream.o flac_stream.o ../rendezvous/getline.o - + pcm_stream.o flac_stream.o +@@ -20,7 +21,7 @@ pcm_stream.o flac_stream.o all: $(TARGET) raop_play: $(OBJS) diff --git a/audio/raop_play/files/patch-rendezvous_Client.c b/audio/raop_play/files/patch-rendezvous_Client.c index 44c81829b410..3bc659752f92 100644 --- a/audio/raop_play/files/patch-rendezvous_Client.c +++ b/audio/raop_play/files/patch-rendezvous_Client.c @@ -1,13 +1,11 @@ --- rendezvous/Client.c.orig 2005-12-16 14:17:02 UTC +++ rendezvous/Client.c -@@ -83,8 +83,9 @@ +@@ -83,7 +83,7 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> -#include <asm/types.h> +#include <sys/types.h> -+#include "getline.h" #include "mDNSClientAPI.h"// Defines the interface to the mDNS core code #include "mDNSPosix.h" // Defines the specific types needed to run mDNS on this platform - #include "ExampleClientApp.h" diff --git a/audio/raop_play/files/patch-rendezvous_Makefile.in b/audio/raop_play/files/patch-rendezvous_Makefile.in index 5067dc748e32..43d09315caed 100644 --- a/audio/raop_play/files/patch-rendezvous_Makefile.in +++ b/audio/raop_play/files/patch-rendezvous_Makefile.in @@ -17,14 +17,12 @@ TARGET = mDNSClient DESTDIR = -@@ -17,8 +18,8 @@ DESTDIR = - all: $(TARGET) +@@ -18,7 +19,7 @@ all: $(TARGET) --mDNSClient: mDNSPosix.o mDNSUNP.o ExampleClientApp.o mDNS.o Client.o + mDNSClient: mDNSPosix.o mDNSUNP.o ExampleClientApp.o mDNS.o Client.o - $(CC) $(LFLAGS) $^ -o $@ -+mDNSClient: mDNSPosix.o mDNSUNP.o ExampleClientApp.o mDNS.o Client.o getline.o -+ $(CC) $(LDFLAGS) mDNSPosix.o mDNSUNP.o ExampleClientApp.o mDNS.o Client.o getline.o -o $@ ++ $(CC) $(LDFLAGS) mDNSPosix.o mDNSUNP.o ExampleClientApp.o mDNS.o Client.o -o $@ install: $(mkinstalldirs) $(DESTDIR)$(bindir)/ |