mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Searching for 'main'
This commit is contained in:
parent
36e2a46e07
commit
aa08a2da68
1 changed files with 10 additions and 1 deletions
11
exec.c
11
exec.c
|
@ -264,6 +264,7 @@ qcint prog_tempstring(qc_program *prog, const char *_str)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
size_t i;
|
||||
qcint fnmain = -1;
|
||||
qc_program *prog;
|
||||
|
||||
if (argc != 2) {
|
||||
|
@ -278,8 +279,16 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
for (i = 1; i < prog->functions_count; ++i) {
|
||||
printf("Found function: %s\n", prog_getstring(prog, prog->functions[i].name));
|
||||
const char *name = prog_getstring(prog, prog->functions[i].name);
|
||||
printf("Found function: %s\n", name);
|
||||
if (!strcmp(name, "main"))
|
||||
fnmain = (qcint)i;
|
||||
}
|
||||
if (fnmain > 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
printf("No main function found\n");
|
||||
|
||||
prog_delete(prog);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue