From 3488946bb5c2bb6d860be058d593830ce73af119 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 17 Jul 2001 20:33:17 +0000 Subject: [PATCH] slightly more interesting output while I procrastinate doing the hard bits --- tools/qfdefs/source/qfdefs.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/qfdefs/source/qfdefs.c b/tools/qfdefs/source/qfdefs.c index f282ac939..7181c5adc 100644 --- a/tools/qfdefs/source/qfdefs.c +++ b/tools/qfdefs/source/qfdefs.c @@ -12,6 +12,8 @@ #include #include +#include "def.h" + void *membase; int memsize = 16*1024*1024; @@ -22,8 +24,6 @@ progs_t progs; int main (int argc, char **argv) { - int i; - Cvar_Init_Hash (); Cmd_Init_Hash (); membase = malloc (memsize); @@ -58,10 +58,20 @@ main (int argc, char **argv) (progs.progs->version >> 24) & 0xff, (progs.progs->version >> 12) & 0xfff, progs.progs->version & 0xfff); - for (i = 0; i < progs.progs->numglobaldefs; i++) { - ddef_t *def = &progs.pr_globaldefs[i]; - printf ("%-8s %d %-5d %s\n", type_name[def->type & ~DEF_SAVEGLOBAL], (def->type & DEF_SAVEGLOBAL) != 0, def->ofs, PR_GetString (&progs, def->s_name)); + if (progs.progs->crc == nq_crc) { + printf ("%s: netquake crc\n", *argv); + } else if (progs.progs->crc == qw_crc) { + printf ("%s: quakeworld crc\n", *argv); + } else { + printf ("%s: unknown crc %d\n", *argv, progs.progs->crc); } + printf ("statements: %d @ %d\n", progs.progs->numstatements, progs.progs->ofs_statements); + printf ("globaldefs: %d @ %d\n", progs.progs->numglobaldefs, progs.progs->ofs_globaldefs); + printf ("fielddefs: %d @ %d\n", progs.progs->numfielddefs, progs.progs->ofs_fielddefs); + printf ("functions: %d @ %d\n", progs.progs->numfunctions, progs.progs->ofs_functions); + printf ("strings: %d @ %d\n", progs.progs->numstrings, progs.progs->ofs_strings); + printf ("globals: %d @ %d\n", progs.progs->numglobals, progs.progs->ofs_globals); + printf ("fields: %d\n", progs.progs->entityfields); } return 0; }