You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2011/12/08 22:57:38 UTC

svn commit: r1212149 [3/5] - in /tcl/rivet/trunk: ./ doc/ doc/examples-sgml/ doc/examples/ doc/xml/ m4/ rivet/ rivet/rivet-tcl/ src/ src/apache-2/ tests/ tests/apachetest/ tests/docroot1/ tests/docroot2/

Modified: tcl/rivet/trunk/doc/xml/directives.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/directives.xml?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/directives.xml (original)
+++ tcl/rivet/trunk/doc/xml/directives.xml Thu Dec  8 21:57:35 2011
@@ -1,130 +1,138 @@
 <section id="directives">
-    <title>Rivet Apache Directives</title>
-
-    <para>
-      These directives are used within the Apache httpd server
-      configuration files to modify Apache Rivet's behavior.  Their
-      precedence is as follows: <command>RivetDirConf</command>,
-      <command>RivetUserConf</command>,
-      <command>RivetServerConf</command>, meaning that DirConf will
-      override UserConf, which will in turn override ServerConf.
-    </para>
-    <para>
-    	The directive <command>ServerInitScript</command> plays a special
-    	role since the script runs within the master interpreter,
-    	an interpreter created before the Apache parent process spawns
-    	the children that actually will serve the requests coming from
-    	the network. During this
-    	stage Apache is still running as a single process, so this
-    	is the right place for doing initialization of anything that 
-    	might work as an IPC infrastructure. Moreover everything
-    	created and initialized in this stage will be handed on to the
-    	interpreters run by the child processes, as they are
-    	created by copying the memory of the parent process.
-    </para>
-
-    <variablelist>
-      <varlistentry>
-	<term>
-	  <cmdsynopsis>
-	    <command>RivetServerConf</command>
-	    <group choice="req">
-	      <arg>CacheSize</arg>
-	      <arg>ServerInitScript</arg>
-	      <arg>GlobalInitScript</arg>
-	      <arg>ChildInitScript</arg>
-	      <arg>ChildExitScript</arg>
-	      <arg>BeforeScript</arg>
-	      <arg>AfterScript</arg>
-	      <arg>ErrorScript</arg>
-	      <arg>AbortScript</arg>
-	      <arg>AfterEveryScript</arg>
-	      <arg>UploadDirectory</arg>
-	      <arg>UploadMaxSize</arg>
-	      <arg>UploadFilesToVar</arg>
-	      <arg>SeparateVirtualInterps</arg>
-	      <arg>HonorHeaderOnlyRequests</arg>
-	    </group>
-	  </cmdsynopsis>
-	</term>
-	<listitem>
-	  <para><command>RivetServerConf</command> specifies a global
-	    option that is valid for the whole server.  If you have a
-	    virtual host, in some cases, the option specified in the
-	    virtualhost takes precedence over the 'global' version.
-	  </para>
-	</listitem>
-	<listitem>
-	  <variablelist>
-	    <varlistentry>
-	      <term>
-				<cmdsynopsis>
-				  <arg choice="plain">CacheSize</arg>
-				  <arg><replaceable>size</replaceable></arg>
-				</cmdsynopsis>
-	      </term>
-			   <listitem>
-					<para>
-					  Sets the size of the internal page cache, where
-					  <option><replaceable>size</replaceable></option> is
-					  the number of byte-compiled pages to be cached for
-					  future use.  Default is
-					  <command>MaxRequestsPerChild</command> / 5, or 50,
-					  if <command>MaxRequestsPerChild</command> is 0.
-					</para>
-					<para>
-					  This option is completely global, even when using
-					  separate, per-virtual host interpreters.
-					</para>
-				</listitem>
-	   </varlistentry>
-	   <varlistentry>
-	   	<term>
-	   		<cmdsynopsis>
-	   			<arg choice="plain">ServerInitScript</arg>
-	   			<arg><replaceable>script</replaceable></arg>
-	   		</cmdsynopsis>
-	   	</term>
-	   	<listitem>
-	   		<para>
-	   			Tcl script which is to run when the master interpreter is created. 
-	   			Namespaces, variables and packages loaded during this stage will 
-	   			be copied later on in the startup process, when child
-	   			processes are created. In general any sort of I/O channel 
-	   			that is opened during this stage must be closed before the 
-	   			execution of the script completes.
-	   		</para>
-	   		<para>
-					This option is only available at the global level	   		
-	   		</para>
-	   	</listitem>
-		</varlistentry>
-	   <varlistentry>
-	      <term>
+   <title>Rivet Apache Directives</title>
+	<section>
+	   <para>
+	      Rivet directives are used within the Apache httpd server
+	      configuration to set up the environment where Rivet script
+	      will be run.  Their precedence is as follows: 
+	      <command>RivetDirConf</command>,
+	      <command>RivetUserConf</command>,
+	      <command>RivetServerConf</command>, meaning that DirConf will
+	      override UserConf, which will in turn override ServerConf.
+	   </para>
+	   <para>
+	    	The directive <command>ServerInitScript</command> plays a special
+	    	role since the script runs within the master interpreter,
+	    	an interpreter created before the Apache parent process spawns
+	    	the children that actually will serve the requests coming from
+	    	the network. During this stage Apache is still running as a 
+	    	single process, so this is the right place for doing 
+	    	initializations or loading packages 
+	    	that have be common to all the interpreters that will be created
+	    	when Apache forks its child processes, even when the option 
+	    	<command>SeparateVirtualInterps</command> is set. Since this
+	    	script will be running in a single process environment (from the
+	    	Apache point of view) <command>ServerInitScript</command> 
+	    	is also the right place for doing everything that must avoid
+	    	resource concurrency among processes (e.g. the creation and 
+	    	initialization of an IPC system)
+	   </para>
+	</section>
+	<section>
+	   <variablelist>	
+   		<varlistentry>
+			<term>
 				<cmdsynopsis>
-				  <arg choice="plain">GlobalInitScript</arg>
-				  <arg><replaceable>script</replaceable></arg>
-				</cmdsynopsis>
-	      </term>
-	      <listitem>
-				<para>
-				  Tcl script that is run as part of a child process initialization. 
-				  If the option <option>SeparateVirtualInterp</option> is not used this is
-				  the right place where file handles, database connections or sockets can 
-				  be opened.
-				  The argument <replaceable><option>script</option></replaceable>
-				  is an actual Tcl script, so to run a file, you would
-				  do:
-		
-				  <programlisting>RivetServerConf GlobalInitScript "source /var/www/foobar.tcl"</programlisting>
-				</para>
+			   	<command>RivetServerConf</command>
+			   	<group choice="req">
+				      <arg>CacheSize</arg>
+				      <arg>ServerInitScript</arg>
+				      <arg>GlobalInitScript</arg>
+				      <arg>ChildInitScript</arg>
+				      <arg>ChildExitScript</arg>
+				      <arg>BeforeScript</arg>
+				      <arg>AfterScript</arg>
+				      <arg>ErrorScript</arg>
+				      <arg>AbortScript</arg>
+				      <arg>AfterEveryScript</arg>
+				      <arg>UploadDirectory</arg>
+				      <arg>UploadMaxSize</arg>
+				      <arg>UploadFilesToVar</arg>
+				      <arg>SeparateVirtualInterps</arg>
+				      <arg>HonorHeaderOnlyRequests</arg>
+	    			</group>
+			  </cmdsynopsis>
+			</term>
+			<listitem>
 				<para>
-				  This option is ignored in virtual hosts.
+					<command>RivetServerConf</command> specifies a global
+			    	option that is valid for the whole server.  If you have a
+			    	virtual host, in some cases, the option specified in the
+			    	virtualhost takes precedence over the 'global' version.
 				</para>
-	      </listitem>
-	  </varlistentry>
+			</listitem>
+			<listitem>
+				<variablelist>
+	   		<varlistentry>
+	      		<term>
+						<cmdsynopsis>
+				  			<arg choice="plain">CacheSize</arg>
+				  			<arg><replaceable>size</replaceable></arg>
+						</cmdsynopsis>
+	      		</term>
+			   	<listitem>
+						<para>
+						  Sets the size of the internal page cache, where
+						  <option><replaceable>size</replaceable></option> is
+						  the number of byte-compiled pages to be cached for
+						  future use.  Default is
+						  <command>MaxRequestsPerChild</command> / 5, or 50,
+						  if <command>MaxRequestsPerChild</command> is 0.
+						</para>
+						<para>
+						  This option is completely global, even when using
+						  separate, per-virtual host interpreters.
+						</para>
+					</listitem>
+	   		</varlistentry>
+	   		<varlistentry>
+	   			<term>
+	   				<cmdsynopsis>
+			   			<arg choice="plain">ServerInitScript</arg>
+			   			<arg><replaceable>script</replaceable></arg>
+	   				</cmdsynopsis>
+	   			</term>
+	   			<listitem>
+			   		<para>
+			   			Tcl script which is to run when the master interpreter is created. 
+			   			Namespaces, variables and packages loaded during this stage will 
+			   			be copied later on in the startup process, when child
+			   			processes are created. In general any sort of I/O channel 
+			   			that is opened during this stage must be closed before the 
+			   			execution of the script completes.
+			   		</para>
+			   		<para>
+							This option is only available at the global level and has
+							effect only if <command>SeparateVirtualInterps</command> is off   		
+			   		</para>
+	   			</listitem>
+				</varlistentry>
+	   		<varlistentry>
+			      <term>
+						<cmdsynopsis>
+						  <arg choice="plain">GlobalInitScript</arg>
+						  <arg><replaceable>script</replaceable></arg>
+						</cmdsynopsis>
+			      </term>
+			      <listitem>
+						<para>
+						  Tcl script that is run as part of a child process initialization. 
+						  If the option <option>SeparateVirtualInterp</option> is not used this is
+						  the right place where file handles, database connections or sockets can 
+						  be opened.
+						  The argument <replaceable><option>script</option></replaceable>
+						  is an actual Tcl script, so to run a file, you would
+						  do:
+				
+						  <programlisting>RivetServerConf GlobalInitScript "source /var/www/foobar.tcl"</programlisting>
+						</para>
+						<para>
+						  This option is ignored in virtual hosts.
+						</para>
+			      </listitem>
+	  			</varlistentry>
 
