Commit b1e70285 authored by Alexandre Julliard's avatar Alexandre Julliard

Added __wine_get_main_args to retrieve command-line arguments for the

application.
parent 3e38431e
......@@ -1023,3 +1023,6 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ cdecl __wine_dbg_header_trace(ptr str) __wine_dbg_header_trace
@ cdecl wine_dbg_vprintf(str ptr) wine_dbg_vprintf
@ varargs wine_dbg_printf(str) wine_dbg_printf
# Command-line
@ cdecl __wine_get_main_args(ptr) __wine_get_main_args
......@@ -25,11 +25,6 @@ struct option
const char *usage;
};
/* Most Windows C/C++ compilers use something like this to */
/* access argc and argv globally: */
int _ARGC;
char **_ARGV;
/* default options */
struct options Options =
{
......@@ -46,6 +41,9 @@ const char *full_argv0; /* the full path of argv[0] (if known) */
static char *inherit_str; /* options to pass to child processes */
static int app_argc; /* argc/argv to pass to application */
static char **app_argv;
static void out_of_memory(void) WINE_NORETURN;
static void out_of_memory(void)
{
......@@ -342,7 +340,21 @@ void OPTIONS_ParseOptions( char *argv[] )
}
/* count the resulting arguments */
_ARGV = argv;
_ARGC = 0;
while (argv[_ARGC]) _ARGC++;
app_argv = argv;
app_argc = 0;
while (argv[app_argc]) app_argc++;
}
/***********************************************************************
* __wine_get_main_args
*
* Return the argc/argv that the application should see.
* Used by the startup code generated in the .spec.c file.
*/
int __wine_get_main_args( char ***argv )
{
*argv = app_argv;
return app_argc;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment