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

Function tc_name

sys/share/tclib.c:194–211  ·  view source on GitHub ↗

check whether `ent' contains `nam'; return start of field entries */

Source from the content-addressed store, hash-verified

192
193/* check whether `ent' contains `nam'; return start of field entries */
194static char *
195tc_name(const char *nam, char *ent)
196{
197 char *nxt, *lst, *p = ent;
198 size_t n = strlen(nam);
199
200 if ((lst = strchr(p, ':')) == 0)
201 lst = p + strlen(p);
202
203 while (p < lst) {
204 if ((nxt = strchr(p, '|')) == 0 || nxt > lst)
205 nxt = lst;
206 if ((long) (nxt - p) == (long) n && strncmp(p, nam, n) == 0)
207 return lst;
208 p = nxt + 1;
209 }
210 return (char *) 0;
211}
212
213/* look up a numeric entry */
214int

Callers 1

tc_findFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected