Commit 6a3c218a authored by csr21's avatar csr21
Browse files

big-request-extension

Implement the protocol portion of the BIG-REQUESTS extension, and the
function for clients to query the maximum extended request length.

The extension is as yet unused in the protocol implementation of other
requests.

darcs-hash:20070101125353-df18d-47e10460bde84aa20185cb59fbbed484d58fed48.gz
parent 6f64efe3
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: XLIB; -*-
;;;
;;; (c) copyright 2006 Richard Kreuter
;;; (c) copyright 2007 by Christophe Rhodes
;;;
;;; Permission is granted to any individual or institution to use,
;;; copy, modify, and distribute this software, provided that this
;;; complete copyright and permission notice is maintained, intact, in
;;; all copies and supporting documentation.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(in-package "XLIB")
;;; No new events or errors are defined by this extension. (Big
;;; Requests Extension, section 3)
;;;
;;; The name of this extension is "BIG-REQUESTS" (Big Requests
;;; Extension, section 4)
(define-extension "BIG-REQUESTS")
(defun enable-big-requests (display)
(declare (type display display))
(let ((opcode (extension-opcode display "BIG-REQUESTS")))
(with-buffer-request-and-reply (display opcode nil)
((data 0))
(let ((maximum-request-length (card32-get 8)))
(setf (display-extended-max-request-length display)
maximum-request-length)))))
......@@ -68,6 +68,7 @@
:pathname #.(make-pathname :directory '(:relative))
:components
((:file "shape")
(:file "big-requests")
(:file "xvidmode")
(:xrender-source-file "xrender")
(:file "glx")
......
......@@ -343,6 +343,7 @@
(atom-id-map (make-hash-table :test (resource-id-map-test)
:size *atom-cache-size*)
:type hash-table)
(extended-max-request-length 0 :type card32)
)
(defun print-display-name (display stream)
......
......@@ -392,6 +392,9 @@ gethostname(3) - is used instead."
(initialize-resource-allocator disp)
(initialize-predefined-atoms disp)
(initialize-extensions disp)
(when (assoc "BIG-REQUESTS" (display-extension-alist disp)
:test #'string=)
(enable-big-requests disp))
(setq ok-p t))
(unless ok-p (close-display disp :abort t)))
disp))
......
......@@ -98,7 +98,8 @@
device-event-mask-class discard-current-event discard-font-info display
display-after-function display-authorization-data display-authorization-name
display-bitmap-format display-byte-order display-default-screen
display-display display-error-handler display-finish-output
display-display display-error-handler
display-extended-max-request-length display-finish-output
display-force-output display-host display-image-lsb-first-p
display-invoke-after-function display-keycode-range display-max-keycode
display-max-request-length display-min-keycode display-motion-buffer-size
......@@ -268,7 +269,8 @@
device-event-mask-class discard-current-event discard-font-info display
display-after-function display-authorization-data display-authorization-name
display-bitmap-format display-byte-order display-default-screen
display-display display-error-handler display-finish-output
display-display display-error-handler
display-extended-max-request-length display-finish-output
display-force-output display-host display-image-lsb-first-p
display-invoke-after-function display-keycode-range display-max-keycode
display-max-request-length display-min-keycode display-motion-buffer-size
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment