Changeset 698feb97ec53ab36b0cb83c2c793f5d103a5fcf4

Show
Ignore:
Timestamp:
11/12/04 09:27:05 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1100248025 +0000
git-parent:

[ddf6a2738844b3eddc53a7e7ea06cfa679049f66]

git-author:
Gildas Bazin <gbazin@videolan.org> 1100248025 +0000
Message:

* src/vlc.c: ported to WinCE.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/extras/libc.c

    rddf6a27 r698feb9  
    622622    int argc = 0; 
    623623    char **argv = 0; 
    624     char *s, *psz_parser, *psz_arg
     624    char *s, *psz_parser, *psz_arg, *psz_orig
    625625    int i_bcount = 0; 
    626626 
    627627    if( !psz_cmdline ) return 0; 
    628     psz_cmdline = strdup( psz_cmdline ); 
    629     psz_arg = psz_parser = s = psz_cmdline
     628    psz_orig = strdup( psz_cmdline ); 
     629    psz_arg = psz_parser = s = psz_orig
    630630 
    631631    while( *s ) 
     
    687687 
    688688    if( i_args ) *i_args = argc; 
    689     free( psz_cmdline ); 
     689    free( psz_orig ); 
    690690    return argv; 
    691691} 
  • src/vlc.c

    r521e212 r698feb9  
    4242 * Local prototypes. 
    4343 *****************************************************************************/ 
    44 #ifndef WIN32 
     44#if !defined(WIN32) && !defined(UNDER_CE) 
    4545static void SigHandler  ( int i_signal ); 
    4646#endif 
     
    8181    } 
    8282 
    83 #ifndef WIN32 
     83#if !defined(WIN32) && !defined(UNDER_CE) 
    8484    /* Set the signal handlers. SIGTERM is not intercepted, because we need at 
    8585     * least one method to kill the program when all other methods failed, and 
     
    114114} 
    115115 
    116 #ifndef WIN32 
     116#if !defined(WIN32) && !defined(UNDER_CE) 
    117117/***************************************************************************** 
    118118 * SigHandler: system signal handler 
     
    156156} 
    157157#endif 
     158 
     159#if defined(UNDER_CE) 
     160/***************************************************************************** 
     161 * WinMain: parse command line, start interface and spawn threads. (WinCE only) 
     162 *****************************************************************************/ 
     163int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, 
     164                    LPTSTR lpCmdLine, int nCmdShow ) 
     165{ 
     166    char **argv, psz_cmdline[MAX_PATH]; 
     167    int argc, i_ret; 
     168 
     169    WideCharToMultiByte( CP_ACP, WC_DEFAULTCHAR, lpCmdLine, -1, 
     170                         psz_cmdline, MAX_PATH, NULL, NULL ); 
     171 
     172    argv = vlc_parse_cmdline( psz_cmdline, &argc ); 
     173    argv = realloc( argv, (argc + 1) * sizeof(char *) ); 
     174    if( !argv ) return -1; 
     175 
     176    if( argc ) memmove( argv + 1, argv, argc ); 
     177    argv[0] = strdup(""); /* Fake program path */ 
     178 
     179    i_ret = main( argc, argv ); 
     180 
     181    /* No need to free the argv memory */ 
     182    return i_ret; 
     183} 
     184#endif