]> git.sesse.net Git - vlc/blobdiff - src/vlc.c
Fix max UDP port number
[vlc] / src / vlc.c
index 260df196f0e293cd2210436d3af6f9b155c06bec..b7870470188238afddd8e5202470d741f9af35d7 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -6,7 +6,7 @@
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
- *          Gildas Bazin <gbazin@netcourrier.com>
+ *          Gildas Bazin <gbazin@videolan.org>
  *          Derk-Jan Hartman <hartman at videolan dot org>
  *          Lots of other people, see the libvlc AUTHORS file
  *
@@ -41,7 +41,7 @@
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-#ifndef WIN32
+#if !defined(WIN32) && !defined(UNDER_CE)
 static void SigHandler  ( int i_signal );
 #endif
 
@@ -51,7 +51,6 @@ static void SigHandler  ( int i_signal );
 int main( int i_argc, char *ppsz_argv[] )
 {
     int i_ret;
-    int b_cli = VLC_FALSE ;
 
 #ifndef SYS_DARWIN
     /* This clutters OSX GUI error logs */
@@ -81,7 +80,7 @@ int main( int i_argc, char *ppsz_argv[] )
         return i_ret;
     }
 
-#ifndef WIN32
+#if !defined(WIN32) && !defined(UNDER_CE)
     /* Set the signal handlers. SIGTERM is not intercepted, because we need at
      * least one method to kill the program when all other methods failed, and
      * when we don't want to use SIGKILL.
@@ -114,7 +113,7 @@ int main( int i_argc, char *ppsz_argv[] )
     return i_ret;
 }
 
-#ifndef WIN32
+#if !defined(WIN32) && !defined(UNDER_CE)
 /*****************************************************************************
  * SigHandler: system signal handler
  *****************************************************************************
@@ -157,3 +156,32 @@ static void SigHandler( int i_signal )
 }
 #endif
 
+#if defined(UNDER_CE)
+#   if defined( _MSC_VER ) && defined( UNDER_CE )
+#       include "vlc_common.h"
+#   endif
+/*****************************************************************************
+ * WinMain: parse command line, start interface and spawn threads. (WinCE only)
+ *****************************************************************************/
+int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
+                    LPTSTR lpCmdLine, int nCmdShow )
+{
+    char **argv, psz_cmdline[MAX_PATH];
+    int argc, i_ret;
+
+    WideCharToMultiByte( CP_ACP, 0, lpCmdLine, -1,
+                         psz_cmdline, MAX_PATH, NULL, NULL );
+
+    argv = vlc_parse_cmdline( psz_cmdline, &argc );
+    argv = realloc( argv, (argc + 1) * sizeof(char *) );
+    if( !argv ) return -1;
+
+    if( argc ) memmove( argv + 1, argv, argc * sizeof(char *) );
+    argv[0] = ""; /* Fake program path */
+
+    i_ret = main( argc + 1, argv );
+
+    /* No need to free the argv memory */
+    return i_ret;
+}
+#endif