MCPcopy Index your code
hub / github.com/NetHack/NetHack / collect_obj_classes

Function collect_obj_classes

src/pickup.c:100–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100int
101collect_obj_classes(char ilets[], struct obj *otmp, boolean here,
102 boolean (*filter)(OBJ_P), int *itemcount)
103{
104 int iletct = 0;
105 char c;
106
107 *itemcount = 0;
108 ilets[iletct] = '\0'; /* terminate ilets so that strchr() will work */
109 while (otmp) {
110 c = def_oc_syms[(int) otmp->oclass].sym;
111 if (!strchr(ilets, c) && (!filter || (*filter)(otmp)))
112 ilets[iletct++] = c, ilets[iletct] = '\0';
113 *itemcount += 1;
114 otmp = here ? otmp->nexthere : otmp->nobj;
115 }
116
117 return iletct;
118}
119
120/*
121 * For menustyle:Traditional and menustyle:Combination.

Callers 3

ggetobjFunction · 0.85
dotypeinvFunction · 0.85
query_classesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected