2) From the plugin\win32 directory, use Borland C++ command-line tools
as follows:
bpr2mak intfwin.bpr -s \
- | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \
+ | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \
> intfwin.mak // Create a makefile from intfwin.bpr
make -fintfwin // It's Borland's make utility !
#
# C compiler flags: plugins and builtins compilation
#
-plugins_CFLAGS += -DPLUGIN -I../../include -I../../extras
-builtins_CFLAGS += -DBUILTIN -I../../include -I../../extras
+vlc_CFLAGS += -D__VLC__
+plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras
+builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras
#
# Linker flags: plugins and builtins linking
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.45 2002/03/26 23:08:40 gbazin Exp $
+ * $Id: audio_output.h,v 1.46 2002/04/24 00:36:24 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
} aout_bank_t;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern aout_bank_t *p_aout_bank;
#else
# define p_aout_bank (p_symbols->p_aout_bank)
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void aout_InitBank ( void );
void aout_EndBank ( void );
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.96 2002/04/21 11:23:03 gbazin Exp $
+ * $Id: common.h,v 1.97 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
} module_symbols_t;
-#ifdef PLUGIN
+#ifdef __PLUGIN__
extern module_symbols_t* p_symbols;
#endif
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: configuration.h,v 1.8 2002/04/23 14:16:19 sam Exp $
+ * $Id: configuration.h,v 1.9 2002/04/24 00:36:24 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* Prototypes - these methods are used to get, set or manipulate configuration
* data.
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
int config_GetIntVariable( const char *psz_name );
float config_GetFloatVariable( const char *psz_name );
char * config_GetPszVariable( const char *psz_name );
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-dec.h,v 1.55 2002/04/23 23:44:36 fenrir Exp $
+ * $Id: input_ext-dec.h,v 1.56 2002/04/24 00:36:24 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
/*****************************************************************************
* Prototypes from input_ext-dec.c
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s *,
void (* pf_bitstream_callback)( struct bit_stream_s *,
boolean_t ),
/*****************************************************************************
* Prototypes from input_dec.c
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void DecoderError ( struct decoder_fifo_s * p_fifo );
#else
# define DecoderError p_symbols->DecoderError
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.64 2002/04/23 14:16:20 sam Exp $
+ * $Id: input_ext-intf.h,v 1.65 2002/04/24 00:36:24 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
} input_bank_t;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern input_bank_t *p_input_bank;
#else
# define p_input_bank (p_symbols->p_input_bank)
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void input_InitBank ( void );
void input_EndBank ( void );
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_ext-plugins.h,v 1.21 2002/03/04 23:56:37 massiot Exp $
+ * $Id: input_ext-plugins.h,v 1.22 2002/04/24 00:36:24 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Prototypes from input_programs.c
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
int input_InitStream( struct input_thread_s *, size_t );
void input_EndStream ( struct input_thread_s * );
struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 );
/*****************************************************************************
* Prototypes from input_dec.c
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
//decoder_capabilities_s * input_ProbeDecoder( void );
vlc_thread_t input_RunDecoder( struct input_thread_s *,
struct es_descriptor_s * );
/*****************************************************************************
* Prototypes from input_clock.c
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void input_ClockInit( struct pgrm_descriptor_s * );
int input_ClockManageControl( struct input_thread_s *,
struct pgrm_descriptor_s *, mtime_t );
/*****************************************************************************
* Prototypes from input_ext-plugins.h (buffers management)
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void * input_BuffersInit( void );
void input_BuffersEnd( struct input_buffers_s * );
struct data_buffer_s * input_NewBuffer( struct input_buffers_s *, size_t );
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void input_ParsePES ( struct input_thread_s *, struct es_descriptor_s * );
void input_GatherPES ( struct input_thread_s *, struct data_packet_s *,
struct es_descriptor_s *, boolean_t, boolean_t );
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void input_FDClose( struct input_thread_s * );
ssize_t input_FDRead( input_thread_t *, byte_t *, size_t );
ssize_t input_FDNetworkRead( input_thread_t *, byte_t *, size_t );
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.27 2002/02/19 00:50:18 sam Exp $
+ * $Id: interface.h,v 1.28 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
void intf_MsgCreate ( void );
void intf_MsgDestroy ( void );
-#ifndef PLUGIN
+#ifndef __PLUGIN__
intf_subscription_t* intf_MsgSub ( void );
void intf_MsgUnsub ( intf_subscription_t * );
#else
* intf_eject.h: CD/DVD-ROM ejection handling functions
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: intf_eject.h,v 1.1 2002/01/09 02:01:14 sam Exp $
+ * $Id: intf_eject.h,v 1.2 2002/04/24 00:36:24 sam Exp $
*
* Author: Julien Blache <jb@technologeek.org>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
int intf_Eject( const char * );
#else
# define intf_Eject p_symbols->intf_Eject
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_msg.h,v 1.18 2002/02/19 00:50:19 sam Exp $
+ * $Id: intf_msg.h,v 1.19 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void intf_Msg ( char *psz_format, ... );
void intf_ErrMsg ( char *psz_format, ... );
void intf_WarnMsg ( int i_level, char *psz_format, ... );
* intf_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_playlist.h,v 1.5 2001/12/30 07:09:54 sam Exp $
+ * $Id: intf_playlist.h,v 1.6 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
playlist_t * intf_PlaylistCreate ( void );
void intf_PlaylistInit ( playlist_t * p_playlist );
int intf_PlaylistAdd ( playlist_t * p_playlist,
* iso_lang.h: function to decode language code (in dvd or a52 for instance).
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: iso_lang.h,v 1.2 2001/12/30 07:09:54 sam Exp $
+ * $Id: iso_lang.h,v 1.3 2002/04/24 00:36:24 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
char * DecodeLanguage( u16 );
#else
# define DecodeLanguage p_symbols->DecodeLanguage
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: main.h,v 1.33 2002/03/21 07:11:57 gbazin Exp $
+ * $Id: main.h,v 1.34 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
vlc_mutex_t config_lock; /* lock for the config file */
} main_t;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern main_t *p_main;
#else
# define p_main (p_symbols->p_main)
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.47 2002/04/19 13:56:10 sam Exp $
+ * $Id: modules.h,v 1.48 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
it is to design thread-safe linked lists */
} module_bank_t;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern module_bank_t *p_module_bank;
#else
# define p_module_bank (p_symbols->p_module_bank)
/*****************************************************************************
* Exported functions.
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void module_InitBank ( void );
void module_LoadMain ( void );
void module_LoadBuiltins ( void );
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.15 2002/04/23 14:16:20 sam Exp $
+ * $Id: modules_inner.h,v 1.16 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* #define MODULE_STRING "foo"
* #define MODULE_VAR(blah) "VLC_MODULE_foo_blah"
*
- * and, if BUILTIN is set, we will also need:
+ * and, if __BUILTIN__ is set, we will also need:
* #define MODULE_FUNC( zog ) module_foo_zog
*
* this can't easily be done with the C preprocessor, thus a few ugly hacks.
/* If the module is built-in, then we need to define foo_InitModule instead
* of InitModule. Same for Activate- and DeactivateModule. */
-#ifdef BUILTIN
+#ifdef __BUILTIN__
# define _M( function ) CONCATENATE( function, MODULE_NAME )
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
# define DECLARE_SYMBOLS ;
* Functions prototyped are implemented in interface/mtime.c.
*****************************************************************************
* Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
- * $Id: mtime.h,v 1.10 2002/01/29 20:11:18 gbazin Exp $
+ * $Id: mtime.h,v 1.11 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
char * mstrtime ( char *psz_buffer, mtime_t date );
mtime_t mdate ( void );
void mwait ( mtime_t date );
* modules.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: netutils.h,v 1.18 2001/12/30 07:09:54 sam Exp $
+ * $Id: netutils.h,v 1.19 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org>
struct sockaddr_in;
int network_BuildAddr ( struct sockaddr_in *, char *, int );
-#ifndef PLUGIN
+#ifndef __PLUGIN__
int network_ChannelJoin ( int );
int network_ChannelCreate ( void );
#else
* os_specific.h: OS specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: os_specific.h,v 1.1 2002/04/02 23:43:57 gbazin Exp $
+ * $Id: os_specific.h,v 1.2 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
****************************************************************************/
struct main_sys_s;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern struct main_sys_s *p_main_sys;
#else
# define p_main_sys (p_symbols->p_main_sys)
* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.73 2002/04/04 05:08:05 sam Exp $
+ * $Id: video_output.h,v 1.74 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
} vout_bank_t;
-#ifndef PLUGIN
+#ifndef __PLUGIN__
extern vout_bank_t *p_vout_bank;
#else
# define p_vout_bank (p_symbols->p_vout_bank)
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#ifndef PLUGIN
+#ifndef __PLUGIN__
void vout_InitBank ( void );
void vout_EndBank ( void );
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc.h,v 1.6 2002/04/02 23:43:57 gbazin Exp $
+ * $Id: vlc.h,v 1.7 2002/04/24 00:36:24 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
/*****************************************************************************
* Required vlc headers
*****************************************************************************/
-#include "defs.h"
-#include "config.h"
+#if defined( __VLC__ ) || defined( __PLUGIN__ ) || defined( __BUILTIN__ )
+# include "defs.h"
+# include "config.h"
-#if defined( PLUGIN ) || defined( BUILTIN )
-# include "modules_inner.h"
-#endif
+# if defined( __PLUGIN__ ) || defined( __BUILTIN__ )
+# include "modules_inner.h"
+# endif
+
+# include "common.h"
-#include "common.h"
+# include "os_specific.h"
-#include "os_specific.h"
+# include "intf_msg.h"
+# include "threads.h"
+# include "mtime.h"
+# include "modules.h"
+
+# include "main.h"
+# include "configuration.h"
+#endif
-#include "intf_msg.h"
-#include "threads.h"
-#include "mtime.h"
-#include "modules.h"
+int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] );
-#include "main.h"
-#include "configuration.h"
../intfwin.so: Makefile
rm -f intfwin.mak
- $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak
+ $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak
$(BCBUILDER)/Bin/make -f intfwin.mak -b
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.5 2002/04/02 22:46:25 massiot Exp $
+ * $Id: input_ext-plugins.c,v 1.6 2002/04/24 00:36:24 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
i_ret = select( p_access_data->i_handle + 1, &fds,
NULL, NULL, &timeout );
- if( i_ret == -1 )
+ if( i_ret == -1 && errno != EINTR )
{
intf_ErrMsg( "input error: network select error (%s)", strerror(errno) );
}
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: intf_msg.c,v 1.47 2002/03/20 23:00:15 gbazin Exp $
+ * $Id: intf_msg.c,v 1.48 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/*****************************************************************************
* QueueMsg: add a message to a queue
*****************************************************************************
- * This function provide basic functionnalities to other intf_*Msg functions.
- * It add a message to a queue (after having printed all stored messages if it
- * is full. If the message can't be converted to string in memory, it exit the
- * program. If the queue is not used, it prints the message immediately.
+ * This function provides basic functionnalities to other intf_*Msg functions.
+ * It adds a message to a queue (after having printed all stored messages if it
+ * is full). If the message can't be converted to string in memory, it issues
+ * a warning.
*****************************************************************************/
static void QueueMsg( int i_type, int i_level, char *psz_format, va_list ap )
{
strerror(errno) );
vfprintf(stderr, psz_format, ap );
fprintf(stderr, "\n" );
- exit( errno );
+ return;
}
#ifndef HAVE_VASPRINTF
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.186 2002/04/23 14:16:21 sam Exp $
+ * $Id: main.c,v 1.187 2002/04/24 00:36:24 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* macros.
*
*****************************************************************************/
-#define BUILTIN
+#define __BUILTIN__
#define MODULE_NAME main
#include "modules_inner.h" /* for configuration stuff */
/* Get the executable name (similar to the basename command) */
- p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ];
- while( *p_tmp )
+ if( i_argc > 0 )
{
- if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp;
- else ++p_tmp;
+ p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ];
+ while( *p_tmp )
+ {
+ if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp;
+ else ++p_tmp;
+ }
+ }
+ else
+ {
+ p_main->psz_arg0 = "vlc";
}
/*