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

Function purge_custom_entries

src/glyphs.c:760–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760void
761purge_custom_entries(enum graphics_sets which_set)
762{
763 enum customization_types custtype;
764 struct symset_customization *gdc;
765 struct customization_detail *details, *next;
766
767 for (custtype = custom_none; custtype < custom_count; ++custtype) {
768 gdc = &gs.sym_customizations[which_set][custtype];
769 details = gdc->details;
770 while (details) {
771 next = details->next;
772 if (gdc->custtype == custom_ureps) {
773 if (details->content.urep.u.utf8str)
774 free(details->content.urep.u.utf8str);
775 details->content.urep.u.utf8str = (uint8 *) 0;
776 } else if (gdc->custtype == custom_symbols) {
777 details->content.sym.symparse = (struct symparse *) 0;
778 details->content.sym.val = 0;
779 } else if (gdc->custtype == custom_nhcolor) {
780 details->content.ccolor.nhcolor = 0;
781 details->content.ccolor.glyphidx = 0;
782 }
783 free(details);
784 details = next;
785 }
786 gdc->details = 0;
787 gdc->details_end = 0;
788 if (gdc->customization_name) {
789 free((genericptr_t) gdc->customization_name);
790 gdc->customization_name = 0;
791 }
792 gdc->count = 0;
793 }
794}
795
796void
797dump_all_glyphids(FILE *fp)

Callers 2

clear_symsetentryFunction · 0.85
purge_all_custom_entriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected