successfully opens plugins.
* ./modules/misc/dummy/*: hacked the dummy plugin so that it compiles for
WinCE.
# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r\r
CPP=cl.exe\r
# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Yu"stdafx.h" /Gz /c\r
-# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /Gz /c\r
+# ADD CPP /nologo /W3 /Zi /Od /I "." /I "..\include" /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /FR /Gz /c\r
# SUBTRACT CPP /YX /Yc /Yu\r
MTL=midl.exe\r
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32\r
# Name "vlc - Win32 (WCE ARM) Debug"\r
# Name "vlc - Win32 (WCE x86em) Release"\r
# Name "vlc - Win32 (WCE x86em) Debug"\r
-\r
# Begin Group "Source Files"\r
+\r
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
# Begin Source File\r
+\r
SOURCE="..\evc\vlc.c"\r
+\r
+!IF "$(CFG)" == "vlc - Win32 (WCE MIPS) Release"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE MIPS) Debug"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE SH4) Release"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE SH4) Debug"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE SH3) Release"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE SH3) Debug"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE ARM) Release"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE ARM) Debug"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE x86em) Release"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ELSEIF "$(CFG)" == "vlc - Win32 (WCE x86em) Debug"\r
+\r
+DEP_CPP_VLC_C=\\r
+ "..\include\beos_specific.h"\\r
+ "..\include\configuration.h"\\r
+ "..\include\darwin_specific.h"\\r
+ "..\include\main.h"\\r
+ "..\include\modules.h"\\r
+ "..\include\modules_inner.h"\\r
+ "..\include\mtime.h"\\r
+ "..\include\os_specific.h"\\r
+ "..\include\variables.h"\\r
+ "..\include\vlc\vlc.h"\\r
+ "..\include\vlc_common.h"\\r
+ "..\include\vlc_config.h"\\r
+ "..\include\vlc_messages.h"\\r
+ "..\include\vlc_objects.h"\\r
+ "..\include\vlc_symbols.h"\\r
+ "..\include\vlc_threads.h"\\r
+ "..\include\vlc_threads_funcs.h"\\r
+ "..\include\win32_specific.h"\\r
+ ".\config.h"\\r
+ \r
+\r
+!ENDIF \r
+\r
# End Source File\r
# End Group\r
-\r
# Begin Group "Resource Files"\r
\r
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
\r
###############################################################################\r
\r
-Project: "plugin_foo"=.\plugin_foo\plugin_foo.vcp - Package Owner=<4>\r
+Project: "plugin_dummy"=.\plugin_dummy.vcp - Package Owner=<4>\r
\r
Package=<5>\r
{{{\r
\r
###############################################################################\r
\r
-Project: "plugins"=.\plugins.vcp - Package Owner=<4>\r
-\r
-Package=<5>\r
-{{{\r
-}}}\r
-\r
-Package=<4>\r
-{{{\r
- Begin Project Dependency\r
- Project_Dep_Name libvlc\r
- End Project Dependency\r
-}}}\r
-\r
-###############################################################################\r
-\r
Project: "vlc"=.\vlc.vcp - Package Owner=<4>\r
\r
Package=<5>\r
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.32 2002/09/30 11:05:33 sam Exp $
+ * $Id: modules_inner.h,v 1.33 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
# define STORE_SYMBOLS p_symbols = p_module->p_symbols
#endif
+#if defined( __PLUGIN__ ) && ( defined( WIN32 ) || defined( UNDER_CE ) )
+# define DLL_SYMBOL __declspec(dllexport)
+# define CDECL_SYMBOL __cdecl
+#else
+# define DLL_SYMBOL
+# define CDECL_SYMBOL
+#endif
+
#if defined( __cplusplus )
# define EXTERN_SYMBOL extern "C"
#else
*/
#define vlc_module_begin( ) \
DECLARE_SYMBOLS; \
- EXTERN_SYMBOL int __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
+ EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \
+ __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
{ \
int i_shortcut = 1, i_config = 0; \
module_config_t p_config[ 100 ]; \
} \
return 0 && i_shortcut; \
} \
- int __VLC_SYMBOL(vlc_entry) ( module_t * ) /* the ; gets added */
+ struct _u_n_u_s_e_d_ /* the ; gets added */
#define add_submodule( ) \
* dec_dummy.c: dummy decoder plugin for vlc.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: decoder.c,v 1.3 2002/10/27 16:58:13 gbazin Exp $
+ * $Id: decoder.c,v 1.4 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* write(), close() */
#endif
-
-#include <sys/types.h> /* open() */
-#include <sys/stat.h>
-#include <fcntl.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h> /* open() */
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
#include <stdio.h> /* sprintf() */
size_t i_bytes = 0;
char psz_file[100];
+#ifndef UNDER_CE
int i_fd;
+#endif
sprintf( psz_file, "stream.%i", p_fifo->i_object_id );
+#ifndef UNDER_CE
i_fd = open( psz_file, O_WRONLY | O_CREAT | O_TRUNC, 00644 );
if( i_fd == -1 )
DecoderError( p_fifo );
return -1;
}
+#endif
msg_Dbg( p_fifo, "dumping stream to file `%s'", psz_file );
msg_Err( p_fifo, "cannot initialize bitstream" );
p_fifo->b_error = 1;
DecoderError( p_fifo );
+#ifndef UNDER_CE
close( i_fd );
+#endif
return -1;
}
while( !p_fifo->b_die && !p_fifo->b_error )
{
GetChunk( &bit_stream, p_buffer, 1024 );
+#ifndef UNDER_CE
write( i_fd, p_buffer, 1024 );
i_bytes += 1024;
+#endif
if( mdate() < last_date + 2000000 )
{
msg_Dbg( p_fifo, "dumped %i bytes", i_bytes );
}
+#ifndef UNDER_CE
close( i_fd );
+#endif
CloseBitstream( &bit_stream );
if( p_fifo->b_error )
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: input.c,v 1.2 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Preamble
*****************************************************************************/
#include <stdlib.h>
-#include <sys/types.h>
#include <string.h>
-#include <errno.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/input.h>
+#ifndef HAVE_STRNCASECMP
+# define strncasecmp(a,b,c) strcmp(a,b)
+#endif
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout.c,v 1.2 2002/09/10 12:58:42 sam Exp $
+ * $Id: vout.c,v 1.3 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.104 2002/11/13 15:28:24 sam Exp $
+ * $Id: modules.c,v 1.105 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
+#elif defined( UNDER_CE )
+# include <windows.h> /* GetFileAttributes() */
#else
# include "../extras/dirent.h"
#endif
#include "iso_lang.h"
+#if defined( UNDER_CE )
+# define MYCHAR wchar_t
+#else
+# define MYCHAR char
+#endif
+
#ifdef HAVE_DYNAMIC_PLUGINS
# include "modules_plugin.h"
#endif
*****************************************************************************/
#ifdef HAVE_DYNAMIC_PLUGINS
static void AllocateAllPlugins ( vlc_object_t * );
-static void AllocatePluginDir ( vlc_object_t *, const char *, int );
-static int AllocatePluginFile ( vlc_object_t *, char * );
+static void AllocatePluginDir ( vlc_object_t *, const MYCHAR *, int );
+static int AllocatePluginFile ( vlc_object_t *, MYCHAR * );
#endif
static int AllocateBuiltinModule( vlc_object_t *, int ( * ) ( module_t * ) );
static int DeleteModule ( module_t * );
vlc_bool_t b_notinroot;
#endif
+#if defined( UNDER_CE )
+ wchar_t psz_dir[MAX_PATH];
+#endif
+
/* If the user provided a plugin path, we add it to the list */
path[ sizeof(path)/sizeof(char*) - 2 ] = config_GetPsz( p_this,
"plugin-path" );
msg_Dbg( p_this, "recursively browsing `%s'", psz_fullpath );
/* Don't go deeper than 5 subdirectories */
+#if defined( UNDER_CE )
+ MultiByteToWideChar( CP_ACP, 0, psz_fullpath, -1, psz_dir, MAX_PATH );
+ AllocatePluginDir( p_this, psz_dir, 5 );
+#else
AllocatePluginDir( p_this, psz_fullpath, 5 );
+#endif
#if defined( SYS_BEOS ) || defined( SYS_DARWIN )
if( b_notinroot )
/*****************************************************************************
* AllocatePluginDir: recursively parse a directory to look for plugins
*****************************************************************************/
-static void AllocatePluginDir( vlc_object_t *p_this, const char *psz_dir,
+static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
int i_maxdepth )
{
+#ifdef UNDER_CE
+ MYCHAR psz_path[MAX_PATH + 256];
+ WIN32_FIND_DATA finddata;
+ HANDLE handle;
+ unsigned int rc;
+#else
int i_dirlen;
DIR * dir;
char * psz_file;
-
struct dirent * file;
+#endif
if( i_maxdepth < 0 )
{
return;
}
- dir = opendir( psz_dir );
+#ifdef UNDER_CE
+ rc = GetFileAttributes( psz_dir );
+ if( !(rc & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ /* Not a directory */
+ return;
+ }
+
+ /* Parse all files in the directory */
+ swprintf( psz_path, L"%s\\*.*", psz_dir );
+ handle = FindFirstFile( psz_path, &finddata );
+ if( handle == INVALID_HANDLE_VALUE )
+ {
+ /* Empty directory */
+ return;
+ }
+
+ /* Parse the directory and try to load all files it contains. */
+ do
+ {
+ unsigned int i_len = wcslen( finddata.cFileName );
+
+ swprintf( psz_path, L"%s\\%s", psz_dir, finddata.cFileName );
+
+ if( GetFileAttributes( psz_path ) & FILE_ATTRIBUTE_DIRECTORY )
+ {
+ AllocatePluginDir( p_this, psz_path, i_maxdepth - 1 );
+ }
+ else if( i_len > strlen( LIBEXT ) )
+ {
+ AllocatePluginFile( p_this, psz_path );
+ }
+ }
+ while( FindNextFile( handle, &finddata ) );
+ /* Close the directory */
+ FindClose( handle );
+
+#else
+ dir = opendir( psz_dir );
if( !dir )
{
return;
/* Parse the directory and try to load all files it contains. */
while( (file = readdir( dir )) )
{
-#ifndef UNDER_CE
struct stat statbuf;
-#endif
unsigned int i_len;
/* Skip ".", ".." and anything starting with "." */
}
i_len = strlen( file->d_name );
-
- psz_file = malloc( i_dirlen + 1 /* / */ + i_len + 1 /* \0 */ );
+ psz_file = malloc( i_dirlen + 1 + i_len + 1 );
sprintf( psz_file, "%s/%s", psz_dir, file->d_name );
-#ifdef UNDER_CE
- if( GetFileAttributes( psz_file ) & FILE_ATTRIBUTE_DIRECTORY )
-#else
if( !stat( psz_file, &statbuf ) && statbuf.st_mode & S_IFDIR )
-#endif
{
AllocatePluginDir( p_this, psz_file, i_maxdepth - 1 );
}
&& !strncasecmp( file->d_name + i_len - strlen( LIBEXT ),
LIBEXT, strlen( LIBEXT ) ) )
{
- AllocatePluginFile( p_this, psz_file );
+ AllocatePluginFile( p_this, psz_file )
}
free( psz_file );
/* Close the directory */
closedir( dir );
+
+#endif
}
/*****************************************************************************
* for its information data. The module can then be handled by module_Need
* and module_Unneed. It can be removed by DeleteModule.
*****************************************************************************/
-static int AllocatePluginFile( vlc_object_t * p_this, char * psz_file )
+static int AllocatePluginFile( vlc_object_t * p_this, MYCHAR * psz_file )
{
module_t * p_module;
module_handle_t handle;
}
/* We need to fill these since they may be needed by CallEntry() */
- p_module->psz_filename = psz_file;
+ /* FIXME: this is not unicode-compliant */
+ p_module->psz_filename = (char *)psz_file;
p_module->handle = handle;
p_module->p_symbols = &p_this->p_libvlc->p_module_bank->symbols;
* modules_plugin.h : Plugin management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_plugin.h.in,v 1.6 2002/11/11 14:39:12 sam Exp $
+ * $Id: modules_plugin.h.in,v 1.7 2002/11/18 18:05:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This function loads a dynamically linked library using a system dependant
* method, and returns a non-zero value on error, zero otherwise.
*****************************************************************************/
-static int module_load( const char * psz_filename, module_handle_t * handle )
+static int module_load( const MYCHAR * psz_filename, module_handle_t * handle )
{
#ifdef SYS_BEOS
*handle = load_add_on( psz_filename );
if( B_OK == get_image_symbol( handle, psz_function,
B_SYMBOL_TYPE_TEXT, &p_symbol ) )
{
- return( p_symbol );
+ return p_symbol;
}
else
{
- return( NULL );
+ return NULL;
}
-#elif defined(WIN32) || defined(UNDER_CE)
- return( (void *)GetProcAddress( handle, psz_function ) );
+#elif defined( UNDER_CE )
+ wchar_t psz_real[256];
+ MultiByteToWideChar( CP_ACP, 0, psz_function, -1, psz_real, 256 );
+
+ return (void *)GetProcAddress( handle, psz_real );
+
+#elif defined( WIN32 )
+ return (void *)GetProcAddress( handle, (MYCHAR*)psz_function );
#else
- return( dlsym( handle, psz_function ) );
+ return dlsym( handle, psz_function );
#endif
}
#if defined(SYS_BEOS)
return( "failed" );
-#elif defined(WIN32) || defined(UNDER_CE)
+#elif defined(UNDER_CE)
+ wchar_t psz_tmp[256];
+
+ int i, i_error = GetLastError();
+
+ FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, i_error, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) psz_tmp, 256, NULL );
+
+ /* Go to the end of the string */
+ for( i = 0;
+ psz_tmp[i] && psz_tmp[i] != L'\r' && psz_tmp[i] != L'\n';
+ i++ ) {};
+
+ if( psz_tmp[i] )
+ {
+ swprintf( psz_tmp + i, L" (error %i)", i_error );
+ psz_tmp[ 255 ] = L'\0';
+ }
+
+ WideCharToMultiByte( CP_ACP, WC_DEFAULTCHAR, psz_tmp, -1,
+ psz_buffer, 256, NULL, NULL );
+
+ return psz_buffer;
+
+#elif defined(WIN32)
int i, i_error = GetLastError();
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, i_error, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) psz_buffer, 256, NULL);
+ (LPTSTR) psz_buffer, 256, NULL );
/* Go to the end of the string */
for( i = 0;
if( psz_buffer[i] )
{
snprintf( psz_buffer + i, 256 - i, " (error %i)", i_error );
- psz_buffer[ 255 ] = '\0';
+ psz_buffer[ 255 ] = '\0';
}
return psz_buffer;