String choices lists can now also have a list of text descriptions associated with them.
Added integer choices lists.
* modules/gui/wxwindows/: modified config widgets to use the new config options.
* ALL: updated for the new config options.
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: configuration.h,v 1.31 2003/08/14 19:25:55 sigmunau Exp $
+ * $Id: configuration.h,v 1.32 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
void *p_callback_data;
char **ppsz_list; /* List of possible values for the option */
+ int *pi_list; /* Idem for integers */
+ char **ppsz_list_text; /* Friendly names for list values */
+ int i_list; /* Options list size */
+ vlc_callback_t pf_list_update; /* Callback that updates the list */
vlc_mutex_t *p_lock; /* Lock to use when modifying the config */
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
-VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char *psz_name ) );
+VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) );
+VLC_EXPORT( module_t *, config_FindModule,( vlc_object_t *, const char * ) );
VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
void config_Free ( module_t * );
*****************************************************************************/
#define add_category_hint( text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; p_config[i_config].b_advanced = advc; }
#define add_subcategory_hint( text, longtext ) \
- { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; }
#define end_subcategory_hint \
- { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; }
#define add_usage_hint( text ) \
- { static module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; }
#define add_string( name, psz_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value }; tmp.b_advanced = advc; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; } i_config++
-#define add_string_from_list( name, psz_value, ppsz_list, p_callback, text, \
- longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, 0, 0, 0, 0, NULL, NULL, ppsz_list }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value }; tmp.b_advanced = advc; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; }
#define add_file( name, psz_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_directory( name, psz_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_DIRECTORY, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_DIRECTORY, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_module( name, psz_caps, psz_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_integer( name, i_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_key( name, i_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_KEY, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_KEY, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_integer_with_range( name, i_value, i_min, i_max, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, i_min, i_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, i_min, i_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_float( name, f_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_float_with_range( name, f_value, f_min, f_max, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, 0, 0, f_min, f_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, 0, 0, f_min, f_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
#define add_bool( name, b_value, p_callback, text, longtext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
-
-/* These should be seldom used. They were added just to provide easy shortcuts
- * for the command line interface */
-#define add_string_with_short( name, ch, psz_value, p_callback, text, ltext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
-#define add_file_with_short( name, ch, psz_value, p_callback, text, ltext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
-#define add_module_with_short( name, ch, psz_caps, psz_value, p_callback, \
- text, ltext, advc) \
- { static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
-#define add_integer_with_short( name, ch, i_value, p_callback, text, ltext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } i_config++
-#define add_float_with_short( name, ch, f_value, p_callback, text, ltext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc;} i_config++
-#define add_bool_with_short( name, ch, b_value, p_callback, text, ltext, advc ) \
- { static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc;} i_config++
+ i_config++; \
+ { static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
+
+/* Modifier macros for the config options (used for fine tuning) */
+#define change_short( ch ) \
+ p_config[i_config].i_short = ch;
+
+#define change_string_list( list, list_text, list_update_func ) \
+ p_config[i_config].i_list = sizeof(list)/sizeof(char *); \
+ p_config[i_config].ppsz_list = list; \
+ p_config[i_config].ppsz_list_text = list_text; \
+ p_config[i_config].pf_list_update = list_update_func;
+
+#define change_integer_list( list, list_text, list_update_func ) \
+ p_config[i_config].i_list = sizeof(list)/sizeof(int); \
+ p_config[i_config].pi_list = list; \
+ p_config[i_config].ppsz_list_text = list_text; \
+ p_config[i_config].pf_list_update = list_update_func;
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.39 2003/10/30 21:44:48 gbazin Exp $
+ * $Id: modules_inner.h,v 1.40 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \
__VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
{ \
- int i_shortcut = 1, i_config = 0; \
+ int i_shortcut = 1, i_config = -1; \
module_config_t p_config[ 130 ]; \
STORE_SYMBOLS; \
p_module->b_submodule = VLC_FALSE; \
} \
{ \
static module_config_t tmp = { CONFIG_HINT_END }; \
- p_config[ i_config ] = tmp; \
+ p_config[ ++i_config ] = tmp; \
} \
config_Duplicate( p_module, p_config ); \
if( p_module->p_config == NULL ) \
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: dvd.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
+ * $Id: dvd.c,v 1.9 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
"libcss.\n" \
"The default method is: key.")
-static char *cssmethod_list[] = { "title", "disc", "key", NULL };
+static char *psz_css_list[] = { "title", "disc", "key" };
+static char *psz_css_list_text[] = { N_("title"), N_("Disc"), N_("Key") };
vlc_module_begin();
int i;
add_usage_hint( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]") );
add_category_hint( N_("dvd"), NULL, VLC_TRUE );
- add_string_from_list( "dvdcss-method", NULL, cssmethod_list, NULL,
- CSSMETHOD_TEXT, CSSMETHOD_LONGTEXT, VLC_TRUE );
+
+ add_string( "dvdcss-method", NULL, NULL, CSSMETHOD_TEXT,
+ CSSMETHOD_LONGTEXT, VLC_TRUE );
+ change_string_list( psz_css_list, psz_css_list_text, 0 );
+
#ifdef GOD_DAMN_DMCA
set_description( _("DVD input (uses libdvdcss if installed)") );
i = 90;
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: file.c,v 1.23 2003/10/25 00:49:13 sam Exp $
+ * $Id: file.c,v 1.24 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
"u16_be", "s16_be", "fixed32", "float32",
- "spdif", NULL };
+ "spdif" };
static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
VLC_FOURCC('s','8',' ',' '),
AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
vlc_module_begin();
add_category_hint( N_("Audio"), NULL, VLC_FALSE );
- add_string_from_list( "audiofile-format", "s16", format_list, NULL,
- FORMAT_TEXT, FORMAT_LONGTEXT, VLC_TRUE );
+ add_string( "audiofile-format", "s16", NULL,
+ FORMAT_TEXT, FORMAT_LONGTEXT, VLC_TRUE );
+ change_string_list( format_list, 0, 0 );
add_file( "audiofile", "audiofile.wav", NULL, FILE_TEXT,
FILE_LONGTEXT, VLC_FALSE );
add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, VLC_TRUE );
* subsdec.c : text subtitles decoder
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: subsdec.c,v 1.4 2003/11/05 00:17:50 hartman Exp $
+ * $Id: subsdec.c,v 1.5 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Samuel Hocevar <sam@zoy.org>
"C99", "JAVA", "UCS-2", "UCS-2BE", "UCS-2LE", "UCS-4", "UCS-4BE", "UCS-4LE", "",
"HZ", "GBK", "GB18030", "JOHAB", "ARMSCII-8",
"Georgian-Academy", "Georgian-PS", "TIS-620", "MuleLao-1", "VISCII", "TCVN",
- "HPROMAN8", "NEXTSTEP", NULL };
+ "HPROMAN8", "NEXTSTEP" };
#endif
+static int pi_justification[] = { 0, 1, 2 };
+static char *ppsz_justification_text[] = {N_("Center"),N_("Left"),N_("Right")};
+
#define ENCODING_TEXT N_("Subtitles text encoding")
#define ENCODING_LONGTEXT N_("Change the encoding used in text subtitles")
#define ALIGN_TEXT N_("Subtitles justification")
-#define ALIGN_LONGTEXT N_("Change the justification of substitles (0=center, 1=left, 2=right)")
+#define ALIGN_LONGTEXT N_("Change the justification of substitles")
vlc_module_begin();
set_description( _("text subtitles decoder") );
set_callbacks( OpenDecoder, NULL );
add_category_hint( N_("Subtitles"), NULL, VLC_FALSE );
- add_integer( "subsdec-align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT, VLC_TRUE );
+ add_integer( "subsdec-align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT,
+ VLC_TRUE );
+ change_integer_list( pi_justification, ppsz_justification_text, 0 );
#if defined(HAVE_ICONV)
- add_string_from_list( "subsdec-encoding", DEFAULT_NAME, ppsz_encodings, NULL, ENCODING_TEXT, ENCODING_LONGTEXT, VLC_FALSE );
+ add_string( "subsdec-encoding", DEFAULT_NAME, NULL,
+ ENCODING_TEXT, ENCODING_LONGTEXT, VLC_FALSE );
+ change_string_list( ppsz_encodings, 0, 0 );
#endif
vlc_module_end();
* geatures.c: control vlc with mouse gestures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: gestures.c,v 1.5 2003/06/22 13:27:41 sigmunau Exp $
+ * $Id: gestures.c,v 1.6 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
#define BUTTON_LONGTEXT N_( \
"the mouse button to be held down during mouse gestures" )
-static char *button_list[] = { "left", "middle", "right", NULL };
+static char *button_list[] = { "left", "middle", "right" };
+static char *button_list_text[] = { N_("Left"), N_("Middle"), N_("Right") };
vlc_module_begin();
add_category_hint( N_( "Gestures" ), NULL, VLC_FALSE );
add_integer( "gestures-threshold", 30, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT, VLC_TRUE );
- add_string_from_list( "gestures-button", "right", button_list, NULL,
- BUTTON_TEXT, BUTTON_LONGTEXT, VLC_FALSE );
+ add_string( "gestures-button", "right", NULL,
+ BUTTON_TEXT, BUTTON_LONGTEXT, VLC_FALSE );
+ change_string_list( button_list, button_list_text, 0 );
set_description( _("mouse gestures control interface") );
set_capability( "interface", 0 );
* mkv.cpp : matroska demuxer
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mkv.cpp,v 1.36 2003/11/05 00:17:50 hartman Exp $
+ * $Id: mkv.cpp,v 1.37 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
!strcmp( tk.psz_codec, "S_ASS" ))
{
tk.i_codec = VLC_FOURCC( 's', 's', 'a', ' ' );
- tk.p_es->p_demux_data = malloc( sizeof( subtitle_data_t ) );
+ tk.p_es->p_demux_data = (es_sys_t *)malloc( sizeof( subtitle_data_t ) );
tk.p_es->p_demux_data->psz_header = strdup( (char *)tk.p_extra_data );
}
else if( !strcmp( tk.psz_codec, "S_VOBSUB" ) )
* sub.c
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
- * $Id: sub.c,v 1.34 2003/11/05 00:17:50 hartman Exp $
+ * $Id: sub.c,v 1.35 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static void sub_fix( subtitle_demux_t *p_sub );
-static char *ppsz_sub_type[] = { "auto", "microdvd", "subrip", "ssa1", "ssa2-4",
- "vplayer", "sami", "vobsub", NULL };
-
+static char *ppsz_sub_type[] = { "auto", "microdvd", "subrip", "ssa1",
+ "ssa2-4", "vplayer", "sami", "vobsub" };
/*****************************************************************************
* Module descriptor
add_integer( "sub-delay", 0, NULL,
"Delay subtitles (in 1/10s)",
SUB_DELAY_LONGTEXT, VLC_TRUE );
- add_string_from_list( "sub-type", "auto", ppsz_sub_type, NULL,
- "subtitles type",
- SUB_TYPE_LONGTEXT, VLC_TRUE );
+ add_string( "sub-type", "auto", NULL, "subtitles type",
+ SUB_TYPE_LONGTEXT, VLC_TRUE );
+ change_string_list( ppsz_sub_type, 0, 0 );
set_callbacks( Open, NULL );
vlc_module_end();
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: BeOS.cpp,v 1.12 2003/06/17 16:09:16 gbazin Exp $
+ * $Id: BeOS.cpp,v 1.13 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
- * Stephan Aßmus <stippi@yellowbites.com>
+ * Stephan AÃ\83Â\9fmus <stippi@yellowbites.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-static char * ppsz_screenshotformat[] = { "TGA", "PPM", "PNG", "JPEG", "BMP", NULL };
+static char * ppsz_screenshotformat[] = { "TGA", "PPM", "PNG", "JPEG", "BMP" };
vlc_module_begin();
add_bool( "beos-dvdmenus", 0, NULL, "Use DVD Menus", "", VLC_TRUE );
add_string( "beos-screenshotpath", "/boot/home/", NULL, "Screenshot Path", "", VLC_TRUE );
- add_string_from_list( "beos-screenshotformat", "PNG", ppsz_screenshotformat, NULL, "Screenshot Format", "", VLC_TRUE );
+ add_string( "beos-screenshotformat", "PNG", NULL, "Screenshot Format",
+ "", VLC_TRUE );
+ change_string_list( ppsz_screenshotformat, 0, 0 );
set_description( _("BeOS standard API interface") );
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
* preferences_widgets.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences_widgets.cpp,v 1.9 2003/11/02 22:16:32 gbazin Exp $
+ * $Id: preferences_widgets.cpp,v 1.10 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
break;
case CONFIG_ITEM_STRING:
- if( !p_item->ppsz_list )
+ if( !p_item->i_list )
{
p_control = new StringConfigControl( p_item, parent );
}
break;
case CONFIG_ITEM_INTEGER:
- if( p_item->i_min != 0 || p_item->i_max != 0 )
+ if( p_item->i_list )
+ {
+ p_control = new IntegerListConfigControl( p_item, parent );
+ }
+ else if( p_item->i_min != 0 || p_item->i_max != 0 )
{
p_control = new RangedIntConfigControl( p_item, parent );
}
{
label = new wxStaticText(this, -1, wxU(p_item->psz_text));
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
- combo = new wxComboBox( this, -1, wxU(p_item->psz_value),
+ combo = new wxComboBox( this, -1, wxT(""),
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
/* build a list of available options */
- for( int i_index = 0; p_item->ppsz_list[i_index];
- i_index++ )
+ for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
- combo->Append( wxU(p_item->ppsz_list[i_index]) );
+ combo->Append( ( p_item->ppsz_list_text &&
+ p_item->ppsz_list_text[i_index] ) ?
+ wxU(p_item->ppsz_list_text[i_index]) :
+ wxU(p_item->ppsz_list[i_index]) );
+ combo->SetClientData( i_index, (void *)p_item->ppsz_list[i_index] );
if( p_item->psz_value && !strcmp( p_item->psz_value,
p_item->ppsz_list[i_index] ) )
+ {
combo->SetSelection( i_index );
+ combo->SetValue( ( p_item->ppsz_list_text &&
+ p_item->ppsz_list_text[i_index] ) ?
+ wxU(p_item->ppsz_list_text[i_index]) :
+ wxU(p_item->ppsz_list[i_index]) );
+ }
}
- if( p_item->psz_value )
- combo->SetValue( wxU(p_item->psz_value) );
combo->SetToolTip( wxU(p_item->psz_longtext) );
sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
sizer->Layout();
wxString StringListConfigControl::GetPszValue()
{
- return combo->GetStringSelection();
+ int selected = combo->GetSelection();
+ if( selected != -1 )
+ {
+ return (char *)combo->GetClientData( selected );
+ }
+ return wxString();
}
/*****************************************************************************
return spin->GetValue();
}
+/*****************************************************************************
+ * IntegerListConfigControl implementation
+ *****************************************************************************/
+IntegerListConfigControl::IntegerListConfigControl( module_config_t *p_item,
+ wxWindow *parent )
+ : ConfigControl( p_item, parent )
+{
+ label = new wxStaticText(this, -1, wxU(p_item->psz_text));
+ sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+ combo = new wxComboBox( this, -1, wxT(""),
+ wxDefaultPosition, wxDefaultSize,
+ 0, NULL, wxCB_READONLY );
+
+ /* build a list of available options */
+ for( int i_index = 0; i_index < p_item->i_list; i_index++ )
+ {
+ combo->Append( ( p_item->ppsz_list_text &&
+ p_item->ppsz_list_text[i_index] ) ?
+ wxU(p_item->ppsz_list_text[i_index]) :
+ wxString::Format(wxT("%i"),
+ p_item->pi_list[i_index]) );
+ combo->SetClientData( i_index, (void *)p_item->pi_list[i_index] );
+ if( p_item->i_value == p_item->pi_list[i_index] )
+ {
+ combo->SetSelection( i_index );
+ combo->SetValue( ( p_item->ppsz_list_text &&
+ p_item->ppsz_list_text[i_index] ) ?
+ wxU(p_item->ppsz_list_text[i_index]) :
+ wxString::Format(wxT("%i"),
+ p_item->pi_list[i_index]) );
+ }
+ }
+
+ combo->SetToolTip( wxU(p_item->psz_longtext) );
+ sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+ sizer->Layout();
+ this->SetSizerAndFit( sizer );
+}
+
+IntegerListConfigControl::~IntegerListConfigControl()
+{
+ ;
+}
+
+int IntegerListConfigControl::GetIntValue()
+{
+ int selected = combo->GetSelection();
+ if( selected != -1 )
+ {
+ return (int)combo->GetClientData( selected );
+ }
+ return -1;
+}
+
/*****************************************************************************
* RangedIntConfigControl implementation
*****************************************************************************/
* preferences_widgets.h : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
- * $Id: preferences_widgets.h,v 1.3 2003/10/20 12:25:22 gbazin Exp $
+ * $Id: preferences_widgets.h,v 1.4 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
wxSpinCtrl *spin;
};
+class IntegerListConfigControl: public ConfigControl
+{
+public:
+ IntegerListConfigControl( module_config_t *p_item, wxWindow *parent );
+ ~IntegerListConfigControl();
+ virtual int GetIntValue();
+private:
+ wxComboBox *combo;
+};
+
class RangedIntConfigControl: public ConfigControl
{
public:
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
- * $Id: freetype.c,v 1.30 2003/10/29 12:23:50 gbazin Exp $
+ * $Id: freetype.c,v 1.31 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
#define FONTSIZE_TEXT N_("Font size")
#define FONTSIZE_LONGTEXT N_("The size of the fonts used by the osd module" )
-static char *ppsz_sizes[] = { "smaller", "small", "normal", "large", "larger", NULL};
+static char *ppsz_sizes[] = { "smaller", "small", "normal", "large", "larger"};
+static char *ppsz_sizes_text[] = { N_("Smaller"), N_("Small"), N_("Normal"),
+ N_("Large"), N_("Larger") };
vlc_module_begin();
add_category_hint( N_("Fonts"), NULL, VLC_FALSE );
add_file( "freetype-font", DEFAULT_FONT, NULL, FONT_TEXT, FONT_LONGTEXT, VLC_FALSE );
add_integer( "freetype-fontsize", 16, NULL, FONTSIZE_TEXT, FONTSIZE_LONGTEXT, VLC_TRUE );
- add_string_from_list( "freetype-rel-fontsize", "normal", ppsz_sizes, NULL, FONTSIZE_TEXT, FONTSIZE_LONGTEXT, VLC_FALSE );
+ add_string( "freetype-rel-fontsize", "normal", NULL, FONTSIZE_TEXT,
+ FONTSIZE_LONGTEXT, VLC_FALSE );
+ change_string_list( ppsz_sizes, ppsz_sizes_text, 0 );
set_description( _("freetype2 font renderer") );
set_capability( "text renderer", 100 );
add_shortcut( "text" );
* logger.c : file logging plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: logger.c,v 1.8 2003/05/15 22:27:37 massiot Exp $
+ * $Id: logger.c,v 1.9 2003/11/05 00:39:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-static char *mode_list[] = { "text", "html", NULL };
+static char *mode_list[] = { "text", "html" };
+static char *mode_list_text[] = { N_("Text"), N_("Html") };
+
#define LOGMODE_TEXT N_("Log format")
#define LOGMODE_LONGTEXT N_("Specify the log format. Available choices are \"text\" (default) and \"html\"")
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL, VLC_FALSE );
add_file( "logfile", NULL, NULL, N_("log filename"), N_("Specify the log filename."), VLC_FALSE );
- add_string_from_list( "logmode", "text", mode_list, NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT, VLC_FALSE );
+ add_string( "logmode", "text", NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT,
+ VLC_FALSE );
+ change_string_list( mode_list, mode_list_text, 0 );
set_description( _("file logging interface") );
set_capability( "interface", 0 );
set_callbacks( Open, Close );
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: deinterlace.c,v 1.15 2003/10/15 22:49:48 gbazin Exp $
+ * $Id: deinterlace.c,v 1.16 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define MODE_TEXT N_("Deinterlace mode")
#define MODE_LONGTEXT N_("You can choose the default deinterlace mode")
-static char *mode_list[] = { "discard", "blend", "mean", "bob", "linear", NULL };
+static char *mode_list[] = { "discard", "blend", "mean", "bob", "linear" };
+static char *mode_list_text[] = { N_("discard"), N_("Blend"), N_("Mean"),
+ N_("Bob"), N_("Linear") };
vlc_module_begin();
add_category_hint( N_("Deinterlace"), NULL, VLC_FALSE );
- add_string_from_list( "deinterlace-mode", "discard", mode_list, NULL,
- MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
+ add_string( "deinterlace-mode", "discard", NULL, MODE_TEXT,
+ MODE_LONGTEXT, VLC_FALSE );
+ change_string_list( mode_list, mode_list_text, 0 );
set_description( _("video deinterlacing filter") );
set_capability( "video filter", 0 );
add_shortcut( "deinterlace" );
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: distort.c,v 1.11 2003/10/15 22:49:48 gbazin Exp $
+ * $Id: distort.c,v 1.12 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define MODE_TEXT N_("Distort mode")
#define MODE_LONGTEXT N_("Distort mode, one of \"wave\" and \"ripple\"")
-static char *mode_list[] = { "wave", "ripple", NULL };
+static char *mode_list[] = { "wave", "ripple" };
+static char *mode_list_text[] = { N_("Wave"), N_("Ripple") };
vlc_module_begin();
add_category_hint( N_("Distort"), NULL, VLC_FALSE );
- add_string_from_list( "distort-mode", "wave", mode_list, NULL,
- MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
+ add_string( "distort-mode", "wave", NULL, MODE_TEXT, MODE_LONGTEXT,
+ VLC_FALSE );
+ change_string_list( mode_list, mode_list_text, 0 );
set_description( _("miscellaneous distort video effects filter") );
set_capability( "video filter", 0 );
add_shortcut( "distort" );
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: transform.c,v 1.14 2003/10/15 22:49:48 gbazin Exp $
+ * $Id: transform.c,v 1.15 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define TYPE_TEXT N_("Transform type")
#define TYPE_LONGTEXT N_("One of '90', '180', '270', 'hflip' and 'vflip'")
-static char *type_list[] = { "90", "180", "270", "hflip", "vflip", NULL };
+static char *type_list[] = { "90", "180", "270", "hflip", "vflip" };
+static char *type_list_text[] = { N_("Rotate by 90°"), N_("Rotate by 1800"),
+ N_("Rotate by 270°"), N_("Flip horizontally"), N_("Flip vertically") };
vlc_module_begin();
add_category_hint( N_("Miscellaneous"), NULL, VLC_FALSE );
- add_string_from_list( "transform-type", "90", type_list, NULL,
+ add_string( "transform-type", "90", NULL,
TYPE_TEXT, TYPE_LONGTEXT, VLC_FALSE);
+ change_string_list( type_list, type_list_text, 0);
set_description( _("video transformation filter") );
set_capability( "video filter", 0 );
add_shortcut( "transform" );
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.100 2003/10/30 22:34:48 hartman Exp $
+ * $Id: libvlc.h,v 1.101 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#define Nothing here, this is just to prevent update-po from being stupid
#include "vlc_keys.h"
-static char *ppsz_language[] = { "auto", "en", "en_GB", "es", "de", "fr", "it", "ja",
- "nl", "no", "pl", "pt_BR", "ru", "sv", NULL };
+static char *ppsz_language[] =
+{ "auto", "en", "en_GB", "es", "de", "fr", "it", "ja",
+ "nl", "no", "pl", "pt_BR", "ru", "sv" };
+static char *ppsz_language_text[] =
+{ N_("Auto"), N_("English US"), N_("English GB"), N_("Spanish"), N_("German"),
+ N_("French"), N_("Italian"), N_("Japanese"), N_("Dutch"), N_("Norwegian"),
+ N_("Polish"), N_("Portugese BR"), N_("Russian"), N_("Swedish") };
/*****************************************************************************
* Configuration options for the main program. Each module will also separatly
vlc_module_begin();
/* Interface options */
add_category_hint( N_("Interface"), INTF_CAT_LONGTEXT , VLC_FALSE );
- add_module_with_short( "intf", 'I', "interface", NULL, NULL,
- INTF_TEXT, INTF_LONGTEXT, VLC_TRUE );
+ add_module( "intf", "interface", NULL, NULL, INTF_TEXT,
+ INTF_LONGTEXT, VLC_TRUE );
+ change_short('I');
add_string( "extraintf", NULL, NULL, EXTRAINTF_TEXT,
EXTRAINTF_LONGTEXT, VLC_FALSE );
- add_integer_with_short( "verbose", 'v', 0, NULL,
- VERBOSE_TEXT, VERBOSE_LONGTEXT, VLC_FALSE );
- add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT,
- QUIET_LONGTEXT, VLC_TRUE );
- add_string_from_list( "language", "auto", ppsz_language, NULL,
- LANGUAGE_TEXT, LANGUAGE_LONGTEXT, VLC_FALSE );
+ add_integer( "verbose", 0, NULL, VERBOSE_TEXT, VERBOSE_LONGTEXT,
+ VLC_FALSE );
+ change_short('v');
+ add_bool( "quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_TRUE );
+ change_short('q');
+ add_string( "language", "auto", NULL, LANGUAGE_TEXT, LANGUAGE_LONGTEXT,
+ VLC_FALSE );
+ change_string_list( ppsz_language, ppsz_language_text, 0 );
add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
add_bool( "advanced", 0, NULL, ADVANCED_TEXT,
ADVANCED_LONGTEXT, VLC_FALSE );
/* Audio options */
add_category_hint( N_("Audio"), AOUT_CAT_LONGTEXT , VLC_FALSE );
- add_module_with_short( "aout", 'A', "audio output", NULL, NULL,
- AOUT_TEXT, AOUT_LONGTEXT, VLC_TRUE);
+ add_module( "aout", "audio output", NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT,
+ VLC_TRUE );
+ change_short('A');
add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, VLC_FALSE );
add_integer_with_range( "volume", AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX, NULL, VOLUME_TEXT,
/* Video options */
add_category_hint( N_("Video"), VOUT_CAT_LONGTEXT , VLC_FALSE );
- add_module_with_short( "vout", 'V', "video output", NULL, NULL,
- VOUT_TEXT, VOUT_LONGTEXT, VLC_TRUE );
+ add_module( "vout", "video output", NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT,
+ VLC_TRUE );
+ change_short('V');
add_bool( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT, VLC_TRUE );
add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE );
add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, VLC_FALSE );
add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, VLC_FALSE );
- add_bool_with_short( "ipv6", '6', 0, NULL, IPV6_TEXT, IPV6_LONGTEXT, VLC_FALSE );
- add_bool_with_short( "ipv4", '4', 0, NULL, IPV4_TEXT, IPV4_LONGTEXT, VLC_FALSE );
+ add_bool( "ipv6", 0, NULL, IPV6_TEXT, IPV6_LONGTEXT, VLC_FALSE );
+ change_short('6');
+ add_bool( "ipv4", 0, NULL, IPV4_TEXT, IPV4_LONGTEXT, VLC_FALSE );
+ change_short('4');
/* Decoder options */
add_category_hint( N_("Decoders"), CODEC_CAT_LONGTEXT , VLC_TRUE );
/* Playlist options */
add_category_hint( N_("Playlist"), PLAYLIST_CAT_LONGTEXT , VLC_FALSE );
- add_bool_with_short( "random", 'Z', 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
- add_bool_with_short( "loop", 'L', 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
- add_bool_with_short( "repeat", 'R', 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
+ add_bool( "random", 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
+ change_short('Z');
+ add_bool( "loop", 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
+ change_short('L');
+ add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
+ change_short('R');
/* Misc options */
add_category_hint( N_("Miscellaneous"), MISC_CAT_LONGTEXT, VLC_TRUE );
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.66 2003/10/29 01:33:27 gbazin Exp $
+ * $Id: configuration.c,v 1.67 2003/11/05 00:39:17 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
return NULL;
}
+/*****************************************************************************
+ * config_FindModule: find a specific module structure.
+ *****************************************************************************/
+module_t *config_FindModule( vlc_object_t *p_this, const char *psz_name )
+{
+ vlc_list_t *p_list;
+ module_t *p_module, *p_result = NULL;
+ int i_index;
+
+ if( !psz_name ) return NULL;
+
+ p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
+
+ for( i_index = 0; i_index < p_list->i_count; i_index++ )
+ {
+ p_module = (module_t *)p_list->p_values[i_index].p_object;
+ if( !strcmp( p_module->psz_object_name, psz_name ) )
+ {
+ p_result = p_module;
+ break;
+ }
+ }
+
+ vlc_list_release( p_list );
+
+ return p_result;
+}
+
/*****************************************************************************
* config_Duplicate: creates a duplicate of a module's configuration data.
*****************************************************************************
/* Do the duplication job */
for( i = 0; i < i_lines ; i++ )
{
- p_module->p_config[i].i_type = p_orig[i].i_type;
- p_module->p_config[i].i_short = p_orig[i].i_short;
- p_module->p_config[i].i_value = p_orig[i].i_value;
- p_module->p_config[i].i_value_orig = p_orig[i].i_value;
- p_module->p_config[i].i_min = p_orig[i].i_min;
- p_module->p_config[i].i_max = p_orig[i].i_max;
- p_module->p_config[i].f_value = p_orig[i].f_value;
- p_module->p_config[i].f_value_orig = p_orig[i].f_value;
- p_module->p_config[i].f_min = p_orig[i].f_min;
- p_module->p_config[i].f_max = p_orig[i].f_max;
- p_module->p_config[i].b_dirty = p_orig[i].b_dirty;
- p_module->p_config[i].b_advanced = p_orig[i].b_advanced;
+ p_module->p_config[i] = p_orig[i];
p_module->p_config[i].psz_type = p_orig[i].psz_type ?
strdup( p_orig[i].psz_type ) : NULL;
p_module->p_config[i].p_lock = &p_module->object_lock;
/* duplicate the string list */
- p_module->p_config[i].ppsz_list = NULL;
- if( p_orig[i].ppsz_list )
+ if( p_orig[i].i_list )
{
- for( j = 0; p_orig[i].ppsz_list[j]; j++ );
- p_module->p_config[i].ppsz_list = malloc( (j+1) *sizeof(char *) );
- if( p_module->p_config[i].ppsz_list )
+ if( p_orig[i].ppsz_list )
+ {
+ p_module->p_config[i].ppsz_list =
+ malloc( (p_orig[i].i_list + 1) * sizeof(char *) );
+ if( p_module->p_config[i].ppsz_list )
+ {
+ for( j = 0; j < p_orig[i].i_list; j++ )
+ p_module->p_config[i].ppsz_list[j] =
+ strdup( p_orig[i].ppsz_list[j] );
+ p_module->p_config[i].ppsz_list[j] = NULL;
+ }
+ }
+ if( p_orig[i].ppsz_list_text )
{
- for( j = 0; p_orig[i].ppsz_list[j]; j++ )
- p_module->p_config[i].ppsz_list[j] =
- strdup( p_orig[i].ppsz_list[j] );
+ p_module->p_config[i].ppsz_list_text =
+ malloc( (p_orig[i].i_list + 1) * sizeof(char *) );
+ if( p_module->p_config[i].ppsz_list_text )
+ {
+ for( j = 0; j < p_orig[i].i_list; j++ )
+ p_module->p_config[i].ppsz_list_text[j] =
+ strdup( _(p_orig[i].ppsz_list_text[j]) );
+ p_module->p_config[i].ppsz_list_text[j] = NULL;
+ }
+ }
+ if( p_orig[i].pi_list )
+ {
+ p_module->p_config[i].pi_list =
+ malloc( (p_orig[i].i_list + 1) * sizeof(int) );
+ if( p_module->p_config[i].pi_list )
+ {
+ for( j = 0; j < p_orig[i].i_list; j++ )
+ p_module->p_config[i].pi_list[j] =
+ p_orig[i].pi_list[j];
+ }
}
- p_module->p_config[i].ppsz_list[j] = NULL;
}
p_module->p_config[i].pf_callback = p_orig[i].pf_callback;
if( p_item->psz_value_orig )
free( p_item->psz_value_orig );
- if( p_item->ppsz_list )
+ if( p_item->i_list )
{
- for( i = 0; p_item->ppsz_list[i]; i++ )
- free(p_item->ppsz_list[i]);
- free( p_item->ppsz_list );
+ for( i = 0; i < p_item->i_list; i++ )
+ {
+ if( p_item->ppsz_list && p_item->ppsz_list[i] )
+ free( p_item->ppsz_list[i] );
+ if( p_item->ppsz_list_text && p_item->ppsz_list_text[i] )
+ free( p_item->ppsz_list_text[i] );
+ }
+ if( p_item->ppsz_list ) free( p_item->ppsz_list );
+ if( p_item->ppsz_list_text ) free( p_item->ppsz_list_text );
+ if( p_item->pi_list ) free( p_item->pi_list );
}
}