mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
-printdefs for qcvm
This commit is contained in:
parent
93e13c3cb1
commit
cafa78d430
1 changed files with 15 additions and 1 deletions
16
exec.c
16
exec.c
|
@ -703,6 +703,7 @@ int main(int argc, char **argv)
|
|||
qc_program *prog;
|
||||
size_t xflags = VMXF_DEFAULT;
|
||||
bool opts_printfields = false;
|
||||
bool opts_printdefs = false;
|
||||
bool opts_info = false;
|
||||
|
||||
arg0 = argv[0];
|
||||
|
@ -726,6 +727,11 @@ int main(int argc, char **argv)
|
|||
++argv;
|
||||
opts_info = true;
|
||||
}
|
||||
else if (!strcmp(argv[1], "-printdefs")) {
|
||||
--argc;
|
||||
++argv;
|
||||
opts_printdefs = true;
|
||||
}
|
||||
else if (!strcmp(argv[1], "-printfields")) {
|
||||
--argc;
|
||||
++argv;
|
||||
|
@ -759,7 +765,15 @@ int main(int argc, char **argv)
|
|||
prog_delete(prog);
|
||||
return 0;
|
||||
}
|
||||
if (opts_printfields) {
|
||||
if (opts_printdefs) {
|
||||
for (i = 0; i < prog->defs_count; ++i) {
|
||||
printf("Global: %8s %-16s at %u\n",
|
||||
type_name[prog->defs[i].type],
|
||||
prog_getstring(prog, prog->defs[i].name),
|
||||
(unsigned int)prog->defs[i].offset);
|
||||
}
|
||||
}
|
||||
else if (opts_printfields) {
|
||||
for (i = 0; i < prog->fields_count; ++i) {
|
||||
printf("Field: %8s %-16s at %u\n",
|
||||
type_name[prog->fields[i].type],
|
||||
|
|
Loading…
Reference in a new issue