Skip to main content

insertlinklist

Function insertlinklist 

Source
pub fn insertlinklist<T: Clone>(
    l: &LinkList<T>,
    where_idx: usize,
    x: &mut LinkList<T>,
)
Expand description

Port of insertlinklist(LinkList l, LinkNode where, LinkList x) from Src/linklist.c:190. C semantics: l is the SOURCE list, where is the position in DEST list x, and x is the DESTINATION. All nodes of l get spliced into x right after node where — equivalent to inserting the contents of l between where and where->next in x. Empty l is a no-op (c:194 if (!firstnode(l)) return;). Param names + positions match C exactly so callers reading insertlinklist(sub.in, lastnode(result->in), result->in) (the canonical zutil.c:1324 pattern) translate 1:1.