]> git.sesse.net Git - vlc/blobdiff - src/interface/main.c
* moved the function definitions from threads.h into threads_funcs.h. This
[vlc] / src / interface / main.c
index ae024c60d3d543bbdb09ea220e4ffc9cdf28388c..1887d894ebf1c6b269bd1b89f8b6893f8f1afab7 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.181 2002/04/21 10:32:21 sam Exp $
+ * $Id: main.c,v 1.189 2002/04/27 22:11:22 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -14,7 +14,7 @@
  * 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
@@ -60,7 +60,7 @@
 #endif
 
 #ifdef HAVE_LOCALE_H
-#    include <locale.h>
+#   include <locale.h>
 #endif
 
 #include <errno.h>                                                 /* ENOMEM */
 #include "video.h"
 #include "video_output.h"
 
-#include "debug.h"
-
 /*****************************************************************************
- * Configuration options for the main program. Each plugin will also separatly
+ * Configuration options for the main program. Each module will also separatly
  * define its own configuration options.
  * Look into configuration.h if you need to know more about the following
  * macros.
  *
  *****************************************************************************/
-#define BUILTIN
+#define __BUILTIN__
 #define MODULE_NAME main
 #include "modules_inner.h"                        /* for configuration stuff */
 
@@ -97,7 +95,7 @@
 #define INTF_TEXT N_("interface module")
 #define INTF_LONGTEXT N_( \
     "This option allows you to select the interface used by vlc.\nNote that " \
-    "the default behaviour is to automatically select the best method " \
+    "the default behavior is to automatically select the best method " \
     "available.")
 
 #define WARNING_TEXT N_("warning level (or use -v, -vv, etc...)")
 #define AOUT_TEXT N_("audio output module")
 #define AOUT_LONGTEXT N_( \
     "This option allows you to select the audio audio output method used by " \
-    "vlc.\nNote that the default behaviour is to automatically select the " \
+    "vlc.\nNote that the default behavior is to automatically select the " \
     "best method available.")
 
 #define NOAUDIO_TEXT N_("disable audio")
 #define VOUT_TEXT N_("video output module")
 #define VOUT_LONGTEXT N_( \
     "This option allows you to select the video output method used by vlc.\n" \
-    "Note that the default behaviour is to automatically select the best " \
+    "Note that the default behavior is to automatically select the best " \
     "method available.")
 
 #define NOVIDEO_TEXT N_("disable video")
     "You can enforce the video height here.\nNote that by default vlc will " \
     "adapt to the video characteristics.")
 
+#define ZOOM_TEXT N_("zoom video")
+#define ZOOM_LONGTEXT N_( \
+    "You can zoom the video by the specified factor.")
+
 #define GRAYSCALE_TEXT N_("grayscale video output")
 #define GRAYSCALE_LONGTEXT N_( \
     "Using this option, vlc will not decode the color information from the " \
 #define VCD_DEV_TEXT N_("VCD device")
 #define VCD_DEV_LONGTEXT ""
 
-#define SAT_FREQ_TEXT N_("satellite transponder frequency")
-#define SAT_FREQ_LONGTEXT ""
-
-#define SAT_POL_TEXT N_("satellite transponder polarization")
-#define SAT_POL_LONGTEXT ""
-
-#define SAT_FEC_TEXT N_("satellite transponder FEC")
-#define SAT_FEC_LONGTEXT ""
-
-#define SAT_SRATE_TEXT N_("satellite transponder symbol rate")
-#define SAT_SRATE_LONGTEXT ""
-
-#define SAT_DISEQC_TEXT N_("use diseqc with antenna")
-#define SAT_DISEQC_LONGTEXT ""
-
-#define SAT_LNB_LOF1_TEXT N_("antenna lnb_lof1 (kHz)")
-#define SAT_LNB_LOF1_LONGTEXT ""
-
-#define SAT_LNB_LOF2_TEXT N_("antenna lnb_lof2 (kHz)")
-#define SAT_LNB_LOF2_LONGTEXT ""
-
-#define SAT_LNB_SLOF_TEXT N_("antenna lnb_slof (kHz)")
-#define SAT_LNB_SLOF_LONGTEXT ""
-
 #define IPV6_TEXT N_("force IPv6")
 #define IPV6_LONGTEXT ""
 
  * ADD_SUBCATEGORY_HINT( N_(text), longtext )
  * ADD_STRING( option_name, value, p_callback, N_(text), N_(longtext) )
  * ADD_FILE( option_name, psz_value, p_callback, N_(text), N_(longtext) )
