/* tty_subr.c 4.20 83/05/27 */
register struct clist
*p
;
register struct cblock
*bp
;
p
->c_cf
= p
->c_cl
= NULL
;
bp
= (struct cblock
*)(p
->c_cf
-1);
bp
= (struct cblock
*) ((int)bp
& ~CROUND
);
} else if (((int)p
->c_cf
& CROUND
) == 0){
bp
= (struct cblock
*)(p
->c_cf
);
p
->c_cf
= bp
->c_next
->c_info
;
* return number of bytes moved.
register struct clist
*q
;
register struct cblock
*bp
;
q
->c_cf
= q
->c_cl
= NULL
;
bp
= (struct cblock
*)(q
->c_cf
-1);
bp
= (struct cblock
*)((int)bp
& ~CROUND
);
q
->c_cf
= q
->c_cl
= NULL
;
if (((int)q
->c_cf
& CROUND
) == 0) {
bp
= (struct cblock
*)(q
->c_cf
);
q
->c_cf
= bp
->c_next
->c_info
;
* Return count of contiguous characters
* in clist starting at q->c_cf.
* Stop counting if flag&character is non-null.
register struct clist
*q
;
cc
= ((int)q
->c_cf
+ CBSIZE
) & ~CROUND
;
register struct clist
*q
;
register struct cblock
*bp
;
while (cc
>0 && q
->c_cc
) {
bp
= (struct cblock
*)((int)q
->c_cf
& ~CROUND
);
if ((int)bp
== (((int)q
->c_cl
-1) & ~CROUND
)) {
end
= (char *)((int)bp
+ sizeof (struct cblock
));
q
->c_cf
= bp
->c_next
->c_info
;
q
->c_cf
= q
->c_cl
= NULL
;
register struct clist
*p
;
register struct cblock
*bp
;
if ((cp
= p
->c_cl
) == NULL
|| p
->c_cc
< 0 ) {
if ((bp
= cfreelist
) == NULL
) {
p
->c_cf
= cp
= bp
->c_info
;
} else if (((int)cp
& CROUND
) == 0) {
bp
= (struct cblock
*)cp
- 1;
if ((bp
->c_next
= cfreelist
) == NULL
) {
* return number of bytes not transfered.
register struct cblock
*bp
;
if ((cq
= q
->c_cl
) == NULL
|| q
->c_cc
< 0) {
if ((bp
= cfreelist
) == NULL
)
q
->c_cf
= cq
= bp
->c_info
;
if (((int)cq
& CROUND
) == 0) {
bp
= (struct cblock
*) cq
- 1;
if ((bp
->c_next
= cfreelist
) == NULL
)
* Given a non-NULL pointter into the list (like c_cf which
* always points to a real character if non-NULL) return the pointer
* to the next character in the list or return NULL if no more chars.
* Callers must not allow getc's to happen between nextc's so that the
* pointer becomes invalid. Note that interrupts are NOT masked.
register struct clist
*p
;
if (p
->c_cc
&& ++cp
!= p
->c_cl
) {
if (((int)cp
& CROUND
) == 0)
return (((struct cblock
*)cp
)[-1].c_next
->c_info
);
* Remove the last character in the list and return it.
register struct clist
*p
;
register struct cblock
*bp
;
bp
= (struct cblock
*)p
->c_cl
;
bp
= (struct cblock
*)((int)bp
& ~CROUND
);
p
->c_cl
= p
->c_cf
= NULL
;
} else if (((int)p
->c_cl
& CROUND
) == sizeof(bp
->c_next
)) {
p
->c_cl
= (char *)((int)p
->c_cl
& ~CROUND
);
bp
= (struct cblock
*)p
->c_cf
;
bp
= (struct cblock
*)((int)bp
& ~CROUND
);
while (bp
->c_next
!= (struct cblock
*)p
->c_cl
)
p
->c_cl
= (char *)(bp
+ 1);
* Put the chars in the from que
* on the end of the to que.
* SHOULD JUST USE q_to_b AND THEN b_to_q HERE.
while ((c
= getc(from
)) >= 0)
* Integer (short) get/put
char Ch
[sizeof (word_t
)];
register struct clist
*p
;
if (p
->c_cc
< sizeof (word_t
))
for (i
= 0; i
< sizeof (word_t
); i
++)
register struct clist
*p
;
for (i
= 0; i
< sizeof (word_t
); i
++)