Commit 0e93bc69 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/misc/beos_specific.cpp, ./src/misc/darwin_specific.m: removed

    the GetProgramPath call, stored the path in p_libvlc instead. Fixes
    compilation under anything other than OS X.
parent 4752aae0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* beos_specific.h: BeOS specific features * beos_specific.h: BeOS specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: beos_specific.h,v 1.7 2002/04/02 23:43:57 gbazin Exp $ * $Id: beos_specific.h,v 1.8 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* *
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
extern "C" { extern "C" {
#endif #endif
char * system_GetProgramPath( void );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* darwin_specific.h: Darwin specific features * darwin_specific.h: Darwin specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: darwin_specific.h,v 1.6 2003/01/18 13:24:44 massiot Exp $ * $Id: darwin_specific.h,v 1.7 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -21,7 +21,3 @@ ...@@ -21,7 +21,3 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
/*****************************************************************************
* Prototypes
*****************************************************************************/
VLC_EXPORT( char *, system_GetProgramPath, ( void ) );
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Declaration and extern access to global program object. * Declaration and extern access to global program object.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: main.h,v 1.51 2002/11/11 14:39:11 sam Exp $ * $Id: main.h,v 1.52 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -57,6 +57,9 @@ struct libvlc_t ...@@ -57,6 +57,9 @@ struct libvlc_t
/* Arch-specific variables */ /* Arch-specific variables */
#if defined( SYS_BEOS ) #if defined( SYS_BEOS )
vlc_object_t * p_appthread; vlc_object_t * p_appthread;
char * psz_vlcpath;
#elif defined( SYS_DARWIN )
char * psz_vlcpath;
#elif defined( WIN32 ) && !defined( UNDER_CE ) #elif defined( WIN32 ) && !defined( UNDER_CE )
SIGNALOBJECTANDWAIT SignalObjectAndWait; SIGNALOBJECTANDWAIT SignalObjectAndWait;
vlc_bool_t b_fast_mutex; vlc_bool_t b_fast_mutex;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.h : Module management functions. * modules.h : Module management functions.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.62 2002/11/11 14:39:11 sam Exp $ * $Id: modules.h,v 1.63 2003/01/19 03:16:24 sam 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
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module. * modules_inner.h : Macros used from within a module.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.36 2003/01/06 00:37:29 garf Exp $ * $Id: modules_inner.h,v 1.37 2003/01/19 03:16:24 sam 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
...@@ -113,16 +113,18 @@ ...@@ -113,16 +113,18 @@
p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \ p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \
} \ } \
{ \ { \
static module_config_t tmp = { CONFIG_HINT_END, NULL, NULL, '\0', \ static module_config_t tmp = { CONFIG_HINT_END, NULL, NULL, '\0', \
NULL, NULL, NULL, 0, 0.0, 0, 0, 0.0, 0.0, NULL,NULL, NULL, VLC_FALSE }; \ NULL, NULL, NULL, 0, 0.0, 0, 0, \
0.0, 0.0, NULL,NULL, NULL, \
VLC_FALSE }; \
p_config[ i_config ] = tmp; \ p_config[ i_config ] = tmp; \
} \ } \
config_Duplicate( p_module, p_config ); \ config_Duplicate( p_module, p_config ); \
if( p_module->p_config == NULL ) \ if( p_module->p_config == NULL ) \
{ \ { \
return -1; \ return VLC_EGENERIC; \
} \ } \
return 0 && i_shortcut; \ return VLC_SUCCESS && i_shortcut; \
} \ } \
struct _u_n_u_s_e_d_ /* the ; gets added */ struct _u_n_u_s_e_d_ /* the ; gets added */
...@@ -147,7 +149,7 @@ ...@@ -147,7 +149,7 @@
p_submodule->i_cpu = p_module->i_cpu; \ p_submodule->i_cpu = p_module->i_cpu; \
p_submodule->pf_activate = NULL; \ p_submodule->pf_activate = NULL; \
p_submodule->pf_deactivate = NULL p_submodule->pf_deactivate = NULL
#define add_requirement( cap ) \ #define add_requirement( cap ) \
p_module->i_cpu |= CPU_CAPABILITY_##cap p_module->i_cpu |= CPU_CAPABILITY_##cap
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread * spudec.c : SPU decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.10 2003/01/18 13:24:44 massiot Exp $ * $Id: spudec.c,v 1.11 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -128,7 +128,7 @@ static int RunDecoder( decoder_fifo_t * p_fifo ) ...@@ -128,7 +128,7 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
#ifdef SYS_DARWIN #ifdef SYS_DARWIN
if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL ) if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{ {
char * psz_vlcpath = system_GetProgramPath(); char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath;
psz_font = malloc( strlen(psz_vlcpath) + strlen("/share/") psz_font = malloc( strlen(psz_vlcpath) + strlen("/share/")
+ strlen(DEFAULT_FONT) + 1 ); + strlen(DEFAULT_FONT) + 1 );
sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath); sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath);
......
...@@ -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.56 2003/01/07 13:26:22 sam Exp $ * $Id: libvlc.c,v 1.57 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -961,7 +961,6 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -961,7 +961,6 @@ static void SetLanguage ( char const *psz_lang )
char * psz_path; char * psz_path;
#ifdef SYS_DARWIN #ifdef SYS_DARWIN
char * psz_vlcpath = system_GetProgramPath();
char psz_tmp[1024]; char psz_tmp[1024];
#endif #endif
...@@ -988,7 +987,7 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -988,7 +987,7 @@ static void SetLanguage ( char const *psz_lang )
#ifndef SYS_DARWIN #ifndef SYS_DARWIN
psz_path = LOCALEDIR; psz_path = LOCALEDIR;
#else #else
snprintf( psz_tmp, sizeof(psz_tmp), "%s/%s", psz_vlcpath, snprintf( psz_tmp, sizeof(psz_tmp), "%s/%s", libvlc.psz_vlcpath,
"locale" ); "locale" );
psz_path = psz_tmp; psz_path = psz_tmp;
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* beos_init.cpp: Initialization for BeOS specific features * beos_init.cpp: Initialization for BeOS specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: beos_specific.cpp,v 1.28 2003/01/12 02:08:39 titer Exp $ * $Id: beos_specific.cpp,v 1.29 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* *
...@@ -60,7 +60,6 @@ private: ...@@ -60,7 +60,6 @@ private:
/***************************************************************************** /*****************************************************************************
* Static vars * Static vars
*****************************************************************************/ *****************************************************************************/
static char * psz_program_path;
//const uint32 INTERFACE_CREATED = 'ifcr'; /* message sent from interface */ //const uint32 INTERFACE_CREATED = 'ifcr'; /* message sent from interface */
#include "../../modules/gui/beos/MsgVals.h" #include "../../modules/gui/beos/MsgVals.h"
...@@ -105,15 +104,7 @@ void system_End( vlc_t *p_this ) ...@@ -105,15 +104,7 @@ void system_End( vlc_t *p_this )
vlc_thread_join( p_this->p_libvlc->p_appthread ); vlc_thread_join( p_this->p_libvlc->p_appthread );
vlc_object_destroy( p_this->p_libvlc->p_appthread ); vlc_object_destroy( p_this->p_libvlc->p_appthread );
free( psz_program_path ); free( p_this->p_libvlc->psz_vlcpath );
}
/*****************************************************************************
* system_GetProgramPath: get the full path to the program.
*****************************************************************************/
char * system_GetProgramPath( void )
{
return( psz_program_path );
} }
/* following functions are local */ /* following functions are local */
...@@ -178,7 +169,7 @@ void VlcApplication::ReadyToRun( ) ...@@ -178,7 +169,7 @@ void VlcApplication::ReadyToRun( )
BEntry entry( &info.ref ); BEntry entry( &info.ref );
entry.GetPath( &path ); entry.GetPath( &path );
path.GetParent( &path ); path.GetParent( &path );
psz_program_path = strdup( path.Path() ); p_this->p_libvlc->psz_vlcpath = strdup( path.Path() );
/* Tell the main thread we are finished initializing the BApplication */ /* Tell the main thread we are finished initializing the BApplication */
vlc_thread_ready( p_this ); vlc_thread_ready( p_this );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* darwin_specific.m: Darwin specific features * darwin_specific.m: Darwin specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: darwin_specific.m,v 1.6 2003/01/16 14:40:04 massiot Exp $ * $Id: darwin_specific.m,v 1.7 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
/*****************************************************************************
* Static vars
*****************************************************************************/
static char * psz_program_path;
/***************************************************************************** /*****************************************************************************
* system_Init: fill in program path & retrieve language * system_Init: fill in program path & retrieve language
*****************************************************************************/ *****************************************************************************/
...@@ -100,7 +95,7 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) ...@@ -100,7 +95,7 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
char *p_char, *p_oldchar = &i_dummy; char *p_char, *p_oldchar = &i_dummy;
/* Get the full program path and name */ /* Get the full program path and name */
p_char = psz_program_path = strdup( ppsz_argv[ 0 ] ); p_char = p_this->p_libvlc->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
/* Remove trailing program name */ /* Remove trailing program name */
for( ; *p_char ; ) for( ; *p_char ; )
...@@ -157,14 +152,6 @@ void system_Configure( vlc_t *p_this ) ...@@ -157,14 +152,6 @@ void system_Configure( vlc_t *p_this )
*****************************************************************************/ *****************************************************************************/
void system_End( vlc_t *p_this ) void system_End( vlc_t *p_this )
{ {
free( psz_program_path ); free( p_this->p_libvlc->psz_vlcpath );
}
/*****************************************************************************
* system_GetProgramPath: get the full path to the program.
*****************************************************************************/
char * system_GetProgramPath( void )
{
return( psz_program_path );
} }
...@@ -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.109 2003/01/02 23:50:55 massiot Exp $ * $Id: modules.c,v 1.110 2003/01/19 03:16:24 sam 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>
...@@ -552,8 +552,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this ) ...@@ -552,8 +552,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
char ** ppsz_path = path; char ** ppsz_path = path;
char * psz_fullpath; char * psz_fullpath;
#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) #if defined( SYS_BEOS ) || defined( SYS_DARWIN )
char * psz_vlcpath = system_GetProgramPath(); int i_vlclen = strlen( p_this->p_libvlc->psz_vlcpath );
int i_vlclen = strlen( psz_vlcpath );
vlc_bool_t b_notinroot; vlc_bool_t b_notinroot;
#endif #endif
...@@ -584,7 +583,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this ) ...@@ -584,7 +583,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
{ {
continue; continue;
} }
sprintf( psz_fullpath, "%s/%s", psz_vlcpath, *ppsz_path ); sprintf( psz_fullpath, "%s/%s",
p_this->p_libvlc->psz_vlcpath, *ppsz_path );
} }
else else
#endif #endif
......
/***************************************************************************** /*****************************************************************************
* win32_specific.c: Win32 specific features * win32_specific.c: Win32 specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: win32_specific.c,v 1.19 2002/11/10 18:04:24 sam Exp $ * $Id: win32_specific.c,v 1.20 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,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
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_text.c : text manipulation functions * video_text.c : text manipulation functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video_text.c,v 1.41 2002/12/06 10:10:40 sam Exp $ * $Id: video_text.c,v 1.42 2003/01/19 03:16:24 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -222,7 +222,7 @@ vout_font_t *vout_LoadFont( vout_thread_t *p_vout, const char *psz_name ) ...@@ -222,7 +222,7 @@ vout_font_t *vout_LoadFont( vout_thread_t *p_vout, const char *psz_name )
char ** ppsz_path = path; char ** ppsz_path = path;
char * psz_file; char * psz_file;
#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) #if defined( SYS_BEOS ) || defined( SYS_DARWIN )
char * psz_vlcpath = system_GetProgramPath(); char * psz_vlcpath = p_this->p_libvlc->psz_vlcpath;
int i_vlclen = strlen( psz_vlcpath ); int i_vlclen = strlen( psz_vlcpath );
#endif #endif
int i_char, i_line; /* character and line indexes */ int i_char, i_line; /* character and line indexes */
......
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