home *** CD-ROM | disk | FTP | other *** search
- /* asixrst.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * unsigned asixrst( port )
- * int port; - Port 0..MAX_PORT-1
- *
- * DESCRIPTION
- *
- * Read and return the contents of rx_accum (count of receive characters)
- * resetting the variable to 0.
- *
- * Because it is not possible to differentiate between an error and the
- * status bits returned in the high order byte of the return value it is
- * necessary to return any errors in the global global variable _aserror.
- *
- * _aserror =
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS Successful (no error)
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- *
- * RETURNS: Receiver Count 0..65535
- *
- * SIDE EFFECTS
- * rx_accum for the port is reset to 0
- *
- * MODIFICATIONS
- * 11-09-85 ""
- * Modified for release 2.0
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- unsigned GF_CONV asixrst(port)
- int port;
- {
- struct PORT_TABLE *p;
- unsigned receivecount;
-
- if((p=_aschkcnl(port))==NULL)
- return(0);
- receivecount=p->rx_accum;
- p->rx_accum=0;
- return(receivecount);
- }
-