/* Copyright (C) Magna Carta Software, Inc. 1990. All Rights Reserved C COMMUNICATIONS TOOLKIT RXCOUNT.C -- Return the number of bytes in the RX buffer. */ #include /* C_RXCOUNT -- return the number of bytes in the receive buffer. Parameters: COMM_PORT *p -- pointer to the port; */ WORD c_rxcount(COMM_PORT *p) { if (!(p->intr & 1)) return (0); if (p->rxbufhead >= p->rxbuftail) return(p->rxbufhead - p->rxbuftail); else return(p->rx_bufsiz - (p->rxbuftail - p->rxbufhead)); }