home *** CD-ROM | disk | FTP | other *** search
- /* asipeekc.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * int asipeekc(port)
- * int port; - Port 0..MAX_PORT
- *
- * DESCRIPTION
- * this function peeks at the next character in the communications queue
- * without removing it from the queue.
- *
- * SIDE EFFECTS
- * none.
- *
- * RETURNS
- *
- * Value Meaning
- * ------ -------
- * 0 thru 255 Return value equals character received
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- * ASBUFREMPTY Requested port's buffer is empty
- *
- * MODIFICATIONS
- *
- * 11-01-85 ""
- * Modified for release 2.0
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- int GF_CONV asipeek(port)
- int port;
- {
- struct PORT_TABLE *p;
-
- if((p=_aschkcnl(port))==NULL)
- return(_aserror);
- if(p->chst_bits.rxempty==1)
- return(ASBUFREMPTY);
- return(_asipekc(p)&0xff);
-
- }
-
-