MCPcopy Create free account
hub / github.com/eggert/tz / inlink

Function inlink

zic.c:2399–2420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2397}
2398
2399static void
2400inlink(char **fields, int nfields)
2401{
2402 struct link l;
2403
2404 if (nfields != LINK_FIELDS) {
2405 error(N_("wrong number of fields on Link line"));
2406 return;
2407 }
2408 if (*fields[LF_TARGET] == '\0') {
2409 error(N_("blank TARGET field on Link line"));
2410 return;
2411 }
2412 if (! namecheck(fields[LF_TARGET]))
2413 return;
2414 if (! namecheck(fields[LF_LINKNAME]))
2415 return;
2416 l.l_filenum = filenum;
2417 l.l_linenum = linenum;
2418 l.l_target = xstrdup(fields[LF_TARGET]);
2419 l.l_linkname = xstrdup(fields[LF_LINKNAME]);
2420 links = growalloc(links, sizeof *links, nlinks, &nlinks_alloc);
2421 links[nlinks++] = l;
2422}
2423

Callers 1

infileFunction · 0.85

Calls 4

errorFunction · 0.85
namecheckFunction · 0.85
xstrdupFunction · 0.85
growallocFunction · 0.85

Tested by

no test coverage detected