-
-#if HAVTR > 0
-/*
- * Traverse a clist copying its contents to a buffer.
- * q->cc and q->cf are updated with the current position
- * in the list, but bytes are not released to the freelist.
- */
-trq_to_b(q, cp, cc)
-register struct clist *q;
-register char *cp;
-register cc;
-{
- register struct cblock *bp;
- char *acp;
-
- if (cc <= 0)
- return(0);
- if (q->c_cc <= 0)
- return(0);
-
- acp = cp;
- cc++;
- while (--cc) {
- *cp++ = *q->c_cf++;
- if (((int)q->c_cf & CROUND) == 0) {
- bp = (struct cblock *)(q->c_cf);
- bp--;
- q->c_cf = bp->c_next->c_info;
- }
- if (--q->c_cc <= 0)
- break;
- }
- return(cp-acp);
-}