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

  1. /* asihold.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asihold( port, option)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  unsigned mode;       - ASIN, ASOUT, or ASINOUT
  10. *
  11. * DESCRIPTION
  12. *
  13. *  Holds (stops) interrupt process for a specified port.
  14. *
  15. *       option          Holds 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       Successful
  29. *       ASINVPORT       Requested port is out of range
  30. *       ASNOTSETUP      Requested port not setup with asifirst()
  31. *       ASINVPAR        Invalid parameter
  32. *
  33. * MODIFICATIONS
  34. *  11-19-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 asihold(port,option)
  42. int port;
  43. unsigned option;
  44. {
  45.         struct PORT_TABLE *p;
  46.         unsigned intregister=0;
  47.  
  48.         if((p=_aschkcnl(port))==NULL)
  49.                 return(_aserror);
  50.  
  51.         switch(option) {
  52.                 case    ASINOUT:
  53.                 case    ASIN:
  54.                         p->chmode_bits.is_rxint=p->chst_bits.rchrun=0;
  55.                         intregister|=1;
  56.                         if(option==ASIN)
  57.                                 break;
  58.                 case    ASOUT:
  59.                         p->chmode_bits.is_txint=0;
  60.                         intregister|=2;
  61.                         break;
  62.                 default:
  63.                         return(ASINVPAR);
  64.         }
  65.         _asihold(p->base_8250,intregister,p);
  66.         return(ASSUCCESS);
  67. }
  68.