3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
7 * Code to initialize standard file handles and command line arguments.
8 * This file is #included in both crt1.c and dllcrt1.c.
13 * Access to a standard 'main'-like argument count and list. Also included
14 * is a table of environment variables.
19 /* NOTE: Thanks to Pedro A. Aranda Gutiirrez <paag@tid.es> for pointing
20 * this out to me. GetMainArgs (used below) takes a fourth argument
21 * which is an int that controls the globbing of the command line. If
22 * _CRT_glob is non-zero the command line will be globbed (e.g. *.*
23 * expanded to be all files in the startup directory). In the mingw32
24 * library a _CRT_glob variable is defined as being -1, enabling
25 * this command line globbing by default. To turn it off and do all
26 * command line processing yourself (and possibly escape bogons in
27 * MS's globbing code) include a line in one of your source modules
28 * defining _CRT_glob and setting it to zero, like this:
37 extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *);
39 extern void __GetMainArgs (int *, char ***, char ***, int);
43 * Initialize the _argc, _argv and environ variables.
46 _mingw32_init_mainargs ()
48 /* The environ variable is provided directly in stdlib.h through
49 * a dll function call. */
52 _startupinfo start_info;
53 start_info.newmode = 0;
57 * Microsoft's runtime provides a function for doing just that.
60 (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob,
64 (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob);