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 / ASISTART.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.7 KB  |  67 lines

  1. /* asistart.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asistart( port, option)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  int option;          - ASIN, ASOUT, or ASINOUT
  10. *
  11. * DESCRIPTION
  12. *
  13. *  Enables interrupt process to begin for a specified port.
  14. *
  15. *       option          Enables Interrupts For:
  16. *       ------          -----------------------
  17. *       ASIN            Receiver (including error & modem changes)
  18. *       ASOUT           Transmitter Only
  19. *       ASINOUT         Receiver and Transmitter
  20. *
  21. * SIDE EFFECTS
  22. *  none
  23. *
  24. * RETURNS
  25. *
  26. *       Value           Meaning
  27. *     -------          --------
  28. *       ASSUCCESS       port initialized (no error)
  29. *       ASINVPORT       Requested port is out of range
  30. *       ASNOTSETUP      Requested port not setup with asifirst()
  31. *       ASINVPAR        Invalid parameter
  32. *
  33. * MODIFICATIONS
  34. *  10-25-85     ""
  35. *               Modified for release 2.0
  36. */
  37. #include <stdio.h>
  38. #include "gf.h"
  39. #include "asiports.h"
  40.  
  41. int GF_CONV asistart(port,option)
  42. int port;
  43. unsigned option;
  44. {
  45.         struct PORT_TABLE *p;
  46.  
  47.         if((p=_aschkcnl(port))==NULL)
  48.                 return(_aserror);
  49.         switch(option) {
  50.                 case    ASINOUT:
  51.                 case    ASIN:
  52.                         p->chmode_bits.is_rxint=1;
  53.                         if(option==ASIN)
  54.                                 break;
  55.  
  56.                 case    ASOUT:
  57.                         p->chmode_bits.is_txint=1;
  58.                         break;
  59.  
  60.                 default:
  61.                         return(ASINVPAR);
  62.  
  63.         }
  64.         return (_asistart(p));
  65. }
  66.  
  67.