Commit ec0617a3 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/dvdread/dvdread.c: disabled the dvdread plugin because it

    currently sucks.
  * ./src/misc/configuration.c, ./src/interface/main.c: we now accept --nofoo
    and --no-foo as negations for --foo. Also, the --help output is nicer.
parent 74356303
...@@ -4,7 +4,11 @@ ...@@ -4,7 +4,11 @@
HEAD HEAD
* ./plugins/macosx: rewrote the net panel for OS X * ./plugins/dvdread/dvdread.c: disabled the dvdread plugin because it
currently sucks.
* ./src/misc/configuration.c, ./src/interface/main.c: we now accept --nofoo
and --no-foo as negations for --foo. Also, the --help output is nicer.
* ./plugins/macosx/*: rewrote the net panel for OS X
* ./plugins/qnx/vout_qnx.c: QNX compilation fix. * ./plugins/qnx/vout_qnx.c: QNX compilation fix.
* ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer * ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer
which caused subtitles to appear slanted in odd width windows. which caused subtitles to appear slanted in odd width windows.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvdread.c : DvdRead input module for vlc * dvdread.c : DvdRead input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: dvdread.c,v 1.15 2002/04/19 13:56:10 sam Exp $ * $Id: dvdread.c,v 1.15.2.1 2002/06/02 23:01:32 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -47,7 +47,7 @@ MODULE_INIT_START ...@@ -47,7 +47,7 @@ MODULE_INIT_START
ADD_CAPABILITY( DEMUX, 0 ) ADD_CAPABILITY( DEMUX, 0 )
ADD_CAPABILITY( ACCESS, 110 ) ADD_CAPABILITY( ACCESS, 110 )
ADD_SHORTCUT( "dvdread" ) ADD_SHORTCUT( "dvdread" )
ADD_SHORTCUT( "dvd" ) //ADD_SHORTCUT( "dvd" )
MODULE_INIT_STOP MODULE_INIT_STOP
MODULE_ACTIVATE_START MODULE_ACTIVATE_START
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: main.c,v 1.195 2002/05/30 08:17:04 gbazin Exp $ * $Id: main.c,v 1.195.2.1 2002/06/02 23:01:32 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -924,15 +924,14 @@ static int GetFilenames( int i_argc, char *ppsz_argv[] ) ...@@ -924,15 +924,14 @@ static int GetFilenames( int i_argc, char *ppsz_argv[] )
*****************************************************************************/ *****************************************************************************/
static void Usage( const char *psz_module_name ) static void Usage( const char *psz_module_name )
{ {
#define FORMAT_STRING " --%s%s%s%s%s%s %s%s" #define FORMAT_STRING " --%s%s%s%s%s%s%s %s%s"
/* option name prefix ------' | | | | | | | /* option name -------------' | | | | | |
* option name ---------------' | | | | | | * <bra --------------------------' | | | | |
* <bra ------------------------' | | | | | * option type or "" ---------------' | | | |
* option type or "" -------------' | | | | * ket> ------------------------------' | | |
* ket> ----------------------------' | | | * padding spaces ----------------------' | |
* padding spaces --------------------' | | * comment --------------------------------' |
* comment ------------------------------' | * comment suffix ---------------------------'
* comment suffix -------------------------'
* *
* The purpose of having bra and ket is that we might i18n them as well. * The purpose of having bra and ket is that we might i18n them as well.
*/ */
...@@ -973,7 +972,7 @@ static void Usage( const char *psz_module_name ) ...@@ -973,7 +972,7 @@ static void Usage( const char *psz_module_name )
p_item++ ) p_item++ )
{ {
char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL; char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
char *psz_suf = ""; char *psz_suf = "", *psz_prefix = NULL;
int i; int i;
switch( p_item->i_type ) switch( p_item->i_type )
...@@ -996,8 +995,8 @@ static void Usage( const char *psz_module_name ) ...@@ -996,8 +995,8 @@ static void Usage( const char *psz_module_name )
case MODULE_CONFIG_ITEM_BOOL: case MODULE_CONFIG_ITEM_BOOL:
psz_bra = ""; psz_type = ""; psz_ket = ""; psz_bra = ""; psz_type = ""; psz_ket = "";
if( !b_help_module ) if( !b_help_module )
psz_suf = p_item->i_value ? _(" (default: enabled)") : psz_suf = p_item->i_value ? _(" (default enabled)") :
_(" (default: disabled)"); _(" (default disabled)");
break; break;
} }
...@@ -1021,7 +1020,30 @@ static void Usage( const char *psz_module_name ) ...@@ -1021,7 +1020,30 @@ static void Usage( const char *psz_module_name )
- strlen( psz_bra ) - strlen( psz_type ) - strlen( psz_bra ) - strlen( psz_type )
- strlen( psz_ket ) - 1; - strlen( psz_ket ) - 1;
if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL && if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL &&
!b_help_module ) i -= 5; !b_help_module )
{
boolean_t b_dash = 0;
psz_prefix = p_item->psz_name;
while( *psz_prefix )
{
if( *psz_prefix++ == '-' )
{
b_dash = 1;
break;
}
}
if( b_dash )
{
psz_prefix = ", --no-";
i -= strlen( p_item->psz_name ) + strlen( ", --no-" );
}
else
{
psz_prefix = ", --no";
i -= strlen( p_item->psz_name ) + strlen( ", --no" );
}
}
if( i < 0 ) if( i < 0 )
{ {
...@@ -1033,11 +1055,19 @@ static void Usage( const char *psz_module_name ) ...@@ -1033,11 +1055,19 @@ static void Usage( const char *psz_module_name )
psz_spaces[i] = '\0'; psz_spaces[i] = '\0';
} }
intf_Msg( psz_format, if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL &&
( p_item->i_type == MODULE_CONFIG_ITEM_BOOL && !b_help_module )
!b_help_module ) ? "(no-)" : "", {
intf_Msg( psz_format, p_item->psz_name, psz_prefix,
p_item->psz_name, psz_bra, psz_type, psz_ket, p_item->psz_name, psz_bra, psz_type, psz_ket,
psz_spaces, p_item->psz_text, psz_suf ); psz_spaces, p_item->psz_text, psz_suf );
}
else
{
intf_Msg( psz_format, p_item->psz_name, "", "",
psz_bra, psz_type, psz_ket, psz_spaces,
p_item->psz_text, psz_suf );
}
psz_spaces[i] = ' '; psz_spaces[i] = ' ';
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration * configuration.c management of the modules configuration
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.26 2002/05/30 08:17:04 gbazin Exp $ * $Id: configuration.c,v 1.26.2.1 2002/06/02 23:01:32 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -824,8 +824,8 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[], ...@@ -824,8 +824,8 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[],
{ {
/* count the number of exported configuration options (to allocate /* count the number of exported configuration options (to allocate
* longopts). We also need to allocate space for too options when * longopts). We also need to allocate space for too options when
* dealing with boolean to allow for --foo and --no-foo */ * dealing with boolean to allow for --foo, --nofoo and --no-foo */
i_opts += (p_module->i_config_items + p_module->i_bool_items); i_opts += (p_module->i_config_items + 2 * p_module->i_bool_items);
} }
p_longopts = malloc( sizeof(struct option) * (i_opts + 1) ); p_longopts = malloc( sizeof(struct option) * (i_opts + 1) );
...@@ -890,11 +890,22 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[], ...@@ -890,11 +890,22 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[],
p_longopts[i_index].val = 0; p_longopts[i_index].val = 0;
i_index++; i_index++;
/* When dealing with bools we also need to add the --no-foo /* When dealing with bools we also need to add the --nofoo and
* option */ * --no-foo options */
if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL ) if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL )
{ {
char *psz_name = malloc( strlen(p_item->psz_name) + 4 ); char *psz_name = malloc( strlen(p_item->psz_name) + 3 );
if( psz_name == NULL ) continue;
strcpy( psz_name, "no" );
strcat( psz_name, p_item->psz_name );
p_longopts[i_index].name = psz_name;
p_longopts[i_index].has_arg = no_argument;
p_longopts[i_index].flag = &flag;
p_longopts[i_index].val = 1;
i_index++;
psz_name = malloc( strlen(p_item->psz_name) + 4 );
if( psz_name == NULL ) continue; if( psz_name == NULL ) continue;
strcpy( psz_name, "no-" ); strcpy( psz_name, "no-" );
strcat( psz_name, p_item->psz_name ); strcat( psz_name, p_item->psz_name );
......
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