[bknr-cvs] r2274 - in branches/trunk-reorg/thirdparty: . chunga-0.4.1 chunga-0.4.1/doc cl-ppcre-1.3.2 cl-ppcre-1.3.2/doc hunchentoot-0.14.6 hunchentoot-0.14.6/doc hunchentoot-0.14.6/test

bknr at bknr.net bknr at bknr.net
Wed Nov 14 00:24:19 EST 2007


Author: hhubner
Date: 2007-11-14 00:24:08 -0500 (Wed, 14 Nov 2007)
New Revision: 2274

Added:
   branches/trunk-reorg/thirdparty/chunga-0.4.1/
   branches/trunk-reorg/thirdparty/chunga-0.4.1/CHANGELOG.txt
   branches/trunk-reorg/thirdparty/chunga-0.4.1/chunga.asd
   branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/
   branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/index.html
   branches/trunk-reorg/thirdparty/chunga-0.4.1/input.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/output.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/packages.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/read.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/specials.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/streams.lisp
   branches/trunk-reorg/thirdparty/chunga-0.4.1/util.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/CHANGELOG
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/README
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/api.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/cl-ppcre-test.asd
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/cl-ppcre-test.system
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/cl-ppcre.asd
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/cl-ppcre.system
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/closures.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/convert.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/doc/
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/doc/benchmarks.2002-12-22.txt
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/doc/index.html
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/errors.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/lexer.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/lispworks-defsystem.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/load.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/optimize.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/packages.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/parser.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/perltest.pl
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/ppcre-tests.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/regex-class.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/repetition-closures.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/scanner.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/specials.lisp
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/testdata
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/testinput
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/util.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/CHANGELOG
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/CHANGELOG_TBNL
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/README
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/conditions.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/cookie.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/doc/
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/doc/LICENSE.txt
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/doc/hunchentoot.gif
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/doc/index.html
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/easy-handlers.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/headers.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/hunchentoot-test.asd
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/hunchentoot.asd
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/log.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/mime-types.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/misc.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/packages.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/port-acl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/port-cmu.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/port-lw.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/port-mcl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/port-sbcl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/reply.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/request.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/server.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/session.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/specials.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/UTF-8-demo.html
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/favicon.ico
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/fz.jpg
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/packages.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/test/test.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/unix-acl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/unix-cmu.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/unix-lw.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/unix-mcl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/unix-sbcl.lisp
   branches/trunk-reorg/thirdparty/hunchentoot-0.14.6/util.lisp
Removed:
   branches/trunk-reorg/thirdparty/chunga-0.3.0/
   branches/trunk-reorg/thirdparty/cl-ppcre-1.3.0/
   branches/trunk-reorg/thirdparty/flexi-streams-0.11.2/
   branches/trunk-reorg/thirdparty/hunchentoot-0.11.1/
   branches/trunk-reorg/thirdparty/trivial-gray-streams-2006-09-16/
   branches/trunk-reorg/thirdparty/trivial-http/
