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

  1. /* asimrst.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  unsigned asimrst( port )
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *
  10. * DESCRIPTION
  11. *
  12. * Read and return static modem status from structure, and
  13. * reset static line modem byte to all 0's.
  14. *
  15. * Because it is not possible to differentiate between an error and the
  16. * status bits returned in the high order byte of the return value it is
  17. * necessary to return any errors in the global global variable _aserror.
  18. *
  19. *       _aserror =
  20. *
  21. *       Value           Meaning
  22. *     -------          --------
  23. *       ASSUCCESS       Successful (no error)
  24. *       ASINVPORT       Requested port is out of range
  25. *       ASNOTSETUP      Requested port not setup with asifirst()
  26. *
  27. * SIDE EFFECTS
  28. *  static modem status bits all set to 0
  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 asimrst(port)
  39. int port;
  40. {
  41.         struct PORT_TABLE *p;
  42.         unsigned modemstatus;
  43.  
  44.         if((p=_aschkcnl(port))==NULL)
  45.                 return(0);
  46.         modemstatus=p->modem_stat;
  47.         p->modem_stat=0;
  48.         return(modemstatus);
  49. }
  50.