[cxml-cvs] CVS cxml/klacks
dlichteblau
dlichteblau at common-lisp.net
Sun Feb 18 15:27:31 UTC 2007
Update of /project/cxml/cvsroot/cxml/klacks
In directory clnet:/tmp/cvs-serv24285/klacks
Modified Files:
klacks-impl.lisp
Log Message:
new argument :buffering to make-source
--- /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2007/02/18 14:35:15 1.3
+++ /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2007/02/18 15:27:30 1.4
@@ -101,10 +101,12 @@
(defun make-source
(input &rest args
&key validate dtd root entity-resolver disallow-internal-subset
- pathname)
+ (buffering t) pathname)
(declare (ignore validate dtd root entity-resolver disallow-internal-subset))
(etypecase input
(xstream
+ (when (and (not buffering) (< 1 (runes::xstream-speed input)))
+ (warn "make-source called with !buffering, but xstream is buffering"))
(let ((*ctx* nil))
(let ((zstream (make-zstream :input-stack (list input))))
(peek-rune input)
@@ -113,10 +115,10 @@
zstream
(loop
for (name value) on args by #'cddr
- unless (eq name :pathname)
+ unless (member name '(:pathname :buffering))
append (list name value)))))))
(stream
- (let ((xstream (make-xstream input)))
+ (let ((xstream (make-xstream input :speed (if buffering 8192 1))))
(setf (xstream-name xstream)
(make-stream-name
:entity-name "main document"
@@ -126,7 +128,8 @@
(apply #'make-source xstream args)))
(pathname
(let* ((xstream
- (make-xstream (open input :element-type '(unsigned-byte 8)))))
+ (make-xstream (open input :element-type '(unsigned-byte 8))
+ :speed (if buffering 8192 1))))
(setf (xstream-name xstream)
(make-stream-name
:entity-name "main document"
More information about the Cxml-cvs
mailing list