Log:
updating

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/CHANGELOG.txt
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/CHANGELOG.txt	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/CHANGELOG.txt	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,50 @@
+Version 0.4.1
+2007-10-11
+Make Chunga work with AllegroCL's "modern" mode (patch by Ross Jekel)
+
+Version 0.4.0
+2007-09-18
+Added *TREAT-SEMICOLON-AS-CONTINUATION*
+
+Version 0.3.1
+2007-09-07
+Fixed bug in STREAM-LISTEN
+
+Version 0.3.0
+2007-05-08
+Added *ACCEPT-BOGUS-EOLS* (suggested by Sean Ross)
+
+Version 0.2.4
+2007-02-08
+Allow more characters in cookie names/values according to original Netscape spec
+Robustified READ-COOKIE-VALUE
+
+Version 0.2.3
+2007-01-17
+Guard against stray semicolons when reading name/value pairs (thanks to Bülent Murtezaoglu)
+
+Version 0.2.2
+2007-01-10
+Faster vesion of READ-LINE* (provided by Gábor Melis)
+
+Version 0.2.1
+2006-10-26
+Added explicit element types for CLISP to fix problems reported by Anton Vodonosov
+
+Version 0.2.0
+2006-10-06
+Only wrap inner stream with flexi stream if really needed
+
+Version 0.1.2
+2006-09-05
+Exported CHUNKED-STREAM-STREAM
+Mentioned Gentoo port in docs
+Added info about mailing lists
+
+Version 0.1.1
+2006-09-02
+Added missing CRLF for output chunking
+
+Version 0.1.0
+2006-09-01
+First public release


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/CHANGELOG.txt
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/chunga.asd
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/chunga.asd	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/chunga.asd	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,40 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/chunga.asd,v 1.15 2007/10/11 06:56:02 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(asdf:defsystem :chunga
+  :serial t
+  :version "0.4.1"
+  :components ((:file "packages")
+               (:file "specials")
+               (:file "util")
+               (:file "read")
+               (:file "streams")
+               (:file "input")
+               (:file "output"))
+  :depends-on (:flexi-streams))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/chunga.asd
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/index.html
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/index.html	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/index.html	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,587 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html> 
+
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+  <title>CHUNGA - Portable chunked streams for Common Lisp</title>
+  <style type="text/css">
+  pre { padding:5px; background-color:#e0e0e0 }
+  h3, h4 { text-decoration: underline; }
+  a { text-decoration: none; padding: 1px 2px 1px 2px; }
+  a:visited { text-decoration: none; padding: 1px 2px 1px 2px; }
+  a:hover { text-decoration: none; padding: 1px 1px 1px 1px; border: 1px solid #000000; } 
+  a:focus { text-decoration: none; padding: 1px 2px 1px 2px; border: none; }
+  a.none { text-decoration: none; padding: 0; }
+  a.none:visited { text-decoration: none; padding: 0; } 
+  a.none:hover { text-decoration: none; border: none; padding: 0; } 
+  a.none:focus { text-decoration: none; border: none; padding: 0; } 
+  a.noborder { text-decoration: none; padding: 0; } 
+  a.noborder:visited { text-decoration: none; padding: 0; } 
+  a.noborder:hover { text-decoration: none; border: none; padding: 0; } 
+  a.noborder:focus { text-decoration: none; border: none; padding: 0; }  
+  </style>
+</head>
+
+<body bgcolor=white>
+
+<h2>CHUNGA - Portable chunked streams for Common Lisp</h2>
+
+<blockquote>
+<br>&nbsp;<br><h3><a name=abstract class=none>Abstract</a></h3> Chunga
+implements streams capable of chunked encoding on demand as defined in
+RFC 2616.  For an example of how these streams can be used
+see <a href="http://weitz.de/drakma/">Drakma</a>.
+<p>
+The library needs a Common Lisp implementation that
+supports <a
+href="http://www.nhplace.com/kent/CL/Issues/stream-definition-by-user.html"><em>Gray
+streams</em></a> and relies on David
+Lichteblau's <a
+href="http://www.cliki.net/trivial-gray-streams">trivial-gray-streams</a> to offer portability between different Lisps.
+<p>
+Chunga is currently not optimized towards performance - it is
+rather intended to be easy to use and (if possible) to behave correctly.
+<p>
+The code comes with
+a <a
+href="http://www.opensource.org/licenses/bsd-license.php">BSD-style
+license</a> so you can basically do with it whatever you want.
+
+<p>
+<font color=red>Download shortcut:</font> <a href="http://weitz.de/files/chunga.tar.gz">http://weitz.de/files/chunga.tar.gz</a>.
+</blockquote>
+
+<br>&nbsp;<br><h3><a class=none name="contents">Contents</a></h3>
+<ol>
+  <li><a href="#download">Download and installation</a>
+  <li><a href="#mail">Support and mailing lists</a>
+  <li><a href="#dictionary">The Chunga dictionary</a>
+    <ol>
+      <li><a href="#streams">Chunked streams</a>
+        <ol>
+          <li><a href="#chunked-stream"><code>chunked-stream</code></a>
+          <li><a href="#chunked-input-stream"><code>chunked-input-stream</code></a>
+          <li><a href="#chunked-output-stream"><code>chunked-output-stream</code></a>
+          <li><a href="#chunked-io-stream"><code>chunked-io-stream</code></a>
+          <li><a href="#make-chunked-stream"><code>make-chunked-stream</code></a>
+          <li><a href="#chunked-stream-stream"><code>chunked-stream-stream</code></a>
+          <li><a href="#chunked-stream-input-chunking-p"><code>chunked-stream-input-chunking-p</code></a>
+          <li><a href="#chunked-stream-output-chunking-p"><code>chunked-stream-output-chunking-p</code></a>
+          <li><a href="#chunked-input-stream-extensions"><code>chunked-input-stream-extensions</code></a>
+          <li><a href="#chunked-input-stream-trailers"><code>chunked-input-stream-trailers</code></a>
+        </ol>
+      <li><a href="#conditions">Conditions</a>
+        <ol>
+          <li><a href="#input-chunking-body-corrupted"><code>input-chunking-body-corrupted</code></a>
+          <li><a href="#input-chunking-unexpected-end-of-file"><code>input-chunking-unexpected-end-of-file</code></a>
+        </ol>
+      <li><a href="#parse">RFC 2616 parsing</a>
+        <ol>
+          <li><a href="#read-line*"><code>read-line*</code></a>
+          <li><a href="#read-http-headers"><code>read-http-headers</code></a>
+          <li><a href="#read-token"><code>read-token</code></a>
+          <li><a href="#read-name-value-pair"><code>read-name-value-pair</code></a>
+          <li><a href="#read-name-value-pairs"><code>read-name-value-pairs</code></a>
+          <li><a href="#assert-char"><code>assert-char</code></a>
+          <li><a href="#skip-whitespace"><code>skip-whitespace</code></a>
+          <li><a href="#trim-whitespace"><code>trim-whitespace</code></a>
+          <li><a href="#*current-error-message*"><code>*current-error-message*</code></a>
+          <li><a href="#*accept-bogus-eols*"><code>*accept-bogus-eols*</code></a>
+          <li><a href="#*treat-semicolon-as-continuation*"><code>*treat-semicolon-as-continuation*</code></a>
+        </ol>
+    </ol>
+  <li><a href="#ack">Acknowledgements</a>
+</ol>
+
+<br>&nbsp;<br><h3><a class=none name="download">Download and installation</a></h3>
+
+Chunga together with this documentation can be downloaded from <a
+href="http://weitz.de/files/chunga.tar.gz">http://weitz.de/files/chunga.tar.gz</a>. The
+current version is 0.4.1.
+<p>
+Chunga depends on
+the <a href="http://weitz.de/flexi-streams/">FLEXI-STREAMS</a>
+library.  You can download and install Chunga and its dependencies
+automatically
+with <a href="http://www.cliki.net/ASDF-Install">ASDF-Install</a>, and
+there's a port for <a href="http://www.gentoo.org/proj/en/common-lisp/index.xml">Gentoo
+Linux</a> thanks to Matthew Kennedy.
+<p>
+A <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a>
+repository of older versions is available
+at <a
+href="http://arcanes.fr.eu.org/~pierre/2007/02/weitz/">http://arcanes.fr.eu.org/~pierre/2007/02/weitz/</a>
+thanks to Pierre Thierry.
+<p>
+Lu&iacute;s Oliveira maintains a <a href="http://darcs.net/">darcs</a>
+repository of Chunga
+at <a
+href="http://common-lisp.net/~loliveira/ediware/">http://common-lisp.net/~loliveira/ediware/</a>.
+
+<br>&nbsp;<br><h3><a name="mail" class=none>Support and mailing lists</a></h3>
+
+For questions, bug reports, feature requests, improvements, or patches
+please use the <a
+href="http://common-lisp.net/mailman/listinfo/drakma-devel">drakma-devel
+mailing list</a>. If you want to be notified about future releases
+subscribe to the <a
+href="http://common-lisp.net/mailman/listinfo/drakma-announce">drakma-announce
+mailing list</a>. These mailing lists were made available thanks to
+the services of <a href="http://common-lisp.net/">common-lisp.net</a>.
+<p>
+If you want to send patches, please <a href="http://weitz.de/patches.html">read this first</a>.
+
+<br>&nbsp;<br><h3><a class=none name="dictionary">The Chunga dictionary</a></h3>
+
+<h4><a name="streams" class=none>Chunked streams</a></h4>
+
+<em>Chunked streams</em> are the core of the <a href="http://globalia.net/donlope/fz/songs/Chunga's_Revenge.html">Chunga</a> library.  You
+create them using the
+function <a
+href="#make-chunked-stream"><code>MAKE-CHUNKED-STREAM</code></a> which
+takes an open binary stream (called the <em>underlying</em> stream) as its single argument.
+A <em>binary</em> stream in this context means that if it's an <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_i.htm#input">input
+stream</a>, you can
+apply <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/f_rd_seq.htm"><code>READ-SEQUENCE</code></a>
+to it where the sequence is an array of element
+type <a href="http://weitz.de/flexi-streams/#octet"><code>OCTET</code></a>, and similarly for <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_seq.htm"><code>WRITE-SEQUENCE</code></a> and <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_o.htm#output">output streams</a>.  (Note that this specifically holds for <a href="http://www.lispworks.com/documentation/lw50/LWRM/html/lwref-91.htm"><em>bivalent</em> streams</a> like socket streams.)
+<p>
+A chunked stream behaves like an ordinary Lisp stream
+of <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#element_type">element
+type</a> <a
+href="http://weitz.de/flexi-streams/#octet"><code>OCTET</code></a>
+with the addition that you can turn <em>chunking</em> on and off for
+input as well as for output.  With chunking turned on, data is read or
+written according to
+the <a href="http://www.rfc.net/rfc2616.html#s3.6.1">definition in RFC
+2616</a>.
+
+<!-- Entry for CHUNKED-STREAM -->
+
+<p><br>[Standard class]<br><a class=none name='chunked-stream'><b>chunked-stream</b></a>
+<blockquote><br>
+
+Every <a href="#stream">chunked stream</a> returned by
+<a href="#make-chunked-stream"><code>MAKE-CHUNKED-STREAM</code></a> is of this type which is a subtype of
+<a href="http://www.lispworks.com/documentation/HyperSpec/Body/t_stream.htm"><code>STREAM</code></a>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-STREAM -->
+
+
+<!-- Entry for CHUNKED-INPUT-STREAM -->
+
+<p><br>[Standard class]<br><a class=none name='chunked-input-stream'><b>chunked-input-stream</b></a>
+<blockquote><br>
+
+A <a href="#stream">chunked stream</a> is of this type if its
+underlying stream is an <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_i.htm#input">input
+stream</a>. This is a subtype of
+<a href="#chunked-stream"><code>CHUNKED-STREAM</code></a>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-INPUT-STREAM -->
+
+
+
+
+<!-- Entry for CHUNKED-OUTPUT-STREAM -->
+
+<p><br>[Standard class]<br><a class=none name='chunked-output-stream'><b>chunked-output-stream</b></a>
+<blockquote><br>
+
+A <a href="#stream">chunked stream</a> is of this type if its
+underlying stream is an <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_o.htm#output">output stream</a>. This is a subtype of
+<a href="#chunked-stream"><code>CHUNKED-STREAM</code></a>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-OUTPUT-STREAM -->
+
+
+<!-- Entry for CHUNKED-IO-STREAM -->
+
+<p><br>[Standard class]<br><a class=none name='chunked-io-stream'><b>chunked-io-stream</b></a>
+<blockquote><br>
+
+A <a href="#stream">chunked stream</a> is of this type if it is both
+a <a href="#chunked-input-stream"><code>CHUNKED-INPUT-STREAM</code></a> as well as a <a href="#chunked-output-stream"><code>CHUNKED-OUTPUT-STREAM</code></a>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-IO-STREAM -->
+
+<!-- Entry for MAKE-CHUNKED-STREAM -->
+
+<p><br>[Function]<br><a class=none name='make-chunked-stream'><b>make-chunked-stream</b> <i>stream</i> =&gt; <i>chunked-stream</i></a>
+<blockquote><br>
+
+Creates and returns a <a href="#stream">chunked stream</a> (a stream of type
+<a href="#chunked-stream"><code>CHUNKED-STREAM</code></a>) which wraps <code><i>stream</i></code>.  <code><i>stream</i></code> must be an open
+binary stream.
+
+</blockquote>
+
+<!-- End of entry for MAKE-CHUNKED-STREAM -->
+
+
+<!-- Entry for CHUNKED-STREAM-STREAM -->
+
+<p><br>[Specialized reader]<br><a class=none name='chunked-stream-stream'><b>chunked-stream-stream</b> <i>(stream chunked-stream)</i> =&gt; <i>underlying-stream</i></a>
+<blockquote><br>
+
+Returns the <a href="#stream">underlying stream</a> of the <a href="#chunked-stream">chunked stream</a> <code><i>stream</i></code>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-STREAM-STREAM -->
+
+
+<!-- Entry for CHUNKED-STREAM-INPUT-CHUNKING-P -->
+
+<p><br>[Generic reader]<br><a class=none name='chunked-stream-input-chunking-p'><b>chunked-stream-input-chunking-p</b> <i>object</i> =&gt; <i>generalized-boolean</i></a>
+
+<blockquote><br>
+
+Returns a true value if <code><i>object</i></code> is of type <a href="#chunked-input-stream"><code>CHUNKED-INPUT-STREAM</code></a> and if input chunking is currently enabled.
+
+</blockquote>
+
+<p><br>[Specialized writer]<br><a class=none><tt>(setf (</tt><b>chunked-stream-input-chunking-p</b> <i>(stream chunked-input-stream)</i><tt>)</tt> <i>new-value</i><tt>)</tt></a>
+
+<blockquote><br>
+
+This function is used to switch input chunking
+on <code><i>stream</i></code> on or off.  Note that input chunking will
+usally be turned off automatically when the last chunk is read.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-STREAM-INPUT-CHUNKING-P -->
+
+
+
+<!-- Entry for CHUNKED-STREAM-OUTPUT-CHUNKING-P -->
+
+<p><br>[Generic reader]<br><a class=none name='chunked-stream-output-chunking-p'><b>chunked-stream-output-chunking-p</b> <i>object</i> =&gt; <i>generalized-boolean</i></a>
+
+<blockquote><br>
+
+Returns a true value if <code><i>object</i></code> is of type <a href="#chunked-output-stream"><code>CHUNKED-OUTPUT-STREAM</code></a> and if output chunking is currently enabled.
+
+</blockquote>
+
+<p><br>[Specialized writer]<br><a class=none><tt>(setf (</tt><b>chunked-stream-output-chunking-p</b> <i>(stream chunked-output-stream)</i><tt>)</tt> <i>new-value</i><tt>)</tt></a>
+
+<blockquote><br>
+
+This function is used to switch output chunking
+on <code><i>stream</i></code> on or off.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-STREAM-OUTPUT-CHUNKING-P -->
+
+
+
+
+<!-- Entry for CHUNKED-INPUT-STREAM-EXTENSIONS -->
+
+<p><br>[Specialized reader]<br><a class=none name='chunked-input-stream-extensions'><b>chunked-input-stream-extensions</b> <i>(stream chunked-input-stream)</i> =&gt; <i>extensions</i></a>
+<blockquote><br>
+
+Returns
+an <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#alist">alist</a>
+of <a href="http://www.rfc.net/rfc2616.html#s3.6">attribute/value pairs</a> corresponding to the optional <a href="http://www.rfc.net/rfc2616.html#s3.6.1">"chunk
+extensions"</a> which might have been encountered when reading
+from <code><i>stream</i></code>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-INPUT-STREAM-EXTENSIONS -->
+
+
+<!-- Entry for CHUNKED-INPUT-STREAM-EXTENSIONS -->
+
+<p><br>[Specialized reader]<br><a class=none name='chunked-input-stream-trailers'><b>chunked-input-stream-trailers</b> <i>(stream chunked-input-stream)</i> =&gt; <i>trailers</i></a>
+<blockquote><br>
+
+Returns the
+optional <a href="http://www.rfc.net/rfc2616.html#s3.6.1">"trailer"
+HTTP headers</a> which might have been sent after the last chunk,
+i.e. directly before input chunking ended on <code><i>stream</i></code>.
+The format of <code><i>trailers</i></code> is identical to that returned
+by <a href="#read-http-headers"><code>READ-HTTP-HEADERS</code></a>.
+
+</blockquote>
+
+<!-- End of entry for CHUNKED-INPUT-STREAM-EXTENSIONS -->
+
+
+
+
+<h4><a name="conditions" class=none>Conditions</a></h4>
+
+Here are two conditions which might be signaled if something bad
+happens while reading from a chunked stream:
+
+<!-- Entry for INPUT-CHUNKING-BODY-CORRUPTED -->
+
+<p><br>[Condition type]<br><a class=none name='input-chunking-body-corrupted'><b>input-chunking-body-corrupted</b></a>
+<blockquote><br>
+
+A condition of this type is signaled if an
+unexpected character (octet) is read while reading from a
+<a href="#stream">chunked stream</a> with input chunking enabled. This is a subtype of
+<a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_stm_er.htm"><code>STREAM-ERROR</code></a>,
+so <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stm_er.htm"><code>STREAM-ERROR-STREAM</code></a>
+can be used to access the offending stream.
+
+</blockquote>
+
+<!-- End of entry for INPUT-CHUNKING-BODY-CORRUPTED -->
+
+
+<!-- Entry for INPUT-CHUNKING-UNEXPECTED-END-OF-FILE -->
+
+<p><br>[Condition type]<br><a class=none name='input-chunking-unexpected-end-of-file'><b>input-chunking-unexpected-end-of-file</b></a>
+<blockquote><br>
+
+A condition of this type is signaled if we
+reach an unexpected EOF on a <a href="#stream">chunked stream</a> with input chunking
+enabled.  This is a subtype of
+<a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_stm_er.htm"><code>STREAM-ERROR</code></a>,
+so <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stm_er.htm"><code>STREAM-ERROR-STREAM</code></a>
+can be used to access the offending stream.
+
+</blockquote>
+
+<!-- End of entry for INPUT-CHUNKING-UNEXPECTED-END-OF-FILE -->
+
+
+
+
+<h4><a name="parse" class=none>RFC 2616 parsing</a></h4>
+
+Chunga needs to know a bit
+about <a href="http://www.rfc.net/rfc2616.html">RFC 2616 syntax</a> in
+order to cope
+with <a href="#chunked-input-stream-extensions">extensions</a>
+and <a href="#chunked-input-stream-trailers">trailers</a>.  As these
+functions are in there anyway, they're exported, so they can be used
+by other code like for
+example <a href="http://weitz.de/drakma/">Drakma</a>.
+
+<!-- Entry for READ-LINE* -->
+
+<p><br>[Function]<br><a class=none name='read-line*'><b>read-line*</b> <i>stream <tt>&amp;optional</tt> log-stream</i> =&gt; <i>line</i></a>
+<blockquote><br>
+
+Reads and assembles characters from <code><i>stream</i></code> until a <a href="http://en.wikipedia.org/wiki/Carriage_return">carriage
+return</a>
+is read.  Makes sure that the following character is a <a href="http://en.wikipedia.org/wiki/Line_feed">linefeed</a>.  If
+<a href="#*accept-bogus-eols*"><code>*ACCEPT-BOGUS-EOLS*</code></a> is not <code>NIL</code>, then the function will also accept a
+lone carriage return or linefeed as a line break.  Returns
+the string of characters read excluding the line break.  Additionally
+logs this string to <code><i>log-stream</i></code> if it is not <code>NIL</code>.
+
+</blockquote>
+
+<!-- End of entry for READ-LINE* -->
+
+
+<!-- Entry for READ-HTTP-HEADERS -->
+
+<p><br>[Function]<br><a class=none name='read-http-headers'><b>read-http-headers</b> <i>stream <tt>&amp;optional</tt> log-stream</i> =&gt; <i>headers</i></a>
+<blockquote><br>
+
+Reads HTTP header lines from the stream <code><i>stream</i></code>
+(except for the initial status line which is supposed to be read
+already) and returns a
+corresponding <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#alist">alist</a>
+of names and values where the names are keywords and the values are
+strings.  Multiple lines with the same name are combined into one
+value, the individual values separated by commas.  Header lines which
+are spread across multiple lines are recognized and treated correctly.  (But see <a href="#*treat-semicolon-as-continuation*"><code>*TREAT-SEMICOLON-AS-CONTINUATION*</code></a>.)
+Additonally logs the header lines to 
+<code><i>log-stream</i></code> if it is not <code>NIL</code>.
+
+</blockquote>
+
+<!-- End of entry for READ-HTTP-HEADERS -->
+
+<!-- Entry for READ-TOKEN -->
+
+<p><br>[Function]<br><a class=none name='read-token'><b>read-token</b> <i>stream</i> =&gt; <i>token</i></a>
+<blockquote><br>
+
+Read characters from the stream <code><i>stream</i></code> while they
+are <em>token</em> constituents (according
+to <a href="http://www.rfc.net/rfc2616.html">RFC 2616</a>).  It is
+assumed that there's a token character at the current position.  The
+token read is returned as a string.  Doesn't signal an error (but
+simply stops reading)
+if <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_end_of.htm"><code>END-OF-FILE</code></a>
+is encountered after the first character.
+
+</blockquote>
+
+<!-- End of entry for READ-TOKEN -->
+
+<!-- Entry for READ-NAME-VALUE-PAIR -->
+
+<p><br>[Function]<br><a class=none name='read-name-value-pair'><b>read-name-value-pair</b> <i>stream <tt>&amp;key</tt> value-required-p cookie-syntax</i> =&gt; <i>pair</i></a>
+<blockquote><br>
+
+Reads a typical (in <a href="http://www.rfc.net/rfc2616.html">RFC
+2616</a>) <a href="http://www.rfc.net/rfc2616.html#s3.6">name/value or
+attribute/value combination</a> from the
+stream <code><i>stream</i></code> - a <em>token</em> followed by
+a <code>#\=</code> character and another token or a <em>quoted
+string</em>.  Returns
+a <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#cons">cons</a>
+of the name and the value, both as strings.
+If <code><i>value-required-p</i></code> is <code>NIL</code> (the
+default is <code>T</code>), the <code>#\=</code> sign and the value
+are optional.  If <code><i>cookie-syntax</i></code> is true (the
+default is <code>NIL</code>), the value is read like the value of
+a <a href="http://weitz.de/drakma/#ccokies">cookie</a> header.
+
+</blockquote>
+
+<!-- End of entry for READ-NAME-VALUE-PAIR -->
+
+
+<!-- Entry for READ-NAME-VALUE-PAIRS -->
+
+<p><br>[Function]<br><a class=none name='read-name-value-pairs'><b>read-name-value-pairs</b> <i>stream <tt>&amp;key</tt> value-required-p cookie-syntax</i> =&gt; <i>pairs</i></a>
+<blockquote><br>
+
+Uses <a href="#read-name-value-pair"><code>READ-NAME-VALUE-PAIR</code></a> to read and return an <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#alist">alist</a> of
+name/value pairs from the stream <code><i>stream</i></code>.  It is assumed that the pairs are
+separated by semicolons and that the first char read (except for
+whitespace) will be a semicolon.  The parameters are used as in
+<a href="#read-name-value-pair"><code>READ-NAME-VALUE-PAIR</code></a>.
+Stops reading in case
+of <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_end_of.htm"><code>END-OF-FILE</code></a>
+(instead of signaling an error).
+
+</blockquote>
+
+<!-- End of entry for READ-NAME-VALUE-PAIRS -->
+
+
+
+<!-- Entry for ASSERT-CHAR -->
+
+<p><br>[Function]<br><a class=none name='assert-char'><b>assert-char</b> <i>stream expected-char</i> =&gt; <i>char</i></a>
+<blockquote><br>
+
+Reads the next character from the stream <code><i>stream</i></code> and checks if it is the
+character <code><i>expected-char</i></code>.  Signals an error otherwise.
+
+</blockquote>
+
+<!-- End of entry for ASSERT-CHAR -->
+
+
+<!-- Entry for SKIP-WHITESPACE -->
+
+<p><br>[Function]<br><a class=none name='skip-whitespace'><b>skip-whitespace</b> <i>stream</i> =&gt; <i>char-or-nil</i></a>
+<blockquote><br>
+
+Consume characters from the stream <code><i>stream</i></code> until an <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_end_of.htm"><code>END-OF-FILE</code></a> is
+encountered or a non-whitespace (according to <a href="http://www.rfc.net/rfc2616.html">RFC 2616</a>)
+characters is seen.  This character is returned (or <code>NIL</code> in case
+of <a
+href="http://www.lispworks.com/documentation/HyperSpec/Body/e_end_of.htm"><code>END-OF-FILE</code></a>).
+
+</blockquote>
+
+<!-- End of entry for SKIP-WHITESPACE -->
+
+
+<!-- Entry for TRIM-WHITESPACE -->
+
+<p><br>[Function]<br><a class=none name='trim-whitespace'><b>trim-whitespace</b> <i>string</i> =&gt; <i>string'</i></a>
+<blockquote><br>
+
+Returns a version of the string <code><i>string</i></code> where spaces and tab
+characters are trimmed from the start and the end.
+
+</blockquote>
+
+<!-- End of entry for TRIM-WHITESPACE -->
+
+
+<!-- Entry for *CURRENT-ERROR-MESSAGE* -->
+
+<p><br>[Special variable]<br><a class=none name='*current-error-message*'><b>*current-error-message*</b></a>
+<blockquote><br>
+
+Used by the parsing functions in <a href="#parse">this section</a> as
+an introduction to a standardized error message.  Must be a string if
+one of these functions is called.
+
+</blockquote>
+
+<!-- End of entry for *CURRENT-ERROR-MESSAGE* -->
+
+<!-- Entry for *ACCEPT-BOGUS-EOLS* -->
+
+<p><br>[Special variable]<br><a class=none name='*accept-bogus-eols*'><b>*accept-bogus-eols*</b></a>
+<blockquote><br>
+
+Some web servers do not respond with a correct CRLF line ending for
+HTTP headers but with a lone linefeed or carriage return instead.  If
+this variable is bound to a true
+value, <a href="#read-line*"><code>READ-LINE*</code></a> will treat a
+lone LF or CR character as an acceptable end of line.  The initial
+value is <code>NIL</code>.
+
+</blockquote>
+<!-- End of entry for *ACCEPT-BOGUS-EOLS* -->
+
+<!-- Entry for *TREAT-SEMICOLON-AS-CONTINUATION* -->
+
+<p><br>[Special variable]<br><a class=none name='*treat-semicolon-as-continuation*'><b>*treat-semicolon-as-continuation*</b></a>
+<blockquote><br>
+
+According to John Foderaro, Netscape v3 web servers bogusly split
+<code>Set-Cookie</code> headers over multiple lines which means that we'd have to
+treat <code>Set-Cookie</code> headers ending with a semicolon as incomplete and
+combine them with the next header.  This will only be done if this
+variable has a true value, though.  Its default value is <code>NIL</code>.
+</blockquote>
+
+<!-- End of entry for *TREAT-SEMICOLON-AS-CONTINUATION* -->
+
+
+
+<br>&nbsp;<br><h3><a class=none name="ack">Acknowledgements</a></h3>
+
+<p>
+Thanks to Jochen Schmidt's chunking code in <a href="http://www.cliki.net/ACL-COMPAT">ACL-COMPAT</a> for inspiration.
+This documentation was prepared with <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>.
+</p>
+<p>
+$Header: /usr/local/cvsrep/chunga/doc/index.html,v 1.24 2007/10/11 06:56:04 edi Exp $
+<p><a href="http://weitz.de/index.html">BACK TO MY HOMEPAGE</a>
+
+</body>
+</html>


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/doc/index.html
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/input.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/input.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/input.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,182 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/input.lisp,v 1.13 2007/09/06 23:01:27 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+(defmethod chunked-input-stream-extensions (object)
+  "The default method which always returns the empty list."
+  nil)
+
+(defmethod chunked-input-stream-trailers (object)
+  "The default method which always returns the empty list."
+  nil)
+
+(defmethod chunked-stream-input-chunking-p (object)
+  "The default method for all objects which are not of type
+CHUNKED-INPUT-STREAM."
+  nil)
+
+(defmethod (setf chunked-stream-input-chunking-p) (new-value (stream chunked-input-stream))
+  "Switches input chunking for STREAM on or off."
+  (unless (eq (not new-value) (not (chunked-stream-input-chunking-p stream)))
+    (with-slots (input-limit input-index expecting-crlf-p chunk-extensions chunk-trailers input-stream)
+        stream
+      (cond (new-value
+             (setq ;; wrap with flexi stream for header parsing
+                   input-stream (make-flexi-stream input-stream :external-format +latin-1+)
+                   expecting-crlf-p nil
+                   input-limit 0
+                   input-index 0
+                   chunk-extensions nil
+                   chunk-trailers nil))
+            (t (when (< input-index input-limit)
+                 (error "Not all chunks from ~S have been read completely."
+                        stream))
+               ;; switch back to original inner stream
+               (setq input-stream (flexi-stream-stream input-stream))))))
+  (setf (slot-value stream 'input-chunking-p) new-value))
+
+(defmethod stream-clear-input ((stream chunked-input-stream))
+  "Implements CLEAR-INPUT by resetting the internal chunk buffer."
+  (when (chunked-stream-input-chunking-p stream)
+    (setf (chunked-stream-input-index stream) 0
+          (chunked-stream-input-limit stream) 0))
+  ;; clear input on inner stream
+  (clear-input (chunked-stream-input-stream stream))
+  nil)
+
+(defmethod chunked-input-available-p ((stream chunked-input-stream))
+  "Whether there's unread input waiting in the chunk buffer."
+  (< (chunked-stream-input-index stream)
+     (chunked-stream-input-limit stream)))
+
+(defmethod stream-listen ((stream chunked-input-stream))
+  "We first check if input chunking is enabled and if there's
+something in the buffer.  Otherwise we poll the underlying stream."
+  (cond ((chunked-stream-input-chunking-p stream)
+         (or (chunked-input-available-p stream)
+             (fill-buffer stream)))
+        (t (listen (chunked-stream-input-stream stream)))))
+
+(defmethod fill-buffer ((stream chunked-input-stream))
+  "Re-fills the chunk buffer.  Returns NIL if chunking has ended."
+  (let ((inner-stream (chunked-stream-input-stream stream))
+        ;; set up error function for the functions in `read.lisp'
+        (*current-error-function*
+         (lambda (last-char expected-chars)
+             "The function which is called when an unexpected
+character is seen.  Signals INPUT-CHUNKING-BODY-CORRUPTED."
+             (error 'input-chunking-body-corrupted
+                    :stream stream
+                    :last-char last-char
+                    :expected-chars expected-chars))))
+    (labels ((add-extensions ()
+               "Reads chunk extensions \(if there are any) and stores
+them into the corresponding slot of the stream."
+               (when-let (extensions (read-name-value-pairs inner-stream))
+                 (warn "Adding uninterpreted extensions to stream ~S." stream)
+                 (setf (slot-value stream 'chunk-extensions)
+                       (append (chunked-input-stream-extensions stream) extensions)))
+               (assert-crlf inner-stream))
+             (get-chunk-size ()
+               "Reads chunk size header \(including optional
+extensions) and returns the size."
+               #+:clisp (setf (flexi-stream-element-type inner-stream) 'character)
+               (when (expecting-crlf-p stream)
+                 (assert-crlf inner-stream))
+               (setf (expecting-crlf-p stream) t)
+               ;; read hexadecimal number
+               (let (last-char)
+                 (prog1 (loop for weight = (digit-char-p (setq last-char
+                                                               (read-char inner-stream))
+                                                         16)
+                              for result = (if weight
+                                             (+ weight (* 16 (or result 0)))
+                                             (return result)))
+                   ;; unread first octet which wasn't a digit
+                   (unread-char last-char inner-stream)
+                   (add-extensions)
+                   #+:clisp (setf (flexi-stream-element-type inner-stream) 'octet)))))
+      (let ((chunk-size (get-chunk-size)))
+        (with-slots (input-buffer input-limit input-index)
+            stream
+          (setq input-index 0
+                input-limit chunk-size)
+          (cond ((zerop chunk-size)
+                 ;; turn chunking off
+                 (setf (chunked-stream-input-chunking-p stream) nil
+                       (slot-value stream 'chunk-trailers) (read-http-headers inner-stream)
+                       input-limit 0)
+                 ;; return NIL
+                 (return-from fill-buffer))
+                ((> chunk-size (length input-buffer))
+                 ;; replace buffer if it isn't big enough for the next chunk
+                 (setq input-buffer (make-array chunk-size :element-type 'octet))))
+          (unless (= (read-sequence input-buffer inner-stream
+                                    :start 0 :end chunk-size)
+                     chunk-size)
+            (error 'input-chunking-unexpected-end-of-file
+                   :stream stream))
+          chunk-size)))))
+
+(defmethod stream-read-byte ((stream chunked-input-stream))
+  "Reads one byte from STREAM.  Checks the chunk buffer first, if
+input chunking is enabled.  Re-fills buffer is necessary."
+  (unless (chunked-stream-input-chunking-p stream)
+    (return-from stream-read-byte (read-byte (chunked-stream-input-stream stream) nil :eof)))
+  (unless (chunked-input-available-p stream)
+    (unless (fill-buffer stream)
+      (return-from stream-read-byte :eof)))
+  (with-slots (input-buffer input-index)
+      stream
+    (prog1 (aref input-buffer input-index)
+      (incf input-index))))
+
+(defmethod stream-read-sequence ((stream chunked-input-stream) sequence start end &key)
+  "Fills SEQUENCE by adding data from the chunk buffer and re-filling
+it until enough data was read.  Works directly on the underlying
+stream if input chunking is off."
+  (unless (chunked-stream-input-chunking-p stream)
+    (return-from stream-read-sequence
+      (read-sequence sequence (chunked-stream-input-stream stream) :start start :end end)))
+  (loop
+   (when (>= start end)
+     (return-from stream-read-sequence start))   
+   (unless (chunked-input-available-p stream)
+     (unless (fill-buffer stream)
+       (return-from stream-read-sequence start)))
+   (with-slots (input-buffer input-limit input-index)
+       stream
+     (replace sequence input-buffer
+              :start1 start :end1 end
+              :start2 input-index :end2 input-limit)
+     (let ((length (min (- input-limit input-index)
+                        (- end start))))
+       (incf start length)
+       (incf input-index length)))))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/input.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/output.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/output.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/output.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,143 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/output.lisp,v 1.10 2007/01/01 23:39:36 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+(defmethod chunked-stream-output-chunking-p (object)
+  "The default method for all objects which are not of type
+CHUNKED-OUTPUT-STREAM."
+  nil)
+
+(defmethod write-chunk ((stream chunked-output-stream) sequence
+                        &key (start 0)
+                             (end (length sequence)))
+  "Writes the contents of SEQUENCE from START to END to the
+underlying stream of STREAM as one chunk."
+  (let ((output-stream (chunked-stream-output-stream stream)))
+    ;; chunk size
+    (format output-stream "~X" (- end start))
+    ;; CRLF
+    (write-string #.(format nil "~C~C" #\Return #\Linefeed) output-stream)
+    ;; data
+    #+:clisp (setf (flexi-stream-element-type output-stream) 'octet)
+    (write-sequence sequence output-stream :start start :end end)
+    #+:clisp (setf (flexi-stream-element-type output-stream) 'character)
+    ;; CRLF
+    (write-string #.(format nil "~C~C" #\Return #\Linefeed) output-stream)))
+
+(defmethod flush-buffer ((stream chunked-output-stream))
+  "Uses WRITE-CHUNK to empty the output buffer unless it is
+already empty."
+  (with-slots (output-buffer output-index)
+      stream
+    (when (plusp output-index)
+      (write-chunk stream output-buffer :end output-index)
+      (setq output-index 0))))
+
+(defmethod (setf chunked-stream-output-chunking-p) (new-value (stream chunked-output-stream))
+  "Switches output chunking for STREAM on or off."
+  (unless (eq (not new-value) (not (chunked-stream-output-chunking-p stream)))
+    (with-slots (output-stream output-index)
+        stream
+      (cond (new-value
+             ;; get rid of "old" data
+             (force-output output-stream)
+             (setq ;; wrap with flexi stream for character output
+                   output-stream (make-flexi-stream output-stream :external-format +latin-1+)
+                   ;; initialize output buffer as being empty
+                   output-index 0))
+            (t (flush-buffer stream)
+               ;; last chunk to signal end of chunking
+               (write-string #.(format nil "0~C~C~C~C"
+                                       #\Return #\Linefeed #\Return #\Linefeed)
+                             output-stream)
+               ;; switch back to original inner stream
+               (setq output-stream (flexi-stream-stream output-stream))))))
+  (setf (slot-value stream 'output-chunking-p) new-value))
+
+(defmethod stream-clear-output ((stream chunked-output-stream))
+  "We clear output by resetting the output buffer and clearing
+the underlying stream."
+  (when (chunked-stream-output-chunking-p stream)
+    (setf (slot-value stream 'output-index) 0))
+  (clear-output (chunked-stream-output-stream stream)))
+
+(defmethod stream-finish-output ((stream chunked-output-stream))
+  "Flush the output buffer if output chunking is on, then operate
+on the underlying stream."
+  (when (chunked-stream-output-chunking-p stream)
+    (flush-buffer stream))
+  (finish-output (chunked-stream-output-stream stream)))
+
+(defmethod stream-force-output ((stream chunked-output-stream))
+  "Flush the output buffer if output chunking is on, then operate
+on the underlying stream."
+  (when (chunked-stream-output-chunking-p stream)
+    (flush-buffer stream))
+  (force-output (chunked-stream-output-stream stream)))
+
+(defmethod stream-write-byte ((stream chunked-output-stream) byte)
+  "Writes one byte by simply adding it to the end of the output
+buffer \(if output chunking is enabled).  The buffer is flushed
+if necessary."
+  (unless (chunked-stream-output-chunking-p stream)
+    (return-from stream-write-byte
+      (write-byte byte (chunked-stream-output-stream stream))))
+  (with-slots (output-index output-buffer)
+      stream
+    (when (>= output-index +output-buffer-size+)
+      (flush-buffer stream))
+    (setf (aref output-buffer output-index) byte)
+    (incf output-index)
+    byte))
+
+(defmethod stream-write-sequence ((stream chunked-output-stream) sequence start end &key)
+  "Outputs SEQUENCE by appending it to the output buffer if it's
+small enough.  Large sequences are written directly using
+WRITE-CHUNK."
+  (unless (chunked-stream-output-chunking-p stream)
+    (return-from stream-write-sequence
+      (write-sequence sequence (chunked-stream-output-stream stream) :start start :end end)))
+  (with-slots (output-buffer output-index)
+      stream
+    (let ((length (- end start)))
+      (cond ((<= length (- +output-buffer-size+ output-index))
+             (replace output-buffer sequence :start1 output-index
+                      :start2 start :end2 end)
+             (incf output-index length))
+            (t (flush-buffer stream)
+               (write-chunk stream sequence :start start :end end)))))
+  sequence)
+
+(defmethod close ((stream chunked-output-stream) &key abort)
+  "When a stream is closed and ABORT isn't true we have to make
+sure to send the last chunk."
+  (unless abort
+    (setf (chunked-stream-output-chunking-p stream) nil))
+  (call-next-method))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/output.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/packages.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/packages.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/packages.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,59 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/packages.lisp,v 1.14 2007/09/18 07:00:39 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :cl-user)
+
+(defpackage :chunga
+  (:use :cl :trivial-gray-streams :flexi-streams)
+  #+:lispworks
+  (:import-from :lw :when-let)
+  (:export :*accept-bogus-eols*
+           :*current-error-message*
+           :*treat-semicolon-as-continuation*
+           :assert-char
+           :chunked-input-stream
+           :chunked-input-stream-extensions
+           :chunked-input-stream-trailers
+           :chunked-io-stream
+           :chunked-output-stream
+           :chunked-stream
+           :chunked-stream-input-chunking-p
+           :chunked-stream-output-chunking-p
+           :chunked-stream-stream
+           :input-chunking-body-corrupted
+           :input-chunking-unexpected-end-of-file
+           :make-chunked-stream
+           :read-http-headers
+           :read-line*
+           :read-name-value-pair
+           :read-name-value-pairs
+           :read-token
+           :skip-whitespace
+           :trim-whitespace))
+           


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/packages.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/read.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/read.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/read.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,279 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/read.lisp,v 1.13 2007/10/11 06:56:02 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+(defmacro ignore-eof (&body body)
+  "This macro is similar to IGNORE-ERRORS but it only ignores
+conditions of type END-OF-FILE."
+  `(handler-case
+       (progn , at body)
+     (end-of-file () nil)))
+
+(defun signal-unexpected-chars (last-char expected-chars)
+  "Signals an error that LAST-CHAR was read although one of
+EXPECTED-CHARS was expected.  \(Note that EXPECTED-CHARS,
+despites its name, can also be a single character instead of a
+list).  Uses *CURRENT-ERROR-MESSAGE* if it's not NIL, or calls
+*CURRENT-ERROR-FUNCTION* otherwise."
+  (cond (*current-error-message*
+         (error "~A~%Read character ~S, but expected ~:[a member of ~S~;~S~]."
+                *current-error-message* last-char (atom expected-chars) expected-chars))
+        (t (funcall *current-error-function* last-char expected-chars))))
+
+(defun charp (char)
+  "Returns true if the Lisp character CHAR is a CHAR according to RFC 2616."
+  (<= 0 (char-code char) 127))
+
+(defun controlp (char)
+  "Returns true if the Lisp character CHAR is a CTL according to RFC 2616."
+  (or (<= 0 (char-code char) 31)
+      (= (char-code char) 127)))
+
+(defun separatorp (char)
+  "Returns true if the Lisp character CHAR is a separator
+according to RFC 2616."
+  (find char #.(format nil " ()<>@,;:\\\"/[]?={}~C" #\Tab)
+        :test #'char=))
+
+(defun whitespacep (char)
+  "Returns true if the Lisp character CHAR is whitespace
+according to RFC 2616."
+  (member char '(#\Space #\Tab) :test #'char=))
+
+(defun token-char-p (char)
+  "Returns true if the Lisp character CHAR is a token constituent
+according to RFC 2616."
+  (and (charp char)
+       (not (or (controlp char)
+                (separatorp char)))))
+
+(defun assert-char (stream expected-char)
+  "Reads the next character from STREAM and checks if it is the
+character EXPECTED-CHAR.  Signals an error otherwise."
+  (let ((char (read-char stream)))
+    (unless (char= char expected-char)
+      (signal-unexpected-chars char expected-char))
+    char))
+
+(defun assert-crlf (stream)
+  "Reads the next two characters from STREAM and checks if these
+are a carriage return and a linefeed.  Signals an error
+otherwise."
+  (assert-char stream #\Return)
+  (assert-char stream #\Linefeed))
+
+(defun read-line* (stream &optional log-stream)
+  "Reads and assembles characters from STREAM until a carriage return
+is read.  Makes sure that the following character is a linefeed.  If
+*ACCEPT-BOGUS-EOLS* is not NIL, then the function will also accept a
+lone carriage return or linefeed as an acceptable line break.  Returns
+the string of characters read excluding the line break.  Additionally
+logs this string to LOG-STREAM if it is not NIL."
+  (flet ((read-eol ()
+           "Read a CRLF from STREAM. If *accept-bogus-eols* is non-nil
+then accept a lone CR as a valid EOL."
+           (cond (*accept-bogus-eols* 
+                  (assert-char stream #\Return)
+                  (when (eql (peek-char nil stream) #\Linefeed)
+                    (assert-char stream #\Linefeed)))))
+                 (t (assert-crlf stream)))
+    (let ((result
+           (with-output-to-string (line)
+             (loop for char = (read-char stream)
+                   for is-cr-p = (char= char #\Return)
+                   until (or is-cr-p
+                             (and *accept-bogus-eols*
+                                  (char= char #\Linefeed)))
+                   do (write-char char line)
+                   finally (cond ((not *accept-bogus-eols*)
+                                  (assert-char stream #\Linefeed))
+                                 (is-cr-p
+                                  (when (eql (peek-char nil stream) #\Linefeed)
+                                    (read-char stream))))))))                                       
+      (when log-stream
+        (write-line result log-stream)
+        (finish-output log-stream))
+      result)))
+
+(defun trim-whitespace (string)
+  "Returns a version of the string STRING where spaces and tab
+characters are trimmed from the start and the end."
+  (string-trim '(#\Space #\Tab) string))
+
+(defun read-http-headers (stream &optional log-stream)
+  "Reads HTTP header lines from STREAM \(except for the initial
+status line which is supposed to be read already) and returns a
+corresponding alist of names and values where the names are
+keywords and the values are strings.  Multiple lines with the
+same name are combined into one value, the individual values
+separated by commas.  Header lines which are spread across
+multiple lines are recognized and treated correctly.  Additonally
+logs the header lines to LOG-STREAM if it is not NIL."
+  (let (headers
+        (*current-error-message* "While reading HTTP headers:"))
+    (labels ((read-header-line ()
+               "Reads one header line, considering continuations."
+               (with-output-to-string (header-line)
+                 (loop
+                  (let ((line (trim-whitespace (read-line* stream log-stream))))
+                    (when (zerop (length line))
+                      (return))
+                    (write-sequence (trim-whitespace line) header-line)
+                    (let ((next (peek-char nil stream)))
+                      (unless (whitespacep next)
+                        (return)))
+                    ;; we've seen whitespace starting a continutation,
+                    ;; so we loop
+                    (write-char #\Space header-line)))))
+             (split-header (line)
+               "Splits line at colon and converts it into a cons.
+Returns NIL if LINE consists solely of whitespace."
+               (unless (zerop (length (trim-whitespace line)))
+                 (let ((colon-pos (or (position #\: line :test #'char=)
+                                      (error "Couldn't find colon in header line ~S." line))))
+                   (cons (as-keyword (subseq line 0 colon-pos))
+                         (trim-whitespace (subseq line (1+ colon-pos)))))))
+             (add-header (pair)
+               "Adds the name/value cons PAIR to HEADERS.  Takes
+care of multiple headers with the same name."
+               (let* ((name (car pair))
+                      (existing-header (assoc name headers :test #'eq))
+                      (existing-value (cdr existing-header)))
+                 (cond (existing-header
+                        (setf (cdr existing-header)
+                              (format nil "~A~:[,~;~]~A"
+                                      existing-value
+                                      (and *treat-semicolon-as-continuation*
+                                           (eq name :set-cookie)
+                                           (ends-with-p (trim-whitespace existing-value) ";"))
+                                      (cdr pair))))
+                       (t (push pair headers))))))             
+      (loop for header-pair = (split-header (read-header-line))
+            while header-pair
+            do (add-header header-pair)))
+    (nreverse headers)))
+
+(defun skip-whitespace (stream)
+  "Consume characters from STREAM until an END-OF-FILE is
+encountered or a non-whitespace \(according to RFC 2616)
+characters is seen.  This character is returned \(or NIL in case
+of END-OF-FILE)."
+  (loop for char = (ignore-eof (peek-char nil stream))
+        while (and char (whitespacep char))
+        do (read-char stream)
+        finally (return char)))
+
+(defun read-token (stream)
+  "Read characters from STREAM while they are token constituents
+\(according to RFC 2616).  It is assumed that there's a token
+character at the current position.  The token read is returned as
+a string.  Doesn't signal an error \(but simply stops reading) if
+END-OF-FILE is encountered after the first character."
+  (with-output-to-string (out)
+    (loop for first = t then nil
+          for char = (if first
+                       (peek-char nil stream)
+                       (or (ignore-eof (peek-char nil stream)) (return)))
+          while (token-char-p char)
+          do (write-char (read-char stream) out))))
+
+(defun read-quoted-string (stream)
+  "Reads a quoted string \(according to RFC 2616).  It is assumed
+that the character at the current position is the opening quote
+character.  Returns the string read without quotes and escape
+characters."
+  (read-char stream)
+  (with-output-to-string (out)
+    (loop for char = (read-char stream)
+          until (char= char #\")
+          do (case char
+               (#\\ (write-char (read-char stream) out))
+               (#\Return (assert-char stream #\Linefeed)
+                         (let ((char (read-char stream)))
+                           (unless (whitespacep char)
+                             (signal-unexpected-chars char '(#\Space #\Tab)))))
+               (otherwise (write-char char out))))))
+
+(defun read-cookie-value (stream &key name separators)
+  "Reads a cookie parameter value from STREAM which is returned as a
+string.  Simply reads until a comma or a semicolon is seen \(or an
+element of SEPARATORS)."
+  (when (eql #\, (ignore-eof (peek-char nil stream)))
+    (return-from read-cookie-value ""))
+  (trim-whitespace
+   (with-output-to-string (out)
+     ;; special case for the `Expires' parameter - maybe skip the first comma
+     (loop with separators% = (cond (separators)
+                                    ((equalp name "Expires") ";")
+                                    (t ",;"))
+           for char = (ignore-eof (peek-char nil stream))
+           until (or (null char) (find char separators% :test #'char=))
+           when (and (null separators)
+                     (or (char= char #\,)
+                         (digit-char-p char)))
+           do (setq separators% '(#\, #\;))
+           do (write-char (read-char stream) out)))))
+
+(defun read-name-value-pair (stream &key (value-required-p t) cookie-syntax)
+  "Reads a typical (in RFC 2616) name/value or attribute/value
+combination from STREAM - a token followed by a #\\= character and
+another token or a quoted string.  Returns a cons of name and value,
+both as strings.  If VALUE-REQUIRED-P is NIL, the #\\= sign and the
+value are optional.  If COOKIE-SYNTAX is true, the uses
+READ-COOKIE-VALUE internally."
+  (skip-whitespace stream)
+  (let ((name (if cookie-syntax
+                (read-cookie-value stream :separators "=,")
+                (read-token stream))))
+    (skip-whitespace stream)
+    (cons name
+          (when (or value-required-p
+                    (eql (ignore-eof (peek-char nil stream)) #\=))
+            (assert-char stream #\=)
+            (skip-whitespace stream)
+            (cond (cookie-syntax (read-cookie-value stream :name name))
+                  ((char= (peek-char nil stream) #\") (read-quoted-string stream))
+                  (t (read-token stream)))))))
+
+(defun read-name-value-pairs (stream &key (value-required-p t) cookie-syntax)
+  "Uses READ-NAME-VALUE-PAIR to read and return an alist of
+name/value pairs from STREAM.  It is assumed that the pairs are
+separated by semicolons and that the first char read \(except for
+whitespace) will be a semicolon.  The parameters are used as in
+READ-NAME-VALUE-PAIR.  Stops reading in case of END-OF-FILE
+\(instead of signaling an error)."
+  (loop for char = (skip-whitespace stream)
+        while (and char (char= char #\;))
+        do (read-char stream)
+        ;; guard against a stray semicolon at the end
+        when (skip-whitespace stream)
+        collect (read-name-value-pair stream
+                                      :value-required-p value-required-p
+                                      :cookie-syntax cookie-syntax)))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/read.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/specials.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/specials.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/specials.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,87 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/specials.lisp,v 1.9 2007/09/18 07:00:39 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+(defmacro define-constant (name value &optional doc)
+  "A version of DEFCONSTANT for, cough, /strict/ CL implementations."
+  ;; See <http://www.sbcl.org/manual/Defining-Constants.html>
+  `(defconstant ,name (if (boundp ',name) (symbol-value ',name) ,value)
+     ,@(when doc (list doc))))
+
+(defconstant +output-buffer-size+ 8192
+  "Size of the initial output buffer for chunked output.")
+
+(define-constant +latin-1+ (make-external-format :iso-8859-1 :eol-style :lf)
+  "Default external format used when reading headers.")
+
+(defvar *current-error-message* nil
+  "Used by the parsing functions in `read.lisp' as an
+introduction to a standardized error message about unexpected
+characters unless it is NIL.")
+
+(defvar *current-error-function* nil
+  "Used by the functions in `read.lisp' as a function to signal
+errors about unexpected characters when *CURRENT-ERROR-MESSAGE*
+is NIL.")
+
+(defvar *accept-bogus-eols* nil
+  "Some web servers do not respond with a correct CRLF line ending for
+HTTP headers but with a lone linefeed or carriage return instead.  If
+this variable is bound to a true value, READ-LINE* will treat a lone
+LF or CR character as an acceptable end of line.  The initial value is
+NIL.")
+
+(defvar *treat-semicolon-as-continuation* nil
+  "According to John Foderaro, Netscape v3 web servers bogusly split
+Set-Cookie headers over multiple lines which means that we'd have to
+treat Set-Cookie headers ending with a semicolon as incomplete and
+combine them with the next header.  This will only be done if this
+variable has a true value, though.")
+
+(pushnew :chunga *features*)
+
+;; stuff for Nikodemus Siivola's HYPERDOC
+;; see <http://common-lisp.net/project/hyperdoc/>
+;; and <http://www.cliki.net/hyperdoc>
+;; also used by LW-ADD-ONS
+
+(defvar *hyperdoc-base-uri* "http://weitz.de/chunga/")
+
+(let ((exported-symbols-alist
+       (loop for symbol being the external-symbols of :chunga
+             collect (cons symbol
+                           (concatenate 'string
+                                        "#"
+                                        (string-downcase symbol))))))
+  (defun hyperdoc-lookup (symbol type)
+    (declare (ignore type))
+    (cdr (assoc symbol
+                exported-symbols-alist
+                :test #'eq))))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/specials.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/streams.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/streams.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/streams.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,173 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/streams.lisp,v 1.7 2007/01/01 23:39:36 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+(defclass chunked-stream (trivial-gray-stream-mixin)
+  ((real-stream :initarg :real-stream
+                :reader chunked-stream-stream
+                :documentation "The actual stream that's used for
+input and/or output."))
+  (:documentation "Every chunked stream returned by
+MAKE-CHUNKED-STREAM is of this type which is a subtype of
+STREAM."))
+
+(defclass chunked-input-stream (chunked-stream fundamental-binary-input-stream)
+  ((input-stream :accessor chunked-stream-input-stream
+                 :documentation "The underlying stream \(see
+REAL-STREAM) used for input, maybe wrapped with a flexi stream.")
+   (input-chunking-p :initform nil
+                     :reader chunked-stream-input-chunking-p
+                     :documentation "Whether input chunking is currently enabled.")
+   (input-buffer :initform nil
+                 :documentation "A vector containing the binary
+data from the most recent chunk that was read.")
+   (input-index :initform 0
+                :accessor chunked-stream-input-index
+                :documentation "The current position within INPUT-BUFFER.")
+   (input-limit :initform 0
+                :accessor chunked-stream-input-limit
+                :documentation "Only the content in INPUT-BUFFER
+up to INPUT-LIMIT belongs to the current chunk.")
+   (chunk-extensions :initform nil
+                     :reader chunked-input-stream-extensions
+                     :documentation "An alist of attribute/value
+pairs corresponding to the optional `chunk extensions' which
+might be encountered when reading from a chunked stream.")
+   (chunk-trailers :initform nil
+                   :reader chunked-input-stream-trailers
+                   :documentation "An alist of attribute/value
+pairs corresponding to the optional `trailer' HTTP headers which
+might be encountered at the end of a chunked stream.")
+   (expecting-crlf-p :initform nil
+                     :accessor expecting-crlf-p
+                     :documentation "Whether we expect to see
+CRLF before we can read the next chunk-size header part from the
+stream.  \(This will actually be the CRLF from the end of the
+last chunk-data part.)"))
+  (:documentation "A chunked stream is of this type if its
+underlying stream is an input stream. This is a subtype of
+CHUNKED-STREAM."))
+
+(defclass chunked-output-stream (chunked-stream fundamental-binary-output-stream)
+  ((output-stream :accessor chunked-stream-output-stream
+                  :documentation "The underlying stream \(see
+REAL-STREAM) used for output, maybe wrapped with a flexi stream.")
+   (output-chunking-p :initform nil
+                      :reader chunked-stream-output-chunking-p
+                      :documentation "Whether output chunking is
+currently enabled.")
+   (output-buffer :initform (make-array +output-buffer-size+ :element-type 'octet)
+                  :accessor output-buffer
+                  :documentation "A vector used to temporary
+store data which will output in one chunk.")
+   (output-index :initform 0
+                 :accessor output-index
+                 :documentation "The current end of OUTPUT-BUFFER."))
+  (:documentation "A chunked stream is of this type if its
+underlying stream is an output stream. This is a subtype of
+CHUNKED-STREAM."))
+
+(defclass chunked-io-stream (chunked-input-stream chunked-output-stream)
+  ()
+  (:documentation "A chunked stream is of this type if it is both
+a CHUNKED-INPUT-STREAM as well as a CHUNKED-OUTPUT-STREAM."))
+
+(defmethod stream-element-type ((stream chunked-stream))
+  "Chunked streams are always binary streams.  Wrap them with
+flexi streams if you need a character stream."
+  'octet)
+
+(defmethod open-stream-p ((stream chunked-stream))
+  "A chunked stream is open if its underlying stream is open."
+  (open-stream-p (chunked-stream-stream stream)))
+
+(defmethod close ((stream chunked-stream) &key abort)
+  "If a chunked stream is closed, we close the underlying stream as well."
+  (with-slots (real-stream)
+      stream
+    (cond ((open-stream-p real-stream)
+           (close real-stream :abort abort))
+          (t nil))))
+
+(define-condition input-chunking-unexpected-end-of-file (stream-error)
+  ()
+  (:documentation "A condition of this type is signaled if we
+reach an unexpected EOF on a chunked stream with input chunking
+enabled.  This is a subtype of STREAM-ERROR, so
+STREAM-ERROR-STREAM can be used to access the offending
+stream."))
+
+(define-condition input-chunking-body-corrupted (stream-error)
+  ((last-char :initarg :last-char
+              :documentation "The \(unexpected) character which was read.")
+   (expected-chars :initarg :expected-chars
+                   :documentation "The characters which were
+expected.  A list of characters or one single character."))
+  (:report (lambda (condition stream)
+             (with-slots (last-char expected-chars)
+                 condition
+               (format stream "Chunked stream ~S seems to be corrupted.
+Read character ~S, but expected ~:[a member of ~S~;~S~]."
+                       (stream-error-stream condition)
+                       last-char (atom expected-chars) expected-chars))))
+  (:documentation "A condition of this type is signaled if an
+unexpected character \(octet) is read while reading from a
+chunked stream with input chunking enabled. This is a subtype of
+STREAM-ERROR, so STREAM-ERROR-STREAM can be used to access the
+offending stream."))
+
+(defmethod initialize-instance :after ((stream chunked-input-stream) &rest initargs)
+  "Initializes the INPUT-STREAM slot."
+  (declare (ignore initargs))
+  (setf (chunked-stream-input-stream stream)
+        (chunked-stream-stream stream)))
+
+(defmethod initialize-instance :after ((stream chunked-output-stream) &rest initargs)
+  "Initializes the INPUT-STREAM slot."
+  (declare (ignore initargs))
+  (setf (chunked-stream-output-stream stream)
+        (chunked-stream-stream stream)))
+
+(defun make-chunked-stream (stream)
+  "Creates and returns a chunked stream \(a stream of type
+CHUNKED-STREAM) which wraps STREAM.  STREAM must be an open
+binary stream."
+  (unless (and (streamp stream)
+               (open-stream-p stream))
+    (error "~S should have been an open stream." stream))
+  (make-instance ;; actual type depends on STREAM
+                 (cond ((and (input-stream-p stream)
+                             (output-stream-p stream))
+                        'chunked-io-stream)
+                       ((input-stream-p stream)
+                        'chunked-input-stream)
+                       ((output-stream-p stream)
+                        'chunked-output-stream))
+                 :real-stream stream))
\ No newline at end of file


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/streams.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/chunga-0.4.1/util.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/chunga-0.4.1/util.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/chunga-0.4.1/util.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,55 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CHUNGA; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/chunga/util.lisp,v 1.5 2007/10/11 06:56:02 edi Exp $
+
+;;; Copyright (c) 2006-2007, Dr. Edmund Weitz.  All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package :chunga)
+
+#-:lispworks
+(defmacro when-let ((var expr) &body body)
+  "Evaluates EXPR, binds it to VAR, and executes BODY if VAR has
+a true value."
+  `(let ((,var ,expr))
+     (when ,var , at body)))
+
+(defun ends-with-p (seq suffix &key (test #'char-equal))
+  "Returns true if the sequence SEQ ends with the sequence
+SUFFIX.  Individual elements are compared with TEST."
+  (let ((mismatch (mismatch seq suffix :from-end t :test test)))
+    (or (null mismatch)
+        (= mismatch (- (length seq) (length suffix))))))
+
+(defun as-keyword (string)
+  "Converts the string STRING to a keyword where all characters are
+uppercase or lowercase, taking into account the current readtable
+case."
+  (intern (funcall
+            (if (eq (readtable-case *readtable*) :upcase)
+              #'string-upcase
+              #'string-downcase)
+            string)
+          :keyword))


Property changes on: branches/trunk-reorg/thirdparty/chunga-0.4.1/util.lisp
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/CHANGELOG
===================================================================
--- branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/CHANGELOG	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/CHANGELOG	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,320 @@
+Version 1.3.2
+2007-09-13
+Updated docs and ChangeLog to be really in sync with 1.3.1 changes (thanks to Sébastien Saint-Sevin)
+
+Version 1.3.1
+2007-08-24
+Second return value for REGEX-REPLACE and REGEX-REPLACE-ALL (patch by Matthew Sachs)
+
+Version 1.3.0
+2007-03-24
+Optional support for named registers (patch by Ondrej Svitek)
+
+Version 1.2.19
+2007-01-16
+Fixed behaviour of look-behind in repeated scans (caught by RegexCoach user Hans Jud)
+
+Version 1.2.18
+2006-10-12
+Changed default element type for LispWorks
+Fixed documentation for REGEX-REPLACE-ALL	
+
+Version 1.2.17
+2006-10-11
+Fixed bug in DO-SCANS which affected anchors (caught by RegexCoach user Laurent Taupiac)
+Update link for 'man perlre' (thanks to Ricardo Boccato Alves)
+
+Version 1.2.16
+2006-07-16
+Added :ELEMENT-TYPE to REGEX-REPLACE(-ALL)
+
+Version 1.2.15
+2006-07-03
+Added :REGEX tag to parse tree syntax (thanks to Frédéric Jolliton)
+
+Version 1.2.14
+2006-05-24
+Added missing </code> tag in docs (thanks to Wojciech Kaczmarek)
+Fixed IMPORT statement for LW	
+
+Version 1.2.13
+2005-12-06
+Fixed bug involving *REAL-START-POS* (caught by "tichy")
+
+Version 1.2.12
+2005-11-01
+REGEX-APROPOS-AUX now also uses :INHERITED
+Fixed typo in parser.lisp (thanks to Derek Peschel)
+Fixed value of *REGEX-CHAR-CODE-LIMIT* in docs and test (thanks to Christophe Rhodes)
+
+Version 1.2.11
+2005-08-01
+Added external format for SBCL in ppcre-tests.lisp (thanks to Christophe Rhodes)
+
+Version 1.2.10
+2005-07-20
+Fixed bug in CHAR-SEARCHER-AUX (caught by Peter Schuller)
+Don't redefine what's already there (for LispWorks)
+
+Version 1.2.9
+2005-06-27
+Hide compiler macros from CCL (thanks to Karsten Poeck)
+
+Version 1.2.8
+2005-06-10
+Change EQ to EQL in REGEX-LENGTH for ANSI conformance and ABCL compatibility (thanks to Peter Graves)
+
+Version 1.2.7
+2005-05-16
+Added lispworks-defsystem.lisp (thanks to Wade Humeniuk)
+Fixed bug in WORD-BOUNDARY-P
+
+Version 1.2.6
+2005-04-13
+Added some DEFGENERICs to appease SBCL (thanks to Alan Shields)
+Removed wrong FTYPE declaration for STR (thanks to Alan Shields)
+
+Version 1.2.5
+2005-03-09
+Customizable optimize qualities (thanks to Damien Kick)
+
+Version 1.2.4
+2005-03-07
+Changed DEBUG optimize quality from 0 to 1
+
+Version 1.2.3
+2005-02-02
+Wrapped WITH-COMPILATION-UNIT around loop in load.lisp
+
+Version 1.2.2
+2005-02-02
+Fixed bug in hash table optimization (introduced in 1.1.0)
+
+Version 1.2.1
+2005-01-25
+There was a wrong read-time conditional in api.lisp, sorry
+
+Version 1.2.0
+2005-01-24
+AllegroCL compatibility mode
+Fixed broken load.lisp file (caught by Jim Prewett and Zach Beane)
+
+Version 1.1.0
+2005-01-23
+Cleaned up load.lisp and cl-ppcre.asd
+Make large hash tables smaller, if possible
+Correct treatment of constant regular expressions in DO-SCANS
+
+Version 1.0.0
+2004-12-22
+Special anniversary release... :)
+
+Version 0.9.4
+2004-12-18
+Fixed bug in NORMALIZE-VAR-LIST (caught by Dave Roberts)
+
+Version 0.9.3
+2004-12-09
+Fixed bug in CREATE-SCANNER-AUX (caught by Allan Ruttenberg and Gary Byers)
+
+Version 0.9.2
+2004-12-06
+More compiler macros (thanks to Allan Ruttenberg)
+
+Version 0.9.1
+2004-11-29
+Shortcuts for REGISTER-GROUPS-BIND and DO-REGISTER-GROUPS (suggested by Alexander Kjeldaas)
+
+Version 0.9.0
+2004-10-14
+Experimental support for "filters"
+Bugfix for standalone regular expressions (ACCUMULATE-START-P wasn't set to NIL)
+
+Version 0.8.1
+2004-09-30
+Patches for Genera 8.5 (thanks to Patrick O'Donnell)
+
+Version 0.8.0
+2004-09-16
+Added parse tree synonyms (thanks to Patrick O'Donnell)
+
+Version 0.7.9
+2004-07-13
+Fixed bug in DO-SCANS (caught by Jan Rychter)
+
+Version 0.7.8
+2004-07-13
+New SIMPLE-CALLS keyword argument for REGEX-REPLACE(-ALL)
+Added environment parameter to compiler macros (thanks to c.l.l article <aczhx5hj.fsf at ccs.neu.edu> by Joe Marshall)
+Added compiler macros for SCAN-TO-STRINGS and REGEX-REPLACE(-ALL) (they somehow got lost)
+
+Version 0.7.7
+2004-05-19
+Fixed bug in NEWLINE-SKIPPER (caught by RegexCoach user Thomas-Paz Hartman)
+Added doc strings for PPCRE-SYNTAX-ERROR and friends (after playing with slime-apropos-package)
+Added hyperdoc support
+
+Version 0.7.6
+2004-04-20
+The closures created by CREATE-BMH-MATCHER now cleanly cope with negative arguments (bug caught by Damien Kick)
+
+Version 0.7.5
+2004-04-19
+Fixed a bug with constant-length repetitions of . (dot) in single-line mode (caught by RegexCoach user Lee Gold)
+
+Version 0.7.4
+2004-02-16
+Fixed wrong call to SIGNAL-PPCRE-SIGNAL-ERROR in lexer.lisp (caught by Peter Graves)
+Added :CL-PPCRE to *FEATURES* (for CL-INTERPOL)
+Compiler macro for SPLIT
+
+Version 0.7.3
+2004-01-28
+Fixed bug in CURRENT-MIN-REST for lookaheads (reported by RegexCoach user Thomas-Paz Hartman)
+Added tests for this bug
+
+Version 0.7.2
+2004-01-27
+Fixed typo (SUBSEQ/NSUBSEQ) in SPLIT (thanks to Alan Ruttenberg)
+Updated docs with respect to ECL (thanks to Alex Mizrahi)
+Mention FreeBSD port in docs
+
+Version 0.7.1
+2003-10-24
+Fixed version numbers in docs (thanks to Sébastien Saint-Sevin)
+
+Version 0.7.0
+2003-10-23
+New macros REGISTER-GROUPS-BIND and DO-REGISTER-GROUPS
+Added SHAREP keyword argument to most API functions and macros
+Mention CL-INTERPOL in docs
+Partial code cleanup (using WITH-UNIQUE-NAMES and REBINDING)
+
+Version 0.6.1
+2003-10-11
+Added EXTERNAL-FORMAT keyword args to CL-PPCRE-TEST:TEST for some CLs (thanks to JP Massar and Scott D. Kalter)
+Fixed bug with REGEX-REPLACE and REGEX-REPLACE-ALL when (= START END) was true
+Added doc sections for quoting problems and backslash confusions (thanks to conversations with Peter Seibel)
+Disable quoting in definition of QUOTE-SECTIONS so you can always safely rebuild CL-PPCRE
+
+Version 0.6.0
+2003-10-07
+CL-PPCRE now has its own condition types
+Added support for Perl's \Q and \E (Peter Seibel convinced me to do it) - see QUOTE-META-CHARS and *ALLOW-QUOTING*
+Added tests for this new feature
+Threaded tests are more verbose now and use only keyword args
+
+Version 0.5.9
+2003-10-03
+Changed "^" optimizations with respect to constant end strings with offsets (bug caught by Yexuan Gui)
+Added tests for this bug
+Removed *.dos files from CL-PPCRE-TEST tests (thanks to JP Massar)
+Added threaded tests for SBCL (thanks to Christophe Rhodes)
+
+Version 0.5.8
+2003-09-17
+Optimizations for ".*" were too optimistic when look-behinds were involved
+Added tests for this bug
+Removed *.dos files
+
+Version 0.5.7
+2003-08-20
+Fixed (CL-PPCRE:SCAN "(.)X$" "ABCX" :START 4) bug (spotted by Tibor Simko)
+Forgot to export *REGEX-CHAR-CODE-LIMIT* in Corman version of DEFPACKAGE
+Removed Emacs local variables from source code (finally...)
+Mention Gentoo in docs
+
+Version 0.5.6
+2003-06-30
+Replaced wrong COPY-REGEX code for WORD-BOUNDARY objects (detected by Max Goldberg)
+Added info about possible TRUENAME problems with ACL in README (thanks to Kevin Layer for providing a patch for this)
+
+Version 0.5.5
+2003-06-09
+Patch for SBCL/Debian compatibility by Kevin Rosenberg
+Simpler version of compiler macro
+Availability through asdf-install
+
+Version 0.5.4
+2003-04-09
+Added DESTRUCTIVE keyword to CREATE-SCANNER
+
+Version 0.5.3
+2003-03-31
+Fixed bug in REGEX-REPLACE (replacement string couldn't contain literal backslash)
+Fixed bug in definition of CHAR-CLASS (since 0.5.0 the hash slot may be NIL - CMUCL's new PCL detects this)
+Micro-optimization in INSERT-CHAR-CLASS-TESTER: CHAR-NOT-GREATERP instead of CHAR-DOWNCASE
+
+Version 0.5.2
+2003-03-28
+Better compiler macro (thanks to Kent M. Pitman)
+
+Version 0.5.1
+2003-03-27
+Removed compiler macro
+
+Version 0.5.0
+2003-03-27
+Lexer, parser, and converter mostly re-written to reduce consing and increase speed
+Get rid of FIX-POS in lexer and parser, "ism" flags are handled after parsing now
+Smaller test suite (again) due to literal embedding of line breaks
+Seperate test files for DOS line endings
+Replaced constant +REGEX-CHAR-CODE-LIMIT+ with special variable *REGEX-CHAR-CODE-LIMIT*
+
+Version 0.4.1
+2003-03-19
+Added compiler macro for SCAN
+Changed test suite to be nicer to Corman Lisp and ECL (see docs for new syntax)
+Incorporated visual feedback (dots) in test suite (thanks to JP Massar)
+Added README file
+Replaced STRING-LIST-TO-SIMPLE-STRING with a much improved version by JP Massar
+
+Version 0.4.0
+2003-02-27
+Added *USE-BMH-MATCHER*
+
+Version 0.3.2
+2003-02-21
+Added load.lisp
+Various minor changes for Corman Lisp compatibility (thanks to Karsten Poeck and JP Massar)
+
+Version 0.3.1
+2003-01-18
+Bugfix in CREATE-SCANNER (didn't work if flags were given and arg was a parse-tree)
+
+Version 0.3.0
+2003-01-12
+Added new features to REGEX-REPLACE and REGEX-REPLACE-ALL
+
+Version 0.2.0
+2003-01-11
+Make SPLIT more Perl-compatible, including new keyword parameters
+
+Version 0.1.4
+2003-01-10
+Don't move "^" and "\A" while iterating with DO-SCANS
+Added link to Debian package
+
+Version 0.1.3
+2002-12-25
+More usable MK:DEFSYSTEM files (courtesy of Hannu Koivisto)
+Fixed typo in documentation
+
+Version 0.1.2
+2002-12-22
+Added version numbers for Debian packaging
+Be friendly to case-sensitive ACL images (courtesy of Kevin Rosenberg and Douglas Crosher)
+"Fixed" two cases where declarations came after docstrings (because of bugs in Corman Lisp and older CMUCL versions)
+Added #-cormanlisp to hide (INCF (THE FIXNUM POS)) from Corman Lisp
+Added file doc/benchmarks.2002-12-22.txt
+
+Version 0.1.1
+2002-12-21
+Added asdf system definitions by Marco Baringer
+Small additions to documentation
+Correct (Emacs) local variables list in closures.lisp and api.lisp
+Added this CHANGELOG
+
+Version 0.1.0
+2002-12-20
+Initial release

Added: branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/README
===================================================================
--- branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/README	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/README	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,62 @@
+Complete documentation for CL-PPCRE can be found in the 'doc'
+directory.
+
+CL-PPCRE also supports Nikodemus Siivola's HYPERDOC, see
+<http://common-lisp.net/project/hyperdoc/> and
+<http://www.cliki.net/hyperdoc>.
+
+1. Installation
+
+1.1. Probably the easiest way is
+
+       (load "/path/to/cl-ppcre/load.lisp")
+
+     This should compile and load CL-PPCRE on most Common Lisp
+     implementations.
+
+1.2. With MK:DEFSYSTEM you can make a symbolic link from
+     'cl-ppcre.system' and 'cl-ppcre-test.system' to your central registry
+     (which by default is in '/usr/local/lisp/Registry/') and then issue
+     the command
+
+       (mk:compile-system "cl-ppcre")
+
+     Note that this relies on TRUENAME returning the original file a
+     symbolic link is pointing to. This will only work with AllegroCL
+     6.2 if you've applied all patches with (SYS:UPDATE-ALLEGRO).
+
+1.3. You can also use ASDF instead of MK:DEFSYSTEM in a similar way
+     (use the .asd files instead of the .system files).
+
+1.4. For LispWorks there's a file 'lispworks-defsystem.lisp' which includes
+     a system definition for LispWork's Common Defsystem.
+
+2. Test
+
+CL-PPCRE comes with a test suite that can be used to check its
+compatibility with Perl's regex syntax. See the documentation on how
+to use this test suite for benchmarks and on how to write your own
+tests.
+
+2.1. If you've used 'load.lisp' to load CL-PPCRE you already have the
+     test suite loaded and can start the default tests with
+
+       (cl-ppcre-test:test)
+
+2.2. With MK:DEFSYSTEM you need to compile the 'cl-ppcre-test' system
+     as well before you can proceed as in 2.1.
+
+2.3. Same for ASDF.
+
+Depending on your machine and your CL implementation the default test
+will take between a few seconds and a couple of minutes. (It will
+print a dot for every tenth test case while it proceeds to give some
+visual feedback.) It should exactly report three 'errors' (662, 790,
+and 1439) which are explained in the documentation.
+
+MCL might report an error for the ninth test case which is also
+explained in the docs.
+
+Genera notes (thanks to Patrick O'Donnell): Some more tests will fail
+because characters like #\Return, #\Linefeed, or #\Tab have encodings
+which differ from Perl's (and thus CL-PPCRE's) expectations.

Added: branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/api.lisp
===================================================================
--- branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/api.lisp	2007-11-14 05:21:09 UTC (rev 2273)
+++ branches/trunk-reorg/thirdparty/cl-ppcre-1.3.2/api.lisp	2007-11-14 05:24:08 UTC (rev 2274)
@@ -0,0 +1,1264 @@
+;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*-
+;;; $Header: /usr/local/cvsrep/cl-ppcre/api.lisp,v 1.75 2007/09/13 07:52:13 edi Exp $
+
+;;; The external API for creating and using scanners.
+
+;;; Copyright (c) 2002-2007, Dr. Edmund Weitz. All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;;   * Redistributions of source code must retain the above copyright
+;;;     notice, this list of conditions and the following disclaimer.
+
+;;;   * Redistributions in binary form must reproduce the above
+;;;     copyright notice, this list of conditions and the following
+;;;     disclaimer in the documentation and/or other materials
+;;;     provided with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
+;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(in-package #:cl-ppcre)
+
+(defgeneric create-scanner (regex &key case-insensitive-mode
+                                       multi-line-mode
+                                       single-line-mode
+                                       extended-mode
+                                       destructive)
+  (:documentation "Accepts a regular expression - either as a
+parse-tree or as a string - and returns a scan closure which will scan
+strings for this regular expression and a list mapping registers to
+their names \(NIL stands for unnamed ones). The \"mode\" keyboard
+arguments are equivalent to the imsx modifiers in Perl. If DESTRUCTIVE
+is not NIL the function is allowed to destructively modify its first
+argument \(but only if it's a parse tree)."))
+
+#-:use-acl-regexp2-engine
+(defmethod create-scanner ((regex-string string) &key case-insensitive-mode
+                                                      multi-line-mode
+                                                      single-line-mode
+                                                      extended-mode
+                                                      destructive)
+  (declare #.*standard-optimize-settings*)
+  (declare (ignore destructive))
+  ;; parse the string into a parse-tree and then call CREATE-SCANNER
+  ;; again
+  (let* ((*extended-mode-p* extended-mode)
+         (quoted-regex-string (if *allow-quoting*
+                                (quote-sections (clean-comments regex-string extended-mode))
+                                regex-string))
+         (*syntax-error-string* (copy-seq quoted-regex-string)))
+    ;; wrap the result with :GROUP to avoid infinite loops for
+    ;; constant strings
+    (create-scanner (cons :group (list (parse-string quoted-regex-string)))
+                    :case-insensitive-mode case-insensitive-mode
+                    :multi-line-mode multi-line-mode
+                    :single-line-mode single-line-mode
+                    :destructive t)))
+
+#-:use-acl-regexp2-engine
+(defmethod create-scanner ((scanner function) &key case-insensitive-mode
+                                                   multi-line-mode
+                                                   single-line-mode
+                                                   extended-mode
+                                                   destructive)
+  (declare #.*standard-optimize-settings*)
+  (declare (ignore destructive))
+  (when (or case-insensitive-mode multi-line-mode single-line-mode extended-mode)
+    (signal-ppcre-invocation-error
+     "You can't use the keyword arguments to modify an existing scanner."))
+  scanner)
+
+#-:use-acl-regexp2-engine
+(defmethod create-scanner ((parse-tree t) &key case-insensitive-mode
+                                               multi-line-mode
+                                               single-line-mode
+                                               extended-mode
+                                               destructive)
+  (declare #.*standard-optimize-settings*)
+  (when extended-mode
+    (signal-ppcre-invocation-error
+     "Extended mode doesn't make sense in parse trees."))
+  ;; convert parse-tree into internal representation REGEX and at the
+  ;; same time compute the number of registers and the constant string
+  ;; (or anchor) the regex starts with (if any)
+  (unless destructive
+    (setq parse-tree (copy-tree parse-tree)))
+  (let (flags)
+    (if single-line-mode
+      (push :single-line-mode-p flags))
+    (if multi-line-mode
+      (push :multi-line-mode-p flags))
+    (if case-insensitive-mode
+      (push :case-insensitive-p flags))
+    (when flags
+      (setq parse-tree (list :group (cons :flags flags) parse-tree))))
+  (let ((*syntax-error-string* nil))
+    (multiple-value-bind (regex reg-num starts-with reg-names)
+        (convert parse-tree)
+      ;; simplify REGEX by flattening nested SEQ and ALTERNATION
+      ;; constructs and gathering STR objects
+      (let ((regex (gather-strings (flatten regex))))
+        ;; set the MIN-REST slots of the REPETITION objects
+        (compute-min-rest regex 0)
+        ;; set the OFFSET slots of the STR objects
+        (compute-offsets regex 0)
+        (let* (end-string-offset
+               end-anchored-p
+               ;; compute the constant string the regex ends with (if
+               ;; any) and at the same time set the special variables
+               ;; END-STRING-OFFSET and END-ANCHORED-P
+               (end-string (end-string regex))
+               ;; if we found a non-zero-length end-string we create an
+               ;; efficient search function for it
+               (end-string-test (and end-string
+                                     (plusp (len end-string))
+                                     (if (= 1 (len end-string))
+                                       (create-char-searcher
+                                        (schar (str end-string) 0)
+                                        (case-insensitive-p end-string))
+                                       (create-bmh-matcher
+                                        (str end-string)
+                                        (case-insensitive-p end-string)))))
+               ;; initialize the counters for CREATE-MATCHER-AUX
+               (*rep-num* 0)
+               (*zero-length-num* 0)
+               ;; create the actual matcher function (which does all the
+               ;; work of matching the regular expression) corresponding
+               ;; to REGEX and at the same time set the special
+               ;; variables *REP-NUM* and *ZERO-LENGTH-NUM*
+               (match-fn (create-matcher-aux regex #'identity))
+               ;; if the regex starts with a string we create an
+               ;; efficient search function for it
+               (start-string-test (and (typep starts-with 'str)
+                                       (plusp (len starts-with))
+                                       (if (= 1 (len starts-with))
+                                         (create-char-searcher
+                                          (schar (str starts-with) 0)
+                                          (case-insensitive-p starts-with))
+                                         (create-bmh-matcher
+                                          (str starts-with)
+                                          (case-insensitive-p starts-with))))))
+          (declare (special end-string-offset end-anchored-p end-string))
+          ;; now create the scanner and return it
+          (values (create-scanner-aux match-fn
+                                      (regex-min-length regex)
+                                      (or (start-anchored-p regex)
+                                          ;; a dot in single-line-mode also
+                                          ;; implicitly anchors the regex at
+                                          ;; the start, i.e. if we can't match
+                                          ;; from the first position we won't
+                                          ;; match at all
+                                          (and (typep starts-with 'everything)
+                                               (single-line-p starts-with)))
+                                      starts-with
+                                      start-string-test
+                                      ;; only mark regex as end-anchored if we
+                                      ;; found a non-zero-length string before
+                                      ;; the anchor
+                                      (and end-string-test end-anchored-p)
+                                      end-string-test
+                                      (if end-string-test
+                                          (len end-string)
+                                          nil)
+                                      end-string-offset
+                                      *rep-num*
+                                      *zero-length-num*
+                                      reg-num)
+                  reg-names))))))
+
+#+:use-acl-regexp2-engine
+(declaim (inline create-scanner))
+
+#+:use-acl-regexp2-engine
+(defmethod create-scanner ((scanner regexp::regular-expression) &key case-insensitive-mode
+                                                                     multi-line-mode
+                                                                     single-line-mode
+                                                                     extended-mode
+                                                                     destructive)
+  (declare #.*standard-optimize-settings*)
+  (declare (ignore destructive))
+  (when (or case-insensitive-mode multi-line-mode single-line-mode extended-mode)
+    (signal-ppcre-invocation-error
+     "You can't use the keyword arguments to modify an existing scanner."))
+  scanner)
+
+#+:use-acl-regexp2-engine
+(defmethod create-scanner ((parse-tree t) &key case-insensitive-mode
+                                               multi-line-mode
+                                               single-line-mode
+                                               extended-mode
+                                               destructive)
+  (declare #.*standard-optimize-settings*)
+  (declare (ignore destructive))
+  (excl:compile-re parse-tree
+                   :case-fold case-insensitive-mode
+                   :ignore-whitespace extended-mode
+                   :multiple-lines multi-line-mode
+                   :single-line single-line-mode
+                   :return :index))
+
+(defgeneric scan (regex target-string &key start end real-start-pos)
+  (:documentation "Searches TARGET-STRING from START to END and tries
+to match REGEX.  On success returns four values - the start of the
+match, the end of the match, and two arrays denoting the beginnings
+and ends of register matches.  On failure returns NIL.  REGEX can be a
+string which will be parsed according to Perl syntax, a parse tree, or
+a pre-compiled scanner created by CREATE-SCANNER.  TARGET-STRING will
+be coerced to a simple string if it isn't one already.  The
+REAL-START-POS parameter should be ignored - it exists only for
+internal purposes."))
+
+#-:use-acl-regexp2-engine
+(defmethod scan ((regex-string string) target-string
+                                       &key (start 0)
+                                            (end (length target-string))
+                                            ((:real-start-pos *real-start-pos*) nil))
+  (declare #.*standard-optimize-settings*)
+  ;; note that the scanners are optimized for simple strings so we
+  ;; have to coerce TARGET-STRING into one if it isn't already
+  (funcall (create-scanner regex-string)
+           (maybe-coerce-to-simple-string target-string)
+           start end))
+
+#-:use-acl-regexp2-engine
+(defmethod scan ((scanner function) target-string
+                                    &key (start 0)
+                                         (end (length target-string))
+                                         ((:real-start-pos *real-start-pos*) nil))
+  (declare #.*standard-optimize-settings*)
+  (funcall scanner
+           (maybe-coerce-to-simple-string target-string)
+           start end))
+
+#-:use-acl-regexp2-engine
+(defmethod scan ((parse-tree t) target-string
+                                &key (start 0)
+                                     (end (length target-string))
+                                     ((:real-start-pos *real-start-pos*) nil))
+  (declare #.*standard-optimize-settings*)
+  (funcall (create-scanner parse-tree)
+           (maybe-coerce-to-simple-string target-string)
+           start end))
+
+#+:use-acl-regexp2-engine
+(declaim (inline scan))
+
+#+:use-acl-regexp2-engine
+(defmethod scan ((parse-tree t) target-string
+                                &key (start 0)
+                                     (end (length target-string))
+                                     ((:real-start-pos *real-start-pos*) nil))
+  (declare #.*standard-optimize-settings*)
+  (when (< end start)
+    (return-from scan nil))
+  (let ((results (multiple-value-list (excl:match-re parse-tree target-string
+                                                     :start start
+                                                     :end end
+                                                     :return :index))))
+    (declare (dynamic-extent results))
+    (cond ((null (first results)) nil)
+          (t (let* ((no-of-regs (- (length results) 2))
+                    (reg-starts (make-array no-of-regs
+                                            :element-type '(or null fixnum)))
+                    (reg-ends (make-array no-of-regs
+                                          :element-type '(or null fixnum)))
+                    (match (second results)))
+               (loop for (start . end) in (cddr results)
+                     for i from 0
+                     do (setf (aref reg-starts i) start
+                              (aref reg-ends i) end))
+               (values (car match) (cdr match) reg-starts reg-ends))))))
+
+#-:cormanlisp
+(define-compiler-macro scan (&whole form &environment env regex target-string &rest rest)
+  "Make sure that constant forms are compiled into scanners at compile time."
+  (cond ((constantp regex env)
+          `(scan (load-time-value (create-scanner ,regex))
+                 ,target-string , at rest))
+        (t form)))
+
+(defun scan-to-strings (regex target-string &key (start 0)
+                                                 (end (length target-string))
+                                                 sharedp)
+  (declare #.*standard-optimize-settings*)
+  "Like SCAN but returns substrings of TARGET-STRING instead of
+positions, i.e. this function returns two values on success: the whole
+match as a string plus an array of substrings (or NILs) corresponding
+to the matched registers. If SHAREDP is true, the substrings may share
+structure with TARGET-STRING."
+  (multiple-value-bind (match-start match-end reg-starts reg-ends)
+      (scan regex target-string :start start :end end)
+    (unless match-start
+      (return-from scan-to-strings nil))
+    (let ((substr-fn (if sharedp #'nsubseq #'subseq)))
+      (values (funcall substr-fn
+                       target-string match-start match-end)
+              (map 'vector
+                   (lambda (reg-start reg-end)
+                     (if reg-start
+                       (funcall substr-fn
+                                target-string reg-start reg-end)
+                       nil))
+                   reg-starts
+                   reg-ends)))))
+
+#-:cormanlisp
+(define-compiler-macro scan-to-strings
+    (&whole form &environment env regex target-string &rest rest)
+  "Make sure that constant forms are compiled into scanners at compile time."
+  (cond ((constantp regex env)
+          `(scan-to-strings (load-time-value (create-scanner ,regex))
+                            ,target-string , at rest))
+        (t form)))
+
+(defmacro re