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

Function tc_field

sys/share/tclib.c:316–339  ·  view source on GitHub ↗

look for a particular field name */

Source from the content-addressed store, hash-verified

314
315/* look for a particular field name */
316static const char *
317tc_field(const char *field, const char **tc_end)
318{
319 const char *end, *q, *p = tc_entry;
320
321 end = p + strlen(p);
322 while (p < end) {
323 if ((p = strchr(p, ':')) == 0)
324 break;
325 ++p;
326 if (p[0] == field[0] && p[1] == field[1]
327 && (p[2] == ':' || p[2] == '=' || p[2] == '#' || p[2] == '@'))
328 break;
329 }
330 if (tc_end) {
331 if (p) {
332 if ((q = strchr(p + 2, ':')) == 0)
333 q = end;
334 } else
335 q = 0;
336 *tc_end = q;
337 }
338 return p;
339}
340
341static char cmbuf[64];
342

Callers 3

tgetnumFunction · 0.85
tgetflagFunction · 0.85
tgetstrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected