* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.71 2003/03/26 00:56:22 gbazin Exp $
+ * $Id: libvlc.c,v 1.80 2003/04/22 16:36:16 titer Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
psz_env = getenv( "VLC_VERBOSE" );
libvlc.i_verbose = psz_env ? atoi( psz_env ) : -1;
-#ifdef HAVE_ISATTY
+#if defined( HAVE_ISATTY ) && !defined( WIN32 )
libvlc.b_color = isatty( 2 ); /* 2 is for stderr */
#else
libvlc.b_color = VLC_FALSE;
}
/* Check for translation config option */
+#if defined( ENABLE_NLS ) \
+ && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
+
+ /* This ain't really nice to have to reload the config here but it seems
+ * the only way to do it. */
+ p_vlc->psz_homedir = config_GetHomeDir();
+ config_LoadConfigFile( p_vlc, "main" );
+ config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE );
+
if( !config_GetInt( p_vlc, "translation" ) )
{
/* Reset the default domain */
SetLanguage( "C" );
-#if defined( ENABLE_NLS ) \
- && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
textdomain( "dummy" );
-#endif
+
+ module_EndBank( p_vlc );
+ module_InitBank( &libvlc );
+ module_LoadMain( &libvlc );
}
+#endif
/*
* Load the builtins and plugins into the module_bank.
libvlc.i_verbose = __MIN( i_tmp, 2 );
}
}
- libvlc.b_color = libvlc.b_color || config_GetInt( p_vlc, "color" );
+ libvlc.b_color = libvlc.b_color && config_GetInt( p_vlc, "color" );
/*
* Output messages that may still be in the queue
psz_parser = psz_modules;
while ( psz_parser && *psz_parser )
{
- char *psz_module;
+ char *psz_module, *psz_temp;
psz_module = psz_parser;
psz_parser = strchr( psz_module, ',' );
if ( psz_parser )
*psz_parser = '\0';
psz_parser++;
}
- VLC_AddIntf( 0, psz_module, VLC_FALSE );
+ psz_temp = (char *)malloc( strlen(psz_module) + sizeof(",none") );
+ if( psz_temp )
+ {
+ sprintf( psz_temp, "%s,none", psz_module );
+ VLC_AddIntf( 0, psz_temp, VLC_FALSE );
+ free( psz_temp );
+ }
}
if ( psz_modules )
{
if( p_intf == NULL )
{
- msg_Err( p_vlc, "interface initialization failed" );
+ msg_Err( p_vlc, "interface \"%s\" initialization failed", psz_module );
if( i_object ) vlc_object_release( p_vlc );
return VLC_EGENERIC;
}
&& ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
char * psz_path;
-#if defined( SYS_DARWIN ) || defined ( WIN32 )
+#if defined( SYS_DARWIN ) || defined ( WIN32 ) || defined( SYS_BEOS )
char psz_tmp[1024];
#endif
else
{
setlocale( LC_ALL, psz_lang );
+#ifdef SYS_DARWIN
+ /* I need that under Darwin, please check it doesn't disturb
+ * other platforms. --Meuuh */
+ setenv( "LANG", psz_lang, 1 );
+#endif
}
/* Specify where to find the locales for current domain */
-#if !defined( SYS_DARWIN ) && !defined( WIN32 )
+#if !defined( SYS_DARWIN ) && !defined( WIN32 ) && !defined( SYS_BEOS )
psz_path = LOCALEDIR;
#else
snprintf( psz_tmp, sizeof(psz_tmp), "%s/%s", libvlc.psz_vlcpath,
/* Set the default domain */
textdomain( PACKAGE );
+
+#ifdef SYS_BEOS
+ /* BeOS only support UTF8 strings */
+ bind_textdomain_codeset( PACKAGE, "UTF-8" );
+#endif
+
#endif
}