/* * Copy a row of tokens into the destination holder, allocating * the space for the contents. Return the destination. */ Tokenrow * copytokenrow(Tokenrow *dtr, Tokenrow *str) { int len = rowlen(str); maketokenrow(len, dtr); movetokenrow(dtr, str); dtr->lp += len; return dtr; }
/* * replace ntok tokens starting at dtr->tp with the contents of str. * tp ends up pointing just beyond the replacement. * Canonical whitespace is assured on each side. */ void insertrow(Tokenrow * dtr, int ntok, Tokenrow * str) { int nrtok = (int)rowlen(str); dtr->tp += ntok; adjustrow(dtr, nrtok - ntok); dtr->tp -= ntok; movetokenrow(dtr, str); dtr->tp += nrtok; }