*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <string.h> /* strdup() */
#include <stdlib.h>
/*****************************************************************************
* vasprintf:
*****************************************************************************/
-#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
+#if !defined(HAVE_VASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS)
int vlc_vasprintf(char **strp, const char *fmt, va_list ap)
{
/* Guess we need no more than 100 bytes. */
/*****************************************************************************
* asprintf:
*****************************************************************************/
-#if !defined(HAVE_ASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
+#if !defined(HAVE_ASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS)
int vlc_asprintf( char **strp, const char *fmt, ... )
{
va_list args;
}
#endif
+#ifndef HAVE_SHARED_LIBVLC
/*****************************************************************************
* dgettext: gettext for plugins.
*****************************************************************************/
return (char *)msgid;
#endif
}
+#endif
/*****************************************************************************
* count_utf8_string: returns the number of characters in the string.
* wraptext: inserts \n at convenient places to wrap the text.
* Returns the modified string in a new buffer.
*****************************************************************************/
-char *vlc_wraptext( const char *psz_text, int i_line, vlc_bool_t b_utf8 )
+char *vlc_wraptext( const char *psz_text, int i_line )
{
int i_len;
char *psz_line, *psz_new_text;
psz_line = psz_new_text = strdup( psz_text );
- if( b_utf8 )
- i_len = count_utf8_string( psz_text );
- else
- i_len = strlen( psz_text );
+ i_len = count_utf8_string( psz_text );
while( i_len > i_line )
{
int i_count = 0;
while( i_count <= i_line && *psz_parser != '\n' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
psz_parser++;
i_count++;
}
/* Find the furthest space. */
while( psz_parser > psz_line && *psz_parser != ' ' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser--;
psz_parser--;
i_count--;
}
/* Wrapping has failed. Find the first space or newline */
while( i_count < i_len && *psz_parser != ' ' && *psz_parser != '\n' )
{
- if( b_utf8 )
- {
- while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
- }
+ while( *((unsigned char *)psz_parser) >= 0x80UL ) psz_parser++;
psz_parser++;
i_count++;
}