-	  <varlistentry>
+			  <varlistentry>
 	      <term>
 				<cmdsynopsis>
 				  <arg choice="plain">ChildInitScript</arg>
@@ -252,10 +260,11 @@
 					is therefore run both when the content generation script
 					completes successfully and when its execution is interrupted
 					by <xref linkend="abort_page" />. The code in this script
-					can tell whether we are running after an abort condition
-					occurred by passing the argument <arg>-aborting</arg> to
-					<xref linkend="abort_page" /> which in turn returns 1 if
-					abort_page had been called earlier in the request processing.
+					can understand whether it's running after the page was
+					interrupted by calling <xref linkend="abort_page" />	
+					with the argument <arg>-aborting</arg>. The command
+					will return 1 if an abort_page call took place 
+					earlier in the request processing.
 				</para>
 	      </listitem>
 	    </varlistentry>
@@ -269,13 +278,13 @@
 			</term>
 			<listitem>
 				<para>
-					Execution of a content generating script can be
-					done by invoking <xref linkend="abort_page" />. When 
+					The execution of a can be interrupted by
+					invoking <xref linkend="abort_page" />. If  
 					an <option>AbortScript</option> is defined for the page
-					being generated, control is passed to it as a way
-					to undertake specific action that might be necessary
+					being generated, control is passed to it. <option>AbortScript</option>
+					is the right place where specific actions can be taken
 					to catch resources left dangling by the sudden interruption.				
-				</para>			
+				</para>
 			</listitem>
 		</varlistentry>
 
@@ -331,14 +340,14 @@
 
 	    <varlistentry>
 	      <term>
-		    <cmdsynopsis>
+		     <cmdsynopsis>
 		       <arg choice="plain">SeparateVirtualInterps</arg>
 		       <group choice="req">
 		          <arg>yes</arg>
 		          <arg>no</arg>
 		       </group>
-		       </cmdsynopsis>
-		   </term>
+		     </cmdsynopsis>
+		  </term>
 	      <listitem>
       		<para>
       		  If on, Rivet will create a separate Tcl interpreter
@@ -347,10 +356,16 @@
       		  clients into separate interpreters, so that they
       		  don't accidentally interfere with one another.
       		</para>
-   		   <para>
-   		     This option is, by nature, only available at the
-   		     global level.
-   		   </para>
+   		    <note>
+   		      This option is, by nature, only available at the
+   		      global level. By enabling <command>SeparateVirtualInterps</command>
+   		      you must rely only on <command>ChildInitScript</command> to
+   		      initialize the interpreters. Don't expect the 
+   		      initialization done in <command>ServerInitScript</command> and 
+   		      <command>GlobalInitScript</command> to be handed down to the
+   		      slave interpreters that are private to each configured 
+   		      virtual host.
+   		   </note>
 	      </listitem>
 	    </varlistentry>
 
@@ -377,52 +392,49 @@
 	  </variablelist>
 	</listitem>
       </varlistentry>
-
-      <varlistentry>
-	<term>
-	  <cmdsynopsis>
-	    <command>RivetDirConf</command>
-	    <group choice="req">
-	      <arg>BeforeScript</arg>
-	      <arg>AfterScript</arg>
-	      <arg>ErrorScript</arg>
-	      <arg>UploadDirectory</arg>
-	    </group>
-	  </cmdsynopsis>
-	</term>
-	<listitem>
-	  <para>
-	    These options are the same as for
-	    <command>RivetServerConf</command>, except that they are
-	    only valid for the directory where they are specified, and
-	    its subdirectories.  It may be specified in <command>Directory</command> 
-	    sections.
-	  </para>
-	</listitem>
+      	<varlistentry>
+			<term>
+			  <cmdsynopsis>
+			    <command>RivetDirConf</command>
+			    <group choice="req">
+			      <arg>BeforeScript</arg>
+			      <arg>AfterScript</arg>
+			      <arg>ErrorScript</arg>
+			      <arg>UploadDirectory</arg>
+			    </group>
+			  </cmdsynopsis>
+			</term>
+			<listitem>
+			  <para>
+			    These options are the same as for
+			    <command>RivetServerConf</command>, except that they are
+			    only valid for the directory where they are specified, and
+			    its subdirectories.  It may be specified in <command>Directory</command> 
+			    sections.
+			  </para>
+			</listitem>
       </varlistentry>
-
-      <varlistentry>
-	<term>
-	  <cmdsynopsis>
-	    <command>RivetUserConf</command>
-	    <group choice="req">
-	      <arg>BeforeScript</arg>
-	      <arg>AfterScript</arg>
-	      <arg>ErrorScript</arg>
-	      <arg>UploadDirectory</arg>
-	    </group>
-	  </cmdsynopsis>
-	</term>
-	<listitem>
-	  <para>
-	    These options are the same as for
-	    <command>RivetServerConf</command>, except that they are
-	    only valid for the directory where they are specified, and
-	    its subdirectories.
-	  </para>
-	</listitem>
+      	<varlistentry>
+			<term>
+			  <cmdsynopsis>
+			    <command>RivetUserConf</command>
+			    <group choice="req">
+			      <arg>BeforeScript</arg>
+			      <arg>AfterScript</arg>
+			      <arg>ErrorScript</arg>
+			      <arg>UploadDirectory</arg>
+			    </group>
+			  </cmdsynopsis>
+			</term>
+			<listitem>
+			  <para>
+			    These options are the same as for
+			    <command>RivetServerConf</command>, except that they are
+			    only valid for the directory where they are specified, and
+			    its subdirectories.
+			  </para>
+			</listitem>
       </varlistentry>
-    </variablelist>
-
+		</variablelist>
+	</section>
 </section>
-

Modified: tcl/rivet/trunk/doc/xml/examples.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/examples.xml?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/examples.xml (original)
+++ tcl/rivet/trunk/doc/xml/examples.xml Thu Dec  8 21:57:35 2011
@@ -18,51 +18,50 @@
 			Assuming you have Apache configured correctly, create a file
 			called <filename>hello.rvt</filename> where Apache can find
 			it, with the following content:
-		</para>
+      </para>
       <programlisting>&hello.rvt;</programlisting>
       <para>
-	If you then access it with your browser, you should see a
-	blank page with the text "Hello World" (without the quotes) on it.
+			If you then access it with your browser, you should see a
+			blank page with the text "Hello World" (without the quotes) on it.
       </para>
     </example>
 
     <example>
-	<title>Generate a Table</title>
-	  <para>
-	    In another simple example, we dynamically generate a table:
-	  </para>
-	  <programlisting>&table.rvt;</programlisting>
-	  <para>
-	    If you read the code, you can see that this is pure Tcl.  We
-	    could take the same code, run it outside of Rivet, and it
-	    would generate the same HTML!
-	  </para>
-	  <para>
-	    The result should look something like this:
-	  </para>
-	  <graphic fileref="images/table.png"/>
-
+		<title>Generate a Table</title>
+	  	<para>
+	   	In another simple example, we dynamically generate a table:
+	  	</para>
+	  	<programlisting>&table.rvt;</programlisting>
+	  	<para>
+	    	If you read the code, you can see that this is pure Tcl.  We
+	    	could take the same code, run it outside of Rivet, and it
+	    	would generate the same HTML!
+	  	</para>
+	  	<para>
+	    	The result should look something like this:
+	  	</para>
+	  	<graphic fileref="images/table.png"/>
     </example>
 
     <example id="variable_access">
       <title>Variable Access</title>
       <para>
-	Here, we demonstrate how to access variables set by GET or
-	POST operations.
+			Here, we demonstrate how to access variables set by GET or
+			POST operations.
       </para>
       <para>
-	Given an HTML form like the following:
+			Given an HTML form like the following:
       </para>
       <programlisting>&vars.html;</programlisting>
       <para>
-	We can use this Rivet script to get the variable values:
+			We can use this Rivet script to get the variable values:
       </para>
       <programlisting>&vars.rvt;</programlisting>
       <para>
-	The first statement checks to make sure that the
-	<varname>boss</varname> variable has been passed to the
-	script, and then does something with that information.  If
-	it's not present, an error is added to the list of errors.
+			The first statement checks to make sure that the
+			<varname>boss</varname> variable has been passed to the
+			script, and then does something with that information.  If
+			it's not present, an error is added to the list of errors.
       </para>
       <para>
 	In the second block of code, the variable
@@ -88,74 +87,74 @@
 	of errors it contains is printed.
       </para>
     </example>
-
+    
     <example id="file_upload">
       <title>File Upload</title>
       <para>
-	The <command>upload</command> command endows Rivet with an
-	interface to access files transferred over http as parts of a
-	multipart form.  The following HTML in one file, say,
-	<filename>upload.html</filename> creates a form with a text
-	input entry. By clicking the file chooser button the file
-	browser shows up and the user selects the file to be uploaded
-	(the file path will appear in the text input).  In order to make
-	sure you're uploading the whole file you must combine the
-	action of the enctype and method attributes of the
-	&lt;form...&gt; tag in the way shown in the example.  Failure
-	to do so would result in the client sending only the file's
-	path, rather than the actual contents.
+			The <command>::rivet::upload</command> command endows Rivet with an
+			interface to access files transferred over http as parts of a
+			multipart form.  The following HTML in one file, say,
+			<filename>upload.html</filename> creates a form with a text
+			input entry. By clicking the file chooser button the file
+			browser shows up and the user selects the file to be uploaded
+			(the file path will appear in the text input).  In order to make
+			sure you're uploading the whole file you must combine the
+			action of the enctype and method attributes of the
+			&lt;form...&gt; tag in the way shown in the example.  Failure
+			to do so would result in the client sending only the file's
+			path, rather than the actual contents.
       </para>
       <programlisting>&upload.html;</programlisting>
       <para>
