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

  1. /* wgets.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  unsigned asiwgets(port,string,length,opt,stat)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  char *string;        - String to transfer
  10. *  unsigned length;     - Maximum number of characters to transfer.
  11. *  int opt;             - Terminating character to watch for.
  12. *  char *stat;          - Array of Char for Status, NULL for none.
  13. *
  14. * DESCRIPTION
  15. *  a string is transferred one character at a time from the receive
  16. *  queue to the specified user buffer.  The status for each character
  17. *  is transferred to a user buffer (unless NULL is specified). Also a
  18. *  terminating null is appended to the user buffer.
  19. *
  20. * SIDE EFFECTS
  21. *  none
  22. *
  23. * RETURNS
  24. *  Always returns the number of characters transferred to the user
  25. *  buffer NOT INCLUDING the terminating null.  For example if only
  26. *  one character was received from the receive queue a null would
  27. *  be added to the second position of the buffer and a value of 1
  28. *  would be returned.  The global variable _aserror can be examined to
  29. *  determine if an error was detected.  _aserror == 0 if no errors were
  30. *  detected.
  31. *
  32. *       _aserror =
  33. *
  34. *       Value           Meaning
  35. *     -------          --------
  36. *       ASSUCCESS       port initialized (no error)
  37. *       ASINVPORT       Requested port is out of range
  38. *       ASNOTSETUP      Requested port not setup with asifirst()
  39. *       ASINVPAR        Option parameter invalid
  40. *       ASBUFREMPTY     Buffer is empty
  41. *       ASNOWIDERX      Wide Track Receive buffer is not enabled
  42. *
  43. * MODIFICATIONS
  44. *
  45. *  11-01-85     ""
  46. *               Modified for release 2.0
  47. */
  48. #include <stdio.h>
  49. #include "gf.h"
  50. #include "asiports.h"
  51.  
  52. unsigned int GF_CONV asiwgets( int port,
  53.                        char *string,
  54.                        unsigned int length,
  55.                        int opt,
  56.                        char *stat )
  57. {
  58.     return( asiwgets_timed( port, string, length, opt, stat, 0 ) );
  59. }
  60.