MCPcopy Index your code
hub / github.com/coreutils/coreutils / getseq

Function getseq

src/join.c:538–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536/* Read a line from FP and add it to SEQ. Return true if successful. */
537
538static bool
539getseq (FILE *fp, struct seq *seq, int whichfile)
540{
541 if (seq->count == seq->alloc)
542 {
543 seq->lines = xpalloc (seq->lines, &seq->alloc, 1, -1, sizeof *seq->lines);
544 for (idx_t i = seq->count; i < seq->alloc; i++)
545 seq->lines[i] = NULL;
546 }
547
548 if (get_line (fp, &seq->lines[seq->count], whichfile))
549 {
550 ++seq->count;
551 return true;
552 }
553 return false;
554}
555
556/* Read a line from FP and add it to SEQ, as the first item if FIRST is
557 true, else as the next. */

Callers 2

advance_seqFunction · 0.85
joinFunction · 0.85

Calls 1

get_lineFunction · 0.70

Tested by

no test coverage detected