MCPcopy Create free account
hub / github.com/NetHack/NetHack / pcmain

Function pcmain

sys/share/pcmain.c:79–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79boolean
80pcmain(int argc, char *argv[])
81{
82 NHFILE *nhfp;
83 char *dir;
84#if defined(MSDOS)
85 char *envp = NULL;
86 char *sptr = NULL;
87#endif
88#ifdef NOCWD_ASSUMPTIONS
89 char failbuf[BUFSZ];
90#endif
91 boolean resuming = FALSE; /* assume new game */
92
93#ifdef _MSC_VER
94# ifdef DEBUG
95 /* set these appropriately for VS debugging */
96 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
97 _CrtSetReportMode(_CRT_ERROR,
98 _CRTDBG_MODE_DEBUG); /* | _CRTDBG_MODE_FILE);*/
99 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
100/*| _CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW);*/
101/* use STDERR by default
102_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
103_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
104/* Heap Debugging
105 _CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)
106 | _CRTDBG_ALLOC_MEM_DF
107 | _CRTDBG_CHECK_ALWAYS_DF
108 | _CRTDBG_CHECK_CRT_DF
109 | _CRTDBG_DELAY_FREE_MEM_DF
110 | _CRTDBG_LEAK_CHECK_DF);
111 _CrtSetBreakAlloc(1423);
112*/
113# endif
114#endif
115
116#if defined(__BORLANDC__)
117 startup();
118#endif
119
120#ifdef TOS
121 long clock_time;
122 if (*argv[0]) { /* only a CLI can give us argv[0] */
123 gh.hname = argv[0];
124 run_from_desktop = FALSE;
125 } else
126#endif
127 gh.hname = "NetHack"; /* used for syntax messages */
128
129 choose_windows(DEFAULT_WINDOW_SYS);
130
131
132#if !defined(AMIGA) && !defined(GNUDOS)
133 /* Save current directory and make sure it gets restored when
134 * the game is exited.
135 */
136 if (getcwd(orgdir, sizeof orgdir) == (char *) 0)

Callers 2

pcmain.cFile · 0.85
WinMainFunction · 0.85

Calls 15

startupFunction · 0.85
choose_windowsFunction · 0.85
getcwdFunction · 0.85
openFunction · 0.85
fqnameFunction · 0.85
closeFunction · 0.85
ami_wininit_dataFunction · 0.85
initoptionsFunction · 0.85
set_colorsFunction · 0.85
argcheckFunction · 0.85
prscoreFunction · 0.85

Tested by

no test coverage detected