Commit f716766a authored by Olivier Teulière's avatar Olivier Teulière

* src/misc/objects.c: vlc_list_find now returns a (vlc_list_t *)

   instead of a (vlc_list_t); this modification was needed because BCB
   doesn't like at all when a function (compiled with mingw32) returns
   a struct...
 * ALL: modified the files to take this change into account
 * modules/gui/win32/menu.cpp: enabled the "Add interface" command
parent 5b84049b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc_objects.h: vlc_object_t definition. * vlc_objects.h: vlc_object_t definition.
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: vlc_objects.h,v 1.14 2002/12/13 01:56:29 gbazin Exp $ * $Id: vlc_objects.h,v 1.15 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -61,7 +61,7 @@ VLC_EXPORT( void *, __vlc_object_get, ( vlc_object_t *, int ) ); ...@@ -61,7 +61,7 @@ VLC_EXPORT( void *, __vlc_object_get, ( vlc_object_t *, int ) );
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) ); VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, __vlc_object_yield, ( vlc_object_t * ) ); VLC_EXPORT( void, __vlc_object_yield, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) ); VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
VLC_EXPORT( vlc_list_t, __vlc_list_find, ( vlc_object_t *, int, int ) ); VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) ); VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
#define vlc_object_create(a,b) \ #define vlc_object_create(a,b) \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.27 2003/01/17 18:19:11 jpsaman Exp $ * $Id: familiar.c,v 1.28 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -261,11 +261,12 @@ void GtkAutoPlayFile( vlc_object_t *p_this ) ...@@ -261,11 +261,12 @@ void GtkAutoPlayFile( vlc_object_t *p_this )
GtkWidget *cbautoplay; GtkWidget *cbautoplay;
intf_thread_t *p_intf; intf_thread_t *p_intf;
int i_index; int i_index;
vlc_list_t list = vlc_list_find( p_this, VLC_OBJECT_INTF, FIND_ANYWHERE ); vlc_list_t *p_list = vlc_list_find( p_this, VLC_OBJECT_INTF,
FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_intf = (intf_thread_t *)list.p_values[i_index].p_object ; p_intf = (intf_thread_t *)p_list->p_values[i_index].p_object ;
if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) ) if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) )
{ {
...@@ -286,7 +287,7 @@ void GtkAutoPlayFile( vlc_object_t *p_this ) ...@@ -286,7 +287,7 @@ void GtkAutoPlayFile( vlc_object_t *p_this )
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( cbautoplay ), gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( cbautoplay ),
p_intf->p_sys->b_autoplayfile ); p_intf->p_sys->b_autoplayfile );
} }
vlc_list_release( &list ); vlc_list_release( p_list );
} }
/* following functions are local */ /* following functions are local */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* display.c: Gtk+ tools for main interface * display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: display.c,v 1.7 2003/01/20 20:07:06 fenrir Exp $ * $Id: display.c,v 1.8 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -242,14 +242,14 @@ void E_(GtkHideTooltips)( vlc_object_t *p_this ) ...@@ -242,14 +242,14 @@ void E_(GtkHideTooltips)( vlc_object_t *p_this )
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
int i_index; int i_index;
vlc_list_t list = vlc_list_find( p_this, VLC_OBJECT_INTF, vlc_list_t *p_list = vlc_list_find( p_this, VLC_OBJECT_INTF,
FIND_ANYWHERE ); FIND_ANYWHERE );
vlc_bool_t b_enable = config_GetInt( p_this, "gnome-tooltips" ); vlc_bool_t b_enable = config_GetInt( p_this, "gnome-tooltips" );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_intf = (intf_thread_t *)list.p_values[i_index].p_object ; p_intf = (intf_thread_t *)p_list->p_values[i_index].p_object ;
if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) ) if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) )
{ {
...@@ -266,7 +266,7 @@ void E_(GtkHideTooltips)( vlc_object_t *p_this ) ...@@ -266,7 +266,7 @@ void E_(GtkHideTooltips)( vlc_object_t *p_this )
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
} }
#ifdef MODULE_NAME_IS_gnome #ifdef MODULE_NAME_IS_gnome
...@@ -282,16 +282,16 @@ void GtkHideToolbarText( vlc_object_t *p_this ) ...@@ -282,16 +282,16 @@ void GtkHideToolbarText( vlc_object_t *p_this )
GtkToolbar * p_toolbar; GtkToolbar * p_toolbar;
intf_thread_t *p_intf; intf_thread_t *p_intf;
int i_index; int i_index;
vlc_list_t list = vlc_list_find( p_this, VLC_OBJECT_INTF, vlc_list_t *p_list = vlc_list_find( p_this, VLC_OBJECT_INTF,
FIND_ANYWHERE ); FIND_ANYWHERE );
style = config_GetInt( p_this, "gnome-toolbartext" ) style = config_GetInt( p_this, "gnome-toolbartext" )
? GTK_TOOLBAR_BOTH ? GTK_TOOLBAR_BOTH
: GTK_TOOLBAR_ICONS; : GTK_TOOLBAR_ICONS;
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_intf = (intf_thread_t *)list.p_values[i_index].p_object ; p_intf = (intf_thread_t *)p_list->p_values[i_index].p_object ;
if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) ) if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) )
{ {
...@@ -303,6 +303,6 @@ void GtkHideToolbarText( vlc_object_t *p_this ) ...@@ -303,6 +303,6 @@ void GtkHideToolbarText( vlc_object_t *p_this )
gtk_toolbar_set_style( p_toolbar, style ); gtk_toolbar_set_style( p_toolbar, style );
} }
vlc_list_release( &list ); vlc_list_release( p_list );
} }
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_preferences.c: functions to handle the preferences dialog box. * gtk_preferences.c: functions to handle the preferences dialog box.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: preferences.c,v 1.7 2003/01/06 00:37:30 garf Exp $ * $Id: preferences.c,v 1.8 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Loc Minier <lool@via.ecp.fr> * Loc Minier <lool@via.ecp.fr>
...@@ -121,7 +121,7 @@ static void GtkCreateConfigDialog( char *psz_module_name, ...@@ -121,7 +121,7 @@ static void GtkCreateConfigDialog( char *psz_module_name,
intf_thread_t *p_intf ) intf_thread_t *p_intf )
{ {
module_t *p_parser = NULL; module_t *p_parser = NULL;
vlc_list_t list; vlc_list_t *p_list;
module_config_t *p_item; module_config_t *p_item;
int i_index; int i_index;
...@@ -179,11 +179,11 @@ static void GtkCreateConfigDialog( char *psz_module_name, ...@@ -179,11 +179,11 @@ static void GtkCreateConfigDialog( char *psz_module_name,
/* Look for the selected module */ /* Look for the selected module */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name if( psz_module_name
&& !strcmp( psz_module_name, p_parser->psz_object_name ) ) && !strcmp( psz_module_name, p_parser->psz_object_name ) )
...@@ -192,9 +192,9 @@ static void GtkCreateConfigDialog( char *psz_module_name, ...@@ -192,9 +192,9 @@ static void GtkCreateConfigDialog( char *psz_module_name,
} }
} }
if( !p_parser || i_index == list.i_count ) if( !p_parser || i_index == p_list->i_count )
{ {
vlc_list_release( &list ); vlc_list_release( p_list );
return; return;
} }
...@@ -334,9 +334,9 @@ static void GtkCreateConfigDialog( char *psz_module_name, ...@@ -334,9 +334,9 @@ static void GtkCreateConfigDialog( char *psz_module_name,
{ {
gchar * entry[2]; gchar * entry[2];
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, if( !strcmp( p_parser->psz_capability,
p_item->psz_type ) ) p_item->psz_type ) )
...@@ -560,7 +560,7 @@ static void GtkCreateConfigDialog( char *psz_module_name, ...@@ -560,7 +560,7 @@ static void GtkCreateConfigDialog( char *psz_module_name,
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item->i_type != CONFIG_HINT_END && p_item++ );
vlc_list_release( &list ); vlc_list_release( p_list );
#ifndef MODULE_NAME_IS_gnome #ifndef MODULE_NAME_IS_gnome
/* Now let's add the action buttons at the bottom of the page */ /* Now let's add the action buttons at the bottom of the page */
...@@ -704,7 +704,7 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column, ...@@ -704,7 +704,7 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column,
intf_thread_t *p_intf; intf_thread_t *p_intf;
GtkWidget *config_button; GtkWidget *config_button;
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
char *psz_name; char *psz_name;
int i_index; int i_index;
...@@ -717,11 +717,11 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column, ...@@ -717,11 +717,11 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column,
} }
/* look for module 'psz_name' */ /* look for module 'psz_name' */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_object_name, psz_name ) ) if( !strcmp( p_parser->psz_object_name, psz_name ) )
{ {
...@@ -738,7 +738,7 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column, ...@@ -738,7 +738,7 @@ static void GtkModuleHighlighted( GtkCList *module_clist, int row, int column,
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
} }
/**************************************************************************** /****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp: preferences window for the kde gui * preferences.cpp: preferences window for the kde gui
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: preferences.cpp,v 1.10 2002/12/17 09:54:32 sam Exp $ * $Id: preferences.cpp,v 1.11 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002
* *
...@@ -53,7 +53,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -53,7 +53,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
"vlc preferences", true, false, "Save") "vlc preferences", true, false, "Save")
{ {
module_t *p_parser = NULL; module_t *p_parser = NULL;
vlc_list_t list; vlc_list_t *p_list;
module_config_t *p_item; module_config_t *p_item;
int i_index; int i_index;
QVBox *category_table = NULL; QVBox *category_table = NULL;
...@@ -62,12 +62,12 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -62,12 +62,12 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
this->p_intf = p_intf; this->p_intf = p_intf;
/* List all modules */ /* List all modules */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
/* Look for the selected module */ /* Look for the selected module */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name if( psz_module_name
&& !strcmp( psz_module_name, p_parser->psz_object_name ) ) && !strcmp( psz_module_name, p_parser->psz_object_name ) )
...@@ -76,9 +76,9 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -76,9 +76,9 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
} }
} }
if( !p_parser || i_index == list.i_count ) if( !p_parser || i_index == p_list->i_count )
{ {
vlc_list_release( &list ); vlc_list_release( p_list );
return; return;
} }
...@@ -130,9 +130,9 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -130,9 +130,9 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
/* build a list of available plugins */ /* build a list of available plugins */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, if( !strcmp( p_parser->psz_capability,
p_item->psz_type ) ) p_item->psz_type ) )
...@@ -251,7 +251,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -251,7 +251,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
} }
while( p_item->i_type != CONFIG_HINT_END ); while( p_item->i_type != CONFIG_HINT_END );
vlc_list_release( &list ); vlc_list_release( p_list );
exec(); exec();
} }
...@@ -269,24 +269,24 @@ KPreferences::~KPreferences() ...@@ -269,24 +269,24 @@ KPreferences::~KPreferences()
bool KPreferences::isConfigureable(QString module) bool KPreferences::isConfigureable(QString module)
{ {
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
int i_index; int i_index;
list = vlc_list_find( this->p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( this->p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !module.compare( p_parser->psz_object_name ) ) if( !module.compare( p_parser->psz_object_name ) )
{ {
bool ret = p_parser->i_config_items != 0; bool ret = p_parser->i_config_items != 0;
vlc_list_release( &list ); vlc_list_release( p_list );
return ret; return ret;
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
return false; return false;
} }
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* prefs.m: MacOS X plugin for vlc * prefs.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: prefs.m,v 1.8 2003/01/27 00:08:31 jlj Exp $ * $Id: prefs.m,v 1.9 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#import "prefs.h" #import "prefs.h"
/***************************************************************************** /*****************************************************************************
* VLCPrefs implementation * VLCPrefs implementation
*****************************************************************************/ *****************************************************************************/
@implementation VLCPrefs @implementation VLCPrefs
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
{ {
p_intf = [NSApp getIntf]; p_intf = [NSApp getIntf];
o_pref_panels = [[NSMutableDictionary alloc] init]; o_pref_panels = [[NSMutableDictionary alloc] init];
o_toolbars = [[NSMutableDictionary alloc] init]; o_toolbars = [[NSMutableDictionary alloc] init];
o_scroll_views = [[NSMutableDictionary alloc] init]; o_scroll_views = [[NSMutableDictionary alloc] init];
o_panel_views = [[NSMutableDictionary alloc] init]; o_panel_views = [[NSMutableDictionary alloc] init];
...@@ -101,28 +101,28 @@ ...@@ -101,28 +101,28 @@
- (BOOL)hasPrefs:(NSString *)o_module_name - (BOOL)hasPrefs:(NSString *)o_module_name
{ {
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
char *psz_module_name; char *psz_module_name;
int i_index; int i_index;
psz_module_name = (char *)[o_module_name lossyCString]; psz_module_name = (char *)[o_module_name lossyCString];
/* look for module */ /* look for module */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_object_name, psz_module_name ) ) if( !strcmp( p_parser->psz_object_name, psz_module_name ) )
{ {
BOOL b_has_prefs = p_parser->i_config_items != 0; BOOL b_has_prefs = p_parser->i_config_items != 0;
vlc_list_release( &list ); vlc_list_release( p_list );
return( b_has_prefs ); return( b_has_prefs );
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
return( NO ); return( NO );
} }
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
int i_module_tag; int i_module_tag;
module_t *p_parser = NULL; module_t *p_parser = NULL;
vlc_list_t list; vlc_list_t *p_list;
module_config_t *p_item; module_config_t *p_item;
char *psz_module_name; char *psz_module_name;
int i_index; int i_index;
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
NSView *o_panel_view; /* panel view */ NSView *o_panel_view; /* panel view */
NSToolbar *o_toolbar; /* panel toolbar */ NSToolbar *o_toolbar; /* panel toolbar */
NSMutableDictionary *o_tb_items; /* panel toolbar items */ NSMutableDictionary *o_tb_items; /* panel toolbar items */
NSScrollView *o_scroll_view; /* panel scroll view */ NSScrollView *o_scroll_view; /* panel scroll view */
NSRect s_scroll_rc; /* panel scroll view rect */ NSRect s_scroll_rc; /* panel scroll view rect */
NSMutableDictionary *o_views; /* panel scroll view docviews */ NSMutableDictionary *o_views; /* panel scroll view docviews */
...@@ -160,16 +160,16 @@ ...@@ -160,16 +160,16 @@
[o_panel center]; [o_panel center];
[o_panel makeKeyAndOrderFront: nil]; [o_panel makeKeyAndOrderFront: nil];
return; return;
} }
psz_module_name = (char *)[o_module_name lossyCString]; psz_module_name = (char *)[o_module_name lossyCString];
/* Look for the selected module */ /* Look for the selected module */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name if( psz_module_name
&& !strcmp( psz_module_name, p_parser->psz_object_name ) ) && !strcmp( psz_module_name, p_parser->psz_object_name ) )
...@@ -178,9 +178,9 @@ ...@@ -178,9 +178,9 @@
} }
} }
if( !p_parser || i_index == list.i_count ) if( !p_parser || i_index == p_list->i_count )
{ {
vlc_list_release( &list ); vlc_list_release( p_list );
return; return;
} }
...@@ -192,15 +192,15 @@ ...@@ -192,15 +192,15 @@
backing: NSBackingStoreBuffered backing: NSBackingStoreBuffered
defer: YES]; defer: YES];
o_toolbar = [[NSToolbar alloc] initWithIdentifier: o_module_name]; o_toolbar = [[NSToolbar alloc] initWithIdentifier: o_module_name];
[o_panel setTitle: [NSString stringWithFormat: @"%@ (%@)", [o_panel setTitle: [NSString stringWithFormat: @"%@ (%@)",
_NS("Preferences"), o_module_name]]; _NS("Preferences"), o_module_name]];
o_panel_view = [o_panel contentView]; o_panel_view = [o_panel contentView];
s_scroll_rc = s_panel_rc; s_scroll_rc = s_panel_rc;
s_scroll_rc.size.height -= 55; s_scroll_rc.origin.y += 55; s_scroll_rc.size.height -= 55; s_scroll_rc.origin.y += 55;
o_scroll_view = [[NSScrollView alloc] initWithFrame: s_scroll_rc]; o_scroll_view = [[NSScrollView alloc] initWithFrame: s_scroll_rc];
[o_scroll_views setObject: o_scroll_view forKey: o_module_name]; [o_scroll_views setObject: o_scroll_view forKey: o_module_name];
[o_scroll_view setBorderType: NSGrooveBorder]; [o_scroll_view setBorderType: NSGrooveBorder];
[o_scroll_view setHasVerticalScroller: YES]; [o_scroll_view setHasVerticalScroller: YES];
[o_scroll_view setDrawsBackground: NO]; [o_scroll_view setDrawsBackground: NO];
[o_scroll_view setRulersVisible: YES]; [o_scroll_view setRulersVisible: YES];
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
i_module_tag = 3; i_module_tag = 3;
#define X_ORIGIN 20 #define X_ORIGIN 20
#define Y_ORIGIN (X_ORIGIN - 10) #define Y_ORIGIN (X_ORIGIN - 10)
#define CHECK_VIEW_HEIGHT \ #define CHECK_VIEW_HEIGHT \
{ \ { \
...@@ -287,14 +287,14 @@ ...@@ -287,14 +287,14 @@
NSToolbarItem *o_tbi; NSToolbarItem *o_tbi;
o_label = [NSApp localizedString: p_item->psz_text]; o_label = [NSApp localizedString: p_item->psz_text];
o_tbi = [[NSToolbarItem alloc] initWithItemIdentifier: o_label]; o_tbi = [[NSToolbarItem alloc] initWithItemIdentifier: o_label];
[o_tbi setImage: [NSImage imageNamed: @"NSApplicationIcon"]]; [o_tbi setImage: [NSImage imageNamed: @"NSApplicationIcon"]];
[o_tbi setLabel: o_label]; [o_tbi setLabel: o_label];
[o_tbi setTarget: self]; [o_tbi setTarget: self];
[o_tbi setAction: @selector(selectPrefView:)]; [o_tbi setAction: @selector(selectPrefView:)];
o_key = [NSString stringWithFormat: @"%02d %@", o_key = [NSString stringWithFormat: @"%02d %@",
i_pos, o_label]; i_pos, o_label];
[o_tb_items setObject: o_tbi forKey: o_key]; [o_tb_items setObject: o_tbi forKey: o_key];
s_vrc = s_scroll_rc; s_vrc.size.height -= 4; s_vrc = s_scroll_rc; s_vrc.size.height -= 4;
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
if( i_pos == 0 ) if( i_pos == 0 )
{ {
[o_scroll_view setDocumentView: o_view]; [o_scroll_view setDocumentView: o_view];
} }
i_pos++; i_pos++;
...@@ -353,23 +353,23 @@ ...@@ -353,23 +353,23 @@
[o_box setContentView: [o_cview autorelease]]; [o_box setContentView: [o_cview autorelease]];
s_crc = [o_cview bounds]; s_crc = [o_cview bounds];
s_brc = NSMakeRect( 5, 10, 200, 30 ); s_brc = NSMakeRect( 5, 10, 200, 30 );
o_modules = [[NSPopUpButton alloc] initWithFrame: s_brc]; o_modules = [[NSPopUpButton alloc] initWithFrame: s_brc];
[o_modules setTag: i_module_tag++]; [o_modules setTag: i_module_tag++];
[o_modules setTarget: self]; [o_modules setTarget: self];
[o_modules setAction: @selector(moduleSelected:)]; [o_modules setAction: @selector(moduleSelected:)];
[o_modules setToolTip: [NSApp localizedString: p_item->psz_longtext]]; [o_modules setToolTip: [NSApp localizedString: p_item->psz_longtext]];
[o_cview addSubview: [o_modules autorelease]]; [o_cview addSubview: [o_modules autorelease]];
MODULE_BUTTON( o_btn_configure, _NS("Configure"), MODULE_BUTTON( o_btn_configure, _NS("Configure"),
configureModule: ); configureModule: );
s_brc = NSMakeRect( 8, s_brc.origin.y + s_brc.size.height + 10, s_brc = NSMakeRect( 8, s_brc.origin.y + s_brc.size.height + 10,
194, 25 ); 194, 25 );
o_text_field = [[VLCTextField alloc] initWithFrame: s_brc]; o_text_field = [[VLCTextField alloc] initWithFrame: s_brc];
[o_text_field setTag: i_module_tag++]; [o_text_field setTag: i_module_tag++];
[o_text_field setAlignment: NSLeftTextAlignment]; [o_text_field setAlignment: NSLeftTextAlignment];
CONTROL_CONFIG( o_text_field, o_module_name, CONTROL_CONFIG( o_text_field, o_module_name,
CONFIG_ITEM_MODULE, p_item->psz_name ); CONFIG_ITEM_MODULE, p_item->psz_name );
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(configChanged:) selector: @selector(configChanged:)
...@@ -378,21 +378,21 @@ ...@@ -378,21 +378,21 @@
[o_cview addSubview: [o_text_field autorelease]]; [o_cview addSubview: [o_text_field autorelease]];
s_brc.origin.x += 3; s_brc.origin.x += 3;
MODULE_BUTTON( o_btn_select, _NS("Select"), MODULE_BUTTON( o_btn_select, _NS("Select"),
selectModule: ); selectModule: );
[o_modules addItemWithTitle: _NS("None")]; [o_modules addItemWithTitle: _NS("None")];
/* build a list of available modules */ /* build a list of available modules */
{ {
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, if( !strcmp( p_parser->psz_capability,
p_item->psz_type ) ) p_item->psz_type ) )
{ {
NSString *o_object_name = [NSString NSString *o_object_name = [NSString
stringWithCString: p_parser->psz_object_name]; stringWithCString: p_parser->psz_object_name];
[o_modules addItemWithTitle: o_object_name]; [o_modules addItemWithTitle: o_object_name];
} }
...@@ -404,9 +404,9 @@ ...@@ -404,9 +404,9 @@
NSString *o_value = NSString *o_value =
[NSString stringWithCString: p_item->psz_value]; [NSString stringWithCString: p_item->psz_value];
[o_text_field setStringValue: o_value]; [o_text_field setStringValue: o_value];
[o_modules selectItemWithTitle: o_value]; [o_modules selectItemWithTitle: o_value];
[o_btn_configure setEnabled: [self hasPrefs: o_value]]; [o_btn_configure setEnabled: [self hasPrefs: o_value]];
} }
else else
{ {
...@@ -443,7 +443,7 @@ ...@@ -443,7 +443,7 @@
CHECK_VIEW_HEIGHT; CHECK_VIEW_HEIGHT;
o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc]; o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
CONTROL_CONFIG( o_combo_box, o_module_name, CONTROL_CONFIG( o_combo_box, o_module_name,
CONFIG_ITEM_STRING, p_item->psz_name ); CONFIG_ITEM_STRING, p_item->psz_name );
[o_combo_box setToolTip: [o_combo_box setToolTip:
[NSApp localizedString: p_item->psz_longtext]]; [NSApp localizedString: p_item->psz_longtext]];
...@@ -454,16 +454,16 @@ ...@@ -454,16 +454,16 @@
object: o_combo_box]; object: o_combo_box];
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(configChanged:) selector: @selector(configChanged:)
name: NSComboBoxSelectionDidChangeNotification name: NSComboBoxSelectionDidChangeNotification
object: o_combo_box]; object: o_combo_box];
for( i=0; p_item->ppsz_list[i]; i++ ) for( i=0; p_item->ppsz_list[i]; i++ )
{ {
[o_combo_box addItemWithObjectValue: [o_combo_box addItemWithObjectValue:
[NSString stringWithCString: p_item->ppsz_list[i]]]; [NSString stringWithCString: p_item->ppsz_list[i]]];
} }
CONTROL_LABEL( p_item->psz_text ); CONTROL_LABEL( p_item->psz_text );
s_rc.origin.y += s_rc.size.height; s_rc.origin.y += s_rc.size.height;
s_rc.origin.x = X_ORIGIN; s_rc.origin.x = X_ORIGIN;
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
{ {
INPUT_FIELD_INTEGER( p_item->psz_name, p_item->psz_text, 70, INPUT_FIELD_INTEGER( p_item->psz_name, p_item->psz_text, 70,
p_item->i_value, p_item->psz_longtext ); p_item->i_value, p_item->psz_longtext );
} }
break; break;
...@@ -499,14 +499,14 @@ ...@@ -499,14 +499,14 @@
o_btn_bool = [[VLCButton alloc] initWithFrame: s_rc]; o_btn_bool = [[VLCButton alloc] initWithFrame: s_rc];
[o_btn_bool setButtonType: NSSwitchButton]; [o_btn_bool setButtonType: NSSwitchButton];
[o_btn_bool setIntValue: p_item->i_value]; [o_btn_bool setIntValue: p_item->i_value];
[o_btn_bool setTitle: [o_btn_bool setTitle:
[NSApp localizedString: p_item->psz_text]]; [NSApp localizedString: p_item->psz_text]];
[o_btn_bool setToolTip: [o_btn_bool setToolTip:
[NSApp localizedString: p_item->psz_longtext]]; [NSApp localizedString: p_item->psz_longtext]];
[o_btn_bool setTarget: self]; [o_btn_bool setTarget: self];
[o_btn_bool setAction: @selector(configChanged:)]; [o_btn_bool setAction: @selector(configChanged:)];
CONTROL_CONFIG( o_btn_bool, o_module_name, CONTROL_CONFIG( o_btn_bool, o_module_name,
CONFIG_ITEM_BOOL, p_item->psz_name ); CONFIG_ITEM_BOOL, p_item->psz_name );
[o_view addSubview: [o_btn_bool autorelease]]; [o_view addSubview: [o_btn_bool autorelease]];
s_rc.origin.y += s_rc.size.height; s_rc.origin.y += s_rc.size.height;
...@@ -526,7 +526,7 @@ ...@@ -526,7 +526,7 @@
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item->i_type != CONFIG_HINT_END && p_item++ );
vlc_list_release( &list ); vlc_list_release( p_list );
[o_toolbars setObject: o_tb_items forKey: o_module_name]; [o_toolbars setObject: o_tb_items forKey: o_module_name];
[o_toolbar setDelegate: self]; [o_toolbar setDelegate: self];
...@@ -547,7 +547,7 @@ ...@@ -547,7 +547,7 @@
s_rc.origin.y = s_panel_rc.origin.y + 14; s_rc.origin.y = s_panel_rc.origin.y + 14;
s_rc.size.height = 25; s_rc.size.width = 100; s_rc.size.height = 25; s_rc.size.width = 100;
s_rc.origin.x = s_panel_rc.size.width - s_rc.size.width - 14; s_rc.origin.x = s_panel_rc.size.width - s_rc.size.width - 14;
DEF_PANEL_BUTTON( 0, _NS("OK"), clickedCancelOK: ); DEF_PANEL_BUTTON( 0, _NS("OK"), clickedCancelOK: );
[o_panel setDefaultButtonCell: [o_button cell]]; [o_panel setDefaultButtonCell: [o_button cell]];
s_rc.origin.x -= s_rc.size.width; s_rc.origin.x -= s_rc.size.width;
...@@ -626,7 +626,7 @@ ...@@ -626,7 +626,7 @@
o_view = [o_views objectForKey: [sender label]]; o_view = [o_views objectForKey: [sender label]];
o_scroll_view = [o_scroll_views objectForKey: o_module_name]; o_scroll_view = [o_scroll_views objectForKey: o_module_name];
[o_scroll_view setDocumentView: o_view]; [o_scroll_view setDocumentView: o_view];
} }
- (void)moduleSelected:(id)sender - (void)moduleSelected:(id)sender
...@@ -651,7 +651,7 @@ ...@@ -651,7 +651,7 @@
NSString *o_module_name; NSString *o_module_name;
NSPopUpButton *o_modules; NSPopUpButton *o_modules;
o_modules = [[sender superview] viewWithTag: [sender tag] - 1]; o_modules = [[sender superview] viewWithTag: [sender tag] - 1];
o_module_name = [o_modules titleOfSelectedItem]; o_module_name = [o_modules titleOfSelectedItem];
[self createPrefPanel: o_module_name]; [self createPrefPanel: o_module_name];
...@@ -681,14 +681,14 @@ ...@@ -681,14 +681,14 @@
id o_vlc_config = [o_unknown isKindOfClass: [NSNotification class]] ? id o_vlc_config = [o_unknown isKindOfClass: [NSNotification class]] ?
[o_unknown object] : o_unknown; [o_unknown object] : o_unknown;
NSString *o_module_name = [o_vlc_config moduleName]; NSString *o_module_name = [o_vlc_config moduleName];
NSPanel *o_pref_panel = [o_pref_panels objectForKey: o_module_name]; NSPanel *o_pref_panel = [o_pref_panels objectForKey: o_module_name];
NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name]; NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
if( [o_prefs indexOfObjectIdenticalTo: o_vlc_config] == NSNotFound ) if( [o_prefs indexOfObjectIdenticalTo: o_vlc_config] == NSNotFound )
{ {
NSView *o_pref_view = [o_pref_panel contentView]; NSView *o_pref_view = [o_pref_panel contentView];
NSButton *o_btn_apply = [o_pref_view viewWithTag: 2]; NSButton *o_btn_apply = [o_pref_view viewWithTag: 2];
[o_prefs addObject: o_vlc_config]; [o_prefs addObject: o_vlc_config];
[o_btn_apply setEnabled: YES]; [o_btn_apply setEnabled: YES];
...@@ -701,8 +701,8 @@ ...@@ -701,8 +701,8 @@
NSEnumerator *o_enum; NSEnumerator *o_enum;
NSView *o_config_view = [sender superview]; NSView *o_config_view = [sender superview];
NSWindow *o_config_panel = [o_config_view window]; NSWindow *o_config_panel = [o_config_view window];
NSButton *o_btn_apply = [o_config_view viewWithTag: 2]; NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
NSString *o_module_name = [[o_config_panel toolbar] identifier]; NSString *o_module_name = [[o_config_panel toolbar] identifier];
NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name]; NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
...@@ -726,7 +726,7 @@ ...@@ -726,7 +726,7 @@
o_value = [o_vlc_control stringValue]; o_value = [o_vlc_control stringValue];
psz_value = (char *)[o_value lossyCString]; psz_value = (char *)[o_value lossyCString];
config_PutPsz( p_intf, psz_name, config_PutPsz( p_intf, psz_name,
*psz_value ? psz_value : NULL ); *psz_value ? psz_value : NULL );
} }
break; break;
...@@ -770,7 +770,7 @@ ...@@ -770,7 +770,7 @@
[o_pref_panel close]; [o_pref_panel close];
if( [self respondsToSelector: @selector(performSelectorOnMainThread: if( [self respondsToSelector: @selector(performSelectorOnMainThread:
withObject:waitUntilDone:)] ) withObject:waitUntilDone:)] )
{ {
[self performSelectorOnMainThread: @selector(destroyPrefPanel:) [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
withObject: o_module_name withObject: o_module_name
...@@ -788,8 +788,8 @@ ...@@ -788,8 +788,8 @@
@implementation VLCPrefs (NSToolbarDelegate) @implementation VLCPrefs (NSToolbarDelegate)
- (NSToolbarItem *)toolbar:(NSToolbar *)o_toolbar - (NSToolbarItem *)toolbar:(NSToolbar *)o_toolbar
itemForItemIdentifier:(NSString *)o_item_id itemForItemIdentifier:(NSString *)o_item_id
willBeInsertedIntoToolbar:(BOOL)b_flag willBeInsertedIntoToolbar:(BOOL)b_flag
{ {
NSMutableDictionary *o_toolbar_items; NSMutableDictionary *o_toolbar_items;
...@@ -819,9 +819,9 @@ ...@@ -819,9 +819,9 @@
if( o_toolbar_items == nil ) if( o_toolbar_items == nil )
{ {
return( nil ); return( nil );
} }
o_ids = [[o_toolbar_items allKeys] o_ids = [[o_toolbar_items allKeys]
sortedArrayUsingSelector: @selector(compare:)]; sortedArrayUsingSelector: @selector(compare:)];
return( o_ids ); return( o_ids );
......
...@@ -517,7 +517,6 @@ object MainFrameDlg: TMainFrameDlg ...@@ -517,7 +517,6 @@ object MainFrameDlg: TMainFrameDlg
object MenuAddInterface: TMenuItem object MenuAddInterface: TMenuItem
Tag = 3 Tag = 3
Caption = '&Add interface' Caption = '&Add interface'
Enabled = False
Hint = 'Spawn a new interface' Hint = 'Spawn a new interface'
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menu.cpp: functions to handle menu items * menu.cpp: functions to handle menu items
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: menu.cpp,v 1.10 2003/01/26 00:51:43 sam Exp $ * $Id: menu.cpp,v 1.11 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr> * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
* *
...@@ -295,9 +295,7 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject() ...@@ -295,9 +295,7 @@ __fastcall TMenusGen::TMenusGen( intf_thread_t *_p_intf ) : TObject()
MenuAddInterface = p_window->MenuAddInterface; MenuAddInterface = p_window->MenuAddInterface;
/* Create the "Add interface" menu */ /* Create the "Add interface" menu */
#if 0 SetupModuleMenu( "interface", MenuAddInterface, InterfaceModuleClick );
SetupModuleMenu( "inerface", MenuAddInterface, InterfaceModuleClick );
#endif
} }
...@@ -679,29 +677,29 @@ void __fastcall TMenusGen::SetupModuleMenu( const char *psz_capability, ...@@ -679,29 +677,29 @@ void __fastcall TMenusGen::SetupModuleMenu( const char *psz_capability,
TMenuItem *Root, TNotifyEvent MenuItemClick ) TMenuItem *Root, TNotifyEvent MenuItemClick )
{ {
module_t * p_parser; module_t * p_parser;
vlc_list_t list; vlc_list_t *p_list;
int i_index; int i_index;
/* remove previous menu */ /* remove previous menu */
Root->Clear(); Root->Clear();
Root->Enabled = false; Root->Enabled = false;
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, psz_capability ) ) if( !strcmp( p_parser->psz_capability, psz_capability ) )
{ {
TMenuItem *Item = new TMenuItem( Root ); TMenuItem *Item = new TMenuItem( Root );
Item->Caption = p_parser->psz_object_name; Item->Caption = p_parser->psz_object_name;
Item->Hint = Item->Caption; Item->Hint = Item->Caption;
Item->OnClick = MenuItemClick; Item->OnClick = MenuItemClick;
Root->Add( Item ); Root->Add( Item );
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
/* be sure that menu is enabled, if there is at least one item */ /* be sure that menu is enabled, if there is at least one item */
if( i_index > 0 ) if( i_index > 0 )
......
...@@ -282,7 +282,7 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner, ...@@ -282,7 +282,7 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
{ {
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
int i_index; int i_index;
/* check that the click is valid (we are on an item, and the click /* check that the click is valid (we are on an item, and the click
...@@ -310,11 +310,11 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -310,11 +310,11 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
} }
/* look for module 'Name' */ /* look for module 'Name' */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( strcmp( p_parser->psz_object_name, Name.c_str() ) == 0 ) if( strcmp( p_parser->psz_object_name, Name.c_str() ) == 0 )
{ {
...@@ -325,6 +325,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -325,6 +325,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
break; break;
} }
} }
vlc_list_release( p_list );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPanelPlugin::CheckListBoxClickCheck( TObject *Sender ) void __fastcall TPanelPlugin::CheckListBoxClickCheck( TObject *Sender )
...@@ -642,7 +643,7 @@ void __fastcall TPreferencesDlg::FormClose( TObject *Sender, ...@@ -642,7 +643,7 @@ void __fastcall TPreferencesDlg::FormClose( TObject *Sender,
void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
{ {
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
int i_index; int i_index;
module_config_t *p_item; module_config_t *p_item;
...@@ -658,11 +659,11 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -658,11 +659,11 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
TPanelBool *PanelBool; TPanelBool *PanelBool;
/* Look for the selected module */ /* Look for the selected module */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name if( psz_module_name
&& !strcmp( psz_module_name, p_parser->psz_object_name ) ) && !strcmp( psz_module_name, p_parser->psz_object_name ) )
...@@ -670,9 +671,9 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -670,9 +671,9 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
break; break;
} }
} }
if( !p_parser || i_index == list.i_count ) if( !p_parser || i_index == p_list->i_count )
{ {
vlc_list_release( &list ); vlc_list_release( p_list );
return; return;
} }
...@@ -714,9 +715,9 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -714,9 +715,9 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
PanelPlugin->Parent = ScrollBox; PanelPlugin->Parent = ScrollBox;
/* Look for valid modules */ /* Look for valid modules */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !strcmp( p_parser->psz_capability, p_item->psz_type ) ) if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
{ {
...@@ -797,7 +798,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -797,7 +798,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
/* set active tabsheet /* set active tabsheet
* FIXME: i don't know why, but both lines are necessary */ * FIXME: i don't know why, but both lines are necessary */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.58 2003/01/22 22:19:29 sigmunau Exp $ * $Id: libvlc.c,v 1.59 2003/01/27 17:41:01 ipkiss 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>
...@@ -509,7 +509,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -509,7 +509,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
{ {
free( psz_modules ); free( psz_modules );
} }
/* /*
* Get input filenames given as commandline arguments * Get input filenames given as commandline arguments
*/ */
...@@ -605,7 +605,7 @@ int VLC_Destroy( int i_object ) ...@@ -605,7 +605,7 @@ int VLC_Destroy( int i_object )
{ {
network_ChannelJoin( p_vlc, COMMON_CHANNEL ); network_ChannelJoin( p_vlc, COMMON_CHANNEL );
} }
/* /*
* Free allocated memory * Free allocated memory
*/ */
...@@ -625,12 +625,12 @@ int VLC_Destroy( int i_object ) ...@@ -625,12 +625,12 @@ int VLC_Destroy( int i_object )
* XXX: Free module bank ! * XXX: Free module bank !
*/ */
//module_EndBank( p_vlc ); //module_EndBank( p_vlc );
/* /*
* System specific cleaning code * System specific cleaning code
*/ */
system_End( p_vlc ); system_End( p_vlc );
/* Destroy mutexes */ /* Destroy mutexes */
vlc_mutex_destroy( &p_vlc->config_lock ); vlc_mutex_destroy( &p_vlc->config_lock );
...@@ -805,7 +805,7 @@ int VLC_Play( int i_object ) ...@@ -805,7 +805,7 @@ int VLC_Play( int i_object )
{ {
return VLC_ENOOBJ; return VLC_ENOOBJ;
} }
vlc_thread_set_priority( p_vlc, VLC_THREAD_PRIORITY_LOW ); vlc_thread_set_priority( p_vlc, VLC_THREAD_PRIORITY_LOW );
p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD ); p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
...@@ -1067,7 +1067,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1067,7 +1067,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
*/ */
#define LINE_START 8 #define LINE_START 8
#define PADDING_SPACES 25 #define PADDING_SPACES 25
vlc_list_t list; vlc_list_t *p_list;
module_t *p_parser; module_t *p_parser;
module_config_t *p_item; module_config_t *p_item;
char psz_spaces[PADDING_SPACES+LINE_START+1]; char psz_spaces[PADDING_SPACES+LINE_START+1];
...@@ -1084,14 +1084,14 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1084,14 +1084,14 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
#endif #endif
/* List all modules */ /* List all modules */
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
/* Enumerate the config for each module */ /* Enumerate the config for each module */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
vlc_bool_t b_help_module; vlc_bool_t b_help_module;
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name && strcmp( psz_module_name, if( psz_module_name && strcmp( psz_module_name,
p_parser->psz_object_name ) ) p_parser->psz_object_name ) )
...@@ -1243,7 +1243,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1243,7 +1243,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
} }
/* Release the module list */ /* Release the module list */
vlc_list_release( &list ); vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */ #ifdef WIN32 /* Pause the console because it's destroyed when we exit */
fprintf( stdout, _("\nPress the RETURN key to continue...\n") ); fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
...@@ -1259,7 +1259,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1259,7 +1259,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
*****************************************************************************/ *****************************************************************************/
static void ListModules( vlc_t *p_this ) static void ListModules( vlc_t *p_this )
{ {
vlc_list_t list; vlc_list_t *p_list;
module_t *p_parser; module_t *p_parser;
char psz_spaces[22]; char psz_spaces[22];
int i_index; int i_index;
...@@ -1277,14 +1277,14 @@ static void ListModules( vlc_t *p_this ) ...@@ -1277,14 +1277,14 @@ static void ListModules( vlc_t *p_this )
fprintf( stdout, _("[module] [description]\n") ); fprintf( stdout, _("[module] [description]\n") );
/* List all modules */ /* List all modules */
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
/* Enumerate each module */ /* Enumerate each module */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
int i; int i;
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
/* Nasty hack, but right now I'm too tired to think about a nice /* Nasty hack, but right now I'm too tired to think about a nice
* solution */ * solution */
...@@ -1298,7 +1298,7 @@ static void ListModules( vlc_t *p_this ) ...@@ -1298,7 +1298,7 @@ static void ListModules( vlc_t *p_this )
psz_spaces[i] = ' '; psz_spaces[i] = ' ';
} }
vlc_list_release( &list ); vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */ #ifdef WIN32 /* Pause the console because it's destroyed when we exit */
fprintf( stdout, _("\nPress the RETURN key to continue...\n") ); fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
......
...@@ -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.48 2003/01/06 00:37:30 garf Exp $ * $Id: configuration.c,v 1.49 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -159,7 +159,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name ) ...@@ -159,7 +159,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, * represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* and CONFIG_ITEM_MODULE). * and CONFIG_ITEM_MODULE).
*****************************************************************************/ *****************************************************************************/
void __config_PutPsz( vlc_object_t *p_this, void __config_PutPsz( vlc_object_t *p_this,
const char *psz_name, const char *psz_value ) const char *psz_name, const char *psz_value )
{ {
module_config_t *p_config; module_config_t *p_config;
...@@ -303,18 +303,18 @@ void __config_PutFloat( vlc_object_t *p_this, ...@@ -303,18 +303,18 @@ void __config_PutFloat( vlc_object_t *p_this,
*****************************************************************************/ *****************************************************************************/
module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name ) module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name )
{ {
vlc_list_t list; vlc_list_t *p_list;
module_t *p_parser; module_t *p_parser;
module_config_t *p_item; module_config_t *p_item;
int i_index; int i_index;
if( !psz_name ) return NULL; if( !psz_name ) return NULL;
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( !p_parser->i_config_items ) if( !p_parser->i_config_items )
continue; continue;
...@@ -328,13 +328,13 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name ) ...@@ -328,13 +328,13 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name )
continue; continue;
if( !strcmp( psz_name, p_item->psz_name ) ) if( !strcmp( psz_name, p_item->psz_name ) )
{ {
vlc_list_release( &list ); vlc_list_release( p_list );
return p_item; return p_item;
} }
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
return NULL; return NULL;
} }
...@@ -507,7 +507,7 @@ void config_UnsetCallbacks( module_config_t *p_new ) ...@@ -507,7 +507,7 @@ void config_UnsetCallbacks( module_config_t *p_new )
*****************************************************************************/ *****************************************************************************/
int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{ {
vlc_list_t list; vlc_list_t *p_list;
module_t *p_parser; module_t *p_parser;
module_config_t *p_item; module_config_t *p_item;
FILE *file; FILE *file;
...@@ -546,11 +546,11 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -546,11 +546,11 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
} }
/* Look for the selected module, if NULL then save everything */ /* Look for the selected module, if NULL then save everything */
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name if( psz_module_name
&& strcmp( psz_module_name, p_parser->psz_object_name ) ) && strcmp( psz_module_name, p_parser->psz_object_name ) )
...@@ -666,8 +666,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -666,8 +666,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
} }
} }
vlc_list_release( &list ); vlc_list_release( p_list );
fclose( file ); fclose( file );
free( psz_filename ); free( psz_filename );
...@@ -687,7 +687,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -687,7 +687,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
* *
* When we save we mustn't delete the config options of the modules that * When we save we mustn't delete the config options of the modules that
* haven't been loaded. So we cannot just create a new config file with the * haven't been loaded. So we cannot just create a new config file with the
* config structures we've got in memory. * config structures we've got in memory.
* I don't really know how to deal with this nicely, so I will use a completly * I don't really know how to deal with this nicely, so I will use a completly
* dumb method ;-) * dumb method ;-)
* I will load the config file in memory, but skipping all the sections of the * I will load the config file in memory, but skipping all the sections of the
...@@ -699,7 +699,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -699,7 +699,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{ {
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
module_config_t *p_item; module_config_t *p_item;
FILE *file; FILE *file;
char p_line[1024], *p_index2; char p_line[1024], *p_index2;
...@@ -788,7 +788,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -788,7 +788,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
p_bigbuffer[0] = 0; p_bigbuffer[0] = 0;
/* List all available modules */ /* List all available modules */
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
/* backup file into memory, we only need to backup the sections we won't /* backup file into memory, we only need to backup the sections we won't
* save later on */ * save later on */
...@@ -799,9 +799,9 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -799,9 +799,9 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{ {
/* we found a section, check if we need to do a backup */ /* we found a section, check if we need to do a backup */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( ((p_index2 - &p_line[1]) if( ((p_index2 - &p_line[1])
== (int)strlen(p_parser->psz_object_name) ) == (int)strlen(p_parser->psz_object_name) )
...@@ -816,7 +816,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -816,7 +816,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
} }
} }
if( i_index == list.i_count ) if( i_index == p_list->i_count )
{ {
/* we don't have this section in our list so we need to back /* we don't have this section in our list so we need to back
* it up */ * it up */
...@@ -855,7 +855,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -855,7 +855,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
msg_Warn( p_this, "could not open config file %s for writing", msg_Warn( p_this, "could not open config file %s for writing",
psz_filename ); psz_filename );
free( psz_filename ); free( psz_filename );
vlc_list_release( &list ); vlc_list_release( p_list );
vlc_mutex_unlock( &p_this->p_vlc->config_lock ); vlc_mutex_unlock( &p_this->p_vlc->config_lock );
return -1; return -1;
} }
...@@ -863,9 +863,9 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -863,9 +863,9 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
fprintf( file, "###\n### " COPYRIGHT_MESSAGE "\n###\n\n" ); fprintf( file, "###\n### " COPYRIGHT_MESSAGE "\n###\n\n" );
/* Look for the selected module, if NULL then save everything */ /* Look for the selected module, if NULL then save everything */
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
p_parser = (module_t *)list.p_values[i_index].p_object ; p_parser = (module_t *)p_list->p_values[i_index].p_object ;
if( psz_module_name && strcmp( psz_module_name, if( psz_module_name && strcmp( psz_module_name,
p_parser->psz_object_name ) ) p_parser->psz_object_name ) )
...@@ -922,7 +922,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -922,7 +922,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
fprintf( file, "\n" ); fprintf( file, "\n" );
} }
vlc_list_release( &list ); vlc_list_release( p_list );
/* /*
* Restore old settings from the config in file * Restore old settings from the config in file
...@@ -951,7 +951,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -951,7 +951,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
{ {
int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0; int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0;
module_t *p_parser; module_t *p_parser;
vlc_list_t list; vlc_list_t *p_list;
module_config_t *p_item; module_config_t *p_item;
struct option *p_longopts; struct option *p_longopts;
int i_modules_index; int i_modules_index;
...@@ -987,17 +987,17 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -987,17 +987,17 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
#endif #endif
/* List all modules */ /* List all modules */
list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
/* /*
* Generate the longopts and shortopts structures used by getopt_long * Generate the longopts and shortopts structures used by getopt_long
*/ */
i_opts = 0; i_opts = 0;
for( i_modules_index = 0; i_modules_index < list.i_count; for( i_modules_index = 0; i_modules_index < p_list->i_count;
i_modules_index++ ) i_modules_index++ )
{ {
p_parser = (module_t *)list.p_values[i_modules_index].p_object ; p_parser = (module_t *)p_list->p_values[i_modules_index].p_object ;
/* 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
...@@ -1010,7 +1010,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1010,7 +1010,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
if( p_longopts == NULL ) if( p_longopts == NULL )
{ {
msg_Err( p_this, "out of memory" ); msg_Err( p_this, "out of memory" );
vlc_list_release( &list ); vlc_list_release( p_list );
return -1; return -1;
} }
...@@ -1019,7 +1019,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1019,7 +1019,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
{ {
msg_Err( p_this, "out of memory" ); msg_Err( p_this, "out of memory" );
free( p_longopts ); free( p_longopts );
vlc_list_release( &list ); vlc_list_release( p_list );
return -1; return -1;
} }
...@@ -1034,7 +1034,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1034,7 +1034,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
msg_Err( p_this, "out of memory" ); msg_Err( p_this, "out of memory" );
free( psz_shortopts ); free( psz_shortopts );
free( p_longopts ); free( p_longopts );
vlc_list_release( &list ); vlc_list_release( p_list );
return -1; return -1;
} }
memcpy( ppsz_argv, p_this->p_vlc->ppsz_argv, memcpy( ppsz_argv, p_this->p_vlc->ppsz_argv,
...@@ -1049,10 +1049,10 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1049,10 +1049,10 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
/* Fill the p_longopts and psz_shortopts structures */ /* Fill the p_longopts and psz_shortopts structures */
i_index = 0; i_index = 0;
for( i_modules_index = 0; i_modules_index < list.i_count; for( i_modules_index = 0; i_modules_index < p_list->i_count;
i_modules_index++ ) i_modules_index++ )
{ {
p_parser = (module_t *)list.p_values[i_modules_index].p_object ; p_parser = (module_t *)p_list->p_values[i_modules_index].p_object ;
if( !p_parser->i_config_items ) if( !p_parser->i_config_items )
continue; continue;
...@@ -1124,7 +1124,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1124,7 +1124,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
} }
/* We don't need the module list anymore */ /* We don't need the module list anymore */
vlc_list_release( &list ); vlc_list_release( p_list );
/* Close the longopts and shortopts structures */ /* Close the longopts and shortopts structures */
memset( &p_longopts[i_index], 0, sizeof(struct option) ); memset( &p_longopts[i_index], 0, sizeof(struct option) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions * modules.c : Builtin and plugin modules management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.110 2003/01/19 03:16:24 sam Exp $ * $Id: modules.c,v 1.111 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com> * Ethan C. Baldridge <BaldridgeE@cadmus.com>
...@@ -250,7 +250,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, ...@@ -250,7 +250,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
}; };
module_list_t *p_list, *p_first, *p_tmp; module_list_t *p_list, *p_first, *p_tmp;
vlc_list_t all; vlc_list_t *p_all;
int i_which_module, i_index = 0; int i_which_module, i_index = 0;
vlc_bool_t b_intf = VLC_FALSE; vlc_bool_t b_intf = VLC_FALSE;
...@@ -295,17 +295,17 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, ...@@ -295,17 +295,17 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
} }
/* Sort the modules and test them */ /* Sort the modules and test them */
all = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_all = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
p_list = malloc( all.i_count * sizeof( module_list_t ) ); p_list = malloc( p_all->i_count * sizeof( module_list_t ) );
p_first = NULL; p_first = NULL;
/* Parse the module list for capabilities and probe each of them */ /* Parse the module list for capabilities and probe each of them */
for( i_which_module = 0; i_which_module < all.i_count; i_which_module++ ) for( i_which_module = 0; i_which_module < p_all->i_count; i_which_module++ )
{ {
module_t * p_submodule = NULL; module_t * p_submodule = NULL;
int i_shortcut_bonus = 0, i_submodule; int i_shortcut_bonus = 0, i_submodule;
p_module = (module_t *)all.p_values[i_which_module].p_object; p_module = (module_t *)p_all->p_values[i_which_module].p_object;
/* Test that this module can do what we need */ /* Test that this module can do what we need */
if( strcmp( p_module->psz_capability, psz_capability ) ) if( strcmp( p_module->psz_capability, psz_capability ) )
...@@ -385,7 +385,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, ...@@ -385,7 +385,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
&& !strcmp( p_module->psz_program, && !strcmp( p_module->psz_program,
p_this->p_vlc->psz_object_name ) ) p_this->p_vlc->psz_object_name ) )
{ {
if( !b_intf ) if( !b_intf )
{ {
/* Remove previous non-matching plugins */ /* Remove previous non-matching plugins */
i_index = 0; i_index = 0;
...@@ -448,7 +448,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, ...@@ -448,7 +448,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
} }
/* We can release the list, interesting modules were yielded */ /* We can release the list, interesting modules were yielded */
vlc_list_release( &all ); vlc_list_release( p_all );
/* Parse the linked list and use the first successful module */ /* Parse the linked list and use the first successful module */
p_tmp = p_first; p_tmp = p_first;
...@@ -671,7 +671,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, ...@@ -671,7 +671,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
AllocatePluginFile( p_this, psz_path ); AllocatePluginFile( p_this, psz_path );
} }
} }
while( FindNextFile( handle, &finddata ) ); while( FindNextFile( handle, &finddata ) );
/* Close the directory */ /* Close the directory */
FindClose( handle ); FindClose( handle );
...@@ -754,7 +754,7 @@ static int AllocatePluginFile( vlc_object_t * p_this, MYCHAR * psz_file ) ...@@ -754,7 +754,7 @@ static int AllocatePluginFile( vlc_object_t * p_this, MYCHAR * psz_file )
} }
/* Now that we have successfully loaded the module, we can /* Now that we have successfully loaded the module, we can
* allocate a structure for it */ * allocate a structure for it */
p_module = vlc_object_create( p_this, VLC_OBJECT_MODULE ); p_module = vlc_object_create( p_this, VLC_OBJECT_MODULE );
if( p_module == NULL ) if( p_module == NULL )
{ {
...@@ -868,7 +868,7 @@ static int AllocateBuiltinModule( vlc_object_t * p_this, ...@@ -868,7 +868,7 @@ static int AllocateBuiltinModule( vlc_object_t * p_this,
module_t * p_module; module_t * p_module;
/* Now that we have successfully loaded the module, we can /* Now that we have successfully loaded the module, we can
* allocate a structure for it */ * allocate a structure for it */
p_module = vlc_object_create( p_this, VLC_OBJECT_MODULE ); p_module = vlc_object_create( p_this, VLC_OBJECT_MODULE );
if( p_module == NULL ) if( p_module == NULL )
{ {
...@@ -948,7 +948,7 @@ static int CallEntry( module_t * p_module ) ...@@ -948,7 +948,7 @@ static int CallEntry( module_t * p_module )
int (* pf_symbol) ( module_t * p_module ); int (* pf_symbol) ( module_t * p_module );
/* Try to resolve the symbol */ /* Try to resolve the symbol */
pf_symbol = (int (*)(module_t *)) module_getsymbol( p_module->handle, pf_symbol = (int (*)(module_t *)) module_getsymbol( p_module->handle,
psz_name ); psz_name );
if( pf_symbol == NULL ) if( pf_symbol == NULL )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling * objects.c: vlc_object_t handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.33 2002/12/14 19:34:06 gbazin Exp $ * $Id: objects.c,v 1.34 2003/01/27 17:41:01 ipkiss Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -57,7 +57,7 @@ static void DumpStructure ( vlc_object_t *, int, char * ); ...@@ -57,7 +57,7 @@ static void DumpStructure ( vlc_object_t *, int, char * );
static int FindIndex ( vlc_object_t *, vlc_object_t **, int ); static int FindIndex ( vlc_object_t *, vlc_object_t **, int );
static void SetAttachment ( vlc_object_t *, vlc_bool_t ); static void SetAttachment ( vlc_object_t *, vlc_bool_t );
static vlc_list_t NewList ( int ); static vlc_list_t * NewList ( int );
static void ListReplace ( vlc_list_t *, vlc_object_t *, int ); static void ListReplace ( vlc_list_t *, vlc_object_t *, int );
static void ListAppend ( vlc_list_t *, vlc_object_t * ); static void ListAppend ( vlc_list_t *, vlc_object_t * );
static int CountChildren ( vlc_object_t *, int ); static int CountChildren ( vlc_object_t *, int );
...@@ -491,9 +491,9 @@ void __vlc_object_detach( vlc_object_t *p_this ) ...@@ -491,9 +491,9 @@ void __vlc_object_detach( vlc_object_t *p_this )
* This function recursively looks for a given object type. i_mode can be one * This function recursively looks for a given object type. i_mode can be one
* of FIND_PARENT, FIND_CHILD or FIND_ANYWHERE. * of FIND_PARENT, FIND_CHILD or FIND_ANYWHERE.
*****************************************************************************/ *****************************************************************************/
vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode ) vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
{ {
vlc_list_t list; vlc_list_t *p_list;
vlc_object_t **pp_current, **pp_end; vlc_object_t **pp_current, **pp_end;
int i_count = 0, i_index = 0; int i_count = 0, i_index = 0;
...@@ -515,7 +515,7 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -515,7 +515,7 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
} }
} }
list = NewList( i_count ); p_list = NewList( i_count );
pp_current = p_this->p_libvlc->pp_objects; pp_current = p_this->p_libvlc->pp_objects;
for( ; pp_current < pp_end ; pp_current++ ) for( ; pp_current < pp_end ; pp_current++ )
...@@ -523,7 +523,7 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -523,7 +523,7 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
if( (*pp_current)->b_attached if( (*pp_current)->b_attached
&& (*pp_current)->i_object_type == i_type ) && (*pp_current)->i_object_type == i_type )
{ {
ListReplace( &list, *pp_current, i_index ); ListReplace( p_list, *pp_current, i_index );
if( i_index < i_count ) i_index++; if( i_index < i_count ) i_index++;
} }
} }
...@@ -531,29 +531,29 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -531,29 +531,29 @@ vlc_list_t __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
case FIND_CHILD: case FIND_CHILD:
i_count = CountChildren( p_this, i_type ); i_count = CountChildren( p_this, i_type );
list = NewList( i_count ); p_list = NewList( i_count );
/* Check allocation was successful */ /* Check allocation was successful */
if( list.i_count != i_count ) if( p_list->i_count != i_count )
{ {
msg_Err( p_this, "list allocation failed!" ); msg_Err( p_this, "list allocation failed!" );
list.i_count = 0; p_list->i_count = 0;
break; break;
} }
list.i_count = 0; p_list->i_count = 0;
ListChildren( &list, p_this, i_type ); ListChildren( p_list, p_this, i_type );
break; break;
default: default:
msg_Err( p_this, "unimplemented!" ); msg_Err( p_this, "unimplemented!" );
list = NewList( 0 ); p_list = NewList( 0 );
break; break;
} }
vlc_mutex_unlock( &structure_lock ); vlc_mutex_unlock( &structure_lock );
return list; return p_list;
} }
/***************************************************************************** /*****************************************************************************
...@@ -595,7 +595,7 @@ static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd, ...@@ -595,7 +595,7 @@ static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd,
if( *newval.psz_string ) if( *newval.psz_string )
{ {
vlc_object_release( p_this ); vlc_object_release( p_this );
} }
} }
else if( *psz_cmd == 'l' ) else if( *psz_cmd == 'l' )
{ {
...@@ -646,6 +646,7 @@ void vlc_list_release( vlc_list_t *p_list ) ...@@ -646,6 +646,7 @@ void vlc_list_release( vlc_list_t *p_list )
} }
free( p_list->p_values ); free( p_list->p_values );
free( p_list );
} }
/* Following functions are local */ /* Following functions are local */
...@@ -882,26 +883,30 @@ static void DumpStructure( vlc_object_t *p_this, int i_level, char *psz_foo ) ...@@ -882,26 +883,30 @@ static void DumpStructure( vlc_object_t *p_this, int i_level, char *psz_foo )
} }
} }
static vlc_list_t NewList( int i_count ) static vlc_list_t * NewList( int i_count )
{ {
vlc_list_t list; vlc_list_t * p_list = (vlc_list_t *)malloc( sizeof( vlc_list_t ) );
if( p_list == NULL )
{
return NULL;
}
list.i_count = i_count; p_list->i_count = i_count;
if( i_count == 0 ) if( i_count == 0 )
{ {
list.p_values = NULL; p_list->p_values = NULL;
return list; return p_list;
} }
list.p_values = malloc( i_count * sizeof( vlc_value_t ) ); p_list->p_values = malloc( i_count * sizeof( vlc_value_t ) );
if( list.p_values == NULL ) if( p_list->p_values == NULL )
{ {
list.i_count = 0; p_list->i_count = 0;
return list; return p_list;
} }
return list; return p_list;
} }
static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object, static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object,
......
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