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

  1. /* wgetb.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  unsigned asiwgetb( port, buffer, length, stat)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  char *buffer;        - Points to buffer that is to receive characters
  10. *  unsigned length;     - Maximum number of characters that can be received
  11. *  char *stat;          - Pointer to destination status buffer
  12. *
  13. * DESCRIPTION
  14. *
  15. *  Transfers characters from receive queue to user buffer.  Note that this
  16. *  function doesn't really do any work.  All the work is done by calling
  17. *  asiwgetb_timed, with a ticks parameter of 0.
  18. *
  19. * SIDE EFFECTS
  20. *  none
  21. *
  22. * RETURNS
  23. *  returns the number of characters SUCCESSFULLY transferred.  The global
  24. *  variable _aserror can be examined to determine if an error was detected.
  25. *  _aserror == 0 if no errors were detected.  If the receive queue becomes
  26. *  empty before the entire user buffer is filled _aserror will be set to
  27. *  ASBUFREMPTY.
  28. *
  29. *       Value           Meaning
  30. *     -------          --------
  31. *       ASSUCCESS       port initialized (no error)
  32. *       ASINVPORT       Requested port is out of range
  33. *       ASNOTSETUP      Requested port not setup with asifirst()
  34. *       ASBUFREMPTY     Receive buffer went empty before length characters
  35. *                       were transferred.
  36. *       ASNOWIDERX      Wide Track receive not enabled for this channel.
  37. *
  38. * MODIFICATIONS
  39. *
  40. */
  41. #include <stdio.h>
  42. #include "gf.h"
  43. #include "asiports.h"
  44.  
  45. unsigned int GF_CONV asiwgetb( int port,
  46.                        char *buffer,
  47.                        unsigned int length,
  48.                        char *stat )
  49. {
  50.     return( asiwgetb_timed( port, buffer, length, stat, 0 ) );
  51. }
  52.  
  53.