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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - fdopen.c
  3.  *
  4.  * function(s)
  5.  *        fdopen        - associates a stream with a file handle
  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. #include <_stdio.h>
  19.  
  20. /*---------------------------------------------------------------------*
  21.  
  22. Name            fdopen -  associates a stream with a file handle
  23.  
  24. Usage           FILE *fdopen(int handle, char *type);
  25.  
  26. Prototype in    stdio.h
  27.  
  28. Description     see fopen
  29.  
  30. *---------------------------------------------------------------------*/
  31. FILE * _FARFUNC fdopen (int handle, char *type)
  32. {
  33.         register FILE   *fp;
  34.  
  35.         if (handle < 0 || (fp = __getfp()) == NULL)
  36.                 return NULL;
  37.  
  38.         fp->fd = handle;
  39.         return __openfp (fp, NULL, type, 0);
  40. }
  41.