From cf6f5debd57c2cba3ad63a8d697d656b54cb94da Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 12 Jun 2008 20:55:44 +0100 Subject: Fix up reporting of supported formats by the ALSA & OSS output plugins. Adjust translations for the spacing changes etc. which this introduces. --- src/xine-utils/utils.c | 8 ++++++++ src/xine-utils/xineutils.h | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'src/xine-utils') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 9f5d122cb..f533d69e5 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -692,3 +692,11 @@ int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) #endif } + +char *xine_strcat_realloc (char **dest, char *append) +{ + char *newstr = realloc (*dest, (*dest ? strlen (*dest) : 0) + strlen (append) + 1); + if (newstr) + strcat (*dest = newstr, append); + return newstr; +} diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 3d630b066..2d6425b00 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -969,6 +969,13 @@ const char *xine_guess_spu_encoding(void) XINE_PROTECTED; */ int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED; +/** + * append to a string, reallocating + * normally, updates & returns *dest + * on error, *dest is unchanged & NULL is returned. + */ +char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED; + /* don't harm following code */ #ifdef extern # undef extern -- cgit v1.2.3 From bc589d30c18a0517804c1306869e77f67d0da3ec Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 15 Jun 2008 02:32:33 +0100 Subject: Move the declaration of xine_strcat_realloc. --- src/xine-utils/xineutils.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/xine-utils') diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 2d6425b00..5476ef2ce 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -676,6 +676,13 @@ void xine_strdupa(char *dest, char *src) XINE_PROTECTED XINE_DEPRECATED; #define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) #define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) +/** + * append to a string, reallocating + * normally, updates & returns *dest + * on error, *dest is unchanged & NULL is returned. + */ +char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED; + /* * Color Conversion Utility Functions * The following data structures and functions facilitate the conversion @@ -969,13 +976,6 @@ const char *xine_guess_spu_encoding(void) XINE_PROTECTED; */ int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED; -/** - * append to a string, reallocating - * normally, updates & returns *dest - * on error, *dest is unchanged & NULL is returned. - */ -char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED; - /* don't harm following code */ #ifdef extern # undef extern -- cgit v1.2.3