@node __crt0_glob_function, startup @subheading Syntax @example #include char **__crt0_glob_function(char *_argument); @end example @subheading Description If the application wishes to provide a wildcard expansion function, it should define a @code{__crt0_glob_function} function. It should return a list of the expanded values, or 0 if no expansion will occur. The startup code will free the returned pointer if it is nonzero. If no expander function is provided, wildcards will be expanded in the POSIX.1 style by the default @code{__crt0_glob_function} from the C library. To disable expansion, provide a @code{__crt0_glob_function} that always returns 0. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node __crt0_setup_arguments, startup @subheading Syntax @example #include void __crt0_setup_arguments(void); @end example @subheading Description This function, provided by libc.a, does all the work required to provide the two arguments passed to main() (usually @code{argc} and @code{argv}). If main() does not use these arguments, the programmer can reduce the size of the program image by providing a version of this function that does nothing. Note that since the default @code{__crt0_setup_arguments_function} will @emph{not} expand wildcards inside quotes (@kbd{"} or @kbd{'}), you can quote a part of the argument that doesn't include wildcards and still have them expanded. This is so you could use wildcard expansion with filenames which have embedded whitespace (on LFN filesystems). @xref{__crt0_load_environment_file}. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node __crt0_load_environment_file, startup @subheading Syntax @example #include void __crt0_load_environment_file(char *_app_name); @end example @subheading Description This function, provided by libc.a, does all the work required to load additional environment variables from the file @file{djgpp.env} whose full pathname is given by the @code{DJGPP} environment variable. If the application does not use environment variables, the programmer can reduce the size of the program image by providing a version of this function that does nothing. @xref{__crt0_setup_arguments}. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node _crt0_startup_flags, startup @subheading Syntax @example #include int _crt0_startup_flags = ...; @end example @subheading Description This variable can be used to determine what the startup code will (or will not) do when the program begins. This can be used to tailor the startup environment to a particular program. @table @code @item _CRT0_FLAG_PRESERVE_UPPER_CASE If set, @code{argv[0]} is left in whatever case it was. If not set, all characters are mapped to lower case. Note that if the @code{argv0} field in the @dfn{stubinfo} structure is present, the case of that part of @code{argv[0]} is not affected. @item _CRT0_FLAG_USE_DOS_SLASHES If set, reverse slashes (dos-style) are preserved in @code{argv[0]}. If not set, all reverse slashes are replaced with unix-style slashes. @item _CRT0_FLAG_DROP_EXE_SUFFIX If set, the @file{.exe} suffix is removed from the file name component of @code{argv[0]}. If not set, the suffix remains. @item _CRT0_FLAG_DROP_DRIVE_SPECIFIER If set, the drive specifier (e.g. @file{C:}) is removed from the beginning of @code{argv[0]} (if present). If not set, the drive specifier remains. @item _CRT0_FLAG_DISALLOW_RESPONSE_FILES If set, response files (e.g. @file{@@gcc.rf}) are not expanded. If not set, the contents of the response files are used to create arguments. Note that if the file does not exist, that argument remains unexpanded. @item _CRT0_FLAG_KEEP_QUOTES If set, the quote characters @samp{'}, @samp{"}, and @samp{\} will be retained in @code{argv[]} elements when processing command lines passed by DOS and via @code{system}. This is used by the @code{redir} program, and should only be needed if you want to get the original command line exactly as it was passed by the caller. @item _CRT0_FLAG_FILL_SBRK_MEMORY If set, fill @code{sbrk}'d memory with a constant value. If not, memory gets whatever happens to have been in there, which breaks some applications. @item _CRT0_FLAG_FILL_DEADBEEF If set, fill memory (above) with @code{0xdeadbeef}, else fill with zero. This is especially useful for debugging uninitialized memory problems. @item _CRT0_FLAG_NEARPTR If set, set DS limit to 4GB which allows use of near pointers to DOS (and other) memory. WARNING, disables memory protection and bad pointers may crash the machine or wipe out your data. This flag is silently ignored on NT and DOSEmu, which disallow such huge selector limits. @item _CRT0_FLAG_NULLOK If set, disable @sc{null} pointer protection (if it can be controlled at all). @item _CRT0_FLAG_NMI_SIGNAL If set, enabled capture of NMI in exception code. This may cause problems with laptops and "green" boxes which use it to wake up. Default is to leave NMIs alone and pass through to real mode code. You decide. @item _CRT0_FLAG_NO_LFN If set, disable usage of long file name functions even on systems (such as Windows 9X) which support them. This might be needed to work around program assumptions on file name format on programs written specifically for DOS. Note that this flag overrides the value of the environment variable @code{LFN}. @item _CRT0_FLAG_NONMOVE_SBRK If set, the @code{sbrk} algorithm uses multiple DPMI memory blocks which makes sure the base of CS/DS/SS does not change. This may cause problems with @code{sbrk(0)} values and programs with other assumptions about @code{sbrk} behavior. This flag is useful with near pointers, since a constant pointer to DOS/Video memory can be computed without needing to reload it after any routine which might call @code{sbrk}. @item _CRT0_FLAG_UNIX_SBRK If set, the @code{sbrk} algorithm resizes memory blocks so that the layout of memory is set up to be the most compatible with Unix @code{sbrk} expectations. This mode should not be used with hardware interrupts, near pointers, and may cause problems with QDPMI virtual memory. On NT, this is the recommended algorithm. If your program requires a specific @code{sbrk} behavior, you should set either this or the previous flag, since the default may change in different libc releases. @item _CRT0_FLAG_LOCK_MEMORY If set, locks all memory as it is allocated. This effectively disables virtual memory, and may be useful if using extensive hardware interrupt codes in a relatively small image size. The memory is locked after it is @code{sbrk}'ed, so the locking may fail. This bit may be set or cleared during execution. When @code{sbrk} uses multiple memory zones, it can be difficult to lock all memory since the memory block size and location is impossible to determine. @item _CRT0_FLAG_PRESERVE_FILENAME_CASE If set, disables all filename letter-case conversions in functions that traverse directories (except findfirst/findnext which always return the filenames exactly as found in the directory entry). When reset, all filenames on 8+3 MSDOS filesystems and DOS-style 8+3 filenames on LFN systems are converted to lower-case by functions such as `readdir', @code{getcwd}, @code{_fixpath} and others. Note that when this flag is set, ALL filenames on MSDOS systems will appear in upper-case, which is both ugly and will break many Unix-born programs. Use only if you know exactly what you are doing! This flag overrides the value of the environment variable @samp{FNCASE}, @xref{_preserve_fncase}. @end table @subheading Portability @portability !ansi, !posix