+unputc(p)
+ register struct clist *p;
+{
+ register struct cblock *bp;
+ register int c, s;
+ struct cblock *obp;
+
+ s = spltty();
+ if (p->c_cc <= 0)
+ c = -1;
+ else {
+ c = *--p->c_cl;
+ if (isquote(p->c_cl))
+ c |= TTY_QUOTE;
+ if (--p->c_cc <= 0) {
+ bp = cbptr(p->c_cl);
+ bp = cbptr((int)bp & ~CROUND);
+ p->c_cl = p->c_cf = NULL;
+ bp->c_next = cfreelist;
+ cfreelist = bp;
+ cfreecount += CBSIZE;
+ } else if (p->c_cl == (cbptr((int)p->c_cl & ~CROUND))->c_info) {
+ p->c_cl = (char *)((int)p->c_cl & ~CROUND);
+
+ bp = cbptr(p->c_cf);
+ bp = cbptr((int)bp & ~CROUND);
+ while (bp->c_next != cbptr(p->c_cl))
+ bp = bp->c_next;
+ obp = bp;
+ p->c_cl = (char *)(bp + 1);
+ bp = bp->c_next;
+ bp->c_next = cfreelist;
+ cfreelist = bp;
+ cfreecount += CBSIZE;
+ obp->c_next = NULL;
+ }
+ }
+ splx(s);
+ return (c);
+}
+
+/*
+ * Put the chars in the from que
+ * on the end of the to que.
+ */
+catq(from, to)
+ struct clist *from, *to;
+{
+#ifdef notdef
+ char bbuf[CBSIZE*4];
+#endif
+ register int s, c;
+
+ s = spltty();
+ if (to->c_cc == 0) {
+ *to = *from;
+ from->c_cc = 0;
+ from->c_cf = NULL;
+ from->c_cl = NULL;
+ splx(s);
+ return;
+ }
+ splx(s);
+#ifdef notdef
+ while (from->c_cc > 0) {
+ c = q_to_b(from, bbuf, sizeof bbuf);
+ (void) b_to_q(bbuf, c, to);
+ }
+#endif
+ /* XXX - FIX */
+ while ((c = getc(from)) >= 0)
+ putc(c, to);
+}
+
+#ifdef unneeded