- * ADD_PLUGIN( option_name, psz_value, i_capability, p_callback,
+ * ADD_MODULE( option_name, psz_value, i_capability, p_callback,
  *             N_(text), N_(longtext) )
  * ADD_INTEGER( option_name, i_value, p_callback, N_(text), N_(longtext) )
  * ADD_BOOL( option_name, p_callback, N_(text), N_(longtext) )
@@ -332,74 +310,60 @@ MODULE_CONFIG_START
 
 /* Interface options */
 ADD_CATEGORY_HINT( N_("Interface"), NULL)
-ADD_PLUGIN  ( "intf", MODULE_CAPABILITY_INTF, NULL, NULL, INTF_TEXT, INTF_LONGTEXT )
+ADD_MODULE_WITH_SHORT  ( "intf", 'I', MODULE_CAPABILITY_INTF, NULL, NULL, INTF_TEXT, INTF_LONGTEXT )
 ADD_INTEGER ( "warning", 0, NULL, WARNING_TEXT, WARNING_LONGTEXT )
 ADD_BOOL    ( "stats", NULL, STATS_TEXT, STATS_LONGTEXT )
-ADD_STRING  ( "search_path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT )
+ADD_STRING  ( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT )
 
 /* Audio options */
 ADD_CATEGORY_HINT( N_("Audio"), NULL)
-ADD_PLUGIN  ( "aout", MODULE_CAPABILITY_AOUT, NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT )
+ADD_MODULE_WITH_SHORT  ( "aout", 'A', MODULE_CAPABILITY_AOUT, NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT )
 ADD_BOOL    ( "noaudio", NULL, NOAUDIO_TEXT, NOAUDIO_LONGTEXT )
 ADD_BOOL    ( "mono", NULL, MONO_TEXT, MONO_LONGTEXT )
 ADD_INTEGER ( "volume", VOLUME_DEFAULT, NULL, VOLUME_TEXT, VOLUME_LONGTEXT )
 ADD_INTEGER ( "rate", 44100, NULL, RATE_TEXT, RATE_LONGTEXT )
 ADD_INTEGER ( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT )
-ADD_INTEGER ( "aout_format", 0, NULL, FORMAT_TEXT,
+ADD_INTEGER ( "audio-format", 0, NULL, FORMAT_TEXT,
               FORMAT_LONGTEXT )
 
 /* Video options */
 ADD_CATEGORY_HINT( N_("Video"), NULL )
-ADD_PLUGIN  ( "vout", MODULE_CAPABILITY_VOUT, NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT )
+ADD_MODULE_WITH_SHORT  ( "vout", 'V', MODULE_CAPABILITY_VOUT, NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT )
 ADD_BOOL    ( "novideo", NULL, NOVIDEO_TEXT, NOVIDEO_LONGTEXT )
 ADD_INTEGER ( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT )
 ADD_INTEGER ( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT )
+ADD_FLOAT   ( "zoom", 1, NULL, ZOOM_TEXT, ZOOM_LONGTEXT )
 ADD_BOOL    ( "grayscale", NULL, GRAYSCALE_TEXT, GRAYSCALE_LONGTEXT )
 ADD_BOOL    ( "fullscreen", NULL, FULLSCREEN_TEXT, FULLSCREEN_LONGTEXT )
 ADD_BOOL    ( "nooverlay", NULL, NOOVERLAY_TEXT, NOOVERLAY_LONGTEXT )
 ADD_INTEGER ( "spumargin", -1, NULL, SPUMARGIN_TEXT, SPUMARGIN_LONGTEXT )
-ADD_PLUGIN  ( "filter", MODULE_CAPABILITY_VOUT, NULL, NULL, FILTER_TEXT, FILTER_LONGTEXT )
+ADD_MODULE  ( "filter", MODULE_CAPABILITY_VOUT, NULL, NULL, FILTER_TEXT, FILTER_LONGTEXT )
 
 /* Input options */
 ADD_CATEGORY_HINT( N_("Input"), NULL )
-ADD_INTEGER ( "server_port", 1234, NULL, SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT )
-ADD_BOOL    ( "network_channel", NULL, NETCHANNEL_TEXT, NETCHANNEL_LONGTEXT )
-ADD_STRING  ( "channel_server", "localhost", NULL, CHAN_SERV_TEXT, CHAN_SERV_LONGTEXT )
-ADD_INTEGER ( "channel_port", 6010, NULL, CHAN_PORT_TEXT, CHAN_PORT_LONGTEXT )
+ADD_INTEGER ( "server-port", 1234, NULL, SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT )
+ADD_BOOL    ( "network-channel", NULL, NETCHANNEL_TEXT, NETCHANNEL_LONGTEXT )
+ADD_STRING  ( "channel-server", "localhost", NULL, CHAN_SERV_TEXT, CHAN_SERV_LONGTEXT )
+ADD_INTEGER ( "channel-port", 6010, NULL, CHAN_PORT_TEXT, CHAN_PORT_LONGTEXT )
 ADD_STRING  ( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT )
 
-ADD_INTEGER ( "input_program", 0, NULL, INPUT_PROGRAM_TEXT,
-        INPUT_PROGRAM_LONGTEXT )
-ADD_INTEGER ( "input_audio", -1, NULL, INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT )
-ADD_INTEGER ( "input_channel", -1, NULL, INPUT_CHAN_TEXT, INPUT_CHAN_LONGTEXT )
-ADD_INTEGER ( "input_subtitle", -1, NULL, INPUT_SUBT_TEXT, INPUT_SUBT_LONGTEXT )
-
-ADD_STRING  ( "dvd_device", "/dev/dvd", NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT )
-ADD_STRING  ( "vcd_device", "/dev/cdrom", NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT )
-#ifdef HAVE_SATELLITE
-ADD_INTEGER ( "sat_frequency", 11954, NULL, SAT_FREQ_TEXT, SAT_FREQ_LONGTEXT )
-ADD_INTEGER ( "sat_polarization", 0, NULL, SAT_POL_TEXT, SAT_POL_LONGTEXT )
-ADD_INTEGER ( "sat_fec", 3, NULL, SAT_FEC_TEXT, SAT_FEC_LONGTEXT )
-ADD_INTEGER ( "sat_symbol_rate", 27500, NULL, SAT_SRATE_TEXT,
-            SAT_SRATE_LONGTEXT )
-ADD_BOOL    ( "sat_diseqc", 0, SAT_DISEQC_TEXT, SAT_DISEQC_LONGTEXT )
-ADD_INTEGER ( "sat_lnb_lof1", 10000, NULL, SAT_LNB_LOF1_TEXT, 
-            SAT_LNB_LOF1_LONGTEXT )
-ADD_INTEGER ( "sat_lnb_lof2", 10000, NULL, SAT_LNB_LOF2_TEXT, 
-            SAT_LNB_LOF2_LONGTEXT )
-ADD_INTEGER ( "sat_lnb_slof", 11700, NULL, SAT_LNB_SLOF_TEXT, 
-            SAT_LNB_SLOF_LONGTEXT )
-#endif
+ADD_INTEGER ( "program", 0, NULL, INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT )
+ADD_INTEGER ( "audio-type", -1, NULL, INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT )
+ADD_INTEGER ( "audio-channel", -1, NULL, INPUT_CHAN_TEXT, INPUT_CHAN_LONGTEXT )
+ADD_INTEGER ( "spu-channel", -1, NULL, INPUT_SUBT_TEXT, INPUT_SUBT_LONGTEXT )
 
-ADD_BOOL    ( "ipv6", NULL, IPV6_TEXT, IPV6_LONGTEXT )
-ADD_BOOL    ( "ipv4", NULL, IPV4_TEXT, IPV4_LONGTEXT )
+ADD_STRING  ( "dvd", "/dev/dvd", NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT )
+ADD_STRING  ( "vcd", "/dev/cdrom", NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT )
+
+ADD_BOOL_WITH_SHORT    ( "ipv6", '6', NULL, IPV6_TEXT, IPV6_LONGTEXT )
+ADD_BOOL_WITH_SHORT    ( "ipv4", '4', NULL, IPV4_TEXT, IPV4_LONGTEXT )
 
 /* Decoder options */
 ADD_CATEGORY_HINT( N_("Decoders"), NULL )
-ADD_PLUGIN  ( "mpeg_adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_MPEG_TEXT, ADEC_MPEG_LONGTEXT )
-ADD_PLUGIN  ( "ac3_adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_AC3_TEXT, ADEC_AC3_LONGTEXT )
-ADD_INTEGER ( "vdec_smp", 0, NULL, VDEC_SMP_TEXT, VDEC_SMP_LONGTEXT )
-ADD_STRING  ( "vpar_synchro", NULL, NULL, VPAR_SYNCHRO_TEXT, VPAR_SYNCHRO_LONGTEXT )
+ADD_MODULE  ( "mpeg-adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_MPEG_TEXT, ADEC_MPEG_LONGTEXT )
+ADD_MODULE  ( "ac3-adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_AC3_TEXT, ADEC_AC3_LONGTEXT )
+ADD_INTEGER ( "vdec-smp", 0, NULL, VDEC_SMP_TEXT, VDEC_SMP_LONGTEXT )
+ADD_STRING  ( "vpar-synchro", NULL, NULL, VPAR_SYNCHRO_TEXT, VPAR_SYNCHRO_LONGTEXT )
 
 /* CPU options */
 ADD_CATEGORY_HINT( N_("CPU"), NULL )
@@ -411,13 +375,15 @@ ADD_BOOL    ( "noaltivec", NULL, NOALTIVEC_TEXT, NOALTIVEC_LONGTEXT )
 
 /* Playlist options */
 ADD_CATEGORY_HINT( N_("Playlist"), NULL )
-ADD_BOOL    ( "playlist_launch", NULL, PLAYLIST_LAUNCH_TEXT, PLAYLIST_LAUNCH_LONGTEXT )
-ADD_BOOL    ( "playlist_enqueue", NULL, PLAYLIST_ENQUEUE_TEXT, PLAYLIST_ENQUEUE_LONGTEXT )
-ADD_BOOL    ( "playlist_loop", NULL, PLAYLIST_LOOP_TEXT, PLAYLIST_LOOP_LONGTEXT )
+ADD_BOOL    ( "launch-playlist", NULL, PLAYLIST_LAUNCH_TEXT, PLAYLIST_LAUNCH_LONGTEXT )
+ADD_BOOL    ( "enqueue-playlist", NULL, PLAYLIST_ENQUEUE_TEXT, PLAYLIST_ENQUEUE_LONGTEXT )
+ADD_BOOL    ( "loop-playlist", NULL, PLAYLIST_LOOP_TEXT, PLAYLIST_LOOP_LONGTEXT )
 
 /* Misc options */
 ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_PLUGIN  ( "memcpy", MODULE_CAPABILITY_MEMCPY, NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT )
+ADD_MODULE  ( "memcpy", MODULE_CAPABILITY_MEMCPY, NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT )
+ADD_MODULE  ( "access", MODULE_CAPABILITY_ACCESS, NULL, NULL, "access module", "This is a legacy entry to let you configure access modules" )
+ADD_MODULE  ( "demux", MODULE_CAPABILITY_DEMUX, NULL, NULL, "demux module", "This is a legacy entry to let you configure demux modules" )
 
 #if defined(WIN32)
 ADD_BOOL    ( "fast_pthread", NULL, FAST_PTHREAD_TEXT, FAST_PTHREAD_LONGTEXT )
@@ -438,18 +404,21 @@ MODULE_DEACTIVATE_STOP
 
 /* Hack for help options */
 static module_t help_module;
-static module_config_t p_help_config[] = {
-    { MODULE_CONFIG_ITEM_BOOL, "help", N_("print help (or use -h)"),
-      NULL, NULL, 0, NULL, NULL, 0 },
-    { MODULE_CONFIG_ITEM_BOOL, "longhelp", N_("print detailed help (or use -H)"),
-      NULL, NULL, 0, NULL, NULL, 0 },
-    { MODULE_CONFIG_ITEM_BOOL, "list", N_("print a list of available plugins "
-      "(or use -l)"), NULL, NULL, 0, NULL, NULL, 0 },
-    { MODULE_CONFIG_ITEM_STRING, "plugin", N_("print help on plugin "
-      "(or use -p)"), NULL, NULL, 0, NULL, &help_module.config_lock, 0 },
-    { MODULE_CONFIG_ITEM_BOOL, "version", N_("print version information"),
-      NULL, NULL, 0, NULL, NULL, 0 },
-    { MODULE_CONFIG_HINT_END, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0 } };
+static module_config_t p_help_config[] =
+{
+    { MODULE_CONFIG_ITEM_BOOL, "help", 'h', N_("print help"),
+      NULL, NULL, 0, 0, NULL, NULL, 0 },
+    { MODULE_CONFIG_ITEM_BOOL, "longhelp", 'H', N_("print detailed help"),
+      NULL, NULL, 0, 0, NULL, NULL, 0 },
+    { MODULE_CONFIG_ITEM_BOOL, "list", 'l', N_("print a list of available "
+      "modules"), NULL, NULL, 0, 0, NULL, NULL, 0 },
+    { MODULE_CONFIG_ITEM_STRING, "module", 'p', N_("print help on module "
+      "<string>"), NULL, NULL, 0, 0, NULL, &help_module.config_lock, 0 },
+    { MODULE_CONFIG_ITEM_BOOL, "version", '\0',
+      N_("print version information"), NULL, NULL, 0, 0, NULL, NULL, 0 },
+    { MODULE_CONFIG_HINT_END, NULL, '\0', NULL, NULL, NULL, 0, 0,
+      NULL, NULL, 0 }
+};
 
 /*****************************************************************************
  * End configuration.
@@ -459,7 +428,6 @@ static module_config_t p_help_config[] = {
  * Global variables - these are the only ones, see main.h and modules.h
  *****************************************************************************/
 main_t        *p_main;
-p_main_sys_t  p_main_sys;
 module_bank_t *p_module_bank;
 input_bank_t  *p_input_bank;
 aout_bank_t   *p_aout_bank;
@@ -504,7 +472,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     input_bank_t  input_bank;
     aout_bank_t   aout_bank;
     vout_bank_t   vout_bank;
-    char *psz_plugin;
+    char *psz_module;
     char *p_tmp;
     struct module_config_s *p_item;
 
@@ -571,11 +539,18 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
 
     /* Get the executable name (similar to the basename command) */
-    p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ];
-    while( *p_tmp )
+    if( i_argc > 0 )
     {
-        if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp;
-        else ++p_tmp;
+        p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ];
+        while( *p_tmp )
+        {
+            if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp;
+            else ++p_tmp;
+        }
+    }
+    else
+    {
+        p_main->psz_arg0 = "vlc";
     }
 
     /*
@@ -588,6 +563,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     /* Hack: insert the help module here */
     help_module.psz_name = "help";
+    help_module.psz_longname = _( "help module" );
     help_module.i_config_items =
                     sizeof(p_help_config) / sizeof(module_config_t) - 1;
     vlc_mutex_init( &help_module.config_lock );
@@ -633,7 +609,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Load the builtins and plugins into the module_bank.
      * We have to do it before config_Load*() because this also gets the
-     * list of configuration options exported by each plugin and loads their
+     * list of configuration options exported by each module and loads their
      * default values.
      */
     module_LoadBuiltins();
@@ -646,8 +622,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     p_module_bank->first = &help_module;
     /* end hack */
 
-    /* Check for help on plugins */
-    if( (p_tmp = config_GetPszVariable( "plugin" )) )
+    /* Check for help on modules */
+    if( (p_tmp = config_GetPszVariable( "module" )) )
     {
         Usage( p_tmp );
         free( p_tmp );
@@ -661,7 +637,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         return( -1 );
     }
 
-    /* Check for plugin list option */
+    /* Check for module list option */
     if( config_GetIntVariable( "list" ) )
     {
         ListModules();
@@ -700,13 +676,11 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * System specific configuration
      */
-#if defined( WIN32 )
     system_Configure();
-#endif
 
     /* p_main inititalization. FIXME ? */
-    p_main->i_desync = (mtime_t)config_GetIntVariable( "desync" )
-      * (mtime_t)1000;
+    p_main->i_warning_level = config_GetIntVariable( "warning" );
+    p_main->i_desync = config_GetIntVariable( "desync" ) * (mtime_t)1000;
     p_main->b_stats = config_GetIntVariable( "stats" );
     p_main->b_audio = !config_GetIntVariable( "noaudio" );
     p_main->b_stereo= !config_GetIntVariable( "mono" );
@@ -725,7 +699,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     if( p_main->b_stats )
     {
-        char          p_capabilities[200];
+        char p_capabilities[200];
         p_capabilities[0] = '\0';
 
 #define PRINT_CAPABILITY( capability, string )                              \
@@ -775,10 +749,10 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Choose the best memcpy module
      */
-    psz_plugin = config_GetPszVariable( "memcpy" );
+    psz_module = config_GetPszVariable( "memcpy" );
     p_main->p_memcpy_module = module_Need( MODULE_CAPABILITY_MEMCPY,
-                                           psz_plugin, NULL );
-    if( psz_plugin ) free( psz_plugin );
+                                           psz_module, NULL );
+    if( psz_module ) free( psz_module );
     if( p_main->p_memcpy_module == NULL )
     {
         intf_ErrMsg( "intf error: no suitable memcpy module, "
@@ -794,13 +768,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Initialize shared resources and libraries
      */
-    if( config_GetIntVariable( "network_channel" ) &&
+    if( config_GetIntVariable( "network-channel" ) &&
         network_ChannelCreate() )
     {
         /* On error during Channels initialization, switch off channels */
         intf_ErrMsg( "intf error: channels initialization failed, "
                                  "deactivating channels" );
-        config_PutIntVariable( "network_channel", 0 );
+        config_PutIntVariable( "network-channel", 0 );
     }
 
     /*
@@ -831,7 +805,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         /*
          * Go back into channel 0 which is the network
          */
-        if( config_GetIntVariable( "network_channel" ) && p_main->p_channel )
+        if( config_GetIntVariable( "network-channel" ) && p_main->p_channel )
         {
             network_ChannelJoin( COMMON_CHANNEL );
         }
@@ -865,10 +839,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * System specific cleaning code
      */
-#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) || defined( WIN32 )
     system_End();
-#endif
-
 
     /*
      * Terminate messages interface and program
@@ -913,11 +884,27 @@ static int GetFilenames( int i_argc, char *ppsz_argv[] )
  *****************************************************************************/
 static void Usage( const char *psz_module_name )
 {
+#define FORMAT_STRING "      --%s%s%s%s%s %s"
+    /* option name ---------------' | | | |  |
+     * <bra ------------------------' | | |  |
+     * option type or "" -------------' | |  |
+     * ket> ----------------------------' |  |
+     * padding spaces --------------------'  |
+     * comment ------------------------------'
+     *
+     * The purpose of having bra and ket is that we might i18n them as well.
+     */
+#define LINE_START 8
+#define PADDING_SPACES 25
     module_t *p_module;
     module_config_t *p_item;
-    char psz_spaces[30];
+    char psz_spaces[PADDING_SPACES+LINE_START+1];
+    char psz_format[sizeof(FORMAT_STRING)];
+
+    memset( psz_spaces, ' ', PADDING_SPACES+LINE_START );
+    psz_spaces[PADDING_SPACES+LINE_START] = '\0';
 
-    memset( psz_spaces, 32, 30 );
+    strcpy( psz_format, FORMAT_STRING );
 
 #ifdef WIN32
     ShowConsole();
@@ -928,11 +915,10 @@ static void Usage( const char *psz_module_name )
          p_module != NULL ;
          p_module = p_module->next )
     {
-
         if( psz_module_name && strcmp( psz_module_name, p_module->psz_name ) )
             continue;
 
-        /* ignore plugins without config options */
+        /* ignore modules without config options */
         if( !p_module->i_config_items ) continue;
 
         /* print module name */
@@ -942,8 +928,22 @@ static void Usage( const char *psz_module_name )
              p_item->i_type != MODULE_CONFIG_HINT_END;
              p_item++ )
         {
+            char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
             int i;
 
+            if( p_item->i_short )
+            {
+                psz_format[2] = '-';
+                psz_format[3] = p_item->i_short;
+                psz_format[4] = ',';
+            }
+            else
+            {
+                psz_format[2] = ' ';
+                psz_format[3] = ' ';
+                psz_format[4] = ' ';
+            }
+
             switch( p_item->i_type )
             {
             case MODULE_CONFIG_HINT_CATEGORY:
@@ -952,39 +952,39 @@ static void Usage( const char *psz_module_name )
 
             case MODULE_CONFIG_ITEM_STRING:
             case MODULE_CONFIG_ITEM_FILE:
-            case MODULE_CONFIG_ITEM_PLUGIN:
-                /* Nasty hack, but right now I'm too tired to think about
-                 * a nice solution */
-                i = 25 - strlen( p_item->psz_name )
-                    - strlen(_(" <string>")) - 1;
-                if( i < 0 ) i = 0; psz_spaces[i] = 0;
-
-                intf_Msg( "  --%s%s%s %s", p_item->psz_name,
-                          _(" <string>"), psz_spaces, p_item->psz_text );
-                psz_spaces[i] = 32;
+            case MODULE_CONFIG_ITEM_MODULE: /* We could also have "=<" here */
+                psz_bra = " <"; psz_type = _("string"); psz_ket = ">";
                 break;
             case MODULE_CONFIG_ITEM_INTEGER:
-                /* Nasty hack, but right now I'm too tired to think about
-                 * a nice solution */
-                i = 25 - strlen( p_item->psz_name )
-                    - strlen(_(" <integer>")) - 1;
-                if( i < 0 ) i = 0; psz_spaces[i] = 0;
-
-                intf_Msg( "  --%s%s%s %s", p_item->psz_name,
-                          _(" <integer>"), psz_spaces, p_item->psz_text );
-                psz_spaces[i] = 32;
+                psz_bra = " <"; psz_type = _("integer"); psz_ket = ">";
+                break;
+            case MODULE_CONFIG_ITEM_FLOAT:
+                psz_bra = " <"; psz_type = _("float"); psz_ket = ">";
                 break;
             case MODULE_CONFIG_ITEM_BOOL:
-                /* Nasty hack, but right now I'm too tired to think about
-                 * a nice solution */
-                i = 25 - strlen( p_item->psz_name ) - 1;
-                if( i < 0 ) i = 0; psz_spaces[i] = 0;
-
-                intf_Msg( "  --%s%s %s",
-                          p_item->psz_name, psz_spaces, p_item->psz_text );
-                psz_spaces[i] = 32;
+                psz_bra = ""; psz_type = ""; psz_ket = "";
                 break;
             }
+
+            if( psz_type )
+            {
+                i = PADDING_SPACES - strlen( p_item->psz_name )
+                     - strlen( psz_bra ) - strlen( psz_type )
+                     - strlen( psz_ket ) - 1;
+                if( i < 0 )
+                {
+                    i = 0;
+                    psz_spaces[i] = '\n';
+                }
+                else
+                {
+                    psz_spaces[i] = '\0';
+                }
+
+                intf_Msg( psz_format, p_item->psz_name, psz_bra, psz_type,
+                          psz_ket, psz_spaces, p_item->psz_text );
+                psz_spaces[i] = ' ';
+            }
         }
 
         /* Yet another nasty hack.
@@ -993,18 +993,18 @@ static void Usage( const char *psz_module_name )
         if( !strcmp( "main", p_module->psz_name ) )
         {
             intf_Msg( _("\nPlaylist items:"
-                "\n  *.mpg, *.vob                   \tplain MPEG-1/2 files"
+                "\n  *.mpg, *.vob                   plain MPEG-1/2 files"
                 "\n  [dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"
-                "\n                                 \tDVD device"
+                "\n                                 DVD device"
                 "\n  [vcd:][device][@[title][,[chapter]]"
-                "\n                                 \tVCD device"
+                "\n                                 VCD device"
                 "\n  udpstream:[@[<bind address>][:<bind port>]]"
-                "\n                                 \tUDP stream sent by VLS"
-                "\n  vlc:loop                       \tloop execution of the "
+                "\n                                 UDP stream sent by VLS"
+                "\n  vlc:loop                       loop execution of the "
                       "playlist"
-                "\n  vlc:pause                      \tpause execution of "
+                "\n  vlc:pause                      pause execution of "
                       "playlist items"
-                "\n  vlc:quit                       \tquit VLC") );
+                "\n  vlc:quit                       quit VLC") );
         }
 
         intf_Msg( "" );
@@ -1026,9 +1026,9 @@ static void Usage( const char *psz_module_name )
 static void ListModules( void )
 {
     module_t *p_module;
-    char psz_spaces[20];
+    char psz_spaces[22];
 
-    memset( psz_spaces, 32, 20 );
+    memset( psz_spaces, ' ', 22 );
 
 #ifdef WIN32
     ShowConsole();
@@ -1038,7 +1038,7 @@ static void ListModules( void )
     intf_Msg( _("Usage: %s [options] [parameters] [file]...\n"),
               p_main->psz_arg0 );
 
-    intf_Msg( _("[plugin]              [description]") );
+    intf_Msg( _("[module]              [description]") );
 
     /* Enumerate each module */
     for( p_module = p_module_bank->first ;
@@ -1049,14 +1049,14 @@ static void ListModules( void )
 
         /* Nasty hack, but right now I'm too tired to think about a nice
          * solution */
-        i = 20 - strlen( p_module->psz_name ) - 1;
+        i = 22 - strlen( p_module->psz_name ) - 1;
         if( i < 0 ) i = 0;
         psz_spaces[i] = 0;
 
         intf_Msg( "  %s%s %s", p_module->psz_name, psz_spaces,
                   p_module->psz_longname );
 
-        psz_spaces[i] = 32;
+        psz_spaces[i] = ' ';
 
     }
 
@@ -1302,7 +1302,7 @@ static u32 CPUCapabilities( void )
         i_capabilities |= CPU_CAPABILITY_MMXEXT;
 
 #   ifdef CAN_COMPILE_SSE
-        /* We test if OS support the SSE instructions */
+        /* We test if OS supports the SSE instructions */
         psz_capability = "SSE";
         i_illegal = 0;
         if( setjmp( env ) == 0 )
@@ -1402,7 +1402,7 @@ static u32 CPUCapabilities( void )
 /*****************************************************************************
  * ShowConsole: On Win32, create an output console for debug messages
  *****************************************************************************
- * This function is usefull only on Win32.
+ * This function is useful only on Win32.
  *****************************************************************************/
 #ifdef WIN32 /*  */
 static void ShowConsole( void )