A compiled funcname spec: newline-separated POSIX regexes tried in order;
a leading ! negates (a match rejects the line). Port of
xdiff_set_find_func + ff_regexp from upstream xdiff-interface.c.
Bridge a word-diff config + its line buffers into the engine’s
HunkWordDiff hook. The engine owns hunk shaping; this adapter owns the
word-level rendering.
Port of def_ff (the default funcname heuristic): a line whose first byte
is a letter, _, or $ is a section heading, truncated to the 80-byte
header buffer with trailing whitespace trimmed.
A per-line section-heading classifier matching git’s funcname resolution:
a userdiff xfuncname pattern when a driver is present, else the default
def_ff heuristic.
Parse a git color word (“red”, “bold”, “green dim”, …) into an ANSI
sequence. Only the simple forms the diff palette uses are supported;
unknown words yield None (caller keeps the default).
Wrap one already-newline-terminated line in a color, mirroring
emit_line_0: the reset lands before the trailing newline, and a line
that is empty (ignoring its newline) is passed through uncolored.