home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / FGETPOS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.4 KB  |  42 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - fgetpos.c
  3.  *
  4.  * function(s)
  5.  *        fgetpos - gets the current file pointer
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*[]------------------------------------------------------------[]*/
  9. /*|                                                              |*/
  10. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  11. /*|                                                              |*/
  12. /*|                                                              |*/
  13. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  14. /*|     All Rights Reserved.                                     |*/
  15. /*|                                                              |*/
  16. /*[]------------------------------------------------------------[]*/
  17.  
  18. #include <stdio.h>
  19.  
  20. /*-----------------------------------------------------------------------*
  21.  
  22. Name        fgetpos - gets the current file pointer
  23.  
  24. Usage        #include <stdio.h>
  25.         int fgetpos(FILE *stream, fpos_t *pos);
  26.  
  27. Prototype in    stdio.h
  28.  
  29. Description    stores the position of the file pointer associated
  30.         with stream in the location pointed to by pos
  31.  
  32. Return value    success : 0
  33.         failure : non-zero
  34.  
  35. *-----------------------------------------------------------------------*/
  36.  
  37.  
  38. int     fgetpos(FILE *stream, fpos_t *pos)
  39. {
  40.     return ((*pos = ftell(stream)) == -1) ? -1 : 0;
  41. }
  42.