;;; -*- Mode:COMMON-LISP; Package:X11; Base:10.; Fonts:(MEDFNB hl12B hl12bi) -*-

;;;                           RESTRICTED RIGHTS LEGEND

;;;Use, duplication, or disclosure by the Government is subject to
;;;restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
;;;Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;                     TEXAS INSTRUMENTS INCORPORATED.
;;;                              P.O. BOX 2909
;;;                           AUSTIN, TEXAS 78769
;;;                                 MS 2151
;;;
;;; Copyright (C) 1987, Texas Instruments Incorporated. All rights reserved.

;;; Change history:
;;;
;;;  Date       Author	Description
;;; -------------------------------------------------------------------------------------
;;; 12/22/88	LGO	Fix KILL-CLIENT to handle the all-temporary case.
;;; 12/12/88	WJB	Modified KILL-CLIENT to kill the process rather than call state-shutdown
;;; 12/08/88	DLS	Implemented KILL-CLIENT request
;;; 09/09/88    LGO	Stub-out LIST-HOSTS so clients using it won't die.
;;; 12/15/87    TWE	Moved requests from the REQUESTS file.


(defreq Change-Hosts ((mode (CARD8 Host-Insert Host-Delete))
		      (family CARD16)
		      (nhosts CARD16)
		      (:long))
  )

(defreq List-Hosts ()
  (list-hosts state))

(defun list-hosts (state)
  (format-reply (state)
		:byte disable-access
		:word 0))

(defreq Grab-Server ()
  (deactivate-server state)
  (activate-solo state :grabist))

(defreq Ungrab-Server ()
  (deactivate-solo state :grabist))

(defreq Kill-Client ((resource (ONEOF RESOURCE)))
  (kill-client resource))

(defun kill-client (resource)
  (when (not (eql resource universal-none))
    (dolist (state (global-state.states *globals*))
      (when (eql (id-mask-to-connection-number (state.id-base state))
		 (id-mask-to-connection-number (resource.id resource)))
	(send (state.process state) :kill)
	(return nil)))))

;;; Set Access Control
(defreq Change-Access-Control ((mode (CARD8 Disable-Access Enable-Access)))
  )

;;; Set Close Down Mode
(defreq Change-Close-Down-Mode ((mode (CARD8 Close-Destroy
					     Close-Retain-Permanent Close-Retain-Temporary)))
  )
