Changeset 698feb97ec53ab36b0cb83c2c793f5d103a5fcf4
- 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
| rddf6a27 |
r698feb9 |
|
| 622 | 622 | int argc = 0; |
|---|
| 623 | 623 | char **argv = 0; |
|---|
| 624 | | char *s, *psz_parser, *psz_arg; |
|---|
| | 624 | char *s, *psz_parser, *psz_arg, *psz_orig; |
|---|
| 625 | 625 | int i_bcount = 0; |
|---|
| 626 | 626 | |
|---|
| 627 | 627 | 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; |
|---|
| 630 | 630 | |
|---|
| 631 | 631 | while( *s ) |
|---|
| … | … | |
| 687 | 687 | |
|---|
| 688 | 688 | if( i_args ) *i_args = argc; |
|---|
| 689 | | free( psz_cmdline ); |
|---|
| | 689 | free( psz_orig ); |
|---|
| 690 | 690 | return argv; |
|---|
| 691 | 691 | } |
|---|
| r521e212 |
r698feb9 |
|
| 42 | 42 | * Local prototypes. |
|---|
| 43 | 43 | *****************************************************************************/ |
|---|
| 44 | | #ifndef WIN32 |
|---|
| | 44 | #if !defined(WIN32) && !defined(UNDER_CE) |
|---|
| 45 | 45 | static void SigHandler ( int i_signal ); |
|---|
| 46 | 46 | #endif |
|---|
| … | … | |
| 81 | 81 | } |
|---|
| 82 | 82 | |
|---|
| 83 | | #ifndef WIN32 |
|---|
| | 83 | #if !defined(WIN32) && !defined(UNDER_CE) |
|---|
| 84 | 84 | /* Set the signal handlers. SIGTERM is not intercepted, because we need at |
|---|
| 85 | 85 | * least one method to kill the program when all other methods failed, and |
|---|
| … | … | |
| 114 | 114 | } |
|---|
| 115 | 115 | |
|---|
| 116 | | #ifndef WIN32 |
|---|
| | 116 | #if !defined(WIN32) && !defined(UNDER_CE) |
|---|
| 117 | 117 | /***************************************************************************** |
|---|
| 118 | 118 | * SigHandler: system signal handler |
|---|
| … | … | |
| 156 | 156 | } |
|---|
| 157 | 157 | #endif |
|---|
| | 158 | |
|---|
| | 159 | #if defined(UNDER_CE) |
|---|
| | 160 | /***************************************************************************** |
|---|
| | 161 | * WinMain: parse command line, start interface and spawn threads. (WinCE only) |
|---|
| | 162 | *****************************************************************************/ |
|---|
| | 163 | int 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 |
|---|