-	In the script invoked by the form
-	(<filename>upload.rvt</filename>) <command>upload</command>
-	<arg>argument ...</arg> commands can be used to manipulate the
-	various files uploaded.
+			In the script invoked by the form
+			(<filename>upload.rvt</filename>) <command>upload</command>
+			<arg>argument ...</arg> commands can be used to manipulate the
+			various files uploaded.
       </para>
       <programlisting>&upload.rvt;</programlisting>
       <para>
-	Don't forget that the apache server must have write access to
-	the directory where files are being created.  The Rivet Apache
-	directives have a substantial impact on the upload process,
-	you have to carefully read the docs in order to set the
-	appropriate directives values that would match your
-	requirements.
-      </para>
-      <para>
-	It is also important to understand that some 
-	<command>upload</command> commands are effective only when
-	used in a mutually exclusive way.  Apache stores the data in
-	temporary files which are read by the <command>upload save
-	<arg>upload name</arg><arg>filename</arg></command> or by the
-	<command>upload data <arg>upload name</arg></command>
-	command. Subsequent calls to these 2 commands using the same
-	<arg>upload name</arg> argument will return no data on the
-	second call.  Likewise <command>upload channel <arg>upload
-	name</arg></command> will return a Tcl file channel that you
-	can use in regular Tcl scripts only if you haven't already
-	read the data, for example with a call to the <command>upload
-	data <arg>upload name</arg></command> command.
+			Don't forget that the apache server must have write access to
+			the directory where files are being created.  The Rivet Apache
+			directives have a substantial impact on the upload process,
+			you have to carefully read the docs in order to set the
+			appropriate directives values that would match your
+			requirements.
+      </para>
+      <para>
+			It is also important to understand that some 
+			<command>upload</command> commands are effective only when
+			used in a mutually exclusive way.  Apache stores the data in
+			temporary files which are read by the <command>upload save
+			<arg>upload name</arg><arg>filename</arg></command> or by the
+			<command>upload data <arg>upload name</arg></command>
+			command. Subsequent calls to these 2 commands using the same
+			<arg>upload name</arg> argument will return no data on the
+			second call.  Likewise <command>upload channel <arg>upload
+			name</arg></command> will return a Tcl file channel that you
+			can use in regular Tcl scripts only if you haven't already
+			read the data, for example with a call to the <command>upload
+			data <arg>upload name</arg></command> command.
       </para>
     </example>
     <example id="file_download">
       <title>File Download</title>
       <para>
-	In general setting up a data file for being sent over http is 
-	as easy as determining the file's URI and letting Apache's
-	do all that is needed. If this approach fits your design all 
-	you have to do is to keep the downloadable files somewhere 
-	within Apache's DocumentRoot (or in any of the directories 
-	Apache has right to access).
-      </para>
-      <para>
-	When a client sends a request for a file, Apache takes
-	care of determining the filetype, sends appropriate headers to
-	the client and then the file content. The client is responsible
-	for deciding how to handle the data accordingly to the 
-	"content-type" headers and its internal design. For example
-	when browsers give up trying to display a certain "content-type"
-	they display a download dialog box asking for directions from
-	the user. 
+			In general setting up a data file for being sent over http is 
+			as easy as determining the file's URI and letting Apache's
+			do all that is needed. If this approach fits your design all 
+			you have to do is to keep the downloadable files somewhere 
+			within Apache's DocumentRoot (or in any of the directories 
+			Apache has right to access).
+      </para>
+      <para>
+			When a client sends a request for a file, Apache takes
+			care of determining the filetype, sends appropriate headers to
+			the client and then the file content. The client is responsible
+			for deciding how to handle the data accordingly to the 
+			"content-type" headers and its internal design. For example
+			when browsers give up trying to display a certain "content-type"
+			they display a download dialog box asking for directions from
+			the user. 
       </para>
       <para>
 	Rivet can help if you have more sofisticated needs.  For

Modified: tcl/rivet/trunk/doc/xml/install.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/install.xml?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/install.xml (original)
+++ tcl/rivet/trunk/doc/xml/install.xml Thu Dec  8 21:57:35 2011
@@ -146,14 +146,6 @@ tar -xvf rivet-X.X.X.tar.gz</programlist
                </listitem>
             </varlistentry>
             <varlistentry>
-                <term>--with-rivet-target-dir=DIR</term>
-               <listitem>
-                    <para>
-                    This option tells the install script where Rivet's Tcl packages have to be copied. 
-                    </para>
-               </listitem>
-            </varlistentry>
-            <varlistentry>
                 <term>--with-upload-dir=DIR (default: '/tmp')</term>
                 <listitem>
                     <para>
@@ -188,10 +180,34 @@ tar -xvf rivet-X.X.X.tar.gz</programlist
             <varlistentry>
                 <term>--disable-upload-var</term>
                 <listitem>
-                    By default uploads are stored in Tcl variables. This switch sets the default for the configuration 
-                    parameter 'UploadFilesToVar' to 0. (Can be changed in the configuration)
+                    By default uploads are stored in Tcl variables. 
+                    This switch sets the default for the configuration 
+                    parameter 'UploadFilesToVar' to 0. 
+                    (Can be changed in the configuration)
                 </listitem>
             </varlistentry>
+            <varlistentry>
+            	<term>--disable-rivet-commands-export</term>
+            	<listitem>
+            		Rivet commands are created in the ::rivet namespace. To improve code readability
+            		it is recommended you write your scripts using the fully qualified name
+            		definitions. For compatibility with existing code, commands are exported from
+            		::rivet and can be thus imported into any namespace (global namespace included)
+            		with the command
+            		<programlisting>namespace import -force ::rivet::*</programlisting>
+            		The default value for this option may change in the future.
+            	</listitem>
+            </varlistentry>
+            <varlistentry>
+            	<term>--disable-import-rivet-commands</term>
+            	<listitem>
+            		Rivet commands can be imported imported into the global namespace. This
+            		is done by default and can be disabled using this option. In future
+            		versions of Rivet the default will be changed to off and eventually
+            		removed altogether. 
+            		<note>This option implicitly sets --enable-rivet-commands-export</note>
+            	</listitem>
+            </varlistentry>
         </variablelist>
             </para>
             <para>

Modified: tcl/rivet/trunk/doc/xml/packages.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/packages.xml?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/packages.xml (original)
+++ tcl/rivet/trunk/doc/xml/packages.xml Thu Dec  8 21:57:35 2011
@@ -36,5 +36,10 @@
       <listitem>
 			<para>tclrivet</para>
       </listitem>
+      
+      <listitem>
+			<para>calendar - a package providing a simple configurable calendar generator</para>
+      </listitem>
+      
     </itemizedlist>
   </section>

Modified: tcl/rivet/trunk/doc/xml/request.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/request.xml?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/request.xml (original)
+++ tcl/rivet/trunk/doc/xml/request.xml Thu Dec  8 21:57:35 2011
@@ -4,18 +4,29 @@
     <simplesect>
     	<title>Apache Child Process Lifecycle</title>
 	    <para>
-	    	Apache responds to HTTP requests through child processes spawned at 
-	    	start up. The number of child processes that have to be initially created
+			At startup Apache spawns child processes which are to become the real
+			agents responding to incoming HTTP requests.
+
+	    	The number of child processes that have to be initially created
 	    	can be controlled in the configuration and the optimum choice
 	    	for this numbers basically depends on the webserver workload and on the 
 	    	available system resources. See
 	    	<ulink url="http://httpd.apache.org/docs/2.2/misc/perf-tuning.html">Apache
 	    	documentation</ulink> for further reading about this crucial point. 
-	    	Each of the child process is set up to respond to requests
-	    	that will come from the network accordingly to the configuration 
-	    	parameters. If your webserver has been properly configured you will have Tcl 
-	    	scripts executed (Rivet templates go through a parsing stage before execution).
-	    	Your web applications will be doing much of their work doing this job of
+	    	 If your webserver has been properly configured you will have Tcl 
+	    	scripts executed (Rivet templates go through a parsing stage before execution)
+	    	when tcl or rvt files are referenced in one of these cases
+	    	<itemizedlist>
+	    		<listitem>The script is explicitly referenced in the URL. E.g.:
+	    		<programlisting>http://&lt;myserver&gt;/&lt;path-to-script&gt;/&lt;script&gt;.tcl</programlisting></listitem>
+	    		<listitem>The script is implicitly referenced by rewriting the URL. See:
+		<ulink url="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</ulink> 
+				documentation</listitem>
+	    		<listitem>The script is implicitly referenced by 
+	<ulink url="http://httpd.apache.org/docs/2.0/mod/mod_alias.html">redirecting or
+	    			aliasing</ulink> the URL to the real script</listitem>
+	    	</itemizedlist>
+	    	Your web applications will be doing much of their work doing this work of
 	    	responding to requests and creating content to be sent back to a client.
 	    </para>
 	    <para>
@@ -38,8 +49,13 @@
 		    		creation of private data. Example of tasks that can be done
 		    		in this context are importing namespace commands and loading packages
 		    		providing code of general interest for every application to
-		    		be served.
+		    		be served. 
 	    		</para>
+	    		<para>
+	    			<note>
+	    				<command>ServerInitScript</command> has effect for child processes when 
+		    			<command>SeparateVirtualInterps</command> is off</note>
+		    	</para>
 	    	</listitem>
 	    	<listitem>
 	    		<bridgehead>Child Process Initialization</bridgehead>
