home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MODEM / UWPC201.ZIP / UWSERVER.TAR / lib / uw_close.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-25  |  575 b   |  28 lines

  1. /*
  2.  *    uw library - uw_close
  3.  *
  4.  * Copyright 1986 by John D. Bruner.  All rights reserved.  Permission to
  5.  * copy this program is given provided that the copy is not sold and that
  6.  * this copyright notice is included.
  7.  */
  8. #include "uwlib.h"
  9.  
  10. uw_close(uwin)
  11. UWIN uwin;
  12. {
  13.     /*
  14.      * Close all connections to an existing window, but do not kill it.
  15.      */
  16.     if (uwin != (UWIN)0) {
  17.         if (uwin->uwi_ctlfd >= 0)
  18.             (void)uw_detach(uwin);
  19.         if (uwin->uwi_datafd >= 0)
  20.             (void)close(uwin->uwi_datafd);
  21.         free((char *)uwin);
  22.         return(0);
  23.     } else {
  24.         uwerrno = UWE_INVAL;
  25.         return(-1);
  26.     }
  27. }
  28.