]> git.sesse.net Git - vlc/blobdiff - src/interface/main.c
Generation d'un makefile presque correct pour les vieilles versions de make
[vlc] / src / interface / main.c
index 785a9ea55fd5ce8ccad6c0d6a2602a02575ab109..bca5b5124bc02eb8fbf784078512b22281319acd 100644 (file)
 #include "defs.h"
 
 #include <signal.h>                               /* SIGHUP, SIGINT, SIGKILL */
-#include <getopt.h>                                              /* getopt() */
 #include <stdio.h>                                              /* sprintf() */
 
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>                                              /* getopt() */
+#endif
+
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdlib.h>                                  /* getenv(), strtol(),  */
 #include <string.h>                                            /* strerror() */
@@ -42,8 +45,8 @@
 #include "tests.h"                                              /* TestMMX() */
 #include "plugins.h"
 #include "playlist.h"
-#include "input_vlan.h"
-#include "input_ps.h"
+#include "stream_control.h"
+#include "input_ext-intf.h"
 
 #include "intf_msg.h"
 #include "interface.h"
 #define OPT_COLOR               165
 #define OPT_YUV                 166
 
-#define OPT_NOVLANS             170
+#define OPT_VLANS               170
 #define OPT_SERVER              171
 #define OPT_PORT                172
 #define OPT_BROADCAST           173
 
 #define OPT_SYNCHRO             180
 
+#define OPT_WARNING             190
+
 /* Usage fashion */
 #define USAGE                     0
 #define SHORT_HELP                1
 #define LONG_HELP                 2
 
 /* Long options */
+#ifdef HAVE_GETOPT_H
 static const struct option longopts[] =
 {
     /*  name,               has_arg,    flag,   val */
@@ -120,7 +126,7 @@ static const struct option longopts[] =
     {   "dvdsubtitle",      1,          0,      's' },
     
     /* Input options */
-    {   "novlans",          0,          0,      OPT_NOVLANS },
+    {   "vlans",            0,          0,      OPT_VLANS },
     {   "server",           1,          0,      OPT_SERVER },
     {   "port",             1,          0,      OPT_PORT },
     {   "broadcast",        0,          0,      OPT_BROADCAST },
@@ -128,11 +134,15 @@ static const struct option longopts[] =
     /* Synchro options */
     {   "synchro",          1,          0,      OPT_SYNCHRO },
 
+    /* Interface messages */
+    {   "warning",          1,          0,      OPT_WARNING },
     {   0,                  0,          0,      0 }
 };
 
 /* Short options */
 static const char *psz_shortopts = "hHvga:s:c:";
+#endif
+
 
 /*****************************************************************************
  * Global variable program_data - this is the one and only, see main.h
@@ -237,6 +247,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Initialize shared resources and libraries
      */
+    /* FIXME: no VLANs */
+#if 0
     if( p_main->b_vlans && input_VlanCreate() )
     {
         /* On error during vlans initialization, switch off vlans */
@@ -244,6 +256,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
                   "vlans management is deactivated\n" );
         p_main->b_vlans = 0;
     }
+#endif
 
     /*
      * Open audio device and start aout thread
@@ -286,10 +299,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Free shared resources and libraries
      */
+    /* FIXME */
+#if 0
     if( p_main->b_vlans )
     {
         input_VlanDestroy();
     }
+#endif
 
     /*
      * Free plugin bank
@@ -411,11 +427,11 @@ void main_PutIntVariable( char *psz_name, int i_value )
 static void SetDefaultConfiguration( void )
 {
     /*
-     * All features are activated by default
+     * All features are activated by default execpted vlans
      */
     p_main->b_audio  = 1;
     p_main->b_video  = 1;
-    p_main->b_vlans  = 1;
+    p_main->b_vlans  = 0;
 }
 
 /*****************************************************************************
@@ -455,6 +471,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     }
 
     /* Parse command line options */
+#ifdef HAVE_GETOPT_H
     opterr = 0;
     while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
     {
@@ -515,6 +532,8 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             main_PutPszVariable( YUV_METHOD_VAR, optarg );
             break;
 
+            /* FIXME */
+#if 0
         /* DVD options */
         case 'a':
             if ( ! strcmp(optarg, "mpeg") )
@@ -526,6 +545,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             else
                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
             break;
+#endif
         case 'c':
             main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );
             break;
@@ -534,8 +554,8 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             break;
 
         /* Input options */
-        case OPT_NOVLANS:                                       /* --novlans */
-            p_main->b_vlans = 0;
+        case OPT_VLANS:                                           /* --vlans */
+            p_main->b_vlans = 1;
             break;
         case OPT_SERVER:                                         /* --server */
             main_PutPszVariable( INPUT_SERVER_VAR, optarg );
@@ -548,10 +568,15 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             break;
 
         /* Synchro options */
-        case OPT_SYNCHRO:
+        case OPT_SYNCHRO:                                      
             main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
             break;
 
+        /* Interface warning messages level */
+        case OPT_WARNING:                                       /* --warning */
+            main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) );
+            break;
+            
         /* Internal error: unknown option */
         case '?':
         default:
@@ -561,6 +586,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             break;
         }
     }
+#endif
 
     /* Parse command line parameters - no check is made for these options */
     for( i_opt = optind; i_opt < i_argc; i_opt++ )
@@ -606,13 +632,15 @@ static void Usage( int i_fashion )
               "  -c, --dvdchannel <channel>     \tchoose DVD audio channel\n"
               "  -s, --dvdsubtitle <channel>    \tchoose DVD subtitle channel\n"
               "\n"
-              "      --novlans                  \tdisable vlans\n"
+              "      --vlans                    \tenable vlans\n"
               "      --server <host>            \tvideo server address\n"
               "      --port <port>              \tvideo server port\n"
               "      --broadcast                \tlisten to a broadcast\n"
               "\n"
               "      --synchro <type>           \tforce synchro algorithm\n"
               "\n"
+              "      --warning <level>          \tdisplay warning messages\n"
+              "\n"
               "  -h, --help                     \tprint help and exit\n"
               "  -H, --longhelp                 \tprint long help and exit\n"
               "  -v, --version                  \toutput version information and exit\n" );
@@ -624,7 +652,8 @@ static void Usage( int i_fashion )
     intf_Msg( "\n"
               "Interface parameters:\n"
               "  " INTF_INIT_SCRIPT_VAR "=<filename>               \tinitialization script\n"
-              "  " INTF_CHANNELS_VAR "=<filename>            \tchannels list\n" );
+              "  " INTF_CHANNELS_VAR "=<filename>            \tchannels list\n"
+              "  " INTF_WARNING_VAR "=<level>                \twarning level\n" );
 
     /* Audio parameters */
     intf_Msg( "\n"