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/01/06 14:30:55 UTC
cvs commit: tcl-rivet/tests channel.rvt cookies.rvt env.rvt get.rvt hello.rvt post.rvt cookies.test env.test get.test hello.test post.test runtests.tcl template.conf.tcl channel.ttml cookies.ttml env.ttml get.ttml hello.ttml post.ttml
davidw 02/01/06 05:30:54
Modified: . ChangeLog
doc commands.html directives.html example.tcl
install.html other.html
src mod_rivet.c testing.c
tests cookies.test env.test get.test hello.test post.test
runtests.tcl template.conf.tcl
Added: . LICENSE README
doc examples.rvt
tests channel.rvt cookies.rvt env.rvt get.rvt hello.rvt
post.rvt
Removed: doc examples.ttml
tests channel.ttml cookies.ttml env.ttml get.ttml
hello.ttml post.ttml
Log:
* General: Changed .ttml to .rvt. Also changed mime type to
x-httpd-rivet. Changed all references in documentation to .rvt from
.ttml.
Revision Changes Path
1.10 +7 -1 tcl-rivet/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /home/cvs/tcl-rivet/ChangeLog,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ChangeLog 5 Jan 2002 14:40:22 -0000 1.9
+++ ChangeLog 6 Jan 2002 13:30:54 -0000 1.10
@@ -1,3 +1,9 @@
+2002-01-06 David N. Welton <da...@dedasys.com>
+
+ * General: Changed .ttml to .rvt. Also changed mime type to
+ x-httpd-rivet. Changed all references in documentation to .rvt
+ from .ttml.
+
2002-01-05 David N. Welton <da...@dedasys.com>
* src/parser.c (Rivet_Parser): A few, mostly cosmetic, cleanups in
@@ -8,7 +14,7 @@
* src/channel.c (outputproc): Change printheaders to
Rivet_PrintHeaders.
- * General whitespace cleanups.
+ * General: whitespace cleanups.
2001-11-21 David N. Welton <da...@dedasys.com>
1.1 tcl-rivet/LICENSE
Index: LICENSE
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000, 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "mod_rivet"
* or "rivet", nor may "rivet" appear in their name, without prior
* written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
1.1 tcl-rivet/README
Index: README
===================================================================
Apache Rivet
============
See LICENSE for licensing terms.
$Id: README,v 1.1 2002/01/06 13:30:54 davidw Exp $
1.5 +9 -9 tcl-rivet/doc/commands.html
Index: commands.html
===================================================================
RCS file: /home/cvs/tcl-rivet/doc/commands.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- commands.html 16 Nov 2001 10:41:44 -0000 1.4
+++ commands.html 6 Jan 2002 13:30:54 -0000 1.5
@@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <!-- $Id: commands.html,v 1.4 2001/11/16 10:41:44 davidw Exp $ -->
+ <!-- $Id: commands.html,v 1.5 2002/01/06 13:30:54 davidw Exp $ -->
<html>
<head>
<title>Rivet tcl commands</title>
@@ -12,7 +12,7 @@
<ul>
<li><code><b>var</b></code><br> These commands retrieve or
retrieve information about "CGI" variables that are passed to
- the rivet script via GET or POST operations.
+ the rivet script via GET or POST operations.
</li>
<li>
<code><b>var get <i>varname</i></b></code><br> Returns the
@@ -79,23 +79,23 @@
<li>
<code><b>hgetvars</b></code><br> Get environmental, and Cookie
variables. This is in a seperate command so as not to make the
- server do this every time you load a .ttml file. <code>ENVS</code> and
+ server do this every time you load an .rvt file. <code>ENVS</code> and
<code>COOKIES</code> are the associative arrays created. <code>ENVS</code> contains
environmental variables, and <code>COOKIES</code> contains any cookies
recieved from the client.
</li>
<li>
- <code><b>include <i>filename</i></b></code><br>
+ <code><b>include <i>filename</i></b></code><br>
Include a file without parsing it. This is the best
way to include an HTML file or any other static content.
</li>
<li>
- <code><b>parse <i>filename</i></b></code><br>
- "Source" a .ttml file. This is the way to include
- other .ttml files.
+ <code><b>parse <i>filename</i></b></code><br>
+ "Source" an .rvt file. This is the way to include
+ other .rvt files.
</li>
<li>
- <code><b>headers redirect <i>uri</i></b></code><br>
+ <code><b>headers redirect <i>uri</i></b></code><br>
Redirect from the current page to a new
URI. <b>Must</b> be done in the first block of TCL code.
@@ -137,7 +137,7 @@
</li>
<li>
- <code><b>rivet_info</b></code><br>
+ <code><b>rivet_info</b></code><br>
Prints information on the internals of the module in
HTML. Currently, only the PID and size of the object
1.4 +12 -12 tcl-rivet/doc/directives.html
Index: directives.html
===================================================================
RCS file: /home/cvs/tcl-rivet/doc/directives.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- directives.html 16 Nov 2001 10:41:44 -0000 1.3
+++ directives.html 6 Jan 2002 13:30:54 -0000 1.4
@@ -1,12 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<!-- $Id: directives.html,v 1.3 2001/11/16 10:41:44 davidw Exp $ -->
+<!-- $Id: directives.html,v 1.4 2002/01/06 13:30:54 davidw Exp $ -->
<html>
<head>
<title>Rivet Apache directives</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
-
+
<h2 align="center">Rivet Apache directives</h2>
<ul>
@@ -19,36 +19,36 @@
</li>
<li>
- <code><b>Rivet_Script ChildInitScript <i>"script"</i></b></code><br>
+ <code><b>Rivet_Script ChildInitScript <i>"script"</i></b></code><br>
Script to be evaluated when each apache child is
initialized. This is the best place to load modules.
</li>
<li>
- <code><b>Rivet_Script ChildExitScript <i>"script"</i></b></code><br>
+ <code><b>Rivet_Script ChildExitScript <i>"script"</i></b></code><br>
Script to be evaluated when each apache child exits.
</li>
<li>
- <code><b>Rivet_Script BeforeScript <i>"script"</i></b></code><br>
- Script to be evaluated before each .ttml page.
+ <code><b>Rivet_Script BeforeScript <i>"script"</i></b></code><br>
+ Script to be evaluated before each .rvt page.
</li>
<li>
- <code><b>Rivet_Script AfterScript <i>"script"</i></b></code><br>
- Script to be called after each .ttml page.
+ <code><b>Rivet_Script AfterScript <i>"script"</i></b></code><br>
+ Script to be called after each .rvt page.
</li>
<li>
- <code><b>Rivet_Script ErrorScript <i>"script"</i></b></code><br>
+ <code><b>Rivet_Script ErrorScript <i>"script"</i></b></code><br>
This code is called in place of the standard 'error' pages
generated for Rivet. This directive may be useful if you
have sensitive logic that you wish to protect.
</li>
-
+
<li>
- <code><b>Rivet_CacheSize <i>cachesize</i></b></code><br>
- Number of ttml scripts to cache as Tcl Objects.
+ <code><b>Rivet_CacheSize <i>cachesize</i></b></code><br>
+ Number of rvt scripts to cache as Tcl Objects.
Default is MaxRequestsPerChild / 2, or 50, if
MaxRequestsPerChild is 0.
</li>
1.4 +2 -2 tcl-rivet/doc/example.tcl
Index: example.tcl
===================================================================
RCS file: /home/cvs/tcl-rivet/doc/example.tcl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- example.tcl 16 Nov 2001 10:41:44 -0000 1.3
+++ example.tcl 6 Jan 2002 13:30:54 -0000 1.4
@@ -1,5 +1,5 @@
# we have complete access to the interpreter here, so it is best to
-# run per-page code in a namespace, just like we do with .ttml pages.
+# run per-page code in a namespace, just like we do with .rvt pages.
proc getcode { filename } {
set fl [ open $filename r ]
@@ -17,7 +17,7 @@
<html>
<head>
<title>.tcl example</title>
- </head>
+ </head>
<body bgcolor="#ffffff">
}
}
1.3 +16 -16 tcl-rivet/doc/install.html
Index: install.html
===================================================================
RCS file: /home/cvs/tcl-rivet/doc/install.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- install.html 19 Sep 2001 22:59:01 -0000 1.2
+++ install.html 6 Jan 2002 13:30:54 -0000 1.3
@@ -6,12 +6,12 @@
</head>
<body>
- <!-- $Id: install.html,v 1.2 2001/09/19 22:59:01 davidw Exp $ -->
+ <!-- $Id: install.html,v 1.3 2002/01/06 13:30:54 davidw Exp $ -->
<h2 align="center">Rivet Installation</h2>
-
+
<ol>
<li><b>Check dependencies</b><br>
-
+
To install Rivet, you will need <b>Tcl 8.2</b> or greater
and <b>Apache 1.3.xx</b>. It is known to run on Linux,
FreeBSD, OpenBSD, and Solaris and HPUX. NT is also possible -
@@ -21,10 +21,10 @@
<li><b>Get Rivet</b><br>
If you are running a Debian or FreeBSD system, there
are pre-built packages available at:
- <a target="_top" href="http://www.debian.org/Packages/unstable/web/libapache-mod-rivet.html">http://www.debian.org/Packages/unstable/web/libapache-mod-rivet.html</a>
+ <a target="_top" href="http://www.debian.org/Packages/unstable/web/libapache-mod-rivet.html">http://www.debian.org/Packages/unstable/web/libapache-mod-rivet.html</a>
or
-
+
<a
target="_top" href="http://www.freebsd.org/cgi/ports.cgi?query=Rivet">http://www.freebsd.org/cgi/ports.cgi?query=Rivet</a>.<br>
@@ -47,7 +47,7 @@
</code>
</li>
- <li><b>Configuring, buildrivet.sh, etc...</b><br>
+ <li><b>Configuring, buildrivet.sh, etc...</b><br>
Do you want to build Rivet as a shared object (such as a
.so file on Linux, or a .dll on windows), or compile it
@@ -58,10 +58,10 @@
<ul>
<li><b>For shared objects</b><br>
-
+
<code>cd ../Rivet/<br></code>
Edit the <code>buildrivet.sh</code> script. The 3
- variables you may need to change are:
+ variables you may need to change are:
<ul>
<li><code>TCLSH</code><br>
Name of the tclsh program on your computer.
@@ -89,7 +89,7 @@
<code>/usr/lib/apache/1.3/</code>.
</li>
-
+
<li><b>For static builds</b><br>
<code>
cd apache-1.3.X/<br>
@@ -98,7 +98,7 @@
<code>cd ../Rivet/<br></code>
Edit the <code>buildrivet.sh</code> script. The 3
- variables you may need to change are:
+ variables you may need to change are:
<ul>
<li><code>TCLSH</code><br>
Name of the tclsh program on your computer.
@@ -127,24 +127,24 @@
<code>export EXTRA_LIBS="-ltcl8.X -lm"</code><br>
<code>make -e<br></code>
<code>make install<br></code>
-
+
</li>
</ul>
</li>
- <li><b>Configure Apache<br></b>
+ <li><b>Configure Apache<br></b>
<ul>
<li>
<b>http.conf</b><br> <code>LoadModule rivet_module
- /usr/lib/apache/1.3/Rivet.so</code><br>
+ /usr/lib/apache/1.3/Rivet.so</code><br>
This points Apache to the shared object if
Rivet is being used as a loadable module.
</li>
<li>
- <b>srm.conf</b><br>
- <code>AddType application/x-httpd-tcl .ttml</code><br>
+ <b>srm.conf</b><br>
+ <code>AddType application/x-httpd-rivet .rvt</code><br>
<code>AddType application/x-rivet-tcl .tcl</code>
(optional)<br>
- These add the .ttml and .tcl (if desired) types to
+ These add the .rvt and .tcl (if desired) types to
Apache, so that they are processed by Rivet.
</li>
</ul>
1.4 +13 -26 tcl-rivet/doc/other.html
Index: other.html
===================================================================
RCS file: /home/cvs/tcl-rivet/doc/other.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- other.html 16 Nov 2001 10:41:44 -0000 1.3
+++ other.html 6 Jan 2002 13:30:54 -0000 1.4
@@ -6,13 +6,13 @@
</head>
<body>
<h2>Other Rivet Documentation</h2>
-
+
<h3>Internals</h3>
<ul>
<li><b>Read the code!</b></li>
- <li>
+ <li>
<b>Initialization</b><br>
-
+
When Apache is started, (or when child Apache
processes are started if a threaded Tcl is used),
<code>tcl_init_stuff</code> is called, which creates
@@ -23,17 +23,16 @@
</li>
<li><b>Achan/apache_channel</b><br>
- The "Apache Channel" system was created so that it is
- possible to have an actual Tcl channel that we could
- redirect standard output to. This lets us use, for
- instance, the regular "puts" command in .ttml pages.
- It works by creating commands that write to memory
- that is slated to be sent to the client.
+ The "Apache Channel" system was created so that it is possible
+ to have an actual Tcl channel that we could redirect standard
+ output to. This lets us use, for instance, the regular "puts"
+ command in .rvt pages. It works by creating commands that
+ write to memory that is slated to be sent to the client.
</li>
<li><b>Page parsing/execution</b><br>
- In <code>send_parsed_file</code> Each .ttml file is loaded and
+ In <code>send_parsed_file</code> Each .rvt file is loaded and
run within its own namespace. No new interpreter is created
for each page. This lets you share variables, and most
importantly, loaded modules, from a common parent (such as one
@@ -51,24 +50,12 @@
</li>
</ul>
- <h3>Upgrading From Older (< 0.9.3) Versions</h3>
+ <h3>Upgrading From mod_dtcl and NeoWebScript</h3>
<ul>
- <li><b>New tags</b><br> As of version 0.9.4, Rivet uses
- <? and ?> instead of <+ and +> to delimit
- sections of Tcl code. By default, rivet is still compiled
- with code to parse the <? ?> tags, but it will run
- faster if <code>USE_OLD_TAGS</code> is set to 0 in
- <code>Rivet.h</code>. You can automatically change your
- .ttml files to the new format by using the
- <code>newtags.sh</code> script in the contrib/ directory.
- Run it at the top level of your DocumentRoot.
- </li>
- <li><b>headers setcookie</b><br>
- The <code>headers setcookie</code> command now uses the
- <code>-name</code> and <code>-value</code> flags for those
- arguments, whereas this was not necessary in the past.
+ <li>
+ <b>TO BE WRITTEN</b>
</li>
</ul>
</body>
</html>
- <!-- $Id: other.html,v 1.3 2001/11/16 10:41:44 davidw Exp $ -->
\ No newline at end of file
+ <!-- $Id: other.html,v 1.4 2002/01/06 13:30:54 davidw Exp $ -->
\ No newline at end of file
1.1 tcl-rivet/doc/examples.rvt
Index: examples.rvt
===================================================================
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<html>
<!-- $Id: examples.rvt,v 1.1 2002/01/06 13:30:54 davidw Exp $ -->
<title>Rivet examples</title>
<body bgcolor=white>
<table bgcolor=black width=100%>
<tr>
<td align=center>
<font size=40 color=#ffffff>
<b>Rivet examples</b>
</font>
</td>
</tr>
</table>
<p>
These are some examples, rather limited ones, of what can be done with Rivet.
<p>
<table>
<tr><td><hr><b>Hello world</b></td></tr>
<tr><td bgcolor=gray><pre>
<?
headers setcookie "foo" "bar" # we have to put this before any 'puts' statements
puts "Hello world"
?>
</pre>
</td></tr>
<tr><td>
Produces:
<p>
<?
headers setcookie "foo" "bar"
puts "hello world"
?>
<p>
</td></tr>
<tr><td><hr>
<b>Conditionals:</b>
</td></tr>
<tr><td bgcolor=gray><pre>
<? if { 1 } { ?>
<h2> True </h2>
<? } ?>
</td></tr></pre>
<tr><td>
Produces:
<p>
<? if { 1 } { ?>
<h2> True </h2>
<? } ?>
</td></tr>
<tr><td><hr><b>Loops:</b>
</td></tr>
<tr><td bgcolor=gray><pre>
<?
set x 0
while { $x < 5 } {
puts "\$x = $x<br>"
incr x
?>
LOOP<br>
<? } ?>
</pre>
</td></tr>
<tr><td>Produces:<p>
<?
set x 0
while { $x < 5 } {
puts "\$x = $x<br>"
incr x
?>
LOOP<BR>
<? } ?>
</td></tr>
<tr><td><hr><b>Variables (environmental as well as those passed to the script)</b><p>
</td></tr>
<tr><td bgcolor=gray><pre>
<?
hgetvars
if { [ array exists VARS ] } {
puts "< ul>"
foreach { vr } [ array names VARS ] {
puts "<li>(VARS) $vr = $VARS($vr)"
}
puts "</ul>"
}
if { [ array exists ENVS ] } {
puts "<ul>"
foreach { vr } [ array names ENVS ] {
puts "<li>(ENVS) $vr = $ENVS($vr)"
}
puts "</ul>"
}
if { [ array exists COOKIES ] } {
puts "<ul>"
foreach { vr } [ array names COOKIES ] {
puts "<li>(COOKIES) $vr = $COOKIES($vr)"
}
puts "</ul>"
}
?>
</pre>
</td></tr>
<tr><td>Produces:<p>
<?
hgetvars
if { [ array exists VARS ] } {
puts "<ul>"
foreach { vr } [ array names VARS ] {
puts "<li>(VARS) $vr = $VARS($vr)"
}
puts "</ul>"
}
if { [ array exists ENVS ] } {
puts "<ul>"
foreach { vr } [ array names ENVS ] {
puts "<li>(ENVS) $vr = $ENVS($vr)"
}
puts "</ul>"
}
if { [ array exists COOKIES ] } {
puts "<ul>"
foreach { vr } [ array names COOKIES ] {
puts "<li>(COOKIES) $vr = $COOKIES($vr)"
}
puts "</ul>"
}
?>
</td></tr>
<tr><td><hr><b>Create a table on the fly</b><p>
</td></tr>
<tr><td bgcolor=gray><pre>
<?
set i 1
puts "<table>\n"
while { $i <= 8 } {
puts "<tr>\n"
for {set j 1} {$j <= 8} {incr j} {
set num [ expr $i * $j * 4 - 1]
puts [ format "<td bgcolor=%2x%2x%2x > $num $num $num </td>\n" $num $num $num ]
}
incr i
puts "</tr>\n"
}
puts "</table>\n"
?>
</pre>
</td></tr>
<tr><td>Produces:<p>
<?
set i 1
puts "<table>\n"
while { $i <= 8 } {
puts "<tr>\n"
for {set j 1} {$j <= 8} {incr j} {
set num [ expr {$i * $j * 4 - 1} ]
puts [ format "<td bgcolor=%2x%2x%2x > $num $num $num </td>\n" $num $num $num ]
}
incr i
puts "</tr>\n"
}
puts "</table>\n"
?>
</td></tr>
<tr><td><hr> <b>In addition</b><br>
There are many, many other things you can do with Rivet. You can,
if everything is compiled right, load tcl modules, like libpgtcl.so
(the Postgresql interface), so that you can interact with a database!
<p>
</td></tr>
</table>
<? rivet_info ?>
<p>
<a href="http://tcl.apache.org/rivet/">Return to the Rivet homepage</a>
</p>
</body>
</html>
1.14 +11 -12 tcl-rivet/src/mod_rivet.c
Index: mod_rivet.c
===================================================================
RCS file: /home/cvs/tcl-rivet/src/mod_rivet.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- mod_rivet.c 5 Jan 2002 14:40:22 -0000 1.13
+++ mod_rivet.c 6 Jan 2002 13:30:54 -0000 1.14
@@ -55,14 +55,14 @@
* originally written at the National Center for Supercomputing Applications,
* University of Illinois, Urbana-Champaign. */
-/* $Id: mod_rivet.c,v 1.13 2002/01/05 14:40:22 davidw Exp $ */
+/* $Id: mod_rivet.c,v 1.14 2002/01/06 13:30:54 davidw Exp $ */
/* mod_rivet.c by David Welton <da...@apache.org>
* and Damon Courtney <da...@unreality.com>
* Originally based off code from mod_include.
*/
-/* See http://tcl.apache.org/mod_rivet/credits.ttml for additional credits. */
+/* See http://tcl.apache.org/mod_rivet/credits.rvt for additional credits. */
/* Apache includes */
#include "httpd.h"
@@ -94,7 +94,7 @@
static void Rivet_InitTclStuff(server_rec *s, pool *p);
static void Rivet_CopyConfig( rivet_server_conf *oldrsc,
rivet_server_conf *newrsc);
-static int get_ttml_file(request_rec *r, rivet_server_conf *rsc,
+static int get_rvt_file(request_rec *r, rivet_server_conf *rsc,
Tcl_Interp *interp, char *filename, int toplevel,
Tcl_Obj *outbuf);
static int Rivet_SendContent(request_rec *);
@@ -219,7 +219,6 @@
"\": ", Tcl_PosixError(interp), (char *) NULL);
return TCL_ERROR;
}
-
result = Tcl_ReadChars(chan, outbuf, (signed)r->finfo.st_size, 1);
if (result < 0)
{
@@ -238,10 +237,10 @@
#endif /* 1 */
}
-/* Parse and execute a ttml file */
+/* Parse and execute an rvt file */
static int
-get_ttml_file(request_rec *r, rivet_server_conf *rsc, Tcl_Interp *interp,
+get_rvt_file(request_rec *r, rivet_server_conf *rsc, Tcl_Interp *interp,
char *filename, int toplevel, Tcl_Obj *outbuf)
{
/* BEGIN PARSER */
@@ -341,7 +340,7 @@
}
/* This is a seperate function so that it may be called from 'Parse' */
-int
+int
get_parse_exec_file(request_rec *r, rivet_server_conf *rsc,
char *filename, int toplevel)
{
@@ -358,7 +357,7 @@
/* If toplevel is 0, we are being called from Parse, which means
we need to get the information about the file ourselves. */
- if (toplevel == 0)
+ if (toplevel == 0)
{
int ret = 0;
struct stat stat;
@@ -389,7 +388,7 @@
{
/* It's a TTML file - which we always are if toplevel is
0, meaning we are in the Parse command */
- result = get_ttml_file(r, rsc, interp, filename, toplevel, outbuf);
+ result = get_rvt_file(r, rsc, interp, filename, toplevel, outbuf);
} else {
/* It's a plain Tcl file */
result = get_tcl_file(r, interp, filename, outbuf);
@@ -426,7 +425,7 @@
{
char error[MAX_STRING_LEN];
char timefmt[MAX_STRING_LEN];
-
+ struct stat foo;
int errstatus;
Tcl_Interp *interp;
@@ -943,7 +942,7 @@
void *
Rivet_MergeConfig(pool *p, void *basev, void *overridesv)
{
- rivet_server_conf *rsc =
+ rivet_server_conf *rsc =
(rivet_server_conf *) ap_pcalloc(p, sizeof(rivet_server_conf));
rivet_server_conf *base = (rivet_server_conf *) basev;
rivet_server_conf *overrides = (rivet_server_conf *) overridesv;
@@ -1029,7 +1028,7 @@
const handler_rec rivet_handlers[] =
{
- {"application/x-httpd-tcl", Rivet_SendContent},
+ {"application/x-httpd-rivet", Rivet_SendContent},
{"application/x-rivet-tcl", Rivet_SendContent},
{NULL}
};
1.2 +12 -4 tcl-rivet/src/testing.c
Index: testing.c
===================================================================
RCS file: /home/cvs/tcl-rivet/src/testing.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testing.c 5 Jan 2002 14:40:22 -0000 1.1
+++ testing.c 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,8 +1,16 @@
/* Testing code for C routines. */
-/* $Id: testing.c,v 1.1 2002/01/05 14:40:22 davidw Exp $ */
+/* $Id: testing.c,v 1.2 2002/01/06 13:30:54 davidw Exp $ */
#include <tcl.h>
-#include <sys/gmon.h>
+#include "httpd.h"
+
+
+
+
+
+
+
+
int
Rivet_Parser_Test
@@ -40,8 +48,9 @@
int objc,
Tcl_Obj *CONST objv[])
{
+ struct stat foo;
+ printf("size of stat __pad1 is %d\n", sizeof(foo.__pad1));
printf("cleaning up\n");
- _mcleanup();
return TCL_OK;
}
@@ -50,7 +59,6 @@
int
Testing_Init(Tcl_Interp *interp)
{
-// monstartup(_init, etext);
Tcl_CreateObjCommand(interp, "parsertest", Rivet_Parser_Test,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateObjCommand(interp, "cleanup", Cleanup,
1.2 +2 -2 tcl-rivet/tests/cookies.test
Index: cookies.test
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/cookies.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cookies.test 21 Nov 2001 17:55:37 -0000 1.1
+++ cookies.test 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,6 +1,6 @@
-# $Id: cookies.test,v 1.1 2001/11/21 17:55:37 davidw Exp $
+# $Id: cookies.test,v 1.2 2002/01/06 13:30:54 davidw Exp $
-set testfilename1 cookies.ttml
+set testfilename1 cookies.rvt
::tcltest::test cookies-1.1 {Cookies} {
set page [ ::http::geturl "${urlbase}$testfilename1" -headers {Cookie "foo=bar"} ]
1.2 +2 -2 tcl-rivet/tests/env.test
Index: env.test
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/env.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- env.test 21 Nov 2001 17:55:37 -0000 1.1
+++ env.test 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,6 +1,6 @@
-# $Id: env.test,v 1.1 2001/11/21 17:55:37 davidw Exp $
+# $Id: env.test,v 1.2 2002/01/06 13:30:54 davidw Exp $
-set testfilename1 env.ttml
+set testfilename1 env.rvt
::tcltest::test env-1.1 {Environment variable} {
set page [ ::http::geturl "${urlbase}$testfilename1" ]
1.2 +4 -4 tcl-rivet/tests/get.test
Index: get.test
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/get.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- get.test 21 Nov 2001 17:55:37 -0000 1.1
+++ get.test 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,19 +1,19 @@
-# $Id: get.test,v 1.1 2001/11/21 17:55:37 davidw Exp $
+# $Id: get.test,v 1.2 2002/01/06 13:30:54 davidw Exp $
::tcltest::test getvariables-1.1 {GET variables} {
- set page [ ::http::geturl "${urlbase}get.ttml?foobar=goober" ]
+ set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ]
regexp -line {\[var get foobar\] = goober$} [ ::http::data $page ] match
set match
} {[var get foobar] = goober}
::tcltest::test getvariables-1.2 {GET variables + I18N} {
- set page [ ::http::geturl "${urlbase}get.ttml?M�s=T�" ]
+ set page [ ::http::geturl "${urlbase}get.rvt?M�s=T�" ]
regexp -line {^\[var get M�s\] = T�$} [ ::http::data $page ] match
set match
} {[var get M�s] = T�}
::tcltest::test getvariables-1.3 {GET variables + I18N + encoding} {
- set page [ ::http::geturl [ format "${urlbase}get.ttml?%s" [ ::http::formatQuery M�s T� ] ] ]
+ set page [ ::http::geturl [ format "${urlbase}get.rvt?%s" [ ::http::formatQuery M�s T� ] ] ]
regexp -line {^\[var get M�s\] = T�$} [ ::http::data $page ] match
set match
} {[var get M�s] = T�}
1.2 +2 -2 tcl-rivet/tests/hello.test
Index: hello.test
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/hello.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hello.test 21 Nov 2001 17:55:37 -0000 1.1
+++ hello.test 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,6 +1,6 @@
-# $Id: hello.test,v 1.1 2001/11/21 17:55:37 davidw Exp $
+# $Id: hello.test,v 1.2 2002/01/06 13:30:54 davidw Exp $
-set testfilename1 hello.ttml
+set testfilename1 hello.rvt
::tcltest::test hello-1.1 {hello world test} {
set page [ ::http::geturl "${urlbase}$testfilename1" ]
1.2 +2 -2 tcl-rivet/tests/post.test
Index: post.test
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/post.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- post.test 21 Nov 2001 17:55:37 -0000 1.1
+++ post.test 6 Jan 2002 13:30:54 -0000 1.2
@@ -1,6 +1,6 @@
-# $Id: post.test,v 1.1 2001/11/21 17:55:37 davidw Exp $
+# $Id: post.test,v 1.2 2002/01/06 13:30:54 davidw Exp $
-set testfilename1 post.ttml
+set testfilename1 post.rvt
::tcltest::test postvariables-1.1 {POST variables} {
set page [ ::http::geturl "${urlbase}$testfilename1" -query foobar=goober ]
1.6 +6 -2 tcl-rivet/tests/runtests.tcl
Index: runtests.tcl
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/runtests.tcl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- runtests.tcl 5 Jan 2002 14:40:23 -0000 1.5
+++ runtests.tcl 6 Jan 2002 13:30:54 -0000 1.6
@@ -38,9 +38,13 @@
puts $oput
exec kill $apachepid
}
- }
+ }
startserver {
- set apachepid [exec $binname -X -f "[file join [pwd] server.conf]" &]
+ if { [catch {
+ exec $binname -X -f "[file join [pwd] server.conf]"
+ } err] } {
+ puts "$errorInfo"
+ }
}
default {
set apachepid [exec $binname -X -f "[file join [pwd] server.conf]" &]
1.4 +4 -2 tcl-rivet/tests/template.conf.tcl
Index: template.conf.tcl
===================================================================
RCS file: /home/cvs/tcl-rivet/tests/template.conf.tcl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- template.conf.tcl 15 Nov 2001 00:39:40 -0000 1.3
+++ template.conf.tcl 6 Jan 2002 13:30:54 -0000 1.4
@@ -29,7 +29,7 @@
DocumentRoot "$CWD"
<Directory "$CWD">
-Options All MultiViews
+Options All MultiViews
AllowOverride All
Order allow,deny
Allow from all
@@ -51,9 +51,11 @@
CustomLog "$CWD/access_log" combined
<IfModule mod_mime.c>
+TypesConfig $CWD/mime.types
+
AddLanguage en .en
AddLanguage it .it
AddLanguage es .es
-AddType application/x-httpd-tcl .ttml
+AddType application/x-httpd-rivet .rvt
AddType application/x-rivet-tcl .tcl
</IfModule>
1.1 tcl-rivet/tests/channel.rvt
Index: channel.rvt
===================================================================
HTML
<?
no_body
puts "foo"
?>
MORE HTML
<?
puts bar
#headers set Foo Bar
flush stdout
#headers set Bee Bop
after 2000
puts stdout baz
?>
LAST HTML
1.1 tcl-rivet/tests/cookies.rvt
Index: cookies.rvt
===================================================================
<?
load_cookies
headers setcookie -name mod -value rivet -expires 01-01-2003
if { [ array exists cookies ] } {
foreach { ck } [ array names cookies ] {
puts "cookies($ck) = $cookies($ck)\n"
}
}
?>
1.1 tcl-rivet/tests/env.rvt
Index: env.rvt
===================================================================
<?
load_env
puts "env(DOCUMENT_NAME) = $env(DOCUMENT_NAME)\n"
?>
1.1 tcl-rivet/tests/get.rvt
Index: get.rvt
===================================================================
<?
if { [ var number ] > 0 } {
# get/post variables 1.1
if { [ var exists foobar ] } {
puts "\[var get foobar\] = [var get foobar]\n"
}
# get/post variables 1.{2,3}
if { [ var exists M�s ] } {
puts "\[var get M�s\] = [var get M�s]\n"
}
}
?>
1.1 tcl-rivet/tests/hello.rvt
Index: hello.rvt
===================================================================
<?
# hello-1.1
puts "Hello, World\n"
# i18n-1.1
puts "� � � � � � - El Burro Sabe M�s Que T�!\n"
?>
1.1 tcl-rivet/tests/post.rvt
Index: post.rvt
===================================================================
<?
if { [ var number ] > 0 } {
# get/post variables 1.1
if { [ var exists foobar ] } {
puts "\[var get foobar\] = [var get foobar]\n"
}
# get/post variables 1.{2,3}
if { [ var exists M�s ] } {
puts "\[var get M�s\] = [var get M�s]\n"
}
}
?>