Commit 48b74806 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* removed vlc_wraptext

parent 49ca4940
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.65 2003/05/25 17:27:13 massiot Exp $ * $Id: vlc_common.h,v 1.66 2003/05/27 01:48:50 hartman Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -563,8 +563,6 @@ static inline uint64_t U64_AT( void * _p ) ...@@ -563,8 +563,6 @@ static inline uint64_t U64_AT( void * _p )
# define vlc_strncasecmp NULL # define vlc_strncasecmp NULL
#endif #endif
VLC_EXPORT( char *, vlc_wraptext, ( char *psz_text, size_t i_line ) );
/* Format type specifiers for 64 bits numbers */ /* Format type specifiers for 64 bits numbers */
#if !defined(WIN32) && !defined(UNDER_CE) #if !defined(WIN32) && !defined(UNDER_CE)
# define I64Fd "%lld" # define I64Fd "%lld"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libc.c: Extra libc function for some systems. * libc.c: Extra libc function for some systems.
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: libc.c,v 1.7 2003/02/08 22:20:28 massiot Exp $ * $Id: libc.c,v 1.8 2003/05/27 01:48:50 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -171,55 +171,3 @@ char *vlc_dgettext( const char *package, const char *msgid ) ...@@ -171,55 +171,3 @@ char *vlc_dgettext( const char *package, const char *msgid )
#endif #endif
} }
/*****************************************************************************
* wraptext: insert \n at convenient places. CAUTION: modifies its argument
*****************************************************************************/
char *vlc_wraptext( char *psz_text, size_t i_line )
{
size_t i_len = strlen(psz_text);
char * psz_line = psz_text;
while ( i_len > i_line )
{
/* Look if there is a newline somewhere. */
char * psz_parser = psz_line;
while ( psz_parser <= psz_line + i_line && *psz_parser != '\n' )
{
psz_parser++;
}
if ( *psz_parser == '\n' )
{
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
continue;
}
/* Find the furthest space. */
psz_parser = psz_line + i_line;
while ( psz_parser > psz_line && *psz_parser != ' ' )
{
psz_parser--;
}
if ( *psz_parser == ' ' )
{
*psz_parser = '\n';
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
continue;
}
/* Wrapping has failed. Find the first space or newline after i_line. */
psz_parser = psz_line + i_line + 1;
while ( psz_parser < psz_line + i_len
&& *psz_parser != ' ' && *psz_parser != '\n' )
{
psz_parser++;
}
if ( psz_parser < psz_line + i_len ) *psz_parser = '\n';
i_len -= psz_parser + 1 - psz_line;
psz_line = psz_parser + 1;
}
return psz_text;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment