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 da...@apache.org on 2002/08/04 04:44:37 UTC

cvs commit: tcl-rivet/src/buildscripts parsetclConfig.tcl

davidw      2002/08/03 19:44:37

  Modified:    .        ChangeLog INSTALL TODO
               doc      rivet.xml rivet.xsl
               src      make.tcl mod_rivet.c mod_rivet.h
               src/buildscripts parsetclConfig.tcl
  Removed:     doc      TODO commands.html directives.html
                        documentation.html install.html nav.html other.html
                        top.html
  Log:
  * src/mod_rivet.c (Rivet_AppendToScript): Changed before, after, and
    error scripts back to plain old ascii, in order to plug a memory
    leak.
  
  * src/mod_rivet.h: New macro: FILEDEBUGINFO off by default.  Useful
    for debugging the order of functions called.
  
  As well as doc updates.
  
  Revision  Changes    Path
  1.63      +18 -0     tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- ChangeLog	19 Jul 2002 22:36:19 -0000	1.62
  +++ ChangeLog	4 Aug 2002 02:44:36 -0000	1.63
  @@ -1,3 +1,21 @@
  +2002-08-03  David N. Welton  <da...@dedasys.com>
  +
  +	* src/mod_rivet.c (Rivet_AppendToScript): Changed before, after,
  +	and error scripts back to plain old ascii, in order to plug a
  +	memory leak.
  +
  +	* src/mod_rivet.h: New macro: FILEDEBUGINFO off by default.
  +	Useful for debugging the order of functions called.
  +
  +2002-07-28  David N. Welton  <da...@dedasys.com>
  +
  +	* doc/rivet.xsl: Updated rivet.xsl from Websh's xsl.
  +
  +2002-07-21  David N. Welton  <da...@dedasys.com>
  +
  +	* doc/rivet.xml: Several new sections.  We now have most of what
  +	is in the HTML documents.
  +
   2002-07-19  David N. Welton  <da...@dedasys.com>
   
   	* src/buildscripts/aardvark.tcl (aardvark::runbuildcommand):
  
  
  
  1.2       +4 -1      tcl-rivet/INSTALL
  
  Index: INSTALL
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/INSTALL,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- INSTALL	30 Sep 2001 18:56:45 -0000	1.1
  +++ INSTALL	4 Aug 2002 02:44:36 -0000	1.2
  @@ -3,4 +3,7 @@
   Rivet is built by means of a Tcl make-like script which calculates
   dependencies and runs the C compiler and linker.
   
  -doc/install.html details the Rivet installation process.
  \ No newline at end of file
  +To build mod_rivet.so, cd to the src/ directory, and run the make.tcl
  +script, then copy that to your Apache libexec/ directory.
  +
  +For more detailed instructions, see the docs/ directory.
  
  
  
  1.13      +6 -0      tcl-rivet/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/TODO,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TODO	15 Jul 2002 06:18:48 -0000	1.12
  +++ TODO	4 Aug 2002 02:44:36 -0000	1.13
  @@ -30,6 +30,12 @@
   
   * Documentation in XML.
   
  +* Script timeouts - limit time scripts can run before bailing out.
  +
  +* Safe mode?
  +
  +* Nice logo.
  +
   MAYBE
   =====
   
  
  
  
  1.3       +143 -128  tcl-rivet/doc/rivet.xml
  
  Index: rivet.xml
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/doc/rivet.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- rivet.xml	21 Jul 2002 16:30:31 -0000	1.2
  +++ rivet.xml	4 Aug 2002 02:44:36 -0000	1.3
  @@ -19,6 +19,144 @@
       </author>
     </articleinfo>
   
  +  <!--
  +  <section>
  +  <title>Introduction</title>
  +
  +  <para>
  +  Hi - thanks for having a look at Apache Rivet - we hope you like
  +  it!  If you have any questions, feel free to ask on the mailing
  +  lists, if you haven't found the answers here.  If you think that
  +  the answer should be here, don't hesitate to tell us that,
  +  either.
  +    </para>
  +  </section>
  +  -->
  +
  +  <section>
  +    <title>Apache Rivet Installation</title>
  +
  +    <procedure>
  +      <step>
  +	<title>Check Dependencies</title>
  +	<para>
  +	  To install Rivet, you will need Tcl 8.2 or greater and
  +	  Apache 1.3.xx.  It is known to run on Linux, FreeBSD,
  +	  OpenBSD, and Solaris and HPUX.  Windows NT is also possible
  +	  - please see the directions in the distribution.
  +	</para>
  +      </step>
  +      <step>
  +	<title>Get Rivet</title>
  +	<para>
  +	  Download the sources at <ulink
  +	    url="http://tcl.apache.org/Rivet/download"/>.  Currently
  +	  the only way to obtain Rivet.  In the future, we hope to
  +	  have a FreeBSD port, Debian package, RPM's, and windows
  +	  binaries.
  +	</para>
  +      </step>
  +      <step performance="optional">
  +	<title>Get and Install Apache Sources</title>
  +	<para>
  +	  If you don't have them, or if you want to build Rivet as a
  +	  static (built in) part of the Apache web server, you need
  +	  the source code to Apache, which is available from <ulink
  +	    url="http://httpd.apache.org/"/>.  Otherwise, you don't need
  +	  to perform this step.  Infact, we recommend that you build
  +	  Rivet as a shared object, and therefore, build it seperately
  +	  from Apache.
  +	</para>
  +      </step>
  +      <step>
  +	<title>Uncompress Sources</title>
  +	<para>
  +	  We will assume that you have Apache installed at this point.
  +	  You must uncompress the Rivet sources in the directory where you
  +	  wish to compile them.
  +	  <programlisting>
  +	    gunzip tcl-rivet-X.X.X.tar.gz
  +	    tar -xvf tcl-rivet-X.X.X.tar.gz
  +	  </programlisting>
  +	</para>
  +      </step>
  +      <step>
  +	<title>Building Rivet</title>
  +	<para>
  +	  Rivet uses a unique build system which we created especially
  +	  for this project.  It utilizes the information included in
  +	  Apache and Tcl regarding their configurations, in order to
  +	  compile itself via a series of Tcl scripts, which are
  +	  located in the <filename>buildscripts/</filename> directory.
  +	</para>
  +	<substeps>
  +	  <step>
  +	    <title>Edit src/make.tcl</title>
  +	    <para>
  +	      It may be necessary to edit
  +	      <filename>src/make.tcl</filename> by hand in order to
  +	      set certain options.  Try the next step first, and see
  +	      if it's successful.
  +	    </para>
  +	  </step>
  +	  <step>
  +	    <para>At this point, you are ready to run the build
  +	      system:</para>
  +	    <programlisting>
  +	      cd src/
  +	      ./make.tcl <replaceable>option</replaceable>
  +	    </programlisting>
  +	    <para>where <replaceable>option</replaceable> can be
  +	      either <option>shared</option> or
  +	      <option>static</option>.
  +	    </para>
  +	  </step>
  +	  <step>
  +	    <title>Install</title>
  +	    <para>
  +	      Now, you are ready to run the <command>./make
  +		install</command> command to install the resulting
  +	      files.  This should copy the shared object (like
  +	      <filename>mod_rivet.so</filename>, if one was
  +	      successfully created, into Apache's
  +	      <filename>libexec</filename> directory, as well as
  +	      install some support scripts and various code.
  +	    </para>
  +	  </step>
  +	</substeps>
  +      </step>
  +      <step>
  +	<title>Apache Configuration Files</title>
  +	<para>
  +	  Rivet is relatively easy to configure - we start off by
  +	  adding the module itself:
  +	</para>
  +	<programlisting>
  +	  LoadModule rivet_module <replaceable>/usr/lib/apache/1.3/mod_rivet.so</replaceable>
  +	</programlisting>
  +	<para>
  +	  This tells Apache to load the Rivet shared object, wherever
  +	  it happens to reside on your file system.  Now we have to
  +	  tell Apache what kind of files are "Rivet" files and how to
  +	  process them:
  +	</para>
  +	<programlisting>
  +	  AddType application/x-httpd-rivet .rvt
  +	  AddType application/x-rivet-tcl .tcl
  +	</programlisting>
  +	<para>
  +	  These tell Apache to process files with the
  +	  <filename>.rvt</filename> and <filename>.tcl</filename>
  +	  extensions as Rivet files.
  +	</para>
  +	<para>
  +	  For other directives that Rivet provides for Apache
  +	  configuration, please see <xref linkend="directives"/>.
  +	</para>
  +      </step>
  +    </procedure>
  +  </section>
  +
     <section id="directives">
       <title>Rivet Apache Directives</title>
       <variablelist>
  @@ -133,7 +271,7 @@
       </variablelist>
   
     </section>
  -  <section>
  +  <section id="commands">
       <title>Rivet Tcl Commands and Variables</title>
       <variablelist>
         <varlistentry>
  @@ -539,7 +677,7 @@
   
     </section>
   
  -  <section>
  +  <section id="help">
       <title>Resources - How to Get Help</title>
   
       <section>
  @@ -598,130 +736,7 @@
       </section>
     </section>
   
  -  <section>
  -    <title>Apache Rivet Installation</title>
  -
  -    <procedure>
  -      <step>
  -	<title>Check Dependencies</title>
  -	<para>
  -	  To install Rivet, you will need Tcl 8.2 or greater and
  -	  Apache 1.3.xx.  It is known to run on Linux, FreeBSD,
  -	  OpenBSD, and Solaris and HPUX.  Windows NT is also possible
  -	  - please see the directions in the distribution.
  -	</para>
  -      </step>
  -      <step>
  -	<title>Get Rivet</title>
  -	<para>
  -	  Download the sources at <ulink
  -	    url="http://tcl.apache.org/Rivet/download"/>.  Currently
  -	  the only way to obtain Rivet.  In the future, we hope to
  -	  have a FreeBSD port, Debian package, RPM's, and windows
  -	  binaries.
  -	</para>
  -      </step>
  -      <step performance="optional">
  -	<title>Get and Install Apache Sources</title>
  -	<para>
  -	  If you don't have them, or if you want to build Rivet as a
  -	  static (built in) part of the Apache web server, you need
  -	  the source code to Apache, which is available from <ulink
  -	    url="http://httpd.apache.org/"/>.  Otherwise, you don't need
  -	  to perform this step.  Infact, we recommend that you build
  -	  Rivet as a shared object, and therefore, build it seperately
  -	  from Apache.
  -	</para>
  -      </step>
  -      <step>
  -	<title>Uncompress Sources</title>
  -	<para>
  -	  We will assume that you have Apache installed at this point.
  -	  You must uncompress the Rivet sources in the directory where you
  -	  wish to compile them.
  -	  <programlisting>
  -	    gunzip tcl-rivet-X.X.X.tar.gz
  -	    tar -xvf tcl-rivet-X.X.X.tar.gz
  -	  </programlisting>
  -	</para>
  -      </step>
  -      <step>
  -	<title>Building Rivet</title>
  -	<para>
  -	  Rivet uses a unique build system which we created especially
  -	  for this project.  It utilizes the information included in
  -	  Apache and Tcl regarding their configurations, in order to
  -	  compile itself via a series of Tcl scripts, which are
  -	  located in the <filename>buildscripts/</filename> directory.
  -	</para>
  -	<substeps>
  -	  <step>
  -	    <title>Edit src/make.tcl</title>
  -	    <para>
  -	      It may be necessary to edit
  -	      <filename>src/make.tcl</filename> by hand in order to
  -	      set certain options.  Try the next step first, and see
  -	      if it's successful.
  -	    </para>
  -	  </step>
  -	  <step>
  -	    <para>At this point, you are ready to run the build
  -	      system:</para>
  -	    <programlisting>
  -	      cd src/
  -	      ./make.tcl <replaceable>option</replaceable>
  -	    </programlisting>
  -	    <para>where <replaceable>option</replaceable> can be
  -	      either <option>shared</option> or
  -	      <option>static</option>.
  -	    </para>
  -	  </step>
  -	  <step>
  -	    <title>Install</title>
  -	    <para>
  -	      Now, you are ready to run the <command>./make
  -		install</command> command to install the resulting
  -	      files.  This should copy the shared object (like
  -	      <filename>mod_rivet.so</filename>, if one was
  -	      successfully created, into Apache's
  -	      <filename>libexec</filename> directory, as well as
  -	      install some support scripts and various code.
  -	    </para>
  -	  </step>
  -	</substeps>
  -      </step>
  -      <step>
  -	<title>Apache Configuration Files</title>
  -	<para>
  -	  Rivet is relatively easy to configure - we start off by
  -	  adding the module itself:
  -	</para>
  -	<programlisting>
  -	  LoadModule rivet_module <replaceable>/usr/lib/apache/1.3/mod_rivet.so</replaceable>
  -	</programlisting>
  -	<para>
  -	  This tells Apache to load the Rivet shared object, wherever
  -	  it happens to reside on your file system.  Now we have to
  -	  tell Apache what kind of files are "Rivet" files and how to
  -	  process them:
  -	</para>
  -	<programlisting>
  -	  AddType application/x-httpd-rivet .rvt
  -	  AddType application/x-rivet-tcl .tcl
  -	</programlisting>
  -	<para>
  -	  These tell Apache to process files with the
  -	  <filename>.rvt</filename> and <filename>.tcl</filename>
  -	  extensions as Rivet files.
  -	</para>
  -	<para>
  -	  For other directives that Rivet provides for Apache
  -	  configuration, please see <xref linkend="directives"/>.
  -	</para>
  -      </step>
  -    </procedure>
  -  </section>
  -  <section>
  +  <section id="internals.html">
       <title>Rivet Internals</title>
       <para>
         This section easily falls out of date, as new code is added, old
  @@ -791,7 +806,7 @@
         </para>
       </section>
     </section>
  -  <section>
  +  <section id="upgrading">
       <title>Upgrading from mod_dtcl or NeoWebScript</title>
       <para>
         Rivet is a break from the past, in that we, the authors, have
  
  
  
  1.6       +88 -4     tcl-rivet/doc/rivet.xsl
  
  Index: rivet.xsl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/doc/rivet.xsl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- rivet.xsl	19 Jul 2002 22:15:08 -0000	1.5
  +++ rivet.xsl	4 Aug 2002 02:44:36 -0000	1.6
  @@ -28,10 +28,12 @@
     -->
   
     <xsl:import
  -    href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl"
  +    href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl"
       />
   
   
  +  <xsl:param name="use.id.as.filename" select="1"/>
  +
     <xsl:variable name="arg.choice.opt.open.str">?</xsl:variable>
     <xsl:variable name="arg.choice.opt.close.str">?</xsl:variable>
     <xsl:variable name="arg.choice.req.open.str"></xsl:variable>
  @@ -55,7 +57,38 @@
         <xsl:call-template name="anchor"/>
         <xsl:apply-templates/>
       </xsl:param>
  -    <tt><u><xsl:copy-of select="$content"/></u></tt>
  +    <tt><span style="text-decoration:underline"><xsl:copy-of
  +	  select="$content"/></span></tt>
  +  </xsl:template>
  +
  +  <xsl:template match="/article/section/title" mode="titlepage.mode"
  +    priority="2">
  +    <hr/>
  +    <xsl:call-template name="section.title"/>
  +  </xsl:template>
  +
  +  <xsl:template match="para">
  +    <xsl:variable name="p">
  +      <p style="width:90%">
  +	<xsl:if test="position() = 1 and parent::listitem">
  +	  <xsl:call-template name="anchor">
  +	    <xsl:with-param name="node" select="parent::listitem"/>
  +	  </xsl:call-template>
  +	</xsl:if>
  +	<xsl:call-template name="anchor"/>
  +	<xsl:apply-templates/>
  +      </p>
  +    </xsl:variable>
  +    <xsl:choose>
  +      <xsl:when test="$html.cleanup != 0">
  +	<xsl:call-template name="unwrap.p">
  +	  <xsl:with-param name="p" select="$p"/>
  +	</xsl:call-template>
  +      </xsl:when>
  +      <xsl:otherwise>
  +	<xsl:copy-of select="$p"/>
  +      </xsl:otherwise>
  +    </xsl:choose>
     </xsl:template>
   
     <xsl:template match="optional">
  @@ -65,7 +98,13 @@
     </xsl:template>
   
     <xsl:template match="option">
  -    <xsl:call-template name="inline.underlineseq"/>
  +    <xsl:call-template name="inline.monounderlineseq"/>
  +  </xsl:template>
  +
  +  <xsl:template match="command">
  +    <span style="font-family:monospace">
  +      <xsl:call-template name="inline.boldseq"/>
  +    </span>
     </xsl:template>
   
     <xsl:template match="cmdsynopsis">
  @@ -184,6 +223,51 @@
       </xsl:choose>
     </xsl:template>
   
  +  <xsl:template match="programlisting|screen|synopsis">
  +    <xsl:param name="suppress-numbers" select="'0'"/>
  +    <xsl:variable name="id">
  +      <xsl:call-template name="object.id"/>
  +    </xsl:variable>
   
  +    <xsl:call-template name="anchor"/>
  +
  +    <xsl:variable name="content">
  +      <xsl:choose>
  +	<xsl:when test="$suppress-numbers = '0'
  +	  and @linenumbering = 'numbered'
  +	  and $use.extensions != '0'
  +	  and $linenumbering.extension != '0'">
  +	  <xsl:variable name="rtf">
  +	    <xsl:apply-templates/>
  +	  </xsl:variable>
  +	  <pre class="{name(.)}">
  +	    <xsl:call-template name="number.rtf.lines">
  +	      <xsl:with-param name="rtf" select="$rtf"/>
  +	    </xsl:call-template>
  +	  </pre>
  +	</xsl:when>
  +	<xsl:otherwise>
  +	  <pre style="background:#bbffbb ; width:auto" class="{name(.)}">
  +	    <xsl:apply-templates/>
  +	  </pre>
  +	</xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:variable>
  +
  +    <xsl:choose>
  +      <xsl:when test="$shade.verbatim != 0">
  +	<table xsl:use-attribute-sets="shade.verbatim.style">
  +	  <tr>
  +	    <td>
  +	      <xsl:copy-of select="$content"/>
  +	    </td>
  +	  </tr>
  +	</table>
  +      </xsl:when>
  +      <xsl:otherwise>
  +	<xsl:copy-of select="$content"/>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.23      +10 -2     tcl-rivet/src/make.tcl
  
  Index: make.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/make.tcl,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- make.tcl	12 Jul 2002 17:40:37 -0000	1.22
  +++ make.tcl	4 Aug 2002 02:44:37 -0000	1.23
  @@ -17,6 +17,14 @@
   
   foreach script $scripts { source [file join . buildscripts $script] }
   
  +# Do we have a threaded Tcl?
  +
  +if { [info exists tcl_platform(threaded)] } {
  +    set TCL_THREADED "-DTCL_THREADED=1"
  +} else {
  +    set TCL_THREADED "-DTCL_THREADED=0"
  +}
  +
   namespace import ::aardvark::*
   
   ## Add variables
  @@ -44,7 +52,7 @@
   
   set INC "-I$INCLUDEDIR -I$TCL_PREFIX/include"
   
  -set COMPILE "$TCL_CC $TCL_CFLAGS_DEBUG $TCL_CFLAGS_OPTIMIZE $TCL_CFLAGS_WARNING $TCL_SHLIB_CFLAGS $INC  $TCL_EXTRA_CFLAGS -c"
  +set COMPILE "$TCL_CC $TCL_CFLAGS_DEBUG $TCL_CFLAGS_OPTIMIZE $TCL_CFLAGS_WARNING $TCL_SHLIB_CFLAGS $INC  $TCL_EXTRA_CFLAGS $TCL_THREADED -c"
   
   set MOD_STLIB mod_rivet.a
   set MOD_SHLIB mod_rivet[info sharedlibextension]
  
  
  
  1.46      +34 -33    tcl-rivet/src/mod_rivet.c
  
  Index: mod_rivet.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- mod_rivet.c	3 May 2002 17:27:14 -0000	1.45
  +++ mod_rivet.c	4 Aug 2002 02:44:37 -0000	1.46
  @@ -128,23 +128,28 @@
       rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
   
       if( Tcl_EvalObjEx(interp, outbuf, 0) == TCL_ERROR ) {
  -	Tcl_Obj *errscript = conf->rivet_error_script;
  +	Tcl_Obj *errscript;
   
   	Tcl_SetVar( interp, "errorOutbuf",
   			Tcl_GetStringFromObj( outbuf, NULL ),
   			TCL_GLOBAL_ONLY );
   
   	/* If we don't have an error script, use the default error handler. */
  -	if( !errscript ) {
  +	if( !conf->rivet_error_script ) {
   	    errscript = conf->rivet_default_error_script;
  +	} else {
  +	    errscript = Tcl_NewStringObj(conf->rivet_error_script, -1);
   	}
  -
  +	Tcl_IncrRefCount(errscript);
   	if (Tcl_EvalObj(interp, errscript) == TCL_ERROR) {
   	    char *errorinfo = Tcl_GetVar( interp, "errorInfo", 0 );
   	    TclWeb_PrintError("<b>Rivet ErrorScript failed!</b>", 1,
   				    globals->req);
   	    TclWeb_PrintError( errorinfo, 0, globals->req );
   	}
  +	/* This shouldn't make the default_error_script go away,
  +	 * because it gets a Tcl_IncrRefCount when it is created. */
  +	Tcl_DecrRefCount(errscript);
       }
   
       /* Make sure to flush the output if buffer_add was the only output */
  @@ -199,10 +204,9 @@
       /* We don't have a compiled version.  Let's create one */
       if (isNew || *(rsc->cache_size) == 0)
       {
  -
   	outbuf = Tcl_NewObj();
   	if (toplevel && rsc->rivet_before_script) {
  -	    Tcl_AppendObjToObj(outbuf, rsc->rivet_before_script);
  +	    Tcl_AppendObjToObj(outbuf, Tcl_NewStringObj(rsc->rivet_before_script, -1));
   	}
   	if( STREQU( req->req->content_type, "application/x-httpd-rivet")
   	    || !toplevel )
  @@ -219,7 +223,7 @@
   	    return result;
   	}
   	if (toplevel && rsc->rivet_after_script) {
  -	    Tcl_AppendObjToObj(outbuf, rsc->rivet_after_script);
  +	    Tcl_AppendObjToObj(outbuf, Tcl_NewStringObj(rsc->rivet_after_script, -1));
   	}
   
   	if (*(rsc->cache_size)) {
  @@ -605,7 +609,7 @@
   }
   
   static char *
  -Rivet_AppendToScript( rivet_server_conf *rsc, char *script, char *string )
  +Rivet_AppendToScript( ap_pool *pool, rivet_server_conf *rsc, char *script, char *string )
   {
       Tcl_Obj *objarg = NULL;
   
  @@ -644,36 +648,24 @@
   	}
       } else if( STREQU( script, "BeforeScript" ) ) {
   	if( rsc->rivet_before_script == NULL ) {
  -	    objarg = Tcl_NewStringObj( string, -1 );
  -	    Tcl_IncrRefCount( objarg );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  -	    rsc->rivet_before_script = objarg;
  +	    rsc->rivet_before_script = ap_pstrcat(pool, string, "\n", NULL);
   	} else {
  -	    objarg = rsc->rivet_before_script;
  -	    Tcl_AppendToObj( objarg, string, -1 );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  +	    rsc->rivet_before_script = ap_pstrcat(pool, rsc->rivet_before_script,
  +						  string, "\n", NULL);
   	}
       } else if( STREQU( script, "AfterScript" ) ) {
   	if( rsc->rivet_after_script == NULL ) {
  -	    objarg = Tcl_NewStringObj( string, -1 );
  -	    Tcl_IncrRefCount( objarg );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  -	    rsc->rivet_after_script = objarg;
  +	    rsc->rivet_after_script = ap_pstrcat(pool, string, "\n", NULL);
   	} else {
  -	    objarg = rsc->rivet_after_script;
  -	    Tcl_AppendToObj( objarg, string, -1 );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  +	    rsc->rivet_after_script = ap_pstrcat(pool, rsc->rivet_after_script,
  +						  string, "\n", NULL);
   	}
       } else if( STREQU( script, "ErrorScript" ) ) {
   	if( rsc->rivet_error_script == NULL ) {
  -	    objarg = Tcl_NewStringObj( string, -1 );
  -	    Tcl_IncrRefCount( objarg );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  -	    rsc->rivet_error_script = objarg;
  +	    rsc->rivet_error_script = ap_pstrcat(pool, string, "\n", NULL);
   	} else {
  -	    objarg = rsc->rivet_error_script;
  -	    Tcl_AppendToObj( objarg, string, -1 );
  -	    Tcl_AppendToObj( objarg, "\n", 1 );
  +	    rsc->rivet_error_script = ap_pstrcat(pool, rsc->rivet_error_script,
  +						 string, "\n", NULL);
   	}
       }
   
  @@ -729,7 +721,7 @@
   	    rsc->seperate_virtual_interps = 0;
   	}
       } else {
  -	string = Rivet_AppendToScript( rsc, var, val );
  +	string = Rivet_AppendToScript( cmd->pool, rsc, var, val);
       }
   
       ap_table_set( rsc->rivet_server_vars, var, string );
  @@ -757,7 +749,7 @@
       if( STREQU( var, "UploadDirectory" ) ) {
   	rdc->upload_dir = val;
       } else {
  -	string = Rivet_AppendToScript( rdc, var, val );
  +	string = Rivet_AppendToScript( cmd->pool, rdc, var, val );
       }
   
       ap_table_set( rdc->rivet_dir_vars, var, string );
  @@ -776,14 +768,15 @@
   Rivet_UserConf( cmd_parms *cmd, rivet_server_conf *rdc, char *var, char *val )
   {
       char *string = val;
  +    FILEDEBUGINFO;
   
       if ( var == NULL || val == NULL ) {
   	return "Rivet Error: RivetUserConf requires two arguments";
       }
   
  -    string = Rivet_AppendToScript( rdc, var, val );
  +    string = Rivet_AppendToScript( cmd->pool, rdc, var, val );
   
  -    ap_table_set( rdc->rivet_user_vars, var, string );
  +    /* ap_table_set( rdc->rivet_user_vars, var, string ); */
       return( NULL );
   }
   
  @@ -794,12 +787,15 @@
   Rivet_MergeDirConfigVars( pool *p, rivet_server_conf *new,
   			  rivet_server_conf *base, rivet_server_conf *add )
   {
  +    FILEDEBUGINFO;
  +
       new->rivet_before_script = add->rivet_before_script ?
   	add->rivet_before_script : base->rivet_before_script;
       new->rivet_after_script = add->rivet_after_script ?
   	add->rivet_after_script : base->rivet_after_script;
       new->rivet_error_script = add->rivet_error_script ?
   	add->rivet_error_script : base->rivet_error_script;
  +
       new->upload_dir = add->upload_dir ?
   	add->upload_dir : base->upload_dir;
   
  @@ -827,6 +823,7 @@
       rivet_server_conf *rdc;
       void *dconf = r->per_dir_config;
   
  +    FILEDEBUGINFO;
   
       /* If there is no per dir config, just return the server config */
       if (dconf == NULL) {
  @@ -854,6 +851,7 @@
       newrsc->rivet_before_script = oldrsc->rivet_before_script;
       newrsc->rivet_after_script = oldrsc->rivet_after_script;
       newrsc->rivet_error_script = oldrsc->rivet_error_script;
  +
       newrsc->rivet_default_error_script = oldrsc->rivet_default_error_script;
   
       /* these are pointers so that they can be passed around...  */
  @@ -884,6 +882,7 @@
       rsc->rivet_before_script = NULL;
       rsc->rivet_after_script = NULL;
       rsc->rivet_error_script = NULL;
  +
       rsc->rivet_default_error_script = Tcl_NewStringObj("::Rivet::handle_error", -1);
       Tcl_IncrRefCount(rsc->rivet_default_error_script);
   
  @@ -927,6 +926,8 @@
       rivet_server_conf *base = (rivet_server_conf *)basev;
       rivet_server_conf *add  = (rivet_server_conf *)addv;
       rivet_server_conf *new  = RIVET_NEW_CONF(p);
  +
  +    FILEDEBUGINFO;
   
       Rivet_MergeDirConfigVars( p, new, base, add );
   
  
  
  
  1.21      +18 -4     tcl-rivet/src/mod_rivet.h
  
  Index: mod_rivet.h
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- mod_rivet.h	15 Mar 2002 16:49:49 -0000	1.20
  +++ mod_rivet.h	4 Aug 2002 02:44:37 -0000	1.21
  @@ -9,6 +9,12 @@
   #define RIVET_DIR "rivet"
   #define RIVET_INIT RIVET_DIR"/init.tcl"
   
  +#if 0
  +#define FILEDEBUGINFO fprintf(stderr, "Function " __FUNCTION__ "\n")
  +#else
  +#define FILEDEBUGINFO
  +#endif
  +
   /* Configuration options  */
   
   /* If you do not have a threaded Tcl, you can define this to 0.  This
  @@ -20,7 +26,9 @@
   #define THREADED_TCL 0 /* Unless you have MINGW32, modify this one! */
   #endif
   
  -/* If you want to show the mod_rivet version, you can define this to 0.
  +/* If you want to show the mod_rivet version in the server
  +   information, you can define this to 0.
  +
      Otherwise, set this to 1 to hide the version from potential
      troublemakers.  */
   #define HIDE_RIVET_VERSION 1
  @@ -40,9 +48,15 @@
       Tcl_Obj *rivet_global_init_script;   /* run once when apache is started */
       Tcl_Obj *rivet_child_init_script;
       Tcl_Obj *rivet_child_exit_script;
  -    Tcl_Obj *rivet_before_script;        /* script run before each page */
  -    Tcl_Obj *rivet_after_script;         /*            after            */
  -    Tcl_Obj *rivet_error_script;         /*            for errors */
  +    char *rivet_before_script;        /* script run before each page */
  +    char *rivet_after_script;         /*            after            */
  +    char *rivet_error_script;         /*            for errors */
  +
  +    /* These next three flags mean that the scripts have been set up
  +       via UserConf. */
  +    int rivet_before_script_user;
  +    int rivet_after_script_user;
  +    int rivet_error_script_user;
       Tcl_Obj *rivet_default_error_script;         /*            for errors */
       int *cache_size;
       int *cache_free;
  
  
  
  1.2       +3 -1      tcl-rivet/src/buildscripts/parsetclConfig.tcl
  
  Index: parsetclConfig.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/buildscripts/parsetclConfig.tcl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- parsetclConfig.tcl	19 Sep 2001 13:20:18 -0000	1.1
  +++ parsetclConfig.tcl	4 Aug 2002 02:44:37 -0000	1.2
  @@ -1,4 +1,6 @@
  -#!/usr/bin/tclsh
  +#!/bin/sh
  +# the next line restarts using tclsh \
  +    exec tclsh "$0" "$@"
   
   source [ file join . buildscripts findconfig.tcl ]
   
  
  
  

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