home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / ASIPUTC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.3 KB  |  52 lines

  1. /* asiputc.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asiputc( port, character)
  8. *  int port;            - Port 0..MAX_PORT
  9. *  int character;       - Char to send 00..FF
  10. *
  11. * DESCRIPTION
  12. *  this function transmits a character via "interrupt" mode.
  13. *
  14. * SIDE EFFECTS
  15. *  none
  16. *
  17. * RETURNS
  18. *
  19. *       Value           Meaning
  20. *       ------          -------
  21. *       ASSUCCESS       Successful (No error(s))
  22. *       ASINVPORT       Requested port is out of range
  23. *       ASNOTSETUP      Requested port not setup with asifirst()
  24. *       ASBUFRFULL      Requested port's buffer is full
  25. *
  26. * MODIFICATIONS
  27. *  10-29-85     ""
  28. *               Modified for release 2.0
  29. *
  30. *  23-FEB-1987  08:51:11.24
  31. *       Removed call to _aschkcnl(), put code inline for speed
  32. */
  33. #include <stdio.h>
  34. #include "gf.h"
  35. #include "asiports.h"
  36.  
  37. int GF_CONV asiputc( port,c )
  38. int port,c;
  39. {
  40.         struct PORT_TABLE *p;
  41.  
  42.         if(port<0 || port>=MAX_PORT)
  43.                 return(_aserror= ASINVPORT);
  44.         if(as_chnl==NULL || (p=as_chnl->tblport[port].ptb)==NULL)
  45.                 return(_aserror= ASNOTSETUP);
  46.         _aserror = ASSUCCESS;
  47.         if(p->chst_bits.txfull==1)
  48.                 return(ASBUFRFULL);
  49.         return(_asiputc(p,c));
  50. }
  51.  
  52.