MCPcopy Create free account
hub / github.com/coreutils/coreutils / scan_mb_delim_field

Function scan_mb_delim_field

src/cut.c:536–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536static enum field_terminator
537scan_mb_delim_field (mbbuf_t *mbbuf, bool *have_pending_line,
538 bool write_field, idx_t *n_bytes)
539{
540 while (true)
541 {
542 mcel_t g = mbbuf_get_char (mbbuf);
543 if (g.ch == MBBUF_EOF)
544 return FIELD_EOF;
545
546 *have_pending_line = true;
547
548 if (g.ch == line_delim)
549 return FIELD_LINE_DELIMITER;
550
551 if (delim_mcel.err ? g.err == delim_mcel.err : mcel_eq (g, delim_mcel))
552 return FIELD_DELIMITER;
553
554 if (n_bytes)
555 append_field_1_bytes (mbbuf, g, n_bytes);
556 else if (write_field)
557 write_bytes (mbbuf_char_offset (mbbuf, g), g.len);
558 }
559}
560
561static inline enum field_terminator
562scan_mb_field (mbbuf_t *mbbuf, struct mbfield_parser *parser,

Callers 1

scan_mb_fieldFunction · 0.85

Calls 4

mbbuf_get_charFunction · 0.85
append_field_1_bytesFunction · 0.85
write_bytesFunction · 0.85
mbbuf_char_offsetFunction · 0.85

Tested by

no test coverage detected