Changeset 08999a39bccd9b1b199294933a54c50e94f4148f

Show
Ignore:
Timestamp:
04/24/02 02:36:24 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1019608584 +0000
git-parent:

[4144b604ceafac6c65629df78a9078f7d93e7e6b]

git-author:
Sam Hocevar <sam@videolan.org> 1019608584 +0000
Message:
  • ./src/interface/main.c: we no longer segfault if argc == 0.
  • ALL: renamed PLUGINS to PLUGINS to avoid conflicts with libraries
    defining it. Grmbl.
  • ./src/input/input_ext-plugins.c: cosmetic change.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • INSTALL.win32

    r1b0868e r08999a3  
    129129as follows: 
    130130bpr2mak intfwin.bpr -s \ 
    131   | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \ 
     131  | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \ 
    132132  > intfwin.mak         // Create a makefile from intfwin.bpr 
    133133make -fintfwin      // It's Borland's make utility ! 
  • Makefile.opts.in

    rfbe65af r08999a3  
    252252# C compiler flags: plugins and builtins compilation 
    253253# 
    254 plugins_CFLAGS += -DPLUGIN -I../../include -I../../extras 
    255 builtins_CFLAGS += -DBUILTIN -I../../include -I../../extras 
     254vlc_CFLAGS += -D__VLC__ 
     255plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras 
     256builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras 
    256257 
    257258# 
  • include/audio_output.h

    r5322a29 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: audio_output.h,v 1.45 2002/03/26 23:08:40 gbazin Exp $ 
     5 * $Id: audio_output.h,v 1.46 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Michel Kaempf <maxx@via.ecp.fr> 
     
    3838} aout_bank_t; 
    3939 
    40 #ifndef PLUGIN 
     40#ifndef __PLUGIN__ 
    4141extern aout_bank_t *p_aout_bank; 
    4242#else 
     
    208208 * Prototypes 
    209209 *****************************************************************************/ 
    210 #ifndef PLUGIN 
     210#ifndef __PLUGIN__ 
    211211void            aout_InitBank           ( void ); 
    212212void            aout_EndBank            ( void ); 
  • include/common.h

    rce25f1e r08999a3  
    44 ***************************************************************************** 
    55 * Copyright (C) 1998, 1999, 2000 VideoLAN 
    6  * $Id: common.h,v 1.96 2002/04/21 11:23:03 gbazin Exp $ 
     6 * $Id: common.h,v 1.97 2002/04/24 00:36:24 sam Exp $ 
    77 * 
    88 * Authors: Samuel Hocevar <sam@via.ecp.fr> 
     
    683683} module_symbols_t; 
    684684 
    685 #ifdef PLUGIN 
     685#ifdef __PLUGIN__ 
    686686extern module_symbols_t* p_symbols; 
    687687#endif 
  • include/configuration.h

    ra6bccb1 r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: configuration.h,v 1.8 2002/04/23 14:16:19 sam Exp $ 
     7 * $Id: configuration.h,v 1.9 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    6666 * data. 
    6767 *****************************************************************************/ 
    68 #ifndef PLUGIN 
     68#ifndef __PLUGIN__ 
    6969int    config_GetIntVariable( const char *psz_name ); 
    7070float  config_GetFloatVariable( const char *psz_name ); 
  • include/input_ext-dec.h

    r4144b60 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: input_ext-dec.h,v 1.55 2002/04/23 23:44:36 fenrir Exp $ 
     5 * $Id: input_ext-dec.h,v 1.56 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    211211 * Prototypes from input_ext-dec.c 
    212212 *****************************************************************************/ 
    213 #ifndef PLUGIN 
     213#ifndef __PLUGIN__ 
    214214void InitBitstream  ( struct bit_stream_s *, struct decoder_fifo_s *, 
    215215                      void (* pf_bitstream_callback)( struct bit_stream_s *, 
     
    543543 * Prototypes from input_dec.c 
    544544 *****************************************************************************/ 
    545 #ifndef PLUGIN 
     545#ifndef __PLUGIN__ 
    546546void DecoderError      ( struct decoder_fifo_s * p_fifo ); 
    547547#else 
  • include/input_ext-intf.h

    ra6bccb1 r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: input_ext-intf.h,v 1.64 2002/04/23 14:16:20 sam Exp $ 
     7 * $Id: input_ext-intf.h,v 1.65 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    5050} input_bank_t; 
    5151 
    52 #ifndef PLUGIN 
     52#ifndef __PLUGIN__ 
    5353extern input_bank_t *p_input_bank; 
    5454#else 
     
    330330 * Prototypes 
    331331 *****************************************************************************/ 
    332 #ifndef PLUGIN 
     332#ifndef __PLUGIN__ 
    333333void   input_InitBank       ( void ); 
    334334void   input_EndBank        ( void ); 
  • include/input_ext-plugins.h

    r5658c1d r08999a3  
    44 ***************************************************************************** 
    55 * Copyright (C) 1999-2002 VideoLAN 
    6  * $Id: input_ext-plugins.h,v 1.21 2002/03/04 23:56:37 massiot Exp $ 
     6 * $Id: input_ext-plugins.h,v 1.22 2002/04/24 00:36:24 sam Exp $ 
    77 * 
    88 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    3939 * Prototypes from input_programs.c 
    4040 *****************************************************************************/ 
    41 #ifndef PLUGIN 
     41#ifndef __PLUGIN__ 
    4242int  input_InitStream( struct input_thread_s *, size_t ); 
    4343void input_EndStream ( struct input_thread_s * ); 
     
    7474 * Prototypes from input_dec.c 
    7575 *****************************************************************************/ 
    76 #ifndef PLUGIN 
     76#ifndef __PLUGIN__ 
    7777//decoder_capabilities_s * input_ProbeDecoder( void ); 
    7878vlc_thread_t input_RunDecoder( struct input_thread_s *, 
     
    9090 * Prototypes from input_clock.c 
    9191 *****************************************************************************/ 
    92 #ifndef PLUGIN 
     92#ifndef __PLUGIN__ 
    9393void input_ClockInit( struct pgrm_descriptor_s * ); 
    9494int  input_ClockManageControl( struct input_thread_s *, 
     
    105105 * Prototypes from input_ext-plugins.h (buffers management) 
    106106 *****************************************************************************/ 
    107 #ifndef PLUGIN 
     107#ifndef __PLUGIN__ 
    108108void * input_BuffersInit( void ); 
    109109void input_BuffersEnd( struct input_buffers_s * ); 
     
    284284 * Prototypes 
    285285 *****************************************************************************/ 
    286 #ifndef PLUGIN 
     286#ifndef __PLUGIN__ 
    287287void input_ParsePES  ( struct input_thread_s *, struct es_descriptor_s * ); 
    288288void input_GatherPES ( struct input_thread_s *, struct data_packet_s *, 
     
    324324 * Prototypes 
    325325 *****************************************************************************/ 
    326 #ifndef PLUGIN 
     326#ifndef __PLUGIN__ 
    327327void input_FDClose( struct input_thread_s * ); 
    328328ssize_t input_FDRead( input_thread_t *, byte_t *, size_t ); 
  • include/interface.h

    r730cc39 r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: interface.h,v 1.27 2002/02/19 00:50:18 sam Exp $ 
     7 * $Id: interface.h,v 1.28 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    101101void            intf_MsgDestroy   ( void ); 
    102102 
    103 #ifndef PLUGIN 
     103#ifndef __PLUGIN__ 
    104104intf_subscription_t* intf_MsgSub    ( void ); 
    105105void                 intf_MsgUnsub  ( intf_subscription_t * ); 
  • include/intf_eject.h

    rc7b1c47 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: intf_eject.h,v 1.1 2002/01/09 02:01:14 sam Exp $ 
     5 * $Id: intf_eject.h,v 1.2 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Author: Julien Blache <jb@technologeek.org> 
     
    2222 *****************************************************************************/ 
    2323 
    24 #ifndef PLUGIN 
     24#ifndef __PLUGIN__ 
    2525int intf_Eject( const char * ); 
    2626#else 
  • include/intf_msg.h

    r730cc39 r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: intf_msg.h,v 1.18 2002/02/19 00:50:19 sam Exp $ 
     7 * $Id: intf_msg.h,v 1.19 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    2727 * Prototypes 
    2828 *****************************************************************************/ 
    29 #ifndef PLUGIN 
     29#ifndef __PLUGIN__ 
    3030void intf_Msg            ( char *psz_format, ... ); 
    3131void intf_ErrMsg         ( char *psz_format, ... ); 
  • include/intf_playlist.h

    rcc0f0bb r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: intf_playlist.h,v 1.5 2001/12/30 07:09:54 sam Exp $ 
     5 * $Id: intf_playlist.h,v 1.6 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    7070 * Prototypes 
    7171 *****************************************************************************/ 
    72 #ifndef PLUGIN 
     72#ifndef __PLUGIN__ 
    7373playlist_t * intf_PlaylistCreate   ( void ); 
    7474void         intf_PlaylistInit     ( playlist_t * p_playlist ); 
  • include/iso_lang.h

    rcc0f0bb r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: iso_lang.h,v 1.2 2001/12/30 07:09:54 sam Exp $ 
     5 * $Id: iso_lang.h,v 1.3 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Author: St�ane Borel <stef@via.ecp.fr> 
     
    2222 *****************************************************************************/ 
    2323 
    24 #ifndef PLUGIN 
     24#ifndef __PLUGIN__ 
    2525char * DecodeLanguage( u16 ); 
    2626#else 
  • include/main.h

    rfb3f8ba r08999a3  
    44 ***************************************************************************** 
    55 * Copyright (C) 1999, 2000 VideoLAN 
    6  * $Id: main.h,v 1.33 2002/03/21 07:11:57 gbazin Exp $ 
     6 * $Id: main.h,v 1.34 2002/04/24 00:36:24 sam Exp $ 
    77 * 
    88 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    7070} main_t; 
    7171 
    72 #ifndef PLUGIN 
     72#ifndef __PLUGIN__ 
    7373extern main_t *p_main; 
    7474#else 
  • include/modules.h

    r4f6c862 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules.h,v 1.47 2002/04/19 13:56:10 sam Exp $ 
     5 * $Id: modules.h,v 1.48 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    9797} module_bank_t; 
    9898 
    99 #ifndef PLUGIN 
     99#ifndef __PLUGIN__ 
    100100extern module_bank_t *p_module_bank; 
    101101#else 
     
    336336 * Exported functions. 
    337337 *****************************************************************************/ 
    338 #ifndef PLUGIN 
     338#ifndef __PLUGIN__ 
    339339void            module_InitBank     ( void ); 
    340340void            module_LoadMain     ( void ); 
  • include/modules_inner.h

    ra6bccb1 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules_inner.h,v 1.15 2002/04/23 14:16:20 sam Exp $ 
     5 * $Id: modules_inner.h,v 1.16 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    3939 * #define MODULE_VAR(blah) "VLC_MODULE_foo_blah" 
    4040 * 
    41  * and, if BUILTIN is set, we will also need: 
     41 * and, if __BUILTIN__ is set, we will also need: 
    4242 * #define MODULE_FUNC( zog ) module_foo_zog 
    4343 * 
     
    5656/* If the module is built-in, then we need to define foo_InitModule instead 
    5757 * of InitModule. Same for Activate- and DeactivateModule. */ 
    58 #ifdef BUILTIN 
     58#ifdef __BUILTIN__ 
    5959#   define _M( function )          CONCATENATE( function, MODULE_NAME ) 
    6060#   define __VLC_SYMBOL( symbol )  CONCATENATE( symbol, MODULE_NAME ) 
  • include/mtime.h

    ree87a69 r08999a3  
    1010 ***************************************************************************** 
    1111 * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN 
    12  * $Id: mtime.h,v 1.10 2002/01/29 20:11:18 gbazin Exp $ 
     12 * $Id: mtime.h,v 1.11 2002/04/24 00:36:24 sam Exp $ 
    1313 * 
    1414 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    5151 * Prototypes 
    5252 *****************************************************************************/ 
    53 #ifndef PLUGIN 
     53#ifndef __PLUGIN__ 
    5454char *  mstrtime ( char *psz_buffer, mtime_t date ); 
    5555mtime_t mdate    ( void ); 
  • include/netutils.h

    rcc0f0bb r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000, 2001 VideoLAN 
    7  * $Id: netutils.h,v 1.18 2001/12/30 07:09:54 sam Exp $ 
     7 * $Id: netutils.h,v 1.19 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    3434int   network_BuildAddr       ( struct sockaddr_in *, char *, int );  
    3535 
    36 #ifndef PLUGIN 
     36#ifndef __PLUGIN__ 
    3737int   network_ChannelJoin     ( int ); 
    3838int   network_ChannelCreate   ( void ); 
  • include/os_specific.h

    r4f08a70 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: os_specific.h,v 1.1 2002/04/02 23:43:57 gbazin Exp $ 
     5 * $Id: os_specific.h,v 1.2 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    4242struct main_sys_s; 
    4343 
    44 #ifndef PLUGIN 
     44#ifndef __PLUGIN__ 
    4545extern struct main_sys_s *p_main_sys; 
    4646#else 
  • include/video_output.h

    rb29f85e r08999a3  
    66 ***************************************************************************** 
    77 * Copyright (C) 1999, 2000 VideoLAN 
    8  * $Id: video_output.h,v 1.73 2002/04/04 05:08:05 sam Exp $ 
     8 * $Id: video_output.h,v 1.74 2002/04/24 00:36:24 sam Exp $ 
    99 * 
    1010 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    4040} vout_bank_t; 
    4141 
    42 #ifndef PLUGIN 
     42#ifndef __PLUGIN__ 
    4343extern vout_bank_t *p_vout_bank; 
    4444#else 
     
    190190 * Prototypes 
    191191 *****************************************************************************/ 
    192 #ifndef PLUGIN 
     192#ifndef __PLUGIN__ 
    193193void            vout_InitBank       ( void ); 
    194194void            vout_EndBank        ( void ); 
  • include/videolan/vlc.h

    r4f08a70 r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998, 1999, 2000 VideoLAN 
    5  * $Id: vlc.h,v 1.6 2002/04/02 23:43:57 gbazin Exp $ 
     5 * $Id: vlc.h,v 1.7 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@via.ecp.fr> 
     
    2727 * Required vlc headers 
    2828 *****************************************************************************/ 
    29 #include "defs.h" 
    30 #include "config.h" 
     29#if defined( __VLC__ ) || defined( __PLUGIN__ ) || defined( __BUILTIN__ ) 
     30#   include "defs.h" 
     31#   include "config.h" 
    3132 
    32 #if defined( PLUGIN ) || defined( BUILTIN ) 
    33 #   include "modules_inner.h" 
     33#   if defined( __PLUGIN__ ) || defined( __BUILTIN__ ) 
     34#       include "modules_inner.h" 
     35#   endif 
     36 
     37#   include "common.h" 
     38 
     39#   include "os_specific.h" 
     40 
     41#   include "intf_msg.h" 
     42#   include "threads.h" 
     43#   include "mtime.h" 
     44#   include "modules.h" 
     45 
     46#   include "main.h" 
     47#   include "configuration.h" 
    3448#endif 
    3549 
    36 #include "common.h" 
     50int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ); 
    3751 
    38 #include "os_specific.h" 
    39  
    40 #include "intf_msg.h" 
    41 #include "threads.h" 
    42 #include "mtime.h" 
    43 #include "modules.h" 
    44  
    45 #include "main.h" 
    46 #include "configuration.h" 
  • plugins/win32/Makefile

    r0d69146 r08999a3  
    1212../intfwin.so: Makefile 
    1313    rm -f intfwin.mak 
    14     $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak 
     14    $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -D__PLUGIN__ -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak 
    1515    $(BCBUILDER)/Bin/make -f intfwin.mak -b 
    1616 
  • src/input/input_ext-plugins.c

    r2fda60d r08999a3  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: input_ext-plugins.c,v 1.5 2002/04/02 22:46:25 massiot Exp $ 
     5 * $Id: input_ext-plugins.c,v 1.6 2002/04/24 00:36:24 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    727727                     NULL, NULL, &timeout ); 
    728728  
    729     if( i_ret == -1
     729    if( i_ret == -1 && errno != EINTR
    730730    { 
    731731        intf_ErrMsg( "input error: network select error (%s)", strerror(errno) ); 
  • src/interface/intf_msg.c

    r313043f r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2001 VideoLAN 
    7  * $Id: intf_msg.c,v 1.47 2002/03/20 23:00:15 gbazin Exp $ 
     7 * $Id: intf_msg.c,v 1.48 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    292292 * QueueMsg: add a message to a queue 
    293293 ***************************************************************************** 
    294  * This function provide basic functionnalities to other intf_*Msg functions. 
    295  * It add a message to a queue (after having printed all stored messages if it 
    296  * is full. If the message can't be converted to string in memory, it exit the 
    297  * program. If the queue is not used, it prints the message immediately
     294 * This function provides basic functionnalities to other intf_*Msg functions. 
     295 * It adds a message to a queue (after having printed all stored messages if it 
     296 * is full). If the message can't be converted to string in memory, it issues 
     297 * a warning
    298298 *****************************************************************************/ 
    299299static void QueueMsg( int i_type, int i_level, char *psz_format, va_list ap ) 
     
    320320        vfprintf(stderr, psz_format, ap ); 
    321321        fprintf(stderr, "\n" ); 
    322         exit( errno )
     322        return
    323323    } 
    324324 
  • src/interface/main.c

    ra6bccb1 r08999a3  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2001 VideoLAN 
    7  * $Id: main.c,v 1.186 2002/04/23 14:16:21 sam Exp $ 
     7 * $Id: main.c,v 1.187 2002/04/24 00:36:24 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    9090 * 
    9191 *****************************************************************************/ 
    92 #define BUILTIN 
     92#define __BUILTIN__ 
    9393#define MODULE_NAME main 
    9494#include "modules_inner.h"                        /* for configuration stuff */ 
     
    543543 
    544544    /* Get the executable name (similar to the basename command) */ 
    545     p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ]; 
    546     while( *p_tmp ) 
    547     { 
    548         if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp; 
    549         else ++p_tmp; 
     545    if( i_argc > 0 ) 
     546    { 
     547        p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ]; 
     548        while( *p_tmp ) 
     549        { 
     550            if( *p_tmp == '/' ) p_main->psz_arg0 = ++p_tmp; 
     551            else ++p_tmp; 
     552        } 
     553    } 
     554    else 
     555    { 
     556        p_main->psz_arg0 = "vlc"; 
    550557    } 
    551558