home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / fonts / lib / fs / FSClServ.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-13  |  2.0 KB  |  60 lines

  1. /* $XConsortium: FSClServ.c,v 1.2 91/05/13 15:11:23 gildea Exp $ */
  2.  
  3. /* @(#)FSClServ.c    4.1    91/05/02
  4.  * Copyright 1990 Network Computing Devices;
  5.  * Portions Copyright 1987 by Digital Equipment Corporation and the
  6.  * Massachusetts Institute of Technology
  7.  *
  8.  * Permission to use, copy, modify, and distribute this protoype software
  9.  * and its documentation to Members and Affiliates of the MIT X Consortium
  10.  * any purpose and without fee is hereby granted, provided
  11.  * that the above copyright notice appear in all copies and that both that
  12.  * copyright notice and this permission notice appear in supporting
  13.  * documentation, and that the names of Network Computing Devices, Digital or
  14.  * MIT not be used in advertising or publicity pertaining to distribution of
  15.  * the software without specific, written prior permission.
  16.  *
  17.  * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
  18.  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  19.  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
  20.  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  21.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  22.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  23.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  */
  25.  
  26. #include    "FSlibint.h"
  27.  
  28. extern FSServer *_FSHeadOfServerList;
  29.  
  30. FSCloseServer(svr)
  31.     FSServer     *svr;
  32. {
  33.     _FSExtension *ext;
  34.     FSServer    **sv = &_FSHeadOfServerList;
  35.     FSServer     *s = _FSHeadOfServerList;
  36.     extern void _FSFreeQ();
  37.  
  38.     svr->flags |= FSlibServerClosing;
  39.     FSSync(svr, 1);        /* throw out pending events */
  40.     ext = svr->ext_procs;
  41.     while (ext) {
  42.     if (ext->close_server != NULL)
  43.         (*ext->close_server) (svr, &ext->codes);
  44.     ext = ext->next;
  45.     }
  46.     _FSDisconnectServer(svr->fd);
  47.     while (s != NULL) {
  48.     if (s == svr) {
  49.         *sv = s->next;
  50.         _FSFreeServerStructure(svr);
  51.         break;
  52.     }
  53.     sv = &(s->next);
  54.     s = *sv;
  55.     }
  56.     if (_FSHeadOfServerList == NULL) {
  57.     _FSFreeQ();
  58.     }
  59. }
  60.