4 * Code to initialize standard file handles and command line arguments.
5 * This file is #included in both crt1.c and dllcrt1.c.
7 * This file is part of the Mingw32 package.
10 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
12 * THIS SOFTWARE IS NOT COPYRIGHTED
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAMED. This includes but is not limited to warrenties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * $Date: 2002/11/24 18:42:15 $
29 * Access to a standard 'main'-like argument count and list. Also included
30 * is a table of environment variables.
35 /* NOTE: Thanks to Pedro A. Aranda Gutiirrez <paag@tid.es> for pointing
36 * this out to me. GetMainArgs (used below) takes a fourth argument
37 * which is an int that controls the globbing of the command line. If
38 * _CRT_glob is non-zero the command line will be globbed (e.g. *.*
39 * expanded to be all files in the startup directory). In the mingw32
40 * library a _CRT_glob variable is defined as being -1, enabling
41 * this command line globbing by default. To turn it off and do all
42 * command line processing yourself (and possibly escape bogons in
43 * MS's globbing code) include a line in one of your source modules
44 * defining _CRT_glob and setting it to zero, like this:
49 extern void __GetMainArgs(int *, char***, char***, int);
52 * Initialize the _argc, _argv and environ variables.
55 _mingw32_init_mainargs (void)
57 /* The environ variable is provided directly in stdlib.h through
58 * a dll function call. */
62 * Microsoft's runtime provides a function for doing just that.
65 (void) __getmainargs(&_argc
, &_argv
, &dummy_environ
, _CRT_glob
);
68 (void) __GetMainArgs(&_argc
, &_argv
, &dummy_environ
, _CRT_glob
);