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

Function dump_enums

src/earlyarg.c:705–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703#ifndef NODUMPENUMS
704
705staticfn void
706dump_enums(void)
707{
708 enum enum_dumps {
709 monsters_enum,
710 objects_enum,
711 objects_misc_enum,
712 defsym_cmap_enum,
713 defsym_mon_syms_enum,
714 defsym_mon_defchars_enum,
715 objclass_defchars_enum,
716 objclass_classes_enum,
717 objclass_syms_enum,
718 arti_enum,
719 mcastu_enum,
720 NUM_ENUM_DUMPS
721 };
722
723#define dump_om(om) { om, #om }
724 static const struct enum_dump omdump[] = {
725 dump_om(LAST_GENERIC),
726 dump_om(OBJCLASS_HACK),
727 dump_om(FIRST_OBJECT),
728 dump_om(FIRST_AMULET),
729 dump_om(LAST_AMULET),
730 dump_om(FIRST_SPELL),
731 dump_om(LAST_SPELL),
732 dump_om(MAXSPELL),
733 dump_om(FIRST_REAL_GEM),
734 dump_om(LAST_REAL_GEM),
735 dump_om(FIRST_GLASS_GEM),
736 dump_om(LAST_GLASS_GEM),
737 dump_om(NUM_REAL_GEMS),
738 dump_om(NUM_GLASS_GEMS),
739 dump_om(MAX_GLYPH),
740 };
741#undef dump_om
742
743 static const struct enum_dump *const ed[NUM_ENUM_DUMPS] = {
744 monsdump, objdump, omdump,
745 defsym_cmap_dump, defsym_mon_syms_dump,
746 defsym_mon_defchars_dump,
747 objclass_defchars_dump,
748 objclass_classes_dump,
749 objclass_syms_dump,
750 arti_enum_dump,
751 mcastu_enum_dump,
752 };
753
754 static const struct de_params {
755 const char *const title;
756 const char *const pfx;
757 int unprefixed_count;
758 int dumpflgs; /* 0 = dump numerically only, 1 = add 'char' comment */
759 int szd;
760 } edmp[NUM_ENUM_DUMPS] = {
761 { "monnums", "PM_", UNPREFIXED_COUNT, 0, SIZE(monsdump) },
762 { "objects_nums", "", 1, 0, SIZE(objdump) },

Callers 1

argcheckFunction · 0.85

Calls 2

raw_printFunction · 0.85
raw_printfFunction · 0.70

Tested by

no test coverage detected