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/03/04 00:51:03 UTC
svn commit: r1076894 [1/2] - in /tcl/rivet/branches/rivet-namespace: ./ doc/
doc/examples/ doc/xml/ rivet/rivet-tcl/ src/ src/apache-2/
Author: mxmanghi
Date: Thu Mar 3 23:51:02 2011
New Revision: 1076894
URL: http://svn.apache.org/viewvc?rev=1076894&view=rev
Log:
2011-03-03 Massimo Manghi <mx...@apache.org>
* rivet/rivet-tcl/*.tcl: all the commands in here moved into ::rivet namespace. File tclIndex
recreated
* doc/xml/directives.xml,doc/xml/commands.tcl: Documentation changed to reflect the new scoping of
the command set. Commands in rivet-tcl/ not yet documented have been briefly explained with some
examples.
* src/apache-2/mod_rivet.[c|h],src/apache-2/rivetCore.c: changes in trunk merged into the
rivet-namespace branch
Modified:
tcl/rivet/branches/rivet-namespace/ (props changed)
tcl/rivet/branches/rivet-namespace/ChangeLog
tcl/rivet/branches/rivet-namespace/VERSION
tcl/rivet/branches/rivet-namespace/configure.ac
tcl/rivet/branches/rivet-namespace/doc/ (props changed)
tcl/rivet/branches/rivet-namespace/doc/examples/download.tcl
tcl/rivet/branches/rivet-namespace/doc/examples/rivet_web_service.tcl
tcl/rivet/branches/rivet-namespace/doc/examples/upload.rvt
tcl/rivet/branches/rivet-namespace/doc/examples/vars.rvt
tcl/rivet/branches/rivet-namespace/doc/xml/commands.xml
tcl/rivet/branches/rivet-namespace/doc/xml/directives.xml
tcl/rivet/branches/rivet-namespace/doc/xml/examples.xml
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/cookie.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/debug.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/html.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/import_keyvalue_pairs.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/import_switch_args.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/lassign.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/lempty.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/lmatch.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/load_cookies.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/load_response.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/parray.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/random.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/read_file.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/rivet_command_document.tcl
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/tclIndex
tcl/rivet/branches/rivet-namespace/rivet/rivet-tcl/wrap.tcl
tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c
tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.h
tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c
tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c
Propchange: tcl/rivet/branches/rivet-namespace/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 3 23:51:02 2011
@@ -1,3 +1,4 @@
/tcl/rivet/branches/2_0:939332-1027850
/tcl/rivet/branches/master-interp:1062190-1065801
-/tcl/rivet/trunk:1065843-1070895
+/tcl/rivet/branches/neh:1069501-1076014
+/tcl/rivet/trunk:1065843-1076465
Modified: tcl/rivet/branches/rivet-namespace/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/ChangeLog?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/ChangeLog (original)
+++ tcl/rivet/branches/rivet-namespace/ChangeLog Thu Mar 3 23:51:02 2011
@@ -1,7 +1,26 @@
+2011-03-03 Massimo Manghi <mx...@apache.org>
+ * rivet/rivet-tcl/*.tcl: all the commands in here moved into ::rivet namespace. File tclIndex
+ recreated
+ * doc/xml/directives.xml,doc/xml/commands.tcl: Documentation changed to reflect the new scoping of
+ the command set. Commands in rivet-tcl/ not yet documented have been briefly explained with some
+ examples.
+ * src/apache-2/mod_rivet.[c|h],src/apache-2/rivetCore.c: changes in trunk merged into the
+ rivet-namespace branch
+
+2011-03-01 Massimo Manghi <mx...@apache.org>
+ * src/apache-2/rivetCode.c: 'abort_code' command is now created through the RIVET_CMD_OBJ macro
+
2011-02-18 Massimo Manghi <mx...@apache.org>
* src/rivet.h,src/apache-2/rivetCore.c,src/rivetPkgInit.c: Core commands namespace is now '::rivet' and
the package provided by the core module is "::rivet". Also package RivetLib was renamed as 'rivetlib'.
+2011-02-14 Karl Lehenbauer <ka...@apache.org>
+ * src/apache-2/mod_rivet.c: Only create root interpreter once, not twice.
+ In Rivet_CopyConfig cache_size and cache_free were getting copied twice.
+ Only once now.
+ * src/apache-2/rivetCore.c: Remove unused command var from Rivet_Upload.
+ Remove unneeded loglevel var from Rivet_LogErrorCmd.
+
2011-02-14 Massimo Manghi <mx...@apache.org>
* src/apache-2/mod_rivet.[h|c],src/apache-2/rivetCore.c: Removed loading of RivetLib by default. Getting
RivetLib into the module keeps Apache to segfault in other calls. In order to gain access to commands
@@ -10,10 +29,10 @@
RivetLib exports the commands to the '::Rivet' namespace.
* src/rivetCrypt.c, src/rivetWWW.c, src/rivetList.c: they now export their commands to the '::Rivet'
-2011-02-14 Karl Lehenbauer <ka...@apache.org>
- * src/apache-2/mod_rivet.c: Only create root interpreter once, not twice.
- In Rivet_CopyConfig cache_size and cache_free were getting copied twice. Only once now.
- * src/apache-2/rivetCore.c: Remove unused command var from Rivet_Upload. Remove unneeded loglevel var from Rivet_LogErrorCmd.
+2011-02-11 Massimo Manghi <mx...@apache.org>
+ * src/apache-2/mod_rivet.[c|h]: new conf scripts rivet_abort_script and rivet_force_script. rivet_abort_script
+ is run when an abort_page command is called in the page content generation
+ * src/apache-2/rivetCode.c: add new command abort_code that returns the code passed to abort_page
2011-02-08 Massimo Manghi <mx...@apache.org>
* src/apache-2/rivetCore.c: call to Rivet_InitWWW to include into Rivet's core the commands provided in
Modified: tcl/rivet/branches/rivet-namespace/VERSION
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/VERSION?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/VERSION (original)
+++ tcl/rivet/branches/rivet-namespace/VERSION Thu Mar 3 23:51:02 2011
@@ -1 +1 @@
-2.1.0r1-ns
+2.1.0a1
Modified: tcl/rivet/branches/rivet-namespace/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/configure.ac?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/configure.ac (original)
+++ tcl/rivet/branches/rivet-namespace/configure.ac Thu Mar 3 23:51:02 2011
@@ -22,7 +22,7 @@ dnl
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------
-AC_INIT([Rivet],[2.1.0r1-ns])
+AC_INIT([Rivet],[2.1.0a1])
TEA_INIT([3.9])
AC_CONFIG_AUX_DIR(tclconfig)
Propchange: tcl/rivet/branches/rivet-namespace/doc/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Mar 3 23:51:02 2011
@@ -0,0 +1,3 @@
+/tcl/rivet/branches/2_0/doc:939332-1027850
+/tcl/rivet/branches/master-interp/doc:1062190-1065801
+/tcl/rivet/trunk/doc:1065843-1076473
Modified: tcl/rivet/branches/rivet-namespace/doc/examples/download.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/doc/examples/download.tcl?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/doc/examples/download.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/doc/examples/download.tcl Thu Mar 3 23:51:02 2011
@@ -1,6 +1,6 @@
# Code example for the transmission of a pdf file.
-if {[var exists pdfname]} {
+if {[::rivet::var exists pdfname]} {
set pdfname [var get pdfname]
# let's build the full path to the pdf file. The 'pdf_repository'
@@ -14,9 +14,9 @@ if {[var exists pdfname]} {
# original one. In this case, this is the point where a new file name
# must be generated.
- headers type "application/pdf"
- headers add Content-Disposition "attachment; filename=${pdfname}.pdf"
- headers add Content-Description "PDF Document"
+ ::rivet::headers type "application/pdf"
+ ::rivet::headers add Content-Disposition "attachment; filename=${pdfname}.pdf"
+ ::rivet::headers add Content-Description "PDF Document"
# The pdf is read and stored in a Tcl variable. The file handle is
# configured for a binary read: we are just shipping raw data to a
@@ -24,21 +24,21 @@ if {[var exists pdfname]} {
# that is able to retrieve the data to be sent from any data source
# (e.g. database, external program, other Tcl code)
- set paper [open $pdf_full_path r]
- fconfigure $paper -translation binary
- set pdf [read $paper]
- close $paper
+ set paper [open $pdf_full_path r]
+ fconfigure $paper -translation binary
+ set pdf [read $paper]
+ close $paper
# Now we got the data: let's tell the client how many bytes we are
# about to send (useful for the download progress bar of a dialog box)
- headers add Content-Length [string length $pdf]
+ ::rivet::headers add Content-Length [string length $pdf]
# Let's send the actual file content
- puts $pdf
+ puts $pdf
} else {
- source pdf_not_found_error.rvt
+ source pdf_not_found_error.rvt
}
} else {
source parameter_not_defined_error.rvt
Modified: tcl/rivet/branches/rivet-namespace/doc/examples/rivet_web_service.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/doc/examples/rivet_web_service.tcl?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/doc/examples/rivet_web_service.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/doc/examples/rivet_web_service.tcl Thu Mar 3 23:51:02 2011
@@ -12,64 +12,63 @@
# A pseudo database. rec_id matches a record in the db
-set composers [dict create 1 {first_name Claudio middle_name "" last_name Monteverdi \
- lifespan 1567-1643 era Renaissance/Baroque} \
- 2 {first_name Johann middle_name Sebastian last_name Bach \
- lifespan 1685-1750 era Baroque } \
- 3 {first_name Ludwig middle_name "" last_name "van Beethoven" \
- lifespan 1770-1827 era Classical/Romantic} \
- 4 {first_name Wolfgang middle_name Amadeus last_name Mozart \
- lifespan 1756-1791 era Classical } \
- 5 {first_name Robert middle_name "" last_name Schumann \
- lifespan 1810-1856 era Romantic} ]
+set composers [dict create \
+ 1 {first_name Claudio middle_name "" last_name Monteverdi \
+ lifespan 1567-1643 era Renaissance/Baroque} \
+ 2 {first_name Johann middle_name Sebastian last_name Bach \
+ lifespan 1685-1750 era Baroque } \
+ 3 {first_name Ludwig middle_name "" last_name "van Beethoven" \
+ lifespan 1770-1827 era Classical/Romantic} \
+ 4 {first_name Wolfgang middle_name Amadeus last_name Mozart \
+ lifespan 1756-1791 era Classical } \
+ 5 {first_name Robert middle_name "" last_name Schumann \
+ lifespan 1810-1856 era Romantic} ]
# we use the 'load' argument in order to determine the type of query
#
-# load=catalog: we have to return a list of the names in the database
+# load=catalog: we have to return a list of the names in the database
# load=composer&res_id=<id>: the script is supposed to return the record
-# having <id> as record id
+# having <id> as record id
-if {[var exists load]} {
+if {[::rivet::var exists load]} {
# the xml declaration is common to every message (error messages included)
set xml "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
- switch [var get load] {
- catalog {
- append xml "<catalog>\n"
- foreach nm [dict keys $composers] {
- set first_name [dict get $composers $nm first_name]
- set middle_name [dict get $composers $nm middle_name]
- set last_name [dict get $composers $nm last_name]
- append xml " <composer key=\"$nm\">$first_name "
- if {[string length [string trim $middle_name]] > 0} {
- append xml "$middle_name "
- }
- append xml "$last_name</composer>\n"
- }
- append xml "</catalog>\n"
- }
- composer {
- append xml "<composer>\n"
- if {[var exists rec_id]} {
- set rec_id [var get rec_id]
- if {[dict exists $composers $rec_id]} {
-
- foreach {k v} [dict get $composers $rec_id] {
- append xml "<$k>$v</$k>\n"
- }
-
- }
- }
- append xml "</composer>\n"
- }
+ switch [::rivet::var get load] {
+ catalog {
+ append xml "<catalog>\n"
+ foreach nm [dict keys $composers] {
+ set first_name [dict get $composers $nm first_name]
+ set middle_name [dict get $composers $nm middle_name]
+ set last_name [dict get $composers $nm last_name]
+ append xml " <composer key=\"$nm\">$first_name "
+ if {[string length [string trim $middle_name]] > 0} {
+ append xml "$middle_name "
+ }
+ append xml "$last_name</composer>\n"
+ }
+ append xml "</catalog>\n"
+ }
+ composer {
+ append xml "<composer>\n"
+ if {[::rivet::var exists rec_id]} {
+ set rec_id [::rivet::var get rec_id]
+ if {[dict exists $composers $rec_id]} {
+ foreach {k v} [dict get $composers $rec_id] {
+ append xml "<$k>$v</$k>\n"
+ }
+ }
+ }
+ append xml "</composer>\n"
+ }
}
# we have to tell the client this is an XML message. Failing to do so
# would result in an XMLResponse property set to null
- headers type "text/xml"
- headers add Content-Length [string length $xml]
+ ::rivet::headers type "text/xml"
+ ::rivet::headers add Content-Length [string length $xml]
puts $xml
}
Modified: tcl/rivet/branches/rivet-namespace/doc/examples/upload.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/doc/examples/upload.rvt?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/doc/examples/upload.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/doc/examples/upload.rvt Thu Mar 3 23:51:02 2011
@@ -1,5 +1,5 @@
<?
-upload save MyUpload /tmp/uploadfiles/file1
-puts "Saved file [upload filename MyUpload] \
- ([upload size MyUpload] bytes) to server"
+::rivet::upload save MyUpload /tmp/uploadfiles/file1
+puts "Saved file [::rivet::upload filename MyUpload] \
+ ([::rivet::upload size MyUpload] bytes) to server"
?>
\ No newline at end of file
Modified: tcl/rivet/branches/rivet-namespace/doc/examples/vars.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/doc/examples/vars.rvt?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/doc/examples/vars.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/doc/examples/vars.rvt Thu Mar 3 23:51:02 2011
@@ -1,13 +1,13 @@
<?
set errlist {}
-if { [var exists title] } {
- set title [var get title]
+if { [::rivet::var exists title] } {
+ set title [::rivet::var get title]
} else {
set errlist "You need to enter a title"
}
-if { [var exists salary] } {
- set salary [var get salary]
+if { [::rivet::var exists salary] } {
+ set salary [::rivet::var get salary]
if { ! [string is digit $salary] } {
lappend errlist "Salary must be a number"
}
@@ -15,14 +15,14 @@ if { [var exists salary] } {
lappend errlist "You need to enter a salary"
}
-if { [var exists boss] } {
- set boss [var get boss]
+if { [::rivet::var exists boss] } {
+ set boss [::rivet::var get boss]
} else {
set boss "Mr. Burns"
}
-if { [var exists skills] } {
- set skills [var list skills]
+if { [::rivet::var exists skills] } {
+ set skills [::rivet::var list skills]
} else {
lappend errlist "You need to enter some skills"
}
Modified: tcl/rivet/branches/rivet-namespace/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/doc/xml/commands.xml?rev=1076894&r1=1076893&r2=1076894&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/rivet-namespace/doc/xml/commands.xml Thu Mar 3 23:51:02 2011
@@ -1,7 +1,268 @@
<section id="commands">
- <title>Rivet Tcl Commands and Variables</title>
+ <title>Rivet Tcl Commands and Variables</title>
+ <section>
+ <para>
+ Starting with version 2.1.0 Rivet command set moved into the
+ <command>::rivet</command> namespace.
+ </para>
+ <para>
+ In order to preserve out of the box compatibility with existing scripts
+ the whole set of commands is now implicitly imported into the global
+ namespace, but this is not guaranteed to work forever and in future
+ releases of Rivet it will be removed. Importing the commands into the global
+ namespace with <command>namespace import ::rivet::*</command> will be possible
+ but deprecated and instead it is recommended commands to be fully specified
+ throught the namespace prefix.
+ </para>
+ </section>
+ <refentry id="debug">
+ <refnamediv>
+ <refname>debug</refname>
+ <refpurpose>
+ A command to print strings, arrays
+ and the values of variables as specified by the arguments.
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::debug</command>
+ <arg choice="plain">-subst</arg><arg><on|off></arg>
+ <arg choice="plain">-separator</arg><arg><string></arg>
+ <arg choice="plain">-option</arg><arg><replaceable><value></replaceable></arg>
+ <arg choice="plain">-option</arg><arg><replaceable><value></replaceable></arg>
+ <arg choice="plain">...</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ A command to make debugging more convenient print strings, arrays
+ and the values of variables as specified by the arguments.
+ </para>
+ <para>
+ Also allows the setting of an array called debug which will pick up
+ options for all debug commands.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="import_keyvalue_pairs">
+ <refnamediv>
+ <refname>import_keyvalue_pairs</refname>
+ <refpurpose>Import an argument list into the named array</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::import_keyvalue_pairs</command>
+ <arg>arrayName</arg>
+ <arg>argsList</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ key-value pairs, like "-foo bar" are stored in the array <arg>arrayName</arg>.
+ In that case, the value "bar" would be stored in the element "foo"
+ </para>
+ <para>
+ If "--" appears or a key doesn't begin with "-", the rest of the arg
+ list is stored in the special args element of the array.
+ </para>
+ <para>
+ Example:
+ <programlisting>::rivet::import_keyvalue_pairs keyvalue_map [list -a1 v1 -a2 v2 -a3 v3 -- 1 2 3 4 5]
+parray keyvalue_map
+
+keyvalue_map(a1) = v1
+keyvalue_map(a2) = v2
+keyvalue_map(a3) = v3
+keyvalue_map(args) = 1 2 3 4 5</programlisting>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="lassign">
+ <refnamediv>
+ <refname>lassign</refname>
+ <refpurpose>Assign a list of values to a list of variables</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::lassign</command>
+ <arg>value_list</arg>
+ <arg>variables</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <command>lassign</command> emulates the TclX lassign command. It accepts
+ a list variables and treats the rest as a list of variable names that will
+ be assigned with the values in the caller's scope
+ </para>
+ <para>
+ <programlisting># ::rivet::lassign {1 2 3} a b c
+# set a
+1
+# set b
+2
+# set c
+3</programlisting>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="lempty">
+ <refnamediv>
+ <refname>lempty</refname>
+ <refpurpose>Returns 1 if <list> is empty or 0 if it has any elements.
+ This command emulates the TclX lempty command.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::lempty</command>
+ <arg>list</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Returns 1 if <list> is empty or 0 if it has any elements.
+ This command emulates the TclX lempty command.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="lmatch">
+ <refnamediv>
+ <refname>lmatch</refname>
+ <refpurpose>
+ Look for elements in <list> that match <pattern>
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::lmatch</command>
+ <group choice="req">
+ <arg>-exact</arg>
+ <arg>-glob</arg>
+ <arg>-regexp</arg>
+ </group>
+ <arg>list</arg>
+ <arg>pattern</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Look for elements in <list> that match <pattern>.
+ This command emulates the TclX lmatch command, but if TclX isn't
+ available, it's a decent substitute.
+ </para>
+ <para>
+ In the following example a regular expression is matched against
+ each element in the input list and a list containing the matching
+ elements is returned
+ </para>
+ <para>
+ <programlisting># ::rivet::lmatch -regexp ::rivet::lmatch -regexp { aaxa bxxb ccxxxxcc } {.+[x]{2}.+}
+bxxb ccxxxxcc
+ </programlisting>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="read_file">
+ <refnamediv>
+ <refname>read_file</refname>
+ <refpurpose>
+ Read the entire contents of a file and return it as a string.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::read_file</command>
+ <arg>file name</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ This is a utility command which loads the entire content of
+ a file and returns it as a result.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="wrap">
+ <refnamediv>
+ <refname>wrap</refname>
+ <refpurpose>
+ Split a string on newlines.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::wrap</command>
+ <arg>string</arg>
+ <arg>maxlen</arg>
+ <arg choice="plan">html</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ For each line, wrap the line at a space character to be
+ equal to or shorter than the maximum length value passed.
+ </para>
+ <para>
+ If a third argument called "-html" is present, the string is put together
+ with html <br> line breaks, otherwise it's broken with newlines.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="wrapline">
+ <refnamediv>
+ <refname>wrapline</refname>
+ <refpurpose>
+ Split the line into multiple lines by splitting on space characters
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::wrapline</command>
+ <arg>string</arg>
+ <arg>maxlen</arg>
+ <arg choice="plan">html</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Given a line and a maximum length and option "-html" argument, split the line
+ into multiple lines by splitting on space characters and making sure each line
+ is less than maximum length.
+ </para>
+ <para>
+ If the third argument, "-html", is present, return the result with the lines
+ separated by html <br> line breaks, otherwise the lines are returned
+ separated by newline characters.
+ </para>
+ <para>
+ If a third argument called "-html" is present, the string is put together
+ with html <br> line breaks, otherwise it's broken with newlines.
+ </para>
+ </refsect1>
+ </refentry>
- <refentry id="var">
+ <refentry id="var">
<refnamediv>
<refname>var</refname>
<refname>var_qs</refname>
@@ -11,7 +272,7 @@
<refsynopsisdiv>
<cmdsynopsis>
- <command>var</command>
+ <command>::rivet::var</command>
<group choice="req">
<arg>get</arg>
<arg>list</arg>
@@ -22,7 +283,7 @@
</cmdsynopsis>
<cmdsynopsis>
- <command>var_qs</command>
+ <command>::rivet::var_qs</command>
<group choice="req">
<arg>get</arg>
<arg>list</arg>
@@ -33,7 +294,7 @@
</cmdsynopsis>
<cmdsynopsis>
- <command>var_post</command>
+ <command>::rivet::var_post</command>
<group choice="req">
<arg>get</arg>
<arg>list</arg>
@@ -44,299 +305,294 @@
</cmdsynopsis>
</refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- The <command>var</command> command retrieves information
- about GET or POST variables sent to the script via client
- request. It treats both GET and POST variables the same,
- regardless of their origin. Note that there are two
- additional forms of <command>var</command>:
- <command>var_qs</command> and <command>var_post</command>.
- These two restrict the retrieval of information to
- parameters arriving via the querystring
- (?foo=bar&bee=bop) or POSTing, respectively.
- </para>
- <variablelist>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>var</command>
- <arg choice="plain">get</arg>
- <arg><replaceable>varname</replaceable></arg>
- <arg><replaceable><optional>default</optional></replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the value of variable
- <option><replaceable>varname</replaceable></option>
- as a string (even if there are multiple values). If
- the variable doesn't exist as a GET or POST
- variable, the
- <option><replaceable><optional>default</optional></replaceable></option>
- value is returned, otherwise "" - an empty string -
- is returned.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>var</command>
- <arg choice="plain">list</arg>
- <arg><replaceable>varname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the value of variable
- <option><replaceable>varname</replaceable></option> as a
- list, if there are multiple values.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>var</command>
- <arg choice="plain">exists</arg>
- <arg><replaceable>varname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns 1 if
- <option><replaceable>varname</replaceable></option>
- exists, 0 if it doesn't.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>var</command>
- <arg choice="plain">number</arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the number of variables.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>var</command>
- <arg choice="plain">all</arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Return a list of variable names and values.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- <para>
- See <xref linkend="variable_access"/>.
- </para>
-
- </refsect1>
- </refentry>
-
- <refentry id="upload">
- <refnamediv>
- <refname>upload</refname>
- <refpurpose>handle a file uploaded by a client.</refpurpose>
- </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ The <command>var</command> command retrieves information
+ about GET or POST variables sent to the script via client
+ request. It treats both GET and POST variables the same,
+ regardless of their origin. Note that there are two
+ additional forms of <command>::rivet::var</command>:
+ <command>rivet::var_qs</command> and
+ <command>::rivet::var_post</command>.
+ These two restrict the retrieval of information to
+ parameters arriving via the querystring
+ (?foo=bar&bee=bop) or POSTing, respectively.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::var</command>
+ <arg choice="plain">get</arg>
+ <arg><replaceable>varname</replaceable></arg>
+ <arg><replaceable><optional>default</optional></replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the value of variable
+ <option><replaceable>varname</replaceable></option>
+ as a string (even if there are multiple values). If
+ the variable doesn't exist as a GET or POST
+ variable, the
+ <option><replaceable><optional>default</optional></replaceable></option>
+ value is returned, otherwise "" - an empty string -
+ is returned.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::var</command>
+ <arg choice="plain">list</arg>
+ <arg><replaceable>varname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the value of variable
+ <option><replaceable>varname</replaceable></option> as a
+ list, if there are multiple values.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::var</command>
+ <arg choice="plain">exists</arg>
+ <arg><replaceable>varname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns 1 if
+ <option><replaceable>varname</replaceable></option>
+ exists, 0 if it doesn't.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::var</command>
+ <arg choice="plain">number</arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the number of variables.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::var</command>
+ <arg choice="plain">all</arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Return a list of variable names and values.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>See <xref linkend="variable_access"/>.</para>
+
+ </refsect1>
+ </refentry>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>upload</command>
- <group choice="req">
- <arg>channel</arg>
- <arg>save</arg>
- <arg>data</arg>
- <arg>exists</arg>
- <arg>size</arg>
- <arg>type</arg>
- <arg>filename</arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
- <para>The upload command is for file upload manipulation.
- See the relevant Apache Directives to further configure the
- behavior of this Rivet feature.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">channel</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- When given the name of a file upload
- <option><replaceable>uploadname</replaceable></option>,
- returns a Tcl channel that can be used to access the
- uploaded file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">save</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- <arg><replaceable>filename</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Saves the
- <option><replaceable>uploadname</replaceable></option> in
- the file
- <option><replaceable>filename</replaceable></option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">data</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns data uploaded to the server. This is binary clean
- - in other words, it will work even with files like
- images, executables, compressed files, and so on.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">exists</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns true if an upload named <arg>uploadname</arg>
- exists. This can be used in scripts that are meant to
- be run by different forms that send over uploads that
- might need specific processing.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">size</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the size of the file uploaded.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">type</arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- If the <varname>Content-type</varname> is set, it is
- returned, otherwise, an empty string.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">filename</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the filename on the remote host that uploaded the file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">tempname</arg>
- <arg><replaceable>uploadname</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the name of the temporary file on the local host that the file was uploaded into.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>upload</command>
- <arg choice="plain">names</arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns the variable names, as a list, of all the files
- uploaded.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- <para>
- See <xref linkend="upload"/>.
- </para>
+ <refentry id="upload">
+ <refnamediv>
+ <refname>upload</refname>
+ <refpurpose>handle a file uploaded by a client.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <group choice="req">
+ <arg>channel</arg>
+ <arg>save</arg>
+ <arg>data</arg>
+ <arg>exists</arg>
+ <arg>size</arg>
+ <arg>type</arg>
+ <arg>filename</arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ The upload command is for file upload manipulation.
+ See the relevant Apache Directives to further configure the
+ behavior of this Rivet feature.
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">channel</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ When given the name of a file upload
+ <option><replaceable>uploadname</replaceable></option>,
+ returns a Tcl channel that can be used to access the
+ uploaded file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">save</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ <arg><replaceable>filename</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Saves the <option><replaceable>uploadname</replaceable></option> in
+ the file <option><replaceable>filename</replaceable></option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">data</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns data uploaded to the server. This is binary clean
+ - in other words, it will work even with files like
+ images, executables, compressed files, and so on.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">exists</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns true if an upload named <arg>uploadname</arg>
+ exists. This can be used in scripts that are meant to
+ be run by different forms that send over uploads that
+ might need specific processing.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">size</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the size of the file uploaded.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">type</arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ If the <varname>Content-type</varname> is set, it is
+ returned, otherwise, an empty string.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">filename</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the filename on the remote host that uploaded the file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">tempname</arg>
+ <arg><replaceable>uploadname</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the name of the temporary file on the local host that the file was uploaded into.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::upload</command>
+ <arg choice="plain">names</arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns the variable names, as a list, of all the files uploaded.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ See <xref linkend="file_upload"/>.
+ </para>
</refsect1>
</refentry>
<refentry id="load_response">
<refnamediv>
- <refname>load_response</refname>
- <refpurpose>load form variables into an array.</refpurpose>
+ <refname>load_response</refname>
+ <refpurpose>load form variables into an array.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>load_response</command>
- <arg><replaceable>arrayName</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::load_response</command>
+ <arg><replaceable>arrayName</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
@@ -370,406 +626,409 @@
<refsynopsisdiv>
<cmdsynopsis>
- <command>load_headers</command>
+ <command>::rivet::load_headers</command>
<arg><replaceable>array_name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- Load the headers that come from a client request into the
- provided array name, or use <option>headers</option> if no
- name is provided.
- </para>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Load the headers that come from a client request into the
+ provided array name, or use <option>headers</option> if no
+ name is provided.
+ </para>
</refsect1>
</refentry>
<refentry id="load_cookies">
<refnamediv>
- <refname>load_cookies</refname>
- <refpurpose>get any cookie variables sent by the client.</refpurpose>
+ <refname>load_cookies</refname>
+ <refpurpose>get any cookie variables sent by the client.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>load_cookies</command>
- <arg choice="opt"><replaceable>array_name</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::load_cookies</command>
+ <arg choice="opt"><replaceable>array_name</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- </refsect1>
- <para>
- Load the array of cookie variables into the specified
- array name. Uses array <option>cookies</option> by
- default.
- </para>
- </refentry>
-
- <refentry id="load_env">
- <refnamediv>
- <refname>load_env</refname>
- <refpurpose>get the request's environment variables.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>load_env</command>
- <arg choice="opt"><replaceable>array_name</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
+ <title>Description</title>
+ </refsect1>
+ <para>
+ Load the array of cookie variables into the specified
+ array name. Uses array <option>cookies</option> by
+ default.
+ </para>
+ </refentry>
+
+ <refentry id="load_env">
+ <refnamediv>
+ <refname>load_env</refname>
+ <refpurpose>get the request's environment variables.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::load_env</command>
+ <arg choice="opt"><replaceable>array_name</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
<refsect1>
- <title>Description</title>
+ <title>Description</title>
- <para>
- Load the array of environment variables into the specified
- array name. Uses array <option>::request::env</option> by
- default.
- </para>
- <para>
- As Rivet pages are run in the <option>::request</option>
- namespace, it isn't necessary to qualify the array name
- for most uses - it's ok to access it as
- <option>env</option>.
- </para>
+ <para>
+ Load the array of environment variables into the specified
+ array name. Uses array <option>::request::env</option> by
+ default.
+ </para>
+ <para>
+ As Rivet pages are run in the <option>::request</option>
+ namespace, it isn't necessary to qualify the array name
+ for most uses - it's ok to access it as
+ <option>env</option>.
+ </para>
</refsect1>
</refentry>
<refentry id="env">
<refnamediv>
- <refname>env</refname> <refpurpose>Loads a single
- "environmental variable" into a Tcl variable.</refpurpose>
+ <refname>env</refname>
+ <refpurpose>
+ Loads a single "environmental variable" into a Tcl variable.
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>env</command>
- <arg><replaceable>varName</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::env</command>
+ <arg><replaceable>varName</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
-
- <para>
- If it is only necessary to load one environmental variable,
- this command may be used to avoid the overhead of loading
- and storing the entire array.
- </para>
+ <title>Description</title>
+ <para>
+ If it is only necessary to load one environmental variable,
+ this command may be used to avoid the overhead of loading
+ and storing the entire array.
+ </para>
</refsect1>
</refentry>
<refentry id="include">
<refnamediv>
- <refname>include</refname>
- <refpurpose>includes a file into the output stream without modification.</refpurpose>
+ <refname>include</refname>
+ <refpurpose>includes a file into the output stream without modification.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>include</command>
- <arg><replaceable>filename_name</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::include</command>
+ <arg><replaceable>filename_name</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Include a file without parsing it for processing tags <?
- and ?>. This is the best way to include an HTML file or
- any other static content.
- </para>
+ <title>Description</title>
+ <para>
+ Include a file without parsing it for processing tags <?
+ and ?>. This is the best way to include an HTML file or
+ any other static content.
+ </para>
</refsect1>
</refentry>
<refentry id="parse">
<refnamediv>
- <refname>parse</refname>
- <refpurpose>parses a Rivet template file.</refpurpose>
+ <refname>parse</refname>
+ <refpurpose>parses a Rivet template file.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>parse</command>
- <arg><replaceable>filename</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::parse</command>
+ <arg><replaceable>filename</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Like the Tcl <command>source</command> command, but also
- parses for Rivet <? and ?> processing tags. Using
- this command, you can use one .rvt file from another.
- </para>
+ <title>Description</title>
+ <para>
+ Like the Tcl <command>source</command> command, but also
+ parses for Rivet <? and ?> processing tags. Using
+ this command, you can use one .rvt file from another.
+ </para>
</refsect1>
</refentry>
<refentry id="headers">
- <refnamediv>
- <refname>headers</refname>
- <refpurpose>set and parse HTTP headers.</refpurpose>
+ <refnamediv>
+ <refname>headers</refname>
+ <refpurpose>set and parse HTTP headers.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>headers</command>
- <group choice="req">
- <arg>set</arg>
- <arg>redirect</arg>
- <arg>add</arg>
- <arg>type</arg>
- <arg>numeric</arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
- <para>
- The <command>headers</command> command is for setting and
- parsing HTTP headers.
- </para>
-
- <variablelist>
-
- <varlistentry>
- <term><cmdsynopsis>
- <command>headers</command>
- <arg choice="plain">set</arg>
- <arg><replaceable>headername</replaceable></arg>
- <arg><replaceable>value</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Set arbitrary header names and values.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>headers</command>
- <arg choice="plain">redirect</arg>
- <arg><replaceable>uri</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Redirect from the current page to a new
- URI. <emphasis>Must</emphasis> be done in the first block
- of TCL code.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>headers</command>
- <arg choice="plain">add</arg>
- <arg><replaceable>headername</replaceable></arg>
- <arg><replaceable>value</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>Add text to header
- <varname>headername</varname>.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><cmdsynopsis>
- <command>headers</command>
- <arg choice="plain">type</arg>
- <arg><replaceable>content-type</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- This command sets the <constant>Content-type</constant>
- header returned by the script, which is useful if you wish
- to send content other than HTML with Rivet - PNG or jpeg
- images, for example.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>headers</command>
- <arg choice="plain">numeric</arg>
- <arg><replaceable>response code</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>Set a numeric response code, such as 200, 404 or 500.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <group choice="req">
+ <arg>set</arg>
+ <arg>redirect</arg>
+ <arg>add</arg>
+ <arg>type</arg>
+ <arg>numeric</arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ The <command>headers</command> command is for setting and
+ parsing HTTP headers.
+ </para>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><cmdsynopsis>
+ <command>::rivet::headers</command>
+ <arg choice="plain">set</arg>
+ <arg><replaceable>headername</replaceable></arg>
+ <arg><replaceable>value</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Set arbitrary header names and values.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <arg choice="plain">redirect</arg>
+ <arg><replaceable>uri</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Redirect from the current page to a new
+ URI. <emphasis>Must</emphasis> be done in the first block
+ of TCL code.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <arg choice="plain">add</arg>
+ <arg><replaceable>headername</replaceable></arg>
+ <arg><replaceable>value</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>Add text to header
+ <varname>headername</varname>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <arg choice="plain">type</arg>
+ <arg><replaceable>content-type</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ This command sets the <constant>Content-type</constant>
+ header returned by the script, which is useful if you wish
+ to send content other than HTML with Rivet - PNG or jpeg
+ images, for example.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::headers</command>
+ <arg choice="plain">numeric</arg>
+ <arg><replaceable>response code</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Set a numeric response code, such as 200, 404 or 500.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</refsect1>
</refentry>
<refentry id="makeurl">
<refnamediv>
- <refname>makeurl</refname>
- <refpurpose>construct url's based on hostname, port.</refpurpose>
+ <refname>makeurl</refname>
+ <refpurpose>construct url's based on hostname, port.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>makeurl</command>
- <arg><replaceable>filename</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::makeurl</command>
+ <arg><replaceable>filename</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Create a self referencing URL from a filename. For example:
- <programlisting>makeurl /tclp.gif</programlisting>
- returns
- <computeroutput>http://[hostname]:[port]/tclp.gif</computeroutput>.
- where hostname and port are the hostname and port of the
- server in question.
- </para>
+ <title>Description</title>
+ <para>
+ Create a self referencing URL from a filename. For example:
+ <programlisting>makeurl /tclp.gif</programlisting>
+ returns
+ <computeroutput>http://[hostname]:[port]/tclp.gif</computeroutput>.
+ where hostname and port are the hostname and port of the
+ server in question.
+ </para>
</refsect1>
</refentry>
<!-- Reference page for command 'cookie' -->
<refentry id="cookie">
<refnamediv>
- <refname>cookie</refname>
- <refpurpose>get, set and delete cookies.</refpurpose>
+ <refname>cookie</refname>
+ <refpurpose>get, set and delete cookies.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>cookie</command>
- <arg>set</arg>
- <arg><replaceable>cookieName</replaceable></arg>
- <arg><replaceable><optional>cookiValue</optional></replaceable></arg>
- <arg>-days <replaceable>expireInDays</replaceable></arg>
- <arg>-hours <replaceable>expireInHours</replaceable></arg>
- <arg>-minutes <replaceable>expireInMinutes</replaceable></arg>
- <arg>-expires <replaceable>Wdy, DD-Mon-YYYY HH:MM:SS GMT</replaceable></arg>
- <arg>-path <replaceable>uriPathCookieAppliesTo</replaceable></arg>
- <arg>-secure <replaceable>1/0</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>cookie</command>
- <arg>get</arg>
- <arg><replaceable>cookieName</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>cookie</command>
- <arg>delete</arg>
- <arg><replaceable>cookieName</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>cookie</command>
- <arg>unset</arg>
- <arg><replaceable>cookieName</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::cookie</command>
+ <arg>set</arg>
+ <arg><replaceable>cookieName</replaceable></arg>
+ <arg><replaceable><optional>cookiValue</optional></replaceable></arg>
+ <arg>-days <replaceable>expireInDays</replaceable></arg>
+ <arg>-hours <replaceable>expireInHours</replaceable></arg>
+ <arg>-minutes <replaceable>expireInMinutes</replaceable></arg>
+ <arg>-expires <replaceable>Wdy, DD-Mon-YYYY HH:MM:SS GMT</replaceable></arg>
+ <arg>-path <replaceable>uriPathCookieAppliesTo</replaceable></arg>
+ <arg>-secure <replaceable>1/0</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::cookie</command>
+ <arg>get</arg>
+ <arg><replaceable>cookieName</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::cookie</command>
+ <arg>delete</arg>
+ <arg><replaceable>cookieName</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::cookie</command>
+ <arg>unset</arg>
+ <arg><replaceable>cookieName</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- <command>cookie</command> gets, sets, unsets or deletes a cookie. When you
- get a cookie, the command returns the value of the cookie,
- or an empty string if no cookie exists.
- </para>
- <para>
- <command>cookie delete</command> will set the timeout value to -1 minutes -
- deleting the cookie in the browser.
- </para>
- <para>
- <command>cookie unset</command> will remove the defined cookie in the server
- (perhaps preparatory to checking/resetting the cookie).
- </para>
+ <title>Description</title>
+ <para>
+ <command>cookie</command> gets, sets, unsets or deletes a cookie. When you
+ get a cookie, the command returns the value of the cookie,
+ or an empty string if no cookie exists.
+ </para>
+ <para>
+ <command>cookie delete</command> will set the timeout value to -1 minutes -
+ deleting the cookie in the browser.
+ </para>
+ <para>
+ <command>cookie unset</command> will remove the defined cookie in the server
+ (perhaps preparatory to checking/resetting the cookie).
+ </para>
</refsect1>
</refentry>
<!-- Reference page for command 'clock_to_rfc' -->
<refentry id="clock_to_rfc">
<refnamediv>
- <refname>clock_to_rfc850_gmt</refname>
- <refpurpose>create a rfc850 time from [clock seconds].</refpurpose>
+ <refname>clock_to_rfc850_gmt</refname>
+ <refpurpose>create a rfc850 time from [clock seconds].</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>clock_to_rfc850_gmt</command>
- <arg><replaceable>seconds</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::clock_to_rfc850_gmt</command>
+ <arg><replaceable>seconds</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Convert an integer-seconds-since-1970 click value to
- RFC850 format, with the additional requirement that it be
- GMT only.
- </para>
+ <title>Description</title>
+ <para>
+ Convert an integer-seconds-since-1970 click value to
+ RFC850 format, with the additional requirement that it be
+ GMT only.
+ </para>
</refsect1>
</refentry>
<refentry id="html">
<refnamediv>
- <refname>html</refname>
- <refpurpose>construct html tagged text.</refpurpose>
+ <refname>html</refname>
+ <refpurpose>construct html tagged text.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>html</command>
- <arg><replaceable>string</replaceable></arg>
- <arg rep="repeat"><replaceable>arg</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::html</command>
+ <arg><replaceable>string</replaceable></arg>
+ <arg rep="repeat"><replaceable>arg</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Print text with the added ability to pass HTML tags
- following the string. Example:
- <programlisting>html "Test" b i</programlisting>
- produces: <computeroutput><b><i>Test</i></b></computeroutput>
- </para>
+ <title>Description</title>
+ <para>
+ Print text with the added ability to pass HTML tags
+ following the string. Example:
+ <programlisting>::rivet::html "Test" b i</programlisting>
+ produces: <computeroutput><b><i>Test</i></b></computeroutput>
+ </para>
</refsect1>
</refentry>
-
+
<refentry id="incr0">
<refnamediv>
- <refname>incr0</refname>
- <refpurpose>increment a variable or set it to 1 if nonexistent.</refpurpose>
+ <refname>incr0</refname>
+ <refpurpose>increment a variable or set it to 1 if nonexistent.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>incr0</command>
- <arg><replaceable>varname</replaceable></arg>
- <arg><replaceable>num</replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>incr0</command>
+ <arg><replaceable>varname</replaceable></arg>
+ <arg><replaceable>num</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
-
<refsect1>
- <title>Description</title>
- <para>
- Increment a variable
- <option><replaceable>varname</replaceable></option> by
- <option><replaceable>num</replaceable></option>. If the
- variable doesn't exist, create it instead of returning an
- error.
- </para>
+ <title>Description</title>
+ <para>
+ Increment a variable
+ <option><replaceable>varname</replaceable></option> by
+ <option><replaceable>num</replaceable></option>. If the
+ variable doesn't exist, create it instead of returning an
+ error.
+ </para>
<note>
incr0 functionality is now provided by <command>incr</command>,
@@ -777,410 +1036,455 @@
only for compatibility. It will be removed in future versions of Rivet
</note>
</refsect1>
- </refentry>
+ </refentry>
- <refentry id="parray">
- <refnamediv>
- <refname>parray</refname>
- <refpurpose>Tcl's <command>parray</command> with html formatting.</refpurpose>
+ <refentry id="parray">
+ <refnamediv>
+ <refname>parray</refname>
+ <refpurpose>Tcl's <command>parray</command> with html formatting.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>parray</command>
- <arg><replaceable>arrayName</replaceable></arg>
- <arg><replaceable><optional>pattern</optional></replaceable></arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::parray</command>
+ <arg><replaceable>arrayName</replaceable></arg>
+ <arg><replaceable><optional>pattern</optional></replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- An html version of the standard Tcl
- <command>parray</command> command. Displays the entire
- contents of an array in a sorted, nicely-formatted way.
- Mostly used for debugging purposes.
- </para>
-
+ <title>Description</title>
+ <para>
+ An html version of the standard Tcl
+ <command>parray</command> command. Displays the entire
+ contents of an array in a sorted, nicely-formatted way.
+ Mostly used for debugging purposes.
+ </para>
</refsect1>
</refentry>
<refentry id="abort_page">
<refnamediv>
- <refname>abort_page</refname>
- <refpurpose>Stops outputing data to web page, similar in
- purpose to PHP's <command>die</command> command.</refpurpose>
+ <refname>abort_page</refname>
+ <refpurpose>
+ Stops outputing data to web page, similar in
+ purpose to PHP's <command>die</command> command.
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>abort_page</command>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::abort_page</command>
+ <group choice="req">
+ <arg><replaceable>abort code</replaceable></arg>
+ <arg><replaceable>-aborting</replaceable></arg>
+ </group>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title> <para>This command flushes the
- output buffer and stops the Tcl script from sending any more
- data to the client. A normal Tcl script might use the
- <command>exit</command> command, but that cannot be used in
- Rivet without actually exiting the apache child
- process!</para>
+ <title>Description</title>
+ <para>
+ This command flushes the output buffer and stops the Tcl
+ script from sending any more data to the client.
+ A normal Tcl script might use the
+ <command>exit</command> command, but that cannot be used in
+ Rivet without actually exiting the apache child
+ process!
+ <command>abort_page</command> triggers
+ the execution of an optional AbortScript that has to be
+ specified in the configuration. The value of the
+ argument <arg>abort code</arg> can be retrieved with the
+ <command>abort_code</command> command during the
+ execution of AbortScript or AfterEveryScript, allowing
+ the script to take appropriate actions in order to deal
+ with the cause of the abort.
+ </para>
+ <para>
+ When passed the argument <option>-aborting</option> the
+ command returns 1 if <option>abort_page</option>
+ had been called earlier in the request processing, thus
+ providing a tool for code in AfterEveryScript to tell
+ if the an abort condition took place.
+ </para>
</refsect1>
- </refentry>
+ </refentry>
- <refentry id="no_body">
+ <refentry id="abort_code">
+ <refnamediv>
+ <refname>abort_code</refname>
+ <refpurpose>
+ Returns the code passed to <command>abort_page</command>
+ earlier during the request processing
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>abort_code</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Usage of this command is meaningful only in code that runs as
+ AbortScript or AfterEveryScript.
+ <command>abort_code</command> returns the value of the optional
+ parameter passed to <command>abort_page</command> earlier in
+ the same request processing.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="no_body">
<refnamediv>
- <refname>no_body</refname>
- <refpurpose>Prevents Rivet from sending any content.</refpurpose>
+ <refname>no_body</refname>
+ <refpurpose>Prevents Rivet from sending any content.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>no_body</command>
- </cmdsynopsis>
- </refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::no_body</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- This command is useful for situations where it is necessary
- to only return HTTP headers and no actual content. For
- instance, when returning a 304 redirect.
- </para>
+ <title>Description</title>
+ <para>
+ This command is useful for situations where it is necessary
+ to only return HTTP headers and no actual content. For
+ instance, when returning a 304 redirect.
+ </para>
</refsect1>
</refentry>
- <refentry id="escape_string">
+ <refentry id="escape_string">
<refnamediv>
<refname>escape_string</refname>
<refpurpose>convert a string into escaped characters.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>escape_string</command>
- <arg>string</arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::escape_string</command>
+ <arg>string</arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Scans through each character in the specified string looking
- for special characters, escaping them as needed, mapping
- special characters to a quoted hexadecimal equivalent,
- returning the result.
- </para>
- <para>
- This is useful for quoting strings that are going to be
- part of a URL.
- </para>
- <note>
- You must require the Rivet package in order to gain access to this command
- </note>
+ <title>Description</title>
+ <para>
+ Scans through each character in the specified string looking
+ for special characters, escaping them as needed, mapping
+ special characters to a quoted hexadecimal equivalent,
+ returning the result.
+ </para>
+ <para>
+ This is useful for quoting strings that are going to be
+ part of a URL.
+ </para>
+ <note>
+ You must require the <command>rivetlib</command> package in order to gain access
+ to this command
+ </note>
</refsect1>
- </refentry>
+ </refentry>
<refentry id="escape_sgml_chars">
<refnamediv>
- <refname>escape_sgml_chars</refname>
- <refpurpose>escape special SGML characters in a string.</refpurpose>
+ <refname>escape_sgml_chars</refname>
+ <refpurpose>escape special SGML characters in a string.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>escape_sgml_chars</command>
- <arg>string</arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::escape_sgml_chars</command>
+ <arg>string</arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Scans through each character in the specified string looking
- for any special (with respect to SGML, and hence HTML) characters
- from the specified string, and returns the result.
- For example, the right angle
- bracket is escaped to the corrected ampersand gt symbol.
- </para>
- <note>
- You must require the Rivet package in order to gain access to this command
- </note>
+ <title>Description</title>
+ <para>
+ Scans through each character in the specified string looking
+ for any special (with respect to SGML, and hence HTML) characters
+ from the specified string, and returns the result.
+ For example, the right angle
+ bracket is escaped to the corrected ampersand gt symbol.
+ </para>
+ <note>
+ You must require the <command>rivetlib</command> package in order to gain access to this command
+ </note>
</refsect1>
</refentry>
<refentry id="escape_shell_command">
<refnamediv>
- <refname>escape_shell_command</refname>
- <refpurpose>escape shell metacharacters in a string.</refpurpose>
+ <refname>escape_shell_command</refname>
+ <refpurpose>escape shell metacharacters in a string.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>escape_shell_command</command>
- <arg>string</arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::escape_shell_command</command>
+ <arg>string</arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Scans through each character in the specified string looking
- for any shell metacharacters, such as asterisk, less than and
- greater than, parens, square brackets, curly brackets, angle
- brackets, dollar signs, backslashes, semicolons, ampersands,
- vertical bars, etc.
- </para>
- <para>
- For each metacharacter found, it is quoted in the result by
- prepending it with a backslash, returning the result.
- </para>
- <note>
- You must require the Rivet package in order to gain access to this command
- </note>
-
+ <title>Description</title>
+ <para>
+ Scans through each character in the specified string looking
+ for any shell metacharacters, such as asterisk, less than and
+ greater than, parens, square brackets, curly brackets, angle
+ brackets, dollar signs, backslashes, semicolons, ampersands,
+ vertical bars, etc.
+ </para>
+ <para>
+ For each metacharacter found, it is quoted in the result by
+ prepending it with a backslash, returning the result.
+ </para>
+ <note>
+ You must require the <command>Rivet</command> package in order to gain access to this command
+ </note>
</refsect1>
</refentry>
<refentry id="unescape_string">
<refnamediv>
- <refname>unescape_string</refname>
- <refpurpose>unescape escaped characters in a string.</refpurpose>
+ <refname>unescape_string</refname>
+ <refpurpose>unescape escaped characters in a string.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>unescape_string</command>
- <arg>string</arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::unescape_string</command>
+ <arg>string</arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>
- Scans through each character in the specified string looking
- for escaped character sequences (characters containing a
- percent sign and two hexadecimal characters, unescaping them
- back to their original character values, as needed, also mapping
- plus signs to spaces, and returning the result.
- </para>
- <para>
- This is useful for unquoting strings that have been quoted to
- be part of a URL.
- </para>
- <note>
- You must require the Rivet package in order to gain access to this command
- </note>
+ <title>Description</title>
+ <para>
+ Scans through each character in the specified string looking
+ for escaped character sequences (characters containing a
+ percent sign and two hexadecimal characters, unescaping them
+ back to their original character values, as needed, also mapping
+ plus signs to spaces, and returning the result.
+ </para>
+ <para>
+ This is useful for unquoting strings that have been quoted to
+ be part of a URL.
+ </para>
+ <note>
+ You must require the <command>rivetlib</command> package in order to gain
+ access to this command
+ </note>
</refsect1>
</refentry>
<refentry id="apache_log_error">
<refnamediv>
- <refname>apache_log_error</refname>
- <refpurpose>log messages to the Apache error log</refpurpose>
+ <refname>apache_log_error</refname>
+ <refpurpose>log messages to the Apache error log</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>apache_log_error</command>
- <arg>priority</arg>
- <arg>message</arg>
- </cmdsynopsis>
+ <cmdsynopsis>
+ <command>::rivet::apache_log_error</command>
+ <arg>priority</arg>
+ <arg>message</arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
- <title>Description</title>
- <para>The apache_log_error command logs a message to the
- Apache error log, whose name and location have been
- set by the <option>ErrorLog</option> directive.
- </para>
- <para>
- Priority must be one of
- <option>debug</option>,
- <option>info</option>,
- <option>notice</option>,
- <option>warning</option>,
- <option>err</option>,
- <option>crit</option>,
- <option>alert</option>, or
- <option>emerg</option>.
- </para>
+ <title>Description</title>
+ <para>The apache_log_error command logs a message to the
+ Apache error log, whose name and location have been
+ set by the <option>ErrorLog</option> directive.
+ </para>
+ <para>
+ Priority must be one of
+ <option>debug</option>,
+ <option>info</option>,
+ <option>notice</option>,
+ <option>warning</option>,
+ <option>err</option>,
+ <option>crit</option>,
+ <option>alert</option>, or
+ <option>emerg</option>.
+ </para>
</refsect1>
</refentry>
<refentry id="apache_table">
<refnamediv>
- <refname>apache_table</refname>
- <refpurpose>access and manipulate Apache tables in the request structure.</refpurpose>
+ <refname>apache_table</refname>
+ <refpurpose>access and manipulate Apache tables in the request structure.</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <cmdsynopsis>
- <command>apache_table</command>
- <group choice="req">
- <arg>get</arg>
- <arg>set</arg>
- <arg>exists</arg>
- <arg>unset</arg>
- <arg>names</arg>
- <arg>array_get</arg>
- <arg>clear</arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
- <para>The apache_table command is for accessing and manipulating
- Apache tables in the request structure.
- </para>
- <para>
- The table name must be one of
- <option>notes</option>,
- <option>headers_in</option>,
- <option>headers_out</option>,
- <option>err_headers_out</option>, or
- <option>subprocess_env</option>.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">get</arg>
- <arg><replaceable>tablename</replaceable></arg>
- <arg><replaceable>key</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- When given the name of an Apache table
- <option><replaceable>tablename</replaceable></option>
- and the name of a key
- <option><replaceable>tablename</replaceable></option>,
- returns the value of the key in the table, or an empty
- string.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">set</arg>
- <arg><replaceable>tablename</replaceable></arg>
- <arg><replaceable>key</replaceable></arg>
- <arg><replaceable>value</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">set</arg>
- <arg><replaceable>tablename</replaceable></arg>
- <arg><replaceable>list</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Stores the
- <option><replaceable>value</replaceable></option> in
- the table
- <option><replaceable>tablename</replaceable></option>
- under the key
- <option><replaceable>key</replaceable></option>.
- </para>
- <para>
- For the list form,
- <option><replaceable>list</replaceable></option> contains
- a list of zero or more pairs of key-value pairs to be
- set into the table
- <option><replaceable>tablename</replaceable></option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">exists</arg>
- <arg><replaceable>tablename</replaceable></arg>
- <arg><replaceable>key</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns 1 if the specified key,
- <option><replaceable>key</replaceable></option>,
- exists in table
- <option><replaceable>tablename</replaceable></option>,
- else 0.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">unset</arg>
- <arg><replaceable>tablename</replaceable></arg>
- <arg><replaceable>key</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Removes the key-value pair referenced by
- <option><replaceable>key</replaceable></option>
- from the table
- <option><replaceable>tablename</replaceable></option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">names</arg>
- <arg><replaceable>tablename</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns a list of all of the keys present in the table
- <option><replaceable>tablename</replaceable></option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">array_get</arg>
- <arg><replaceable>tablename</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Returns a list of key-value pairs from the table
- <option><replaceable>tablename</replaceable></option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <cmdsynopsis>
- <command>apache_table</command>
- <arg choice="plain">clear</arg>
- <arg><replaceable>tablename</replaceable></arg>
- </cmdsynopsis>
- </term>
- <listitem>
- <para>
- Clears the contents of the specified table.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <group choice="req">
+ <arg>get</arg>
+ <arg>set</arg>
+ <arg>exists</arg>
+ <arg>unset</arg>
+ <arg>names</arg>
+ <arg>array_get</arg>
+ <arg>clear</arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>The apache_table command is for accessing and manipulating
+ Apache tables in the request structure.
+ </para>
+ <para>
+ The table name must be one of
+ <option>notes</option>,
+ <option>headers_in</option>,
+ <option>headers_out</option>,
+ <option>err_headers_out</option>, or
+ <option>subprocess_env</option>.
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">get</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ <arg><replaceable>key</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ When given the name of an Apache table
+ <option><replaceable>tablename</replaceable></option>
+ and the name of a key
+ <option><replaceable>tablename</replaceable></option>,
+ returns the value of the key in the table, or an empty
+ string.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>apache_table</command>
+ <arg choice="plain">set</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ <arg><replaceable>key</replaceable></arg>
+ <arg><replaceable>value</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>apache_table</command>
+ <arg choice="plain">set</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ <arg><replaceable>list</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Stores the <option><replaceable>value</replaceable></option> in
+ the table <option><replaceable>tablename</replaceable></option>
+ under the key <option><replaceable>key</replaceable></option>.
+ </para>
+ <para>
+ For the list form,
+ <option><replaceable>list</replaceable></option> contains
+ a list of zero or more pairs of key-value pairs to be
+ set into the table
+ <option><replaceable>tablename</replaceable></option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">exists</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ <arg><replaceable>key</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns 1 if the specified key,
+ <option><replaceable>key</replaceable></option>,
+ exists in table
+ <option><replaceable>tablename</replaceable></option>,
+ else 0.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">unset</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ <arg><replaceable>key</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Removes the key-value pair referenced by
+ <option><replaceable>key</replaceable></option>
+ from the table
+ <option><replaceable>tablename</replaceable></option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">names</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns a list of all of the keys present in the table
+ <option><replaceable>tablename</replaceable></option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">array_get</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Returns a list of key-value pairs from the table
+ <option><replaceable>tablename</replaceable></option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
+ <command>::rivet::apache_table</command>
+ <arg choice="plain">clear</arg>
+ <arg><replaceable>tablename</replaceable></arg>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Clears the contents of the specified table.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</refsect1>
</refentry>
-
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org