home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / fgetws.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  47 lines

  1. /***
  2. *fgetws.c - get wide string from a file
  3. *
  4. *       Copyright (c) 1993-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines fgetws() - read a wide string from a file
  8. *
  9. *******************************************************************************/
  10.  
  11.  
  12. /***
  13. *wchar_t *fgetws(string, count, stream) - input string from a stream
  14. *
  15. *Purpose:
  16. *       get a string, up to count-1 wide chars or L'\n', whichever comes first,
  17. *       append L'\0' and put the whole thing into string. the L'\n' IS included
  18. *       in the string. if count<=1 no input is requested. if WEOF is found
  19. *       immediately, return NULL. if WEOF found after chars read, let WEOF
  20. *       finish the string as L'\n' would.
  21. *
  22. *Entry:
  23. *       wchar_t *string - pointer to place to store string
  24. *       int count - max characters to place at string (include \0)
  25. *       FILE *stream - stream to read from
  26. *
  27. *Exit:
  28. *       returns wide string with text read from file in it.
  29. *       if count <= 0 return NULL
  30. *       if count == 1 put null string in string
  31. *       returns NULL if error or end-of-file found immediately
  32. *
  33. *Exceptions:
  34. *
  35. *******************************************************************************/
  36.  
  37. #ifndef _UNICODE
  38. #define _UNICODE 1
  39. #endif  /* _UNICODE */
  40.  
  41. #ifndef UNICODE
  42. #define UNICODE 1
  43. #endif  /* UNICODE */
  44.  
  45. #include "fgets.c"
  46.  
  47.