@@ -59,7 +75,7 @@
 	    			When <command>SeparateVirtualInterps</command> is turned on 
 	    			each configured virtual host will have its own slave interpreter.
 	    			<command>ChildInitScript</command> is the directive to be
-	    			placed within a &lt;VirtualHost ...&gt; ... &lt;/VirtualHost ...&gt;
+	    			placed within a &lt;VirtualHost...&gt;...&lt;/VirtualHost ...&gt;
 	    			stanza to have a special initialization of an interpreter bound to
 	    			a certain virtual host. This scenario of interpreter 
 	    			separation is extremely useful to
@@ -67,8 +83,10 @@
 	    			serving different web applications. 
 	    		</para>
 	    		<para>
-	    			<command>GlobalInitScript</command> has no effect to working interpreters
-	    			when <command>SeparateVirtualInterps</command> is set.
+	    			<note>
+	    				<command>GlobalInitScript</command> has no effect to working interpreters
+	    				when <command>SeparateVirtualInterps</command> is set.
+	    			</note>
 	    		</para>
 	    	</listitem>
 	    	<listitem>

Modified: tcl/rivet/trunk/m4/ax_prefix_config_h.m4
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/m4/ax_prefix_config_h.m4?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/m4/ax_prefix_config_h.m4 (original)
+++ tcl/rivet/trunk/m4/ax_prefix_config_h.m4 Thu Dec  8 21:57:35 2011
@@ -1,5 +1,5 @@
 # ===========================================================================
-#           http://autoconf-archive.cryp.to/ax_prefix_config_h.html
+#    http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -68,10 +68,10 @@
 #   it by itself". You might want to clean up about these - consider an
 #   extra mylib/conf.h that reads something like:
 #
-#      #include <mylib/_config.h>
-#      #ifndef _testpkg_const
-#      #define _testpkg_const const
-#      #endif
+#     #include <mylib/_config.h>
+#     #ifndef _testpkg_const
+#     #define _testpkg_const const
+#     #endif
 #
 #   and then start using _testpkg_const in the header files. That is also a
 #   good thing to differentiate whether some library-user has starting to
@@ -87,11 +87,7 @@
 #     #define _testpkg_const const
 #     #endif
 #
-# LAST MODIFICATION
-#
-#   2008-04-12
-#
-# COPYLEFT
+# LICENSE
 #
 #   Copyright (c) 2008 Guido U. Draheim <gu...@gmx.de>
 #   Copyright (c) 2008 Marten Svantesson
@@ -99,7 +95,7 @@
 #
 #   This program is free software; you can redistribute it and/or modify it
 #   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation; either version 2 of the License, or (at your
+#   Free Software Foundation; either version 3 of the License, or (at your
 #   option) any later version.
 #
 #   This program is distributed in the hope that it will be useful, but
@@ -119,11 +115,14 @@
 #   all other use of the material that constitutes the Autoconf Macro.
 #
 #   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Macro Archive. When you make and
-#   distribute a modified version of the Autoconf Macro, you may extend this
-#   special exception to the GPL to apply to your modified version as well.
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 11
 
 AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl
+AC_PREREQ([2.62])
 AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl
 AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
 AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
@@ -167,14 +166,14 @@ else
   fi fi
   AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
   if test -f $_INP ; then
-    echo "s/^@%:@undef  *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
-    echo "s/^@%:@undef  *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
-    echo "s/^@%:@def[]ine  *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
-    echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
-    echo "@%:@endif/" >>_script
-    echo "s/^@%:@def[]ine  *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
-    echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script
-    echo "@%:@endif/" >> _script
+    AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script
+    AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script
+    AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script
+    AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script
+    AS_ECHO(["@%:@endif/"]) >> _script
+    AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script
+    AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script
+    AS_ECHO(["@%:@endif/"]) >> _script
     # now executing _script on _DEF input to create _OUT output file
     echo "@%:@ifndef $_DEF"      >$tmp/pconfig.h
     echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
@@ -208,12 +207,3 @@ AS_VAR_POPDEF([_PKG])dnl
 AS_VAR_POPDEF([_DEF])dnl
 AS_VAR_POPDEF([_OUT])dnl
 ],[PACKAGE="$PACKAGE"])])
-
-dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points
-dnl out a problem where `echo "\1"` results in a Control-A. The unix standard
-dnl    http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
-dnl defines all backslash-sequences to be inherently non-portable asking
-dnl for replacement mit printf. Some old systems had problems with that
-dnl one either. However, the latest libtool (!) release does export an $ECHO
-dnl (and $echo) that does the right thing - just one question is left: what
-dnl was the first version to have it? Is it greater 2.58 ?

