home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC.ZIP / FGETPOS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.0 KB  |  41 lines

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