home *** CD-ROM | disk | FTP | other *** search
- /* aschkcnl.c
- *
- * struct PORT_TABLE *_aschkcnl( port )
- * int port; - Logical port to check, 0 <= port < MAX_PORT
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * DESCRIPTION
- * checks whether or not the logical port has been setup with
- * asifirst(). This is an absolute requirement before any other
- * function can be called.
- *
- * SIDE EFFECTS
- * none.
- *
- * RETURNS
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS Success (no errors)
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- *
- * MODIFICATIONS
- * 10-25-85 New for release 2.0
- * 03-FEB-1987 10:47:00.23
- * The range check on port would allow port==16 (MAX_PORT), changed
- * this test to fail if port is >= MAX_PORT.
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- struct PORT_TABLE * GF_CONV _aschkcnl(port)
- int port;
- {
- if(port<0 || port>=MAX_PORT) {
- _aserror = ASINVPORT;
- return(NULL);
- }
- if(as_chnl==NULL || as_chnl->tblport[port].ptb==NULL) {
- _aserror = ASNOTSETUP;
- return(NULL);
- }
- _aserror = ASSUCCESS;
- return(as_chnl->tblport[port].ptb);
- }
-
-