Modified: tcl/rivet/trunk/rivet/init.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/init.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/init.tcl (original)
+++ tcl/rivet/trunk/rivet/init.tcl Thu Dec  8 21:57:35 2011
@@ -12,11 +12,56 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-package provide RivetTcl 1.1
+package provide RivetTcl 2.1
 
 namespace eval ::Rivet {
 
     ###
+    ## export_tcl_commands --
+    ## this is temporary hack to export names of Tcl commands in rivet-tcl/.
+    ## This function will be removed in future versions of Rivet and it's
+    ## meant to provide a basic way to guarantee compatibility with older
+    ## versions of Rivet (see code in ::Rivet::init)
+    ##
+
+    proc tcl_commands_export_list {tclpath} {
+
+        # we collect the commands in rivet-tcl by reading the tclIndex
+        # file and then we extract the command list from auto_index
+
+        namespace eval ::rivet_temp { }
+        set ::rivet_temp::tclpath $tclpath
+
+        namespace eval ::rivet_temp {
+            variable auto_index
+            array set auto_index {}
+
+            # the auto_index in ${tclpath}/tclIndex is loaded
+            
+            set dir $tclpath
+            source [file join $tclpath tclIndex]
+        }
+        
+        set command_list [namespace eval ::rivet_temp {array names auto_index}]
+
+        # commands in 'command_list' are prefixed with ::rivet, so we have to
+        # remove it to build an export list 
+        
+        set export_list {}
+        foreach c $command_list {
+            if {[regexp {::rivet::(.*)} $c m cmd]} {
+                lappend export_list $cmd
+#               namespace eval ::rivet [list namespace export $cmd]
+            }
+        }
+
+        # we won't left anything behind
+        namespace delete ::rivet_temp
+
+        return $export_list
+    }
+
+    ###
     ## This routine gets called each time a new request comes in.
     ## It sets up the request namespace and creates a global command
     ## to replace the default global.  This ensures that when a user
@@ -72,6 +117,31 @@ namespace eval ::Rivet {
         set tclpath [file join [file dirname [info script]] rivet-tcl]
         set auto_path [linsert $auto_path 0 $tclpath]
 
+        ## As we moved the commands ensemble to ::rivet namespace we
+        ## we want to guarantee the commands are still accessible
+        ## at global level by putting them on the export list.
+        ## Importing the ::rivet namespace is deprecated and we should
+        ## make it clear that this will be removed in the future
+
+        ## we keep in ::rivet::export_list a list of importable commands
+
+        namespace eval ::rivet [list set export_list [tcl_commands_export_list $tclpath]]
+        namespace eval ::rivet {
+
+        ## init.tcl is run by mod_rivet (which creates the ::rivet namespace) but it gets run
+        ## standalone by mkPkgindex during the installation phase. We have to make sure the
+        ## procedure won't fail in this case, so we check for the existence of the variable.
+
+            if {[info exists module_conf(export_namespace_commands)] && \
+                 $module_conf(export_namespace_commands)} {
+
+                apache_log_error debug "exporting ::rivet commands"
+                eval namespace export $export_list
+
+            } else {
+                apache_log_error debug "::rivet commands won't be exported"
+            }
+        }
         ## Add the packages directory to the auto_path.
         ## If we have a packages$tcl_version directory
         ## (IE: packages8.3, packages8.4) append that as well.
@@ -88,7 +158,7 @@ namespace eval ::Rivet {
         ## Likewise we have also to add to auto_path the directory containing 
         ## this script since it holds the pkgIndex.tcl file for package Rivet. 
 
-        # set auto_path [linsert $auto_path 0 [file dirname [info script]]]
+        set auto_path [linsert $auto_path 0 [file dirname [info script]]]
 
         ## This will allow users to create proc libraries and tclIndex files
         ## in the local directory that can be autoloaded.
@@ -99,5 +169,29 @@ namespace eval ::Rivet {
 
 } ;## namespace eval ::Rivet
 
+
+## Rivet 2.1.x supports Tcl >= 8.5, therefore there's no more need for
+## the command incr0, as the functionality of creating a not yet
+## existing variable is now provided by 'incr'. Being incr0 a command
+## in Rivet < 2.1.0, before the move into the ::Rivet namespace, 
+## we alias this command only in the global namespace
+
+interp alias {} ::incr0 {} incr
+
 ## Initialize Rivet.
 ::Rivet::init
+
+## And now we get to the import of the whole ::rivet namespace. 
+## Some commands (namely lassign) replace the native lassign command
+## so we have to  use the -force switch
+
+# Do we actually want to import everything? If Rivet was configured
+# to import the ::rivet namespace for compatibility we do it right away.
+# This option is not guaranteed to be supported in future versions.
+
+if {[info exists module_conf(import_rivet_commands)] && $module_conf(import_rivet_commands)} {
+    namespace import -force ::rivet::*
+}
+
+array unset module_conf
+

Modified: tcl/rivet/trunk/rivet/rivet-tcl/cookie.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/cookie.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/cookie.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/cookie.tcl Thu Dec  8 21:57:35 2011
@@ -4,13 +4,16 @@
 ## $Id$
 ##
 
+
+namespace eval ::rivet {
+
 ## clock_to_rfc850_gmt seconds -- Convert an integer-seconds-since-1970 
 ## click value to RFC850 format, with the additional requirement that it 
 ## be GMT only.
 ##
-proc clock_to_rfc850_gmt {seconds} {
-    return [clock format $seconds -format "%a, %d-%b-%y %T GMT" -gmt 1]
-}
+    proc clock_to_rfc850_gmt {seconds} {
+        return [clock format $seconds -format "%a, %d-%b-%y %T GMT" -gmt 1]
+    }
 
 ## make_cookie_attributes paramsArray -- Build up cookie parameters.
 ##
@@ -27,37 +30,38 @@ proc clock_to_rfc850_gmt {seconds} {
 ##
 ## The resut is returned.
 ##
-proc make_cookie_attributes {paramsArray} {
-    upvar 1 $paramsArray params
 
-    set cookieParams ""
-    set expiresIn 0
+    proc make_cookie_attributes {paramsArray} {
+        upvar 1 $paramsArray params
 
-    if { [info exists params(expires)] } {
-	append cookieParams "; expires=$params(expires)"
-    } else {
-	foreach {time num} [list days 86400 hours 3600 minutes 60] {
-	    if [info exists params($time)] {
-		incr expiresIn [expr $params($time) * $num]
-	    }
-	}
-	if {$expiresIn != 0} {
-	    set secs [expr [clock seconds] + $expiresIn]
-	    append cookieParams "; expires=[clock_to_rfc850_gmt $secs]"
-	}
-    }
-    if { [info exists params(path)] } {
-        append cookieParams "; path=$params(path)"
-    }
-    if { [info exists params(domain)] } {
-        append cookieParams "; domain=$params(domain)"
-    }
-    if { [info exists params(secure)] && $params(secure) == 1} {
-        append cookieParams "; secure"
-    }
+        set cookieParams ""
+        set expiresIn 0
 
-    return $cookieParams
-}
+        if { [info exists params(expires)] } {
+            append cookieParams "; expires=$params(expires)"
+        } else {
+            foreach {time num} [list days 86400 hours 3600 minutes 60] {
+                if [info exists params($time)] {
+                    incr expiresIn [expr $params($time) * $num]
+                }
+            }
+            if {$expiresIn != 0} {
+                set secs [expr [clock seconds] + $expiresIn]
+                append cookieParams "; expires=[clock_to_rfc850_gmt $secs]"
+            }
+        }
+        if { [info exists params(path)] } {
+            append cookieParams "; path=$params(path)"
+        }
+        if { [info exists params(domain)] } {
+            append cookieParams "; domain=$params(domain)"
+        }
+        if { [info exists params(secure)] && $params(secure) == 1} {
+            append cookieParams "; secure"
+        }
+
+        return $cookieParams
+    }
 
 ## cookie [set|get] cookieName ?cookieValue? [-days expireInDays]
 ##    [-hours expireInHours] [-minutes expireInMinutes]
@@ -65,50 +69,53 @@ proc make_cookie_attributes {paramsArray
 ##    [-path uriPathCookieAppliesTo]
 ##    [-secure 1|0]
 ##
-proc cookie {cmd name args} {
-    set badchars "\[ \t;\]"
 
-    switch -- $cmd {
-	"set" {
-	    set value [lindex $args 0]
-	    set args  [lrange $args 1 end]
-	    import_keyvalue_pairs params $args
-
-	    if {[regexp $badchars $name]} {
-		return -code error \
-		    "name may not contain semicolons, spaces, or tabs"
-	    }
-	    if {[regexp $badchars $value]} {
-		return -code error \
-		    "value may not contain semicolons, spaces, or tabs"
-	    }
-
-	    set cookieKey "Set-Cookie"
-	    set cookieValue "$name=$value"
-
-	    append cookieValue [make_cookie_attributes params]
-
-	    headers add $cookieKey $cookieValue
-	}
-
-	"get" {
-	    ::request::global RivetCookies
-
-	    if {![array exists RivetCookies]} { load_cookies RivetCookies }
-	    if {![info exists RivetCookies($name)]} { return }
-	    return $RivetCookies($name)
-	}
-
-	"delete" {
-	    ## In order to delete a cookie, we just need to set a cookie
-	    ## with a time that has already expired.
-	    cookie set $name "" -minutes -1
-	}
-	"unset" {
-	    ::request::global RivetCookies
-	    if {![array exists RivetCookies]} { load_cookies RivetCookies }
-	    if {![info exists RivetCookies($name)]} { return }
-	    unset RivetCookies($name)
-	}
+    proc cookie {cmd name args} {
+        set badchars "\[ \t;\]"
+
+        switch -- $cmd {
+        "set" {
+            set value [lindex $args 0]
+            set args  [lrange $args 1 end]
+            import_keyvalue_pairs params $args
+
+            if {[regexp $badchars $name]} {
+            return -code error \
+                "name may not contain semicolons, spaces, or tabs"
+            }
+            if {[regexp $badchars $value]} {
+            return -code error \
+                "value may not contain semicolons, spaces, or tabs"
+            }
+
+            set cookieKey "Set-Cookie"
+            set cookieValue "$name=$value"
+
+            append cookieValue [make_cookie_attributes params]
+
+            headers add $cookieKey $cookieValue
+        }
+
+        "get" {
+            ::request::global RivetCookies
+
+            if {![array exists RivetCookies]} { load_cookies RivetCookies }
+            if {![info exists RivetCookies($name)]} { return }
+            return $RivetCookies($name)
+        }
+
+        "delete" {
+            ## In order to delete a cookie, we just need to set a cookie
+            ## with a time that has already expired.
+            cookie set $name "" -minutes -1
+        }
+        "unset" {
+            ::request::global RivetCookies
+            if {![array exists RivetCookies]} { load_cookies RivetCookies }
+            if {![info exists RivetCookies($name)]} { return }
+            unset RivetCookies($name)
+        }
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/debug.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/debug.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/debug.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/debug.tcl Thu Dec  8 21:57:35 2011
@@ -11,6 +11,7 @@
 ##    it at the global level.
 ##
 ##    Options:
+##
 ##	-subst <on|off> - Each word should be considered a variable and subst'd.
 ##	-separator <string> - A text string that goes between each variable.
 ##	-ip <ip address> - A list of IP addresses to display to.
@@ -19,70 +20,73 @@
 ##
 ###
 
-proc debug {args} {
-    ## If they've turned off debugging, we don't do anything.
-    if {[info exists ::RivetUserConf(Debug)] && !$::RivetUserConf(Debug)} {
-	return
-    }
-
-    ## We want to save the REMOTE_ADDR for any subsequent calls to debug.
-    if {![info exists ::RivetUserConf(REMOTE_ADDR)]} {
-	set REMOTE_ADDR [env REMOTE_ADDR]
-	set ::RivetUserConf(REMOTE_ADDR) $REMOTE_ADDR
-    }
-
-
-    ## Set some defaults for the options.
-    set data(subst) 0
-    set data(separator) <br>
-
-    ## Check RivetUserConf for globally set options.
-    if {[info exists ::RivetUserConf(DebugIp)]} {
-	set data(ip) $::RivetUserConf(DebugIp)
-    }
-    if {[info exists ::RivetUserConf(DebugSubst)]} {
-	set data(subst) $::RivetUserConf(DebugSubst)
-    }
-    if {[info exists ::RivetUserConf(DebugSeparator)]} {
-	set data(separator) $::RivetUserConf(DebugSeparator)
-    }
-
-    import_keyvalue_pairs data $args
-
-    if {[info exists data(ip)]} {
-	set can_see 0
-	foreach ip $data(ip) {
-	    if {[string match $data(ip)* $::RivetUserConf(REMOTE_ADDR)]} {
-		set can_see 1
-		break
-	    }
-	}
-	if {!$can_see} { return }
-    }
-
-    if {[string tolower $data(subst)] != "on"} {
-	html [join $data(args)]
-	return
-    }
+namespace eval ::rivet {
 
-    set lastWasArray 0
-    foreach varName $data(args) {
-	upvar $varName var
-	if {[array exists var]} {
-	    parray $varName
-	    set lastWasArray 1
-	} elseif {[info exists var]} {
-	    if {!$lastWasArray} {
-		html $data(separator)
-	    }
-	    html $var
-	    set lastWasArray 0
-	} else {
-	    if {!$lastWasArray} {
-		html $data(separator)
-	    }
-	    html $varName
-	    set lastWasArray 0
-	}
+    proc debug {args} {
+        ## If they've turned off debugging, we don't do anything.
+        if {[info exists ::RivetUserConf(Debug)] && !$::RivetUserConf(Debug)} {
+            return
+        }
+
+        ## We want to save the REMOTE_ADDR for any subsequent calls to debug.
+        if {![info exists ::RivetUserConf(REMOTE_ADDR)]} {
+            set REMOTE_ADDR [env REMOTE_ADDR]
+            set ::RivetUserConf(REMOTE_ADDR) $REMOTE_ADDR
+        }
+
+
+        ## Set some defaults for the options.
+        set data(subst) 0
+        set data(separator) <br>
+
+        ## Check RivetUserConf for globally set options.
+        if {[info exists ::RivetUserConf(DebugIp)]} {
+            set data(ip) $::RivetUserConf(DebugIp)
+        }
+        if {[info exists ::RivetUserConf(DebugSubst)]} {
+            set data(subst) $::RivetUserConf(DebugSubst)
+        }
+        if {[info exists ::RivetUserConf(DebugSeparator)]} {
+            set data(separator) $::RivetUserConf(DebugSeparator)
+        }
+
+        import_keyvalue_pairs data $args
+
+        if {[info exists data(ip)]} {
+            set can_see 0
+            foreach ip $data(ip) {
+                if {[string match $data(ip)* $::RivetUserConf(REMOTE_ADDR)]} {
+                    set can_see 1
+                    break
+                }
+            }
+            if {!$can_see} { return }
+        }
+
+        if {[string tolower $data(subst)] != "on"} {
+            ::rivet::html [join $data(args)]
+            return
+        }
+
+        set lastWasArray 0
+        foreach varName $data(args) {
+            upvar $varName var
+            if {[array exists var]} {
+                parray $varName
+                set lastWasArray 1
+            } elseif {[info exists var]} {
+                if {!$lastWasArray} {
+                    ::rivet::html $data(separator)
+                }
+                ::rivet::html $var
+                set lastWasArray 0
+            } else {
+                if {!$lastWasArray} {
+                    ::rivet::html $data(separator)
+                }
+                ::rivet::html $varName
+                set lastWasArray 0
+            }
+        }
     }
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/html.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/html.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/html.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/html.tcl Thu Dec  8 21:57:35 2011
@@ -14,11 +14,15 @@
 ##
 ###
 
-proc html {string args} {
-    foreach arg $args { append output <$arg> }
-    append output $string
-    for {set i [expr [llength $args] - 1]} {$i >= 0} {incr i -1} {
-	append output </[lindex [lindex $args $i] 0]>
+namespace eval ::rivet {
+
+    proc html {string args} {
+        foreach arg $args { append output <$arg> }
+        append output $string
+        for {set i [expr [llength $args] - 1]} {$i >= 0} {incr i -1} {
+            append output </[lindex [lindex $args $i] 0]>
+        }
+        puts $output
     }
-    puts $output
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/import_keyvalue_pairs.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/import_keyvalue_pairs.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/import_keyvalue_pairs.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/import_keyvalue_pairs.tcl Thu Dec  8 21:57:35 2011
@@ -10,43 +10,48 @@
 ## $Id$
 ##
 ###
-proc import_keyvalue_pairs {arrayName argsList} {
-    upvar 1 $arrayName data
 
-    # if the first character of the arg list isn't a dash, put the whole
-    # body in the args element of the array, and we're done
+namespace eval ::rivet {
 
-    if {[string index $argsList 0] != "-"} {
-	set data(args) $argsList
-	return
-    }
+    proc import_keyvalue_pairs {arrayName argsList} {
+        upvar 1 $arrayName data
+
+        # if the first character of the arg list isn't a dash, put the whole
+        # body in the args element of the array, and we're done
 
-    set index 0
-    set looking 0
-    set data(args) ""
-
-    foreach arg $argsList {
-	if {$looking} {
-	    set data($varName) $arg
-	    set looking 0
-	} elseif {[string index $arg 0] == "-"} {
-
-	    if {$arg == "--"} {
-		# "--" appears as an argument, store the reset of the arg list
-		# in the args element of the array
-		set data(args) [lrange $argsList [expr $index + 1] end]
-		break
-	    }
-
-	    if {$arg == "-args"} {
-		return -code error "-args is a reserved value."
-	    }
-	    set varName [string range $arg 1 end]
-	    set looking 1
-	} else {
-	    set data(args) [lrange $argsList $index end]
-	    break
-	}
-	incr index
+        if {[string index $argsList 0] != "-"} {
+            set data(args) $argsList
+            return
+        }
+
+        set index 0
+        set looking 0
+        set data(args) ""
+
+        foreach arg $argsList {
+            if {$looking} {
+                set data($varName) $arg
+                set looking 0
+            } elseif {[string index $arg 0] == "-"} {
+
+                if {$arg == "--"} {
+                # "--" appears as an argument, store the rest of the arg list
+                # in the args element of the array
+                    set data(args) [lrange $argsList [expr $index + 1] end]
+                    break
+                }
+
+                if {$arg == "-args"} {
+                    return -code error "-args is a reserved value."
+                }
+                set varName [string range $arg 1 end]
+                set looking 1
+            } else {
+                set data(args) [lrange $argsList $index end]
+                break
+            }
+            incr index
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/import_switch_args.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/import_switch_args.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/import_switch_args.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/import_switch_args.tcl Thu Dec  8 21:57:35 2011
@@ -8,29 +8,35 @@
 ## $Id$
 ##
 ###
-proc import_switch_args {arrayName argsList {switchList ""}} {
-    upvar 1 $arrayName array
-    set index 0
-    set array(args) ""
-    set array(switches) ""
-    if {[llength $switchList] > 0} {
-	set proofSwitches 1
-    } else {
-	set proofSwitches 0
-    }
-    foreach arg $argsList {
-	if {[string index $args 0] != "-"} {
-            set array(args) [lrange $argsList $index end]
-            break
-        } elseif {$arg == "--"} {
-	    set array(args) [lrange $argsList [expr $index + 1] end]
-	    break
-	}
-        set switch [string range $arg 1 end]
-	if {!$proofSwitches || [lsearch -exact $switchList $switch] >= 0} {
-            set array($switch) $index
-	    lappend array(switches) $switch
-	}
-        incr index
+
+namespace eval ::rivet {
+
+    proc import_switch_args {arrayName argsList {switchList ""}} {
+        upvar 1 $arrayName array
+        set index 0
+        set array(args) ""
+        set array(switches) ""
+        if {[llength $switchList] > 0} {
+            set proofSwitches 1
+        } else {
+            set proofSwitches 0
+        }
+
+        foreach arg $argsList {
+            if {[string index $arg 0] != "-"} {
+                set array(args) [lrange $argsList $index end]
+                break
+            } elseif {$arg == "--"} {
+                set array(args) [lrange $argsList [expr $index + 1] end]
+                break
+            }
+
+            set switch [string range $arg 1 end]
+            if {!$proofSwitches || [lsearch -exact $switchList $switch] >= 0} {
+                set array($switch) $index
+                lappend array(switches) $switch
+            }
+            incr index
+        }
     }
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/lassign.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/lassign.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/lassign.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/lassign.tcl Thu Dec  8 21:57:35 2011
@@ -8,9 +8,13 @@
 ##
 ###
 
-proc lassign {list args} {
-    foreach elem $list varName $args {
-	upvar 1 $varName var
-	set var $elem
+namespace eval ::rivet {
+
+    proc lassign {list args} {
+        foreach elem $list varName $args {
+            upvar 1 $varName var
+            set var $elem
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/lempty.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/lempty.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/lempty.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/lempty.tcl Thu Dec  8 21:57:35 2011
@@ -8,7 +8,11 @@
 ##
 ###
 
-proc lempty {list} {
-    if {[catch {llength $list} len]} { return 0 }
-    return [expr $len == 0]
+namespace eval ::rivet {
+
+    proc lempty {list} {
+        if {[catch {llength $list} len]} { return 0 }
+        return [expr $len == 0]
+    }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/lmatch.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/lmatch.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/lmatch.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/lmatch.tcl Thu Dec  8 21:57:35 2011
@@ -13,38 +13,40 @@
 ##
 ###
 
-proc lmatch {args} {
-    set modes(-exact)  0
-    set modes(-glob)   1
-    set modes(-regexp) 2
+namespace eval ::rivet {
+    proc lmatch {args} {
+        set modes(-exact)  0
+        set modes(-glob)   1
+        set modes(-regexp) 2
 
-    if {[llength $args] == 3} {
-	lassign $args mode list pattern
-    } elseif {[llength $args] == 2} {
-	set mode -glob
-	lassign $args list pattern
-    } else {
-        return -code error \
-	    {wrong # args: should be "lmatch ?mode? list pattern"}
-    }
+        if {[llength $args] == 3} {
+            lassign $args mode list pattern
+        } elseif {[llength $args] == 2} {
+            set mode -glob
+            lassign $args list pattern
+        } else {
+            return -code error \
+                {wrong # args: should be "lmatch ?mode? list pattern"}
+        }
 
-    if {![info exists modes($mode)]} {
-	return -code error \
-	    "bad search mode \"$mode\": must be -exact, -glob, or -regexp"
-    }
-    set mode $modes($mode)
+        if {![info exists modes($mode)]} {
+            return -code error \
+                "bad search mode \"$mode\": must be -exact, -glob, or -regexp"
+        }
+        set mode $modes($mode)
 
-    set return {}
-    foreach elem $list {
-	if {$mode == 0} {
-	    if {[string compare $elem $pattern] == 0} { lappend return $elem }
-	}
-	if {$mode == 1} {
-	    if {[string match $pattern $elem]} { lappend return $elem }
-	}
-	if {$mode == 2} {
-	    if {[regexp $pattern $elem]} { lappend return $elem }
-	}
+        set return {}
+        foreach elem $list {
+            if {$mode == 0} {
+                if {[string compare $elem $pattern] == 0} { lappend return $elem }
+            }
+            if {$mode == 1} {
+                if {[string match $pattern $elem]} { lappend return $elem }
+            }
+            if {$mode == 2} {
+                if {[regexp $pattern $elem]} { lappend return $elem }
+            }
+        }
+        return $return
     }
-    return $return
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/load_cookies.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/load_cookies.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/load_cookies.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/load_cookies.tcl Thu Dec  8 21:57:35 2011
@@ -7,15 +7,20 @@
 ## $Id$
 ##
 ###
-proc load_cookies {{arrayName cookies}} {
-    upvar 1 $arrayName cookies
 
-    set HTTP_COOKIE [env HTTP_COOKIE]
+namespace eval ::rivet {
 
-    foreach pair [split $HTTP_COOKIE ";"] {
-	set pair [split [string trim $pair] "="]
-	set key [lindex $pair 0]
-	set value [lindex $pair 1]
-	set cookies($key) [list $value]
+    proc load_cookies {{arrayName cookies}} {
+        upvar 1 $arrayName cookies
+
+        set HTTP_COOKIE [env HTTP_COOKIE]
+
+        foreach pair [split $HTTP_COOKIE ";"] {
+            set pair [split [string trim $pair] "="]
+            set key [lindex $pair 0]
+            set value [lindex $pair 1]
+            set cookies($key) [list $value]
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/load_response.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/load_response.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/load_response.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/load_response.tcl Thu Dec  8 21:57:35 2011
@@ -9,20 +9,24 @@
 ##
 ###
 
-proc load_response {{arrayName response}} {
-    upvar 1 $arrayName response
+namespace eval ::rivet {
 
-    foreach {var elem} [var all] {
-	if {[info exists response(__$var)]} {
-		# we have seen var multiple times already, add to the list
-		lappend response($var) $elem
-	} elseif {[info exists response($var)]} {
-		# second occurence of var,  convert response(var) list:
-		set response($var) [list $response($var) $elem]
-		set response(__$var) ""
-	} else {
-		# first time seeing this var
-		set response($var) $elem
-	}
+    proc load_response {{arrayName response}} {
+        upvar 1 $arrayName response
+
+        foreach {var elem} [::rivet::var all] {
+            if {[info exists response(__$var)]} {
+                # we have seen var multiple times already, add to the list
+                lappend response($var) $elem
+            } elseif {[info exists response($var)]} {
+                # second occurence of var,  convert response(var) list:
+                set response($var) [list $response($var) $elem]
+                set response(__$var) ""
+            } else {
+                # first time seeing this var
+                set response($var) $elem
+            }
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/parray.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/parray.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/parray.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/parray.tcl Thu Dec  8 21:57:35 2011
@@ -11,22 +11,27 @@
 ##
 ###
 
-proc parray {arrayName {pattern *}} {
-    upvar 1 $arrayName array
-    if {![array exists array]} {
-        return -code error "\"$arrayName\" isn't an array"
-    }
-    set maxl 0
-    foreach name [lsort [array names array $pattern]] {
-        if {[string length $name] > $maxl} {
-            set maxl [string length $name]
+namespace eval ::rivet {
+
+    proc parray {arrayName {pattern *}} {
+        upvar 1 $arrayName array
+        if {![array exists array]} {
+            return -code error "\"$arrayName\" isn't an array"
         }
+        set maxl 0
+        foreach name [lsort [array names array $pattern]] {
+            if {[string length $name] > $maxl} {
+                set maxl [string length $name]
+            }
+        }
+        puts stdout "<PRE><B>$arrayName</B>"
+        set maxl [expr {$maxl + [string length $arrayName] + 2}]
+        foreach name [lsort [array names array $pattern]] {
+            set nameString [format %s(%s) $arrayName $name]
+            puts stdout [format "%-*s = %s" $maxl $nameString $array($name)]
+        }
+        puts stdout "</PRE>"
     }
-    puts stdout "<PRE><B>$arrayName</B>"
-    set maxl [expr {$maxl + [string length $arrayName] + 2}]
-    foreach name [lsort [array names array $pattern]] {
-        set nameString [format %s(%s) $arrayName $name]
-        puts stdout [format "%-*s = %s" $maxl $nameString $array($name)]
-    }
-    puts stdout "</PRE>"
+
+    namespace export parray
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/random.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/random.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/random.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/random.tcl Thu Dec  8 21:57:35 2011
@@ -12,18 +12,23 @@
 ## $Id$
 ##
 ###
-proc random {args} {
-    global _ran
 
-    if {[llength $args] > 1} {
-	set _ran [lindex $args 1]
-    } else {
-	set period 233280
-	if {[info exists _ran]} {
-	    set _ran [expr { ($_ran*9301 + 49297) % $period }]
-	} else {
-	    set _ran [expr { [clock seconds] % $period } ]
-	}
-	return [expr { int($args*($_ran/double($period))) } ]
+namespace eval ::rivet {
+
+    proc random {args} {
+        global _ran
+
+        if {[llength $args] > 1} {
+            set _ran [lindex $args 1]
+        } else {
+            set period 233280
+            if {[info exists _ran]} {
+                set _ran [expr { ($_ran*9301 + 49297) % $period }]
+            } else {
+                set _ran [expr { [clock seconds] % $period } ]
+            }
+            return [expr { int($args*($_ran/double($period))) } ]
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/read_file.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/read_file.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/read_file.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/read_file.tcl Thu Dec  8 21:57:35 2011
@@ -8,9 +8,13 @@
 ##
 ###
 
-proc read_file {file} {
-    set fp [open $file]
-    set x [read $fp]
-    close $fp
-    return $x
+namespace eval ::rivet {
+
+    proc read_file {file} {
+        set fp [open $file]
+        set x [read $fp]
+        close $fp
+        return $x
+    }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/rivet_command_document.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/rivet_command_document.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/rivet_command_document.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/rivet_command_document.tcl Thu Dec  8 21:57:35 2011
@@ -9,44 +9,48 @@
 ## $Id$
 ##
 ###
-proc rivet_command_document {list} {
-    array set info $list
+namespace eval ::rivet {
 
-    puts "<HEAD>"
-    puts "<TITLE>$info(name) Documentation</TITLE>"
-    puts "</HEAD>"
-    puts "<BODY BGCOLOR=WHITE VLINK=blue>"
-
-    puts "<CENTER>"
-    puts {<FONT SIZE="+3">}
-    puts "$info(name) - $info(package)"
-    puts "</FONT>"
-    puts "<BR>"
-    puts "<B>"
-    puts {<A HREF="#synopsis">Synopsis</A>}
-    puts " * "
-    puts {<A HREF="#description">Description</A>}
-    if {[info exists info(seealso)]} {
-	puts " * "
-	puts {<A HREF="#seealso">See Also</A>}
-    }
-    puts "</B>"
-    puts "</CENTER>"
-
-    puts {<H3><A NAME="name" HREF="#name">Name</A></H3>}
-    puts "<B>$info(name) - $info(short)</B>"
-
-    if {![info exists info(command)]} { set info(command) $info(name) }
+    proc rivet_command_document {list} {
+        array set info $list
 
-    puts {<H3><A NAME="synopsis" HREF="#synopsis">Synopsis</A></H3>}
-    puts "$info(command)"
-    if {[info exists info(arguments)]} { puts "<I>$info(arguments)</I>" }
-
-    puts {<H3><A NAME="description" HREF="#description">Description</A></H3>}
-    puts $info(description)
-
-    if {[info exists info(seealso)]} {
-	puts {<H3><A NAME="seealso" HREF="#seealso">See Also</A></H3>}
-	puts $info(seealso)
+        puts "<HEAD>"
+        puts "<TITLE>$info(name) Documentation</TITLE>"
+        puts "</HEAD>"
+        puts "<BODY BGCOLOR=WHITE VLINK=blue>"
+
+        puts "<CENTER>"
+        puts {<FONT SIZE="+3">}
+        puts "$info(name) - $info(package)"
+        puts "</FONT>"
+        puts "<BR>"
+        puts "<B>"
+        puts {<A HREF="#synopsis">Synopsis</A>}
+        puts " * "
+        puts {<A HREF="#description">Description</A>}
+        if {[info exists info(seealso)]} {
+            puts " * "
+            puts {<A HREF="#seealso">See Also</A>}
+        }
+        puts "</B>"
+        puts "</CENTER>"
+
+        puts {<H3><A NAME="name" HREF="#name">Name</A></H3>}
+        puts "<B>$info(name) - $info(short)</B>"
+
+        if {![info exists info(command)]} { set info(command) $info(name) }
+
+        puts {<H3><A NAME="synopsis" HREF="#synopsis">Synopsis</A></H3>}
+        puts "$info(command)"
+        if {[info exists info(arguments)]} { puts "<I>$info(arguments)</I>" }
+
+        puts {<H3><A NAME="description" HREF="#description">Description</A></H3>}
+        puts $info(description)
+
+        if {[info exists info(seealso)]} {
+            puts {<H3><A NAME="seealso" HREF="#seealso">See Also</A></H3>}
+            puts $info(seealso)
+        }
     }
+
 }

Modified: tcl/rivet/trunk/rivet/rivet-tcl/tclIndex
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/tclIndex?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/tclIndex (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/tclIndex Thu Dec  8 21:57:35 2011
@@ -6,20 +6,22 @@
 # element name is the name of a command and the value is
 # a script that loads the command.
 
-set auto_index(debug) [list source [file join $dir debug.tcl]]
-set auto_index(lassign) [list source [file join $dir lassign.tcl]]
-set auto_index(html) [list source [file join $dir html.tcl]]
-set auto_index(incr0) [list source [file join $dir incr0.tcl]]
-set auto_index(load_response) [list source [file join $dir load_response.tcl]]
-set auto_index(parray) [list source [file join $dir parray.tcl]]
-set auto_index(read_file) [list source [file join $dir read_file.tcl]]
-set auto_index(wrap) [list source [file join $dir wrap.tcl]]
-set auto_index(wrapline) [list source [file join $dir wrap.tcl]]
-set auto_index(lempty) [list source [file join $dir lempty.tcl]]
-set auto_index(load_cookies) [list source [file join $dir load_cookies.tcl]]
-set auto_index(clock_to_rfc850_gmt) [list source [file join $dir cookie.tcl]]
-set auto_index(make_cookie_attributes) [list source [file join $dir cookie.tcl]]
-set auto_index(cookie) [list source [file join $dir cookie.tcl]]
-set auto_index(import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]]
-set auto_index(import_switch_args) [list source [file join $dir import_switch_args.tcl]]
-set auto_index(rivet_command_document) [list source [file join $dir rivet_command_document.tcl]]
+set auto_index(::rivet::html) [list source [file join $dir html.tcl]]
+set auto_index(::rivet::lassign) [list source [file join $dir lassign.tcl]]
+set auto_index(::rivet::random) [list source [file join $dir random.tcl]]
+set auto_index(::rivet::rivet_command_document) [list source [file join $dir rivet_command_document.tcl]]
+set auto_index(::rivet::load_response) [list source [file join $dir load_response.tcl]]
+set auto_index(::rivet::debug) [list source [file join $dir debug.tcl]]
+set auto_index(::rivet::clock_to_rfc850_gmt) [list source [file join $dir cookie.tcl]]
+set auto_index(::rivet::make_cookie_attributes) [list source [file join $dir cookie.tcl]]
+set auto_index(::rivet::cookie) [list source [file join $dir cookie.tcl]]
+set auto_index(::rivet::lempty) [list source [file join $dir lempty.tcl]]
+set auto_index(::rivet::import_switch_args) [list source [file join $dir import_switch_args.tcl]]
+set auto_index(::rivet::lmatch) [list source [file join $dir lmatch.tcl]]
+set auto_index(::rivet::read_file) [list source [file join $dir read_file.tcl]]
+set auto_index(::rivet::import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]]
+set auto_index(::rivet::parray) [list source [file join $dir parray.tcl]]
+set auto_index(::rivet::tablearray) [list source [file join $dir tablearray.tcl]]
+set auto_index(::rivet::wrap) [list source [file join $dir wrap.tcl]]
+set auto_index(::rivet::wrapline) [list source [file join $dir wrap.tcl]]
+set auto_index(::rivet::load_cookies) [list source [file join $dir load_cookies.tcl]]

Modified: tcl/rivet/trunk/rivet/rivet-tcl/wrap.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/wrap.tcl?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/wrap.tcl (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/wrap.tcl Thu Dec  8 21:57:35 2011
@@ -10,17 +10,19 @@
 ##
 ###
 
-proc wrap {string maxlen {html ""}} {
-    set splitstring {}
-    foreach line [split $string "\n"] {
-	lappend splitstring [wrapline $line $maxlen $html]
-    }
-    if {$html == "-html"} {
-	return [join $splitstring "<br>"]
-    } else {
-	return [join $splitstring "\n"]
+namespace eval ::rivet {
+
+    proc wrap {string maxlen {html ""}} {
+        set splitstring {}
+        foreach line [split $string "\n"] {
+            lappend splitstring [wrapline $line $maxlen $html]
+        }
+        if {$html == "-html"} {
+            return [join $splitstring "<br>"]
+        } else {
+            return [join $splitstring "\n"]
+        }
     }
-}
 
 ##
 ## wrapline -- Given a line and a maximum length and option "-html"
@@ -31,20 +33,22 @@ proc wrap {string maxlen {html ""}} {
 ## the lines separated by html <br> line breaks, otherwise the lines
 ## are returned separated by newline characters.
 ##
-proc wrapline {line maxlen {html ""}} {
-    set string [split $line " "]
-    set newline [list [lindex $string 0]]
-    foreach word [lrange $string 1 end] {
-	if {[string length $newline]+[string length $word] > $maxlen} {
-	    lappend lines [join $newline " "]
-	    set newline {}
-	}
-	lappend newline $word
-    }
-    lappend lines [join $newline " "]
-    if {$html == "-html"} {
-	return [join $lines <br>]
-    } else {
-	return [join $lines "\n"]
+    proc wrapline {line maxlen {html ""}} {
+        set string [split $line " "]
+        set newline [list [lindex $string 0]]
+        foreach word [lrange $string 1 end] {
+            if {[string length $newline]+[string length $word] > $maxlen} {
+                lappend lines [join $newline " "]
+                set newline {}
+            }
+            lappend newline $word
+        }
+        lappend lines [join $newline " "]
+        if {$html == "-html"} {
+            return [join $lines <br>]
+        } else {
+            return [join $lines "\n"]
+        }
     }
+
 }

Modified: tcl/rivet/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/Makefile.am?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/src/Makefile.am (original)
+++ tcl/rivet/trunk/src/Makefile.am Thu Dec  8 21:57:35 2011
@@ -26,7 +26,7 @@ INCLUDES = -I@apache_include@ 
 # ... and these two.  We want to put the libs in the package path,
 # rather than the standard library location for the system.
 lib_libexecdir = @RIVET_TCL_TARGET@
-lib_libexec_LTLIBRARIES = librivet.la librivetparser.la
+lib_libexec_LTLIBRARIES = librivetlib.la librivetparser.la
 
 #
 # Apache Rivet Module, mod_rivet.so / mod_rivet.dll
@@ -50,19 +50,19 @@ lib_libexec_LTLIBRARIES = librivet.la li
 #
 # Rivet Library
 #
-librivet_la_SOURCES = rivetList.c rivetCrypt.c rivetWWW.c rivetPkgInit.c
-librivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
-librivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
-librivet_la_CPPFLAGS = @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
+librivetlib_la_SOURCES = rivetList.c rivetCrypt.c rivetWWW.c rivetPkgInit.c
+librivetlib_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
+librivetlib_la_LIBADD =  @APXS_LIBS@
+librivetlib_la_CPPFLAGS = @MOD_RIVET_INCLUDES@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"' -DUSE_TCL_STUBS=1
 
 #
 # Rivet Parser Library
 #
 librivetparser_la_SOURCES = rivetParser.c parserPkgInit.c
-librivetparser_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version
-librivetparser_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
-librivetparser_la_CPPFLAGS = @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
-
+librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version
+librivetparser_la_LIBADD = @APXS_LIBS@
+librivetparser_la_CPPFLAGS = @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"' -DUSE_TCL_STUBS=1
+ 
 SUBDIRS = @apache_version_dir@
 
 # Removing libtool .la files from installation

Modified: tcl/rivet/trunk/src/apache-2/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/Makefile.am?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/Makefile.am (original)
+++ tcl/rivet/trunk/src/apache-2/Makefile.am Thu Dec  8 21:57:35 2011
@@ -31,14 +31,14 @@ INCLUDES = -I@apache_include@ -I@RIVET_B
 #
 # Apache Rivet Module, mod_rivet.so / mod_rivet.dll
 #
-mod_rivet_la_SOURCES = 			\
-	apache_multipart_buffer.c 	\
-	apache_request.c			\
-	mod_rivet.c 				\
-	TclWebapache.c 				\
-	rivetCore.c					\
-	../rivetChannel.c 			\
-	../rivetParser.c
+mod_rivet_la_SOURCES = 			        \
+	        apache_multipart_buffer.c 	\
+	        apache_request.c			\
+	        mod_rivet.c 				\
+	        TclWebapache.c 				\
+	        rivetCore.c					\
+	        ../rivetChannel.c 			\
+            ../rivetParser.c
 
 ##mod_rivet_la_SOURCES = mod_rivet.c mod_rivet.h
 

Modified: tcl/rivet/trunk/src/apache-2/apache_request.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/apache_request.c?rev=1212149&r1=1212148&r2=1212149&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/apache_request.c (original)
+++ tcl/rivet/trunk/src/apache-2/apache_request.c Thu Dec  8 21:57:35 2011
@@ -46,11 +46,8 @@ util_read(ApacheRequest *req, const char
         long length = r->remaining;
 
         if (length > req->post_max && req->post_max > 0) {
-            //TODO: fix logging apr_log_rerror
-            //ap_log_error(REQ_ERROR, "[libapreq] entity too large (%d, max=%d)",
-            //        (int)length, req->post_max);
-            //apr_log_rerror(REQ_ERROR, "[libapreq] entity too large (%d, max=%d)",
-            //        (int)length, req->post_max);
+            ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)",
+					(int)length, req->post_max);
             return HTTP_REQUEST_ENTITY_TOO_LARGE;
         }
 
@@ -391,7 +388,6 @@ int ApacheRequest___parse(ApacheRequest 
         } else if (ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) {
             result = ApacheRequest_parse_multipart(req,ct);
         } else {
-            //TODO: fix logging apr_log_rerror
             ap_log_rerror(REQ_ERROR, "unknown content-type: `%s'", ct);
             result = HTTP_INTERNAL_SERVER_ERROR;
         }
@@ -493,14 +489,14 @@ apr_file_t *ApacheRequest_tmpfile(Apache
 int
 ApacheRequest_parse_multipart(ApacheRequest *req,const char* ct)
 {
-    request_rec *r = req->r;
-    int rc = OK;
-    long length;
-    char *boundary;
-    multipart_buffer *mbuff;
-    ApacheUpload *upload = NULL;
-    apr_status_t  status;
-    char error[1024];
+    request_rec 	*r = req->r;
+    int 		rc = OK;
+    long 		length;
+    char 		*boundary;
+    multipart_buffer 	*mbuff;
+    ApacheUpload 	*upload = NULL;
+    apr_status_t  	status;
+    char 		error[1024];
 
     if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
         return rc;
@@ -511,9 +507,8 @@ ApacheRequest_parse_multipart(ApacheRequ
     }
 
     if ((length = r->remaining) > req->post_max && req->post_max > 0) {
-        //TODO: fix logging apr_log_rerror
-        //apr_log_rerror(REQ_ERROR, "entity too large (%d, max=%d)",
-        //        (int)length, req->post_max);
+        ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)",
+				(int)length,req->post_max);
         return HTTP_REQUEST_ENTITY_TOO_LARGE;
     }
 
@@ -542,7 +537,7 @@ ApacheRequest_parse_multipart(ApacheRequ
 
         if (!header) {
 #ifdef DEBUG
-            apr_log_rerror(REQ_ERROR,"Silently dropping remaining '%ld' bytes", r->remaining);
+            ap_log_rerror(REQ_ERROR,"Silently dropping remaining '%ld' bytes", r->remaining);
 #endif
 	    do { } while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 );
             	
@@ -576,8 +571,9 @@ ApacheRequest_parse_multipart(ApacheRequ
             if (!param) continue; /* shouldn't happen, but just in case. */
 
             if (req->disable_uploads) {
-                //TODO: fix logging apr_log_rerror
-                //apr_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden");
+#if DEBUG
+                ap_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden");
+#endif
                 return HTTP_FORBIDDEN;
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org