home *** CD-ROM | disk | FTP | other *** search
- /* gettxfree.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * unsigned gettxfree( port )
- * int port; - Port 0..MAX_PORT-1
- *
- * DESCRIPTION
- *
- * Return the number of available character positions in the Transmit (ring)
- * buffer.
- *
- * Because it is not possible to differentiate between an error and a
- * valid return value it is necessary to return any errors in the global
- * variable _aserror.
- *
- * _aserror =
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS Successful (no error)
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- *
- * SIDE EFFECTS
- * None
- *
- * MODIFICATIONS
- * None
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- unsigned GF_CONV gettxfree(port)
- int port;
- {
- struct PORT_TABLE *p;
-
- if((p=_aschkcnl(port))==NULL)
- return(0);
- return(p->tx_size-p->tx_count);
- }
-