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

  1. /* asierst.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  unsigned asierst( port )
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *
  10. * DESCRIPTION
  11. *
  12. * Reset error bits in chst_bits variable.  Resets: alert bit,
  13. * rxovflow bit, linerr bit and modchg bit.
  14. *
  15. * The user program must check the _aserror global variable to determine
  16. * if an error has occurred.
  17. *
  18. *       _aserror =
  19. *
  20. *       Value           Meaning
  21. *     -------          --------
  22. *       ASSUCCESS       Successful (no error)
  23. *       ASINVPORT       Requested port is out of range
  24. *       ASNOTSETUP      Requested port not setup with asifirst()
  25. *
  26. * SIDE EFFECTS
  27. * Reset error bits in chst_bits variable.  Resets: alert bit,
  28. * rxovflow bit, linerr bit and modchg bit.
  29. *
  30. * MODIFICATIONS
  31. *  11-09-85     ""
  32. *               Modified for release 2.0
  33. */
  34. #include <stdio.h>
  35. #include "gf.h"
  36. #include "asiports.h"
  37.  
  38. unsigned GF_CONV asierst(port)
  39. int port;
  40. {
  41.         struct PORT_TABLE *p;
  42.         unsigned retval;
  43.  
  44.         if((p=_aschkcnl(port))==NULL)
  45.                 return(0);
  46.         retval=asibstat(port);
  47.         _ascli();
  48.         p->chst_bits.alert=p->chst_bits.linerr=p->chst_bits.rxovflow=
  49.         p->chst_bits.modchg=0;
  50.         _assti();
  51.         return(retval);
  52.  
  53. }
  54.