X-Git-Url: http://git.kpe.io/?p=xmlutils.git;a=blobdiff_plain;f=pxml1.cl;fp=pxml1.cl;h=4849fb255a782363e2d5b08c117b4e00eacb8a58;hp=cc6df9dc05544fa1223d3bba34c8acb5d25bd96c;hb=7a3f6cd041edb5d596ffb20bfd626e844d98b538;hpb=1e8aa1df433841c85c5a0b44fbd92964672e18b5 diff --git a/pxml1.cl b/pxml1.cl index cc6df9d..4849fb2 100644 --- a/pxml1.cl +++ b/pxml1.cl @@ -25,13 +25,13 @@ (in-package :net.xml.parser) -(pxml-dribble-bug-hook "$Id: pxml1.cl,v 1.3 2003/06/20 02:21:23 kevin Exp $") +(pxml-dribble-bug-hook "$Id: pxml1.cl,v 1.4 2003/07/11 18:02:41 kevin Exp $") (defparameter *collectors* (list nil nil nil nil nil nil nil nil)) (defun put-back-collector (col) (declare (optimize (speed 3) (safety 1))) - (mp::without-scheduling + (without-scheduling (do ((cols *collectors* (cdr cols))) ((null cols) ; toss it away @@ -83,7 +83,7 @@ (defun get-tokenbuf () (declare (optimize (speed 3) (safety 1))) (let (buf) - (mp::without-scheduling + (without-scheduling (do* ((bufs *tokenbufs* (cdr bufs)) (this (car bufs) (car bufs))) ((null bufs)) @@ -185,7 +185,7 @@ (defun put-back-tokenbuf (buf) (declare (optimize (speed 3) (safety 1))) - (mp::without-scheduling + (without-scheduling (do ((bufs *tokenbufs* (cdr bufs))) ((null bufs) ; toss it away @@ -197,7 +197,7 @@ (defun get-collector () (declare (optimize (speed 3) (safety 1))) (let (col) - (mp::without-scheduling + (without-scheduling (do* ((cols *collectors* (cdr cols)) (this (car cols) (car cols))) ((null cols)) @@ -266,17 +266,20 @@ (if* (and from-stream (eq tmp-char #\return)) then #\newline else tmp-char))) (defun unicode-check (p tokenbuf) + #-allegro (return-from unicode-check t) + #+allegro (declare (ignorable tokenbuf) (optimize (speed 3) (safety 1))) ;; need no-OO check because external format support isn't completely done yet + #+allegro (when (not (typep p 'string-input-simple-stream)) - #+(version>= 6 0 pre-final 1) + #+allegro (let ((format (ignore-errors (excl:sniff-for-unicode p)))) (if* (eq format (find-external-format :unicode)) then (setf (stream-external-format p) format) else (setf (stream-external-format p) (find-external-format :utf8)))) - #-(version>= 6 0 pre-final 1) + #-allegro (let* ((c (read-char p nil)) c2 (c-code (if c (char-code c) nil))) (if* (eq #xFF c-code) then @@ -285,8 +288,9 @@ (if* (eq #xFE c-code) then (format t "set unicode~%") (setf (stream-external-format p) - (find-external-format #+(version>= 6 0 pre-final 1) :unicode - #-(version>= 6 0 pre-final 1) :fat-little)) + (find-external-format + #+allegro :unicode + #-allegro :fat-little)) else (xml-error "stream has incomplete Unicode marker")) else (setf (stream-external-format p) @@ -432,6 +436,7 @@ ;; if we have a stream we're reading from set its external-format ;; to the encoding ;; note - tokenbuf is really an iostruct, not a tokenbuf + #+allegro (if* (tokenbuf-stream (iostruct-tokenbuf tokenbuf)) then (setf (stream-external-format (tokenbuf-stream (iostruct-tokenbuf tokenbuf)))