rezero() { iomove(0); level = 0; T_STATE = 0; T_RULE = -1; T_CH = -1; T_POS = 0; strcpy(T_STR, ""); }
void rezero(void) { iomove(0); level = 0; T_STATE = 0; T_RULE = -1; T_CH = -1; T_POS = 0; strlcpy(T_STR, "", sizeof T_STR); }
/* * write checks to make sure that the data set is not reading, * and that it is ready. Then the record is copied * and transmission started. */ dpwrite() { register char *bp; if (u.u_count==0 || dpwait()) return; dp11.dp_state = WRITE; bp = dp11.dp_buf->b_addr; dp11.dp_bufp = bp; if (u.u_count>512) u.u_count = 512; dp11.dp_nxmit = u.u_count; iomove(dp11.dp_buf, 0, u.u_count, B_WRITE); dpstart(); }
/* * Read waits until: * there is loss of "data set ready", or * a timeout occurs, or * a full record has been received. * The former two result in an error. */ dpread() { register char *bp, **epp; bp = dp11.dp_buf->b_addr; epp = &dp11.dp_bufp; for(;;) { if(dpwait()) return; if (*epp > bp) break; spl6(); if (dp11.dp_timer <= 1) { spl0(); return; } sleep(&dp11, DPPRI); spl0(); } iomove(dp11.dp_buf, 0, min(u.u_count, *epp-bp), B_READ); }