home *** CD-ROM | disk | FTP | other *** search
- /* getb.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * unsigned asigetb( port, buffer, length)
- * int port; - Port 0..MAX_PORT-1
- * char *buffer; - Points to buffer that is to receive characters
- * unsigned length; - Maximum number of characters that can be received
- *
- * DESCRIPTION
- *
- * This routine reads in up to length characters into the buffer supplied by
- * the user. All the work for this guy is done in the asigetb_timed()
- * routine, which is called with a timeout parameter of 0. This makes
- * this routine a prime candidate for being turned into a macro.
- *
- * SIDE EFFECTS
- * none
- *
- * RETURNS
- * returns the number of characters SUCCESSFULLY transferred. The global
- * variable _aserror can be examined to determine if an error was detected.
- * _aserror == 0 if no errors were detected. If the receive queue becomes
- * empty before the entire user buffer is filled _aserror will be set to
- * ASBUFREMPTY.
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS port initialized (no error)
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- * ASBUFREMPTY Receive buffer went empty before length characters
- * were transferred.
- *
- * MODIFICATIONS
- * 10-25-85 ""
- * Modified for release 2.0
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- unsigned GF_CONV asigetb( int port, char *buffer, unsigned int length )
- {
- return( asigetb_timed( port, buffer, length, 0 ) );
- }