rivet-3.2.1/rivet/packages/entities/000775 001750 001750 00000000000 14141530732 020153 5ustar00manghimanghi000000 000000 rivet-3.2.1/doc/html/images/scrollup.png000644 001750 001750 00000000541 14142162544 020750 0ustar00manghimanghi000000 000000 PNG  IHDR _w(gAMA asRGB cHRMz&u0`:pQ<PLTE5us0tRNS@fbKGDH pHYsHHFk>0IDATc```d! l$Ag"\@Ɔ B (hi6P%tEXtdate:create2012-10-01T18:29:07+02:00j%tEXtdate:modify2004-02-19T05:50:42+01:00%:,IENDB`rivet-3.2.1/rivet/packages/tclrivet/README000664 001750 001750 00000000200 14141530732 021033 0ustar00manghimanghi000000 000000 This package provides "Rivet" for tclsh. In other words, for Tcl scripts not executed inside Apache. tclrivetparser.tcl $Id$rivet-3.2.1/rivet/rivet-tcl/cookie.tcl000664 001750 001750 00000007437 14141530732 020452 0ustar00manghimanghi000000 000000 ## ## cookie [set|get] and supporting functions ## ## $Id$ ## namespace eval ::rivet { ## clock_to_rfc850_gmt seconds -- Convert an integer-seconds-since-1970 ## click value to RFC850 format, with the additional requirement that it ## be GMT only. ## proc clock_to_rfc850_gmt {seconds} { return [clock format $seconds -format "%a, %d-%b-%y %T GMT" -gmt 1] } ## make_cookie_attributes paramsArray -- Build up cookie parameters. ## ## If an expires element appears in the array, it's appended to the ## result as "; expires=value" ## ## If an element is present named "days", "hours", or "minutes", the ## corresponding value is converted to seconds, added to the current ## time, converted to RFC850 time format, and appended to the result ## as, for example, "; expires=Sun, 25-Sep-05 23:09:52 GMT" ## ## If any other elements named "path", "domain", or "secure" are present, ## they too are appended to the result. ## ## The resut is returned. ## proc make_cookie_attributes {paramsArray} { upvar 1 $paramsArray params set cookieParams "" set expiresIn 0 if { [info exists params(expires)] } { append cookieParams "; expires=$params(expires)" } else { foreach {time num} [list days 86400 hours 3600 minutes 60] { if {[info exists params($time)]} { incr expiresIn [expr {$params($time) * $num}] } } if {$expiresIn != 0} { set secs [expr [clock seconds] + $expiresIn] append cookieParams "; expires=[clock_to_rfc850_gmt $secs]" } } if { [info exists params(path)] } { append cookieParams "; path=$params(path)" } if { [info exists params(domain)] } { append cookieParams "; domain=$params(domain)" } if { [info exists params(secure)] && $params(secure) == 1} { append cookieParams "; secure" } if { [info exists params(HttpOnly)] && $params(HttpOnly)} { append cookieParams "; HttpOnly" } return $cookieParams } ## cookie [set|get] cookieName ?cookieValue? [-days expireInDays] ## [-hours expireInHours] [-minutes expireInMinutes] ## [-expires Wdy, DD-Mon-YYYY HH:MM:SS GMT] ## [-path uriPathCookieAppliesTo] ## [-secure 1|0] ## proc cookie {cmd name args} { set badchars "\[ \t;\]" switch -- $cmd { "set" { set value [lindex $args 0] set args [lrange $args 1 end] import_keyvalue_pairs params $args if {[regexp $badchars $name]} { return -code error \ "name may not contain semicolons, spaces, or tabs" } if {[regexp $badchars $value]} { return -code error \ "value may not contain semicolons, spaces, or tabs" } set cookieKey "Set-Cookie" set cookieValue "$name=$value" append cookieValue [make_cookie_attributes params] headers add $cookieKey $cookieValue } "get" { ::request::global RivetCookies if {![array exists RivetCookies]} { load_cookies RivetCookies } if {![info exists RivetCookies($name)]} { return } return $RivetCookies($name) } "delete" { ## In order to delete a cookie, we just need to set a cookie ## with a time that has already expired. cookie set $name "" -minutes -1 } "unset" { ::request::global RivetCookies if {![array exists RivetCookies]} { load_cookies RivetCookies } if {![info exists RivetCookies($name)]} { return } unset RivetCookies($name) } } } } rivet-3.2.1/tests/apachetest/template.conf.2.tcl000664 001750 001750 00000001334 14141530732 022307 0ustar00manghimanghi000000 000000 # Minimal config file for testing # Parsed by makeconf.tcl ServerRoot "$CWD" PidFile "$CWD/httpd.pid" #ResourceConfig "$CWD/srm.conf" #AccessConfig "$CWD/access.conf" Timeout 300 KeepAliveTimeout 100 KeepAlive On MaxRequestsPerChild 0 $LOADMODULES Listen 8081 ServerName localhost DocumentRoot "$CWD" Options All MultiViews AllowOverride All #Order allow,deny #Allow from all Require all granted DirectoryIndex index.html AccessFileName .htaccess HostnameLookups Off ErrorLog $CWD/error_log LogLevel debug LogFormat "%h %l %u %t \\"%r\\" %>s %b \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined CustomLog "$CWD/access_log" combined rivet-3.2.1/cvsversion.tcl000755 001750 001750 00000005072 14141530732 016332 0ustar00manghimanghi000000 000000 #!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # By David N. Welton # $Id$ # This is to generate new versions based on CVS information. set newversionvar 0 proc newversion { } { global newversionvar puts stderr "New version" set newversionvar 1 } proc diffentries { {dir .} } { global newversionvar set CVSEntries [file join . CVS Entries] set OldEntries [file join . .OLDEntries] puts stderr "Diffentries for $dir" set currentdir [pwd] cd $dir if { ! [file exists $CVSEntries] } { puts stderr "You must be in a directory with a path to ./CVS/Entries." } if { ! [file exists $OldEntries] } { puts stderr "No OLDEntries file. It will be created." set fl [open $OldEntries w] close $fl } set entries [open $CVSEntries] set blob "" while { [gets $entries ln] != -1 } { lappend blob $ln } close $entries set oldentries [open $OldEntries] set blob2 "" while { [gets $oldentries ln] != -1 } { lappend blob2 $ln } close $oldentries if { $blob != $blob2 } { newversion } foreach ln $blob { # the regexp below scans for directories in CVS Entries files if { [regexp {^D/(.*)////$} "$ln" match dir] } { diffentries $dir } } file copy -force $CVSEntries $OldEntries cd $currentdir } proc main {} { global newversionvar diffentries if { $newversionvar == 0 } { puts stderr "No changes, exiting." } else { if { [file exists VERSION] } { set versionfile [open VERSION "r"] gets $versionfile versionstring close $versionfile } else { set versionstring "0.0.0" } if { ! [regexp {([0-9]+)\.([0-9]+)\.([0-9]+)} $versionstring match major minor point] } { puts stderr "Problem with versionstring '$versionstring', exiting" exit 1 } set versionfile [ open VERSION "w" ] if { [catch { while { 1 } { puts -nonewline "Current version: $major.$minor.$point. " puts -nonewline {Increment [M]ajor, m[I]nor, [P]oint release, or [A]bort? >>> } flush stdout gets stdin answer switch [string tolower $answer] { m { incr major set minor 0 set point 0 break } i { incr minor set point 0 break } p { incr point break } a { puts "Aborted" break } } } puts $versionfile "$major.$minor.$point" } err] } { puts stderr "Problem writing VERSION file: $err" puts $versionfile "$major.$minor.$point" } close $versionfile puts "Done, version is $major.$minor.$point" } } mainrivet-3.2.1/doc/html/request.html000664 001750 001750 00000046726 14142162543 017530 0ustar00manghimanghi000000 000000 Apache Child Processes Lifecycle and Request Processing

Apache Child Processes Lifecycle and Request Processing

Apache Child Process Lifecycle

Apache Rivet devolves to the Multi-Processing Module (MPM) the task of managing the agents responding to network requests. An MPM is responsible for creating such agents during the start-up, and is in charge for terminating existing ones and recreating new agents when the workload is requiring it.

Apache Rivet 2.x supported only the prefork MPM which creates child processes as independent agents responding to network requests. Starting with 3.0 also the worker and event MPM are supported. The worker MPM is an hybrid model where forked child processes in turn create threads as real network agents. Also Apache on Windows© is now supported and tested with the winnt MPM, where a single process creates and manages a large number of thread agents.

Configuration parameters about this critical point can be read in the Apache documentation.

There are 4 stages in the lifetime of an Apache webserver that are relevant to Rivet:

  1. Server Initialization

    Apaches starts up as a single process. During this stage Apache performs various preliminary tasks including reading and parsing the configuration. After the configuration has been read Rivet sets up some internal resources and if a Tcl script is set as argument of a ServerInitScript directive the script is executed. Variables, arrays or dictionaries created during the execution of this script will be preserved and later replicated in the child process intepreters if the prefork MPM is loaded (which restricts this feature to the Unix systems). The prefork MPM creates new child processes with a fork() system call, which involves only in memory copy of sections of a process address space. Tcl is careful about reproducing an environment across a fork call in order to have a functional interpreter.
    Still, regardless the OS and loaded MPM ServerInitScript is a good place to do global initialization that doesn't involve creation of private data. Example of tasks that can be done in this context are IPC methods that must be initialized at this stage. With the prefork MPM also importing from namespaces and loading packages can be done here removing the burden from the child initialization stage.
  2. Child Process Initialization

    A child process calls the MPM bridge interface function to set up the Tcl run time environment,either creating multiple threads each running its Tcl interpreters or, in the case of the prefork MPM bridge, setting up the environment within a the child process itself as a single Tcl thread.
    This is the stage where most likely you want to open I/O channels, database connections or any other resource that has to be private to an interpreter and has to persist over a whole thread lifespan. When the option SeparateVirtualInterps is turned off child processes will have a single interpreter regardless the number of virtual hosts configured. The GlobalInitScript is the configuration script the child process will run once before getting ready to serve requests
    When SeparateVirtualInterps is turned on each configured virtual host will have its own slave interpreter which can will run the ChildInitScript directive as initialization script. The ChildInitScript has to be placed within a <VirtualHost...>...</VirtualHost ...> stanza to associate a script to a specific virtual host initialization. This scenario of interpreter separation is extremely useful to prevent resource conflicts when different virtual hosts are serving different web applications.
    [Note]Note
    GlobalInitScript has no effect to working interpreters when SeparateVirtualInterps is set.
    [Note]Note
    The lazy MPM bridge implements a model where every worker thread has exactly one interpreter and belongs to a single virtual host, therefore SeparateVirtualInterps is ignored and you can't share the same interpreter among virtual host
  3. Request Processing and Content Generation

    [Note]Note
    This section explain the default request handling procedure which was written to let Rivet 3.0 work as a drop in replacement of any 2.x module. For a in-depth understanding of the new request processing mechanics please read the request processing section of the manual
    After a child has been initialized it's ready to serve requests. A child process' lifetime is almost entirely spent in this phase, waiting for connections and responding to requests. At every request the URL goes through filter processing and, in case, rewritten (mod_rewrite, Alias directives, etc). Parameter values encoded in the request are made available to the environment and finally the script encoded in the URL is run. The developer can tell Rivet if optionally the execution has to be preceded by a BeforeScript and followed by an AfterScript. The real script mod_rivet will execute is the result of the concatenation of the BeforeScript, the script encoded in the URL and the AfterScript. Thus the whole ensemble of code that makes up a web application might be running within the same "before" and "after" scripts to which the programmer can devolve tasks common to every page of an application.
  4. Child Process Exit

    If no error condition forces the child process to a premature exit, his life is determined by the Apache configuration parameters. To reduce the effects of memory leaks in buggy applications the Apache webserver forces a child process to exit after a certain number of requests served. A child process gets replaced with a brand new one if the workload of webserver requires so. Before the process quits an exit handler can be run to do some housekeeping, just in case something the could have been left behind has to be cleaned up. Like the initialization scripts ChildExitScript too is a "one shot" script.
    The Tcl exit command forces an interpreter to quit, thus removing the ability of the process embedding it to run more Tcl scripts. The child process then is forced to exit and be replaced by a new one when the workload demands it. This operation implies the ChildExitScript be run before the interpreter is actually deleted.

Apache Rivet Error and Exception Scripts Directives

Rivet is highly configurable and each of the webserver lifecycle stages can be exploited to control a web application. Not only the orderly sequence of stages in a child lifecycle can be controlled with Tcl scripts, but also Tcl error or abnormal conditions taking place during the execution can be caught and handled with specific scripts.

Tcl errors (conditions generated when a command exits with code TCL_ERROR) usually result in the printing of a backtrace of the code fragment relevant to the error. Rivet can set up scripts to trap these errors and run instead an ErrorScript to handle it and conceal details that usually have no interest for the end user and it may show lines of code that ought to remain private. The ErrorScript handler might create a polite error page where things can be explained in human readable form, thus enabling the end user to provide meaningful feedback information.

In other cases an unmanageable conditions might take place in the data and this could demand an immediate interruption of the content generation. These abort conditions can be fired by the abort_page command, which in turn fires the execution of an AbortScript to handle the abnormal condition. Starting with Rivet 2.1.0 abort_page accepts a free form parameter that can be retrieved later with the command abort_code

Tcl Namespaces in Rivet and the ::request Namespace

[Note]Note
This section explain the default request handling procedure which was written to let Rivet 3.0 work as a drop in replacement of any 2.x module. For a in-depth understanding of the new request processing mechanics please read the request processing section of the manual

With the sole exception of .rvt templates, mod_rivet runs pure Tcl scripts at the global namespace. That means that every variable or procedure created in Tcl scripts resides by default in the "::" namespace (just like in traditional Tcl scripting) and they are persistent across different requests until explicitly unset or until the interpreter is deleted. You can create your own application namespaces to store data but it is important to remember that subsequent requests will in general be served by different child processes. Your application can rely on the fact that certain application data will be in the interpreter, but you shouldn't assume the state of a transaction spanning several pages can be stored in this way and be safely kept available to a specific client. Sessions exist for this purpose and Rivet ships its own session package with support for most of popular DBMS. Nonetheless storing data in the global namespace can be useful, even though scoping data in a namespace is recommended. I/O channels and database connections are examples of information usually specific to a process for which you don't want to pay the overhead of creating them at every request, probably causing a dramatic loss in the application performance.

A special role in the interpreter is played by the ::request namespace. The ::request namespace is deleted and recreated at every request and Rivet templates (.rvt files) are executed within it.

Unless you're fully qualifying variable names outside the ::request namespace, every variable and procedure created in .rvt files is by default placed in it and deleted before any other requests gets processed. It is therefore safe to create variables or object instances in template files and foresake about them: Rivet will take care of cleaning the namespace up and everything created inside the namespace will be destroyed.

StageScriptNamespace
Apache InitializationServerInitScript::
Child InitializationGlobalInitScript::
ChildInitScript::
Request ProcessingBeforeScript::
.rvt::request
.tcl::
AfterScript::
AbortScript::
AfterEveryScript::
Child TerminationChildExitScript::
Error HandlingErrorScript::
rivet-3.2.1/tclconfig/config.guess000755 001750 001750 00000130361 14141530732 017712 0ustar00manghimanghi000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rivet-3.2.1/doc/examples-sgml/color-table.tcl000664 001750 001750 00000002337 14141530732 021657 0ustar00manghimanghi000000 000000 puts "<html><head>" puts "<style>\n td { font-size: 12px; text-align: center; padding-left: 3px; padding-right: 3px}" puts " td.bright { color: #eee; }\n td.dark { color: #222; }\n</style>" puts "</head><body>" puts "<table>" # we create a 9x9 table selecting a different background for each cell for {set i 0} { $i < 9 } {incr i} { puts "<tr>" for {set j 0} {$j < 9} {incr j} { set r [expr int(255 * ($i + $j) / 16)] set g [expr int(255 * (8 - $i + $j) / 16)] set b [expr int(255 * ($i + 8 - $j) / 16)] # determining the background luminosity (YIQ space of NTSC) and choosing # the foreground color accordingly in order maintain maximum contrast if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 128.0} { set cssclass "dark" } else { set cssclass "bright" } puts [format "<td bgcolor=\"%02x%02x%02x\" class=\"%s\">$r $g $b</td>" $r $g $b $cssclass] } puts "</tr>" } puts "</table>" puts "</body></html>" rivet-3.2.1/doc/examples/hello.rvt000664 001750 001750 00000000031 14141530732 017635 0ustar00manghimanghi000000 000000 rivet-3.2.1/rivet/packages/tclrivet/tclrivet.tcl000664 001750 001750 00000002267 14141530732 022532 0ustar00manghimanghi000000 000000 # Tcl versions of Rivet commands. # Copyright 2003-2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # $Id$ package provide tclrivet 0.1 #load [file join [file dirname [info script]] .. .. \ # librivetparser[info sharedlibextension]] proc include { filename } { set fl [ open $filename ] fconfigure $fl -translation binary puts -nonewline [ read $fl ] close $fl } # We need to fill these in, of course. proc makeurl {} {} proc headers {} {} proc load_env {} {} proc load_headers {} {} proc var {} {} proc var_qs {} {} proc var_post {} {} proc upload {} {} proc parse {} {} proc no_body {} {} proc env {} {} proc abort_page {} {} proc virtual_filename {} {} rivet-3.2.1/rivet/rivet-tcl/html.tcl000664 001750 001750 00000001212 14141530732 020126 0ustar00manghimanghi000000 000000 ### ## html ?arg.. arg.. arg..? ## Print text with the added ability to pass HTML tags following the string. ## Example: ## html "Test" b i ## ## Will produce: ## Test ## ## string - A text string to be displayed. ## args - A list of HTML tags (without <>) to surround in. ## ## $Id$ ## ### namespace eval ::rivet { proc html {string args} { foreach arg $args { append output <$arg> } append output $string for {set i [expr {[llength $args] - 1} ]} {$i >= 0} {incr i -1} { append output } puts $output } } rivet-3.2.1/rivet/packages/dio/diodisplay.tcl000664 001750 001750 00000077601 14141530732 021762 0ustar00manghimanghi000000 000000 # diodisplay.tcl -- # Copyright 2002-2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # $Id$ # package require Itcl package require DIO package require form package provide DIODisplay 1.0 catch { ::itcl::delete class DIODisplay } ::itcl::class ::DIODisplay { constructor {args} { eval configure $args load_response if {[::rivet::lempty $DIO]} { return -code error "You must specify a DIO object" } if {[::rivet::lempty $form]} { set form [namespace which [::form #auto -defaults response]] } set document [env DOCUMENT_NAME] if {[info exists response(num)] \ && ![::rivet::lempty $response(num)]} { set pagesize $response(num) } read_css_file } destructor { if {$cleanup} { do_cleanup } } method destroy {} { ::itcl::delete object $this } # # configvar - a convenient helper for creating methods that can # set and fetch one of the object's variables # method configvar {varName string} { if {[::rivet::lempty $string]} { return [set $varName] } configure -$varName $string } # # is_function - return true if name is known to be a function # such as Search List Add Edit Delete Details Main Save DoDelete Cancel # etc. # method is_function {name} { if {[lsearch $functions $name] > -1} { return 1 } if {[lsearch $allfunctions $name] > -1} { return 1 } return 0 } # # do_cleanup - clean up our field subobjects, DIO objects, forms, and the # like. # method do_cleanup {} { ## Destroy all the fields created. foreach field $allfields { catch { $field destroy } } ## Destroy the DIO object. catch { $DIO destroy } ## Destroy the form object. catch { $form destroy } } # # handle_error - emit an error message # method handle_error {error} { puts "An error has occurred processing your request" puts "
"
	puts "$error"
	puts ""
	puts "$::errorInfo"
	puts "
" } # # read_css_file - parse and read in a CSS file so we can # recognize CSS info and emit it in appropriate places # method read_css_file {} { if {[::rivet::lempty $css]} { return } if {[catch {open [virtual_filename $css]} fp]} { return } set contents [read $fp] close $fp array set tmpArray $contents foreach class [array names tmpArray] { set cssArray([string toupper $class]) $tmpArray($class) } } # # get_css_class - figure out which CSS class we want to use. # If class exists, we use that. If not, we use default. # method get_css_class {tag default class} { # if tag.class exists, use that if {[info exists cssArray([string toupper $tag.$class])]} { return $class } # if .class exists, use that if {[info exists cssArray([string toupper .$class])]} { return $class } # use the default return $default } # # parse_css_class - given a class and the name of an array, parse # the named CSS class (read from the style sheet) and return it as # key-value pairs in the named array. # method parse_css_class {class arrayName} { # if we don't have an entry for the specified glass, give up if {![info exists cssArray($class)]} { return } # split CSS entry on semicolons, for each one... upvar 1 $arrayName array foreach line [split $cssArray($class) \;] { # trim leading and trailing spaces set line [string trim $line] # split the line on a colon into property and value lassign [split $line :] property value # map the property to space-trimmed lowercase and # space-trim the value, then store in the passed array set property [string trim [string tolower $property]] set value [string trim $value] set array($property) $value } } # # button_image_src - return the value of the image-src element in # the specified class (from the CSS style sheet), or an empty # string if there isn't one. # method button_image_src {class} { set class [string toupper input.$class] parse_css_class $class array if {![info exists array(image-src)]} { return } return $array(image-src) } # state - return a list of name-value pairs that represents the current # state of the query, which can be used to properly populate links # outside DIOdisplay. method state {} { set state {} foreach fld {mode query by how sort num page} { if [info exists response($fld)] { lappend state $fld $response($fld) } } return $state } method show {} { # if there's a mode in the response array, use that, else set # mode to Main set mode Main if {[info exists response(mode)]} { set mode $response(mode) } # if there is a style sheet defined, emit HTML to reference it if {![::rivet::lempty $css]} { puts "" } # put out the table header puts {} puts "" puts {" puts "" puts "
} # if mode isn't Main and persistentmain is set (the default), # run Main if {$mode != "Main" && $persistentmain} { Main } if {![is_function $mode]} { puts "In-valid function" return } if {[catch "$this $mode" error]} { handle_error $error } puts "
" if {$cleanup} { destroy } } method showview {} { puts {} set row 0 foreach field $fields { $field showview [lindex {"" "Alt"} $row] set row [expr 1 - $row] } puts "
" } # # showform_prolog - emit a form for inserting a new record # # response(by) will contain whatever was in the "where" field # response(query) will contain whatever was in the "is" field # method showform_prolog {{args ""}} { get_field_values array eval $form start $args foreach fld [array names hidden] { $form hidden $fld -value $hidden($fld) } $form hidden mode -value Save $form hidden DIODfromMode -value $response(mode) $form hidden DIODkey -value [$DIO makekey array] puts {} } method showform_epilog {} { set save [button_image_src DIOFormSaveButton] set cancel [button_image_src DIOFormCancelButton] puts "
" puts "" puts "" puts "" puts "" puts "" puts "
" if {![::rivet::lempty $save]} { $form image save -src $save -class DIOFormSaveButton } else { $form submit save.x -value "Save" -class DIOFormSaveButton } puts "" if {![::rivet::lempty $cancel]} { $form image cancel -src $cancel -class DIOFormSaveButton } else { $form submit cancel.x -value "Cancel" -class DIOFormCancelButton } puts "
" $form end } # # showform - emit a form for inserting a new record # # response(by) will contain whatever was in the "where" field # response(query) will contain whatever was in the "is" field # method showform {} { showform_prolog # emit each field foreach field $fields { showform_field $field } showform_epilog } # showform_field - emit the form field for the specified field using # the showform method of the field. If the user has typed something # into the search field and it matches the fields being emitted, # use that value as the default # method showform_field {field} { if {[info exists response(by)] && $response(by) == [$field text]} { if {![$field readonly] && $response(query) != ""} { $field value $response(query) } } $field showform } method page_buttons {end {count 0}} { if {$pagesize <= 0} { return } if {![info exists response(page)]} { set response(page) 1 } set pref DIO$end if {!$count} { set count [$DIOResult numrows] } set pages [expr ($count + $pagesize - 1) / $pagesize] if {$pages <= 1} { return } set first [expr $response(page) - 4] if {$first > $pages - 9} { set first [expr $pages - 9] } if {$first > 1} { lappend pagelist 1 1 if {$first > 3} { lappend pagelist ".." 0 } elseif {$first > 2} { lappend pagelist 2 2 } } else { set first 1 } set last [expr $response(page) + 4] if {$last < 9} { set last 9 } if {$last > $pages} { set last $pages } for {set i $first} {$i <= $last} {incr i} { lappend pagelist $i $i } if {$last < $pages} { if {$last < $pages - 2} { lappend pagelist ".." 0 } elseif {$last < $pages - 1} { incr last lappend pagelist $last $last } lappend pagelist $pages $pages } foreach {n p} $pagelist { if {$p == 0 || $p == $response(page)} { lappend navbar $n } else { set html {$n" lappend navbar $html } } if {"$end" == "Bottom"} { puts "
" } set class [get_css_class TABLE DIONavButtons ${pref}NavButtons] puts "" puts "" puts "" if {"$end" == "Top" && $pages>10} { set f [::form #auto] $f start foreach fld [array names hidden] { $f hidden $fld -value $hidden($fld) } foreach fld {mode query by how sort num} { if [info exists response($fld)] { $f hidden $fld -value $response($fld) } } puts "" $f end } puts "" puts "
" if {"$end" == "Top"} { puts "$count rows, go to page" } else { puts "Go to page" } foreach link $navbar { puts "$link " } puts "" puts "Jump directly to" $f text page -size 4 -value $response(page) $f submit submit -value "Go" puts "
" if {"$end" == "Top"} { puts "
" } } method rowheader {{total 0}} { set fieldList $fields if {![::rivet::lempty $rowfields]} { set fieldList $rowfields } set rowcount 0 puts

if {$topnav} { page_buttons Top $total } puts {} puts "" foreach field $fieldList { set text [$field text] set sorting $allowsort ## If sorting is turned off, or this field is not in the ## sortfields, we don't display the sort option. if {$sorting && ![::rivet::lempty $sortfields]} { if {[lsearch $sortfields $field] < 0} { set sorting 0 } } if {$sorting && [info exists response(sort)]} { if {"$response(sort)" == "$field"} { set sorting 0 } } if {!$sorting} { set html $text } else { set html {$text" } set class [get_css_class TH DIORowHeader DIORowHeader-$field] puts "" } if {![::rivet::lempty $rowfunctions] && "$rowfunctions" != "-"} { puts {} } puts "" } method showrow {arrayName} { upvar 1 $arrayName a incr rowcount set alt "" if {$alternaterows && ![expr $rowcount % 2]} { set alt Alt } set fieldList $fields if {![::rivet::lempty $rowfields]} { set fieldList $rowfields } puts "" foreach field $fieldList { set class [get_css_class TD DIORowField$alt DIORowField$alt-$field] set text "" if {[info exists a($field)]} { set text $a($field) if [info exists filters($field)] { set text [$filters($field) $text] } } if ![string length $text] { set text " " } puts "" } if {![::rivet::lempty $rowfunctions] && "$rowfunctions" != "-"} { set f [::form #auto] puts "" $f end } puts "" } method rowfooter {{total 0}} { puts "
$htmlFunctions
$text" $f start foreach fld [array names hidden] { $f hidden $fld -value $hidden($fld) } $f hidden query -value [$DIO makekey a] if {[llength $rowfunctions] > 1} { $f select mode -values $rowfunctions -class DIORowFunctionSelect$alt $f submit submit -value "Go" -class DIORowFunctionButton$alt } else { set func [lindex $rowfunctions 0] $f hidden mode -value $func $f submit submit -value $func -class DIORowFunctionButton$alt } puts "
" if {$bottomnav} { page_buttons Bottom $total } } ## Define a new function. method function {name} { lappend allfunctions $name } ## Define a field in the object. method field {name args} { import_keyvalue_pairs data $args lappend fields $name lappend allfields $name set class DIODisplayField if {[info exists data(type)]} { if {![::rivet::lempty [::itcl::find classes *DIODisplayField_$data(type)]]} { set class DIODisplayField_$data(type) } } eval $class $name -name $name -display $this -form $form $args set FieldTextMap([$name text]) $name } method fetch {key arrayName} { upvar 1 $arrayName $arrayName set result [$DIO fetch $key $arrayName] set error [$DIO errorinfo] if {![::rivet::lempty $error]} { return -code error $error } return $result } method store {arrayName} { upvar 1 $arrayName array set result [$DIO store array] set error [$DIO errorinfo] if {![::rivet::lempty $error]} { return -code error $error } return $result } method update_with_explicit_key {key arrayName} { upvar 1 $arrayName array set result [$DIO update_with_explicit_key $key array] set error [$DIO errorinfo] if {![::rivet::lempty $error]} {return -code error $error} return $result } method delete {key} { set result [$DIO delete $key] set error [$DIO errorinfo] if {![::rivet::lempty $error]} { return -code error $error } return $result } method pretty_fields {list} { foreach field $list { lappend fieldList [$field text] } return $fieldList } method set_field_values {arrayName} { upvar 1 $arrayName array # for all the elements in the specified array, try to invoke # the element as an object, invoking the method "value" to # set the value to the specified value foreach var [array names array] { #if {[catch { $var value $array($var) } result] == 1} {} if {[catch { $var configure -value $array($var) } result] == 1} { } } } method get_field_values {arrayName} { upvar 1 $arrayName array foreach field $allfields { # for some reason the method for getting the value doesn't # work for boolean values, which inherit DIODisplayField, # something to do with configvar #set array($field) [$field value] set array($field) [$field cget -value] } } method DisplayRequest {query} { set DIOResult [eval $DIO search -select "count(*)" $query] if [$DIOResult numrows] { $DIOResult next -array a set total $a(count) } else { set total 0 } $DIOResult destroy set DIOResult "" append query [sql_order_by_syntax] append query [sql_limit_syntax] set DIOResult [eval $DIO search $query] if {[$DIOResult numrows] <= 0} { puts "Could not find any matching records." $DIOResult destroy set DIOResult "" return } rowheader $total $DIOResult forall -array a { showrow a } rowfooter $total $DIOResult destroy set DIOResult "" } method Main {} { puts "" set selfunctions {} foreach f $functions { if {"$f" != "List"} { lappend selfunctions $f } else { set f [::form #auto] $f start foreach fld [array names hidden] { $f hidden $fld -value $hidden($fld) } $f hidden mode -value "List" $f hidden query -value "" puts "" $f end } } puts "" if {![::rivet::lempty $numresults]} { puts "" } $form end puts "
" $f submit submit -value "Show All" -class DIORowFunctionButton puts "" $form start puts " " foreach fld [array names hidden] { $form hidden $fld -value $hidden($fld) } if {[llength $selfunctions] > 1} { $form select mode -values $selfunctions -class DIOMainFunctionsSelect puts "where" } else { puts "Where" } set useFields $fields if {![::rivet::lempty $searchfields]} { set useFields $searchfields } $form select by -values [pretty_fields $useFields] \ -class DIOMainSearchBy if [string match {[Ss]earch} $selfunctions] { $form select how -values {"=" "<" "<=" ">" ">="} } else { puts "is" } if [info exists response(query)] { $form text query -value $response(query) -class DIOMainQuery } else { $form text query -value "" -class DIOMainQuery } if {[llength $selfunctions] > 1} { $form submit submit -value "GO" -class DIOMainSubmitButton } else { $form hidden mode -value $selfunctions $form submit submit -value $selfunctions -class DIOMainSubmitButton } puts "
Results per page: " $form select num -values $numresults -class DIOMainNumResults puts "
" } method sql_order_by_syntax {} { if {[info exists response(sort)] && ![::rivet::lempty $response(sort)]} { return " ORDER BY $response(sort)" } if {![::rivet::lempty $defaultsortfield]} { return " ORDER BY $defaultsortfield" } } method sql_limit_syntax {} { if {$pagesize <= 0} { return } set offset "" if {[info exists response(page)]} { set offset [expr ($response(page) - 1) * $pagesize] } return [$DIO sql_limit_syntax $pagesize $offset] } method Search {} { set searchField $FieldTextMap($response(by)) set what $response(query) if {[info exists response(how)] && [string length $response(how)]} { set what "$response(how)$what" } DisplayRequest "-$searchField $what" } method List {} { DisplayRequest "" } method Add {} { showform } method Edit {} { if {![fetch $response(query) array]} { puts "That record does not exist in the database." return } set_field_values array showform } ## ## When we save, we want to set all the fields' values and then get ## them into a new array. We do this because we want to clean any ## unwanted variables out of the array but also because some fields ## have special handling for their values, and we want to make sure ## we get the right value. ## method Save {} { if {[info exists response(cancel.x)]} { Cancel return } ## We need to see if the key exists. If they are adding a new ## entry, we just want to see if the key exists. If they are ## editing an entry, we need to see if they changed the keyfield ## while editing. If they didn't change the keyfield, there's no ## reason to check it. if {$response(DIODfromMode) == "Add"} { set key [$DIO makekey response] fetch $key a } else { set key $response(DIODkey) set newkey [$DIO makekey response] ## If we have a new key, and the newkey doesn't exist in the ## database, we are moving this record to a new key, so we ## need to delete the old key. if {$key != $newkey} { if {![fetch $newkey a]} { # no record already exists with the new key, # do a special update set_field_values response get_field_values updateArray update_with_explicit_key $key updateArray headers redirect $document return } } } # if we got here and array "a" exists, they're trying to alter a key # to a key that already exists if {[array exists a]} { puts "That record already exists in the database." return } set_field_values response get_field_values storeArray store storeArray headers redirect $document } method Delete {} { if {![fetch $response(query) array]} { puts "That record does not exist in the database." return } if {!$confirmdelete} { DoDelete return } puts "

" puts {} puts "" puts {" puts "" puts "" puts {" puts {" puts "" puts "
} puts "Are you sure you want to delete this record from the database?" puts "
} set f [::form #auto] $f start foreach fld [array names hidden] { $f hidden $fld -value $hidden($fld) } $f hidden mode -value DoDelete $f hidden query -value $response(query) $f submit submit -value Yes -class DIODeleteConfirmYesButton $f end puts "} set f [::form #auto] $f start foreach fld [array names hidden] { $f hidden $fld -value $hidden($fld) } $f submit submit -value No -class "DIODeleteConfirmNoButton" $f end puts "
" puts "
" } method DoDelete {} { delete $response(query) headers redirect $document } method Details {} { if {![fetch $response(query) array]} { puts "That record does not exist in the database." return } set_field_values array showview } method Cancel {} { headers redirect $document } ### ## Define variable functions for each variable. ### method fields {{list ""}} { if {[::rivet::lempty $list]} { return $fields } foreach field $list { if {[lsearch $allfields $field] < 0} { return -code error "Field $field does not exist." } } set fields $list } method searchfields {{list ""}} { if {[::rivet::lempty $list]} { return $searchfields } foreach field $list { if {[lsearch $allfields $field] < 0} { return -code error "Field $field does not exist." } } set searchfields $list } method rowfields {{list ""}} { if {[::rivet::lempty $list]} { return $rowfields } foreach field $list { if {[lsearch $allfields $field] < 0} { return -code error "Field $field does not exist." } } set rowfields $list } method filter {field {value ""}} { if [string length $value] { set filters($field) [uplevel 1 [list namespace which $value]] } else { if [info exists filters($field)] { return $filters($field) } else { return "" } } } method hidden {name {value ""}} { if [string length $value] { set hidden($name) $value } else { if [info exists hidden($name)] { return $hidden($name) } else { return "" } } } method DIO {{string ""}} { configvar DIO $string } method DIOResult {{string ""}} { configvar DIOResult $string } method title {{string ""}} { configvar title $string } method functions {{string ""}} { configvar functions $string } method pagesize {{string ""}} { configvar pagesize $string } method form {{string ""}} { configvar form $string } method cleanup {{string ""}} { configvar cleanup $string } method confirmdelete {{string ""}} { configvar confirmdelete $string } method css {{string ""}} { configvar css $string } method persistentmain {{string ""}} { configvar persistentmain $string } method alternaterows {{string ""}} { configvar alternaterows $string } method allowsort {{string ""}} { configvar allowsort $string } method sortfields {{string ""}} { configvar sortfields $string } method topnav {{string ""}} { configvar topnav $string } method bottomnav {{string ""}} { configvar bottomnav $string } method numresults {{string ""}} { configvar numresults $string } method defaultsortfield {{string ""}} { configvar defaultsortfield $string } method rowfunctions {{string ""}} { configvar rowfunctions $string } ## OPTIONS ## public variable DIO "" public variable DIOResult "" public variable title "" public variable fields "" public variable searchfields "" public variable functions "Search List Add Edit Delete Details" public variable pagesize 25 public variable form "" public variable cleanup 1 public variable confirmdelete 1 public variable css "diodisplay.css" { if {![::rivet::lempty $css]} { catch {unset cssArray} read_css_file } } public variable persistentmain 1 public variable alternaterows 1 public variable allowsort 1 public variable sortfields "" public variable topnav 1 public variable bottomnav 1 public variable numresults "" public variable defaultsortfield "" public variable rowfields "" public variable rowfunctions "Details Edit Delete" public variable response public variable cssArray public variable document "" public variable allfields "" public variable FieldTextMap public variable allfunctions { Search List Add Edit Delete Details Main Save DoDelete Cancel } private variable rowcount private variable filters private variable hidden } ; ## ::itcl::class DIODisplay catch { ::itcl::delete class ::DIODisplayField } # # DIODisplayField object -- defined for each field we're displaying # ::itcl::class ::DIODisplayField { constructor {args} { ## We want to simulate Itcl's configure command, but we want to ## check for arguments that are not variables of our object. If ## they're not, we save them as arguments to the form when this ## field is displayed. import_keyvalue_pairs data $args foreach var [array names data] { if {![info exists $var]} { lappend formargs -$var $data($var) } else { set $var $data($var) } } # if text (field description) isn't set, prettify the actual # field name and use that if {[::rivet::lempty $text]} { set text [pretty [split $name _]] } } destructor { } method destroy {} { ::itcl::delete object $this } # # get_css_class - ask the parent DIODIsplay object to look up # a CSS class entry # method get_css_class {tag default class} { return [$display get_css_class $tag $default $class] } # # get_css_tag -- set tag to select or textarea if type is select # or textarea, else to input # method get_css_tag {} { switch -- $type { "select" { set tag select } "textarea" { set tag textarea } default { set tag input } } } # # pretty -- prettify a list of words by uppercasing the first letter # of each word # method pretty {string} { set words "" foreach w $string { lappend words \ [string toupper [string index $w 0]][string range $w 1 end] } return [join $words " "] } method configvar {varName string} { if {[::rivet::lempty $string]} { return [set $varName] } configure -$varName $string } # # showview - emit a table row of either DIOViewRow, DIOViewRowAlt, # DIOViewRow-fieldname (this object's field name), or # DIOViewRowAlt-fieldname, a table data field of either # DIOViewHeader or DIOViewHeader-fieldname, and then a # value of class DIOViewField or DIOViewField-fieldname # method showview {{alt ""}} { set class [get_css_class TR DIOViewRow$alt DIOViewViewRow$alt-$name] puts "" set class [get_css_class TD DIOViewHeader DIOViewHeader-$name] puts "$text:" set class [get_css_class TD DIOViewField DIOViewField-$name] puts "$value" puts "" } # # showform -- like showview, creates a table row and table data, but # if readonly isn't set, emits a form field corresponding to the type # of this field # method showform {} { puts "" set class [get_css_class TD DIOFormHeader DIOFormHeader-$name] puts "$text:" set class [get_css_class TD DIOFormField DIOFormField-$name] puts "" if {$readonly} { puts "$value" } else { set tag [get_css_tag] set class [get_css_class $tag DIOFormField DIOFormField-$name] if {$type == "select"} { $form select $name -values $values -value $value -class $class } else { eval $form $type $name -value [list $value] $formargs -class $class } } puts "" puts "" } # methods that give us method-based access to get and set the # object's variables... method display {{string ""}} { configvar display $string } method form {{string ""}} { configvar form $string } method formargs {{string ""}} { configvar formargs $string } method name {{string ""}} { configvar name $string } method text {{string ""}} { configvar text $string } method type {{string ""}} { configvar type $string } method value {{string ""}} { configvar value $string } method readonly {{string ""}} { configvar readonly $string } public variable display "" public variable form "" public variable formargs "" # values - for fields of type "select" only, the values that go in # the popdown (or whatever) selector public variable values "" # name - the field name public variable name "" # text - the description text for the field. if not specified, # it's constructed from a prettified version of the field name public variable text "" # value - the default value of the field public variable value "" # type - the data type of the field public variable type "text" # readonly - if 1, we don't allow the value to be changed public variable readonly 0 } ; ## ::itcl::class DIODisplayField catch { ::itcl::delete class ::DIODisplayField_boolean } # # DIODisplayField_boolen -- superclass of DIODisplayField that overrides # a few methods to specially handle booleans # ::itcl::class ::DIODisplayField_boolean { inherit ::DIODisplayField constructor {args} {eval configure $args} { eval configure $args } method add_true_value {string} { lappend trueValues $string } # # showform -- emit a form field for a boolean # method showform {} { puts "" set class [get_css_class TD DIOFormHeader DIOFormHeader-$name] puts "$text:" set class [get_css_class TD DIOFormField DIOFormField-$name] puts "" if {$readonly} { if {[boolean_value]} { puts $true } else { puts $false } } else { if {[boolean_value]} { $form default_value $name $true } else { $form default_value $name $false } eval $form radiobuttons $name \ -values [list "$true $false"] $formargs } puts "" puts "" } # # showview -- emit a view for a boolean # method showview {{alt ""}} { set class [get_css_class TR DIOViewRow$alt DIOViewRow$alt-$name] puts "" set class [get_css_class TD DIOViewHeader DIOViewHeader-$name] puts "$text:" set class [get_css_class TD DIOViewField DIOViewField-$name] puts "" if {[boolean_value]} { puts $true } else { puts $false } puts "" puts "" } # # boolean_value -- return 1 if value is found in the values list, else 0 # method boolean_value {} { set val [string tolower $value] if {[lsearch -exact $values $val] > -1} { return 1 } return 0 } method value {{string ""}} { configvar value $string } public variable true "Yes" public variable false "No" public variable values "1 y yes t true on" public variable value "" { if {[boolean_value]} { set value $true } else { set value $false } } } ; ## ::itcl::class ::DIODisplayField_boolean rivet-3.2.1/doc/xml/calendar.xml000664 001750 001750 00000031303 14141530732 017260 0ustar00manghimanghi000000 000000
Calendar Package
Introduction The package is based on the Calendar class, a class capable of printing an ascii calendar table that closely resembles the output of the typical Unix cal command. The internal code is written entirely in Tcl, therefore doesn't rely on the existance of cal on the system. XmlCalendar inherits the basic methods and adds XML tagging to the table. XmlCalendar prints an XML calendar table whose header, weekdays banner and days rows tags are configurable. Also specific days or specific weeks can be given arbitrary attributes. Calendar core methods are based on the cal procedure written by Richard Suchenwirth and published on the Tcl Wiki The Calendar package uses Tcl dict command to manage markup information. Hence either Tcl8.5 or Tcl8.4 with package dict are required.
Calendar Utility class the builds and prints a calendar table Calendar calendar_name Calendar object subcommands The main public command for a calendar object is emit that returns a calendar table calendar_obj emit calendar_obj emit month year calendar_obj emit month | year The method 'emit' if invoked without arguments returns an ASCII formatted calendar of the current month set cal [Calendar #auto] set current_month [$cal emit] puts $current_month Jun 2010 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 The method emit when invoked with a single argument takes it as an year number and prints the whole calendar of that year. When invoked with 2 arguments takes the first as a month, either expressed in its shortened form ('Jan','Feb',...) or as a number in the range 1-12. The second argument is a year number. XmlCalendar Prints XML formatted calendar tables XmlCalendar calendar_name -option1 option_list -option2 option_list ... An XmlCalendar object is created and returned. XmlCalendar objects print XML formatted calendar tables. The markup can be customized using the configuration options. Configuration options accept odd-length lists as values. An option_list has the following structure tag_name The first element of an option list is a tag name, the remaining terms are therefore an even-length sublist which is interpreted as a sequence of attribute-value pairs that will in turn become attributes of the tag. Methods cal_obj emit cal_obj emit month year cal_obj emit month | year The method 'emit' if invoked without arguments returns an XML calendar table of the current month Options -container tag_name Assigns an options list to the XML element that will hold the whole table. The default tag for the container is 'calendar', with no attributes. -header tag_name Assigns tag name and attributes to the XML header element (default: calheader) -body tag_name Assigns tag name and attributes to the XML body element of the table (default: calbody) -banner tag_name Assigns tag name and attributes to the XML banner element of the table (default: monthyear) The header of a calendar table is made of a banner, showing the Month and Year number, and of a weekdays bar. -foot tag_name Assigns tag name and attributes to the XML foot element of the table (default: calfoot). This option was added for completeness, but it's not implemented yet -banner_month tag_name Tag name and attributes for the XML element holding the month name (default:month) -banner_year tag_name Tag name and attributes for the XML element holding the month name (default: year) -weekdays tag_name Tag name and attributes for the XML element holding the weekday header (default: weekdays) -weekdays_cell tag_name Tag name and attributes for the XML element holding the each single weekday (default: wkdays) -days_row tag_name Tag name and attributes for the XML element holding the each row of the calendar table (default: week) -days_cell tag_name Tag name and attributes for the XML element representing a cell in the calendar table (default: day) -cell_function If set this option is the name of a procedure that gets called for every day of the month. The procedure must accept 4 argument representing day, month, year and weekday and must return an odd-length list interpreted in the same way as options lists. -current_day This option works as a simple method for pointing out a specific day of the month. If set with a day number that day will get the class attribute automatically set as "current" -current_weekday This option works as a simple method for pointing out a specific weekday of the month. If set with a weekday index (0: Sunday, 6: Saturday) the corresponding cell in the weekdays header will get the class attribute automatically set as "current_wkday" HtmlCalendar Concrete class derived from XmlCalendar HtmlCalendar calendar_name -option1 option_list -option2 option_list ... Concrete XmlCalendar class for printing html calendar tables. The markup of the class is xhtml compliant and prints a code fragment for inclusion in a webpage. The following is the class definition. ::itcl::class HtmlCalendar { inherit XmlCalendar constructor {args} {XmlCalendar::constructor $args} { $this configure -container table \ -header thead \ -body tbody \ -banner tr \ -banner_month {th colspan 3 style "text-align: right;"} \ -banner_year {th colspan 4 style "text-align: left;"} \ -weekdays tr \ -weekday_cell th \ -days_row tr \ -days_cell td } } A sample output from HtmlCalendar (with some styling)
rivet-3.2.1/doc/images/warning.png000664 001750 001750 00000002331 14141530732 017604 0ustar00manghimanghi000000 000000 PNG  IHDRשPLTE!)1BJRZks{{{RRZZ{{99JJ11))))))!!p;bKGDHIDATxm}o0M5%%m szP^UDKnk[;һ?0n!qCtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignaturec42b7d2d564aab588891979703f02b45OߓtEXtPage24x24+0+0r[ 1IENDB`rivet-3.2.1/doc/xml/installation.xml000664 001750 001750 00000032672 14141530732 020222 0ustar00manghimanghi000000 000000
Apache Rivet &version; Installation Rivet &version; runs with the Apache 2.4.x HTTP web server. It is known to build and run on various Linux distributions (Debian & Ubuntu, Redhat, SuSE and CentOS), FreeBSD and OpenBSD. For some of these Unix-like operative systems binary packages are already available for download. Rivet &version2-generic; was restricted to work with the prefork MPM of the Apache HTTP webserver. MPM modules are fundamental components of the webserver architecture. They provide multiple implementations of multiprocessing in order to better suit specific OS features and scalability requirements. The prefork MPM exploited the UNIX traditional approach to multiprocess server applications based on the fork system call. This model has several limitations but also some advantages. The solution we adopted tries to attain the best from any MPM as much as possible and Rivet &version; is now able to run with the worker and the event MPMs. Rivet &version; has not been ported to OS of the Windows family but we feel that the current design would fit just fine with the Windows specific MPMs such as winnt. If you need to build Apache Rivet yourself this is the procedure to follow Building Tcl: requirements Installing Rivet is about endowing the Apache HTTP webserver with the ability of running scripts written with the Tcl programming language. Therefore the Tcl language with its runtime, development libraries and shell (≥8.5.10 required, ≥8.6.0 recommended) have to be installed. Building Rivet you will have to tell the scripts where the Tcl libraries are located via the option of the configure script (see below). Several Tcl packages shipped with rivet need also the Itcl OOP extension of Tcl. If you need to run any of the Session or DIO packages you need to install this language extension but you don't need it to build mod_rivet The Apache HTTP Webserver development files and libraries are required along with the Apache Portable Runtime and the libapreq library. Building Rivet Getting and Installing the Apache Sources You can build Rivet either statically (compiled into the Apache web server) or dynamically (as a loadable shared library). We recommend that you build Rivet as a shared library, for maximum flexibility. We will tell Rivet where it the Apache development files and libraries are located via the option to configure (see below). Most modern Unix OS (Linux and FreeBSD systems included) come with their own packages of the Apache Web Server executables, runtime libraries and development files and libraries. Check the documentation of the package manager of your OS to find out how to install this software Uncompress Sources Download the sources at . We will assume that you have Apache installed at this point. You must uncompress the Rivet sources in the directory where you wish to compile them. gunzip rivet-&fullversion;.tar.gz tar -xvf rivet-&fullversion;.tar.gz Building Rivet Rivet uses the standard ./configure ; make ; make install sequence which installs to their target directories the Apache module, the binary libraries and the Tcl code There are several rivet specific options to configure that might be useful (or needed): --with-apache Defines the configure internal variable 'apache_base'. This variable points to the root of the Apache web server directory hierarchy --with-tcl This points to the directory where the tclConfig.sh file is located. --with-tclsh This points to the location of the tclsh executable. --with-apxs The location of the apxs program that provides information about the configuration and compilation options of Apache modules. --with-apache-include[=DIR] Locates the Apache include files on your computer, if they're not in standard directory. --enable-version-display=[yes|no] This option enables Rivet to display its version in the logfiles when Apache is started. The default is to keep the Rivet version hidden. --with-rivet-target-dir=DIR This option is for fine tuning of the installation final directories. Rivet Tcl packages, commands and loadable libraries go into the same directory hierarchy (by default is ${apache_base}/lib/rivet${PACKAGE_VERSION}, where $apache_base takes the value set by --with-apache) --with-upload-dir=DIR Configures Rivet's default upload directory. It can be overridden in the configuration either globally or specifically for a virtual host --with-post-max=BYTES The value to this option establishes a default for the maximum size of POST data. Default: 0 (unlimited size) --enable-head-requests By default HEAD requests don't go through the usual request processing which leads to script execution and therefore resource consumption and Rivet returns a standard hardcoded HTML header to save CPU time. --enable-head-requests can change the default. --enable-rivet-commands-export By default Rivet's commands are put on the export list of the ::rivet namespace. With this option you may prevent it thus forcing the programmers to fully qualify in their code. By default this option is enabled and it can be changed in the configuration with the directive ExportRivetNS. Disabling this option can be also reverted to 'On' with the --enable-import-rivet-commands switch --enable-import-rivet-commands Rivet's namespace is by default imported into the global namespace. Enabling the import of Rivet's commands overrides the switch and forces --enable-rivet-commands-export=yes thus demanding the commands to be exported (otherwise it would generate errors at run-time). This option is disabled by default and it can be changed in the configuration with the ImportRivetNS directive --enable-rivet-debug-build Enable definition of the preprocessor symbol RIVET_DEBUG_BUILD. This is used to conditionally include code into the build for development and debugging purposes --enable-virtual-interps-separation This option changes the default for the SeparateVirtualInterps configuration variable. Default: 0 (no separation among interpreters) Example: configuring the build system to compile Rivet for an Apache HTTP server custom installation, using tcl8.6. In this specific case the determination of the apxs path is redundant and it could be omitted since it could be inferred from the --with-apache option value ./configure --with-tcl=/usr/lib/tcl8.6/ --with-tclsh=/usr/bin/tclsh8.6 \ --with-apxs=/usr/local/apache2/bin/apxs --with-apache=/usr/local/apache2 \ --with-rivetlib-target-dir=/usr/local/apache2/rivet&version; Run make At this point, you are ready to run make, which should run to completion without any errors (a warning or two is OK, generally). Install Now, you are ready to run the make install to install the resulting files. The install target actually fires the install-binaries and install-packages targets which in turn copy the binary modules and Tcl packages to their destination directories. This commands create a functional Rivet environment with its core language. Apache Configuration Files Rivet is relatively easy to configure - we start off by adding the module itself: LoadModule rivet_module /usr/lib/apache2/modules/mod_rivet.so This tells Apache to load the Rivet shared object, wherever it happens to reside on your file system. Now we have to tell Apache what kind of files are "Rivet" files and how to process them: AddType application/x-httpd-rivet rvt AddType application/x-rivet-tcl tcl These tell Apache to process files with the .rvt and .tcl extensions as Rivet files. The characters encoding can be changed using the header type command, but you can also change the default charset for the whole site: AddType 'application/x-httpd-rivet;charset=utf-8' rvt All the pages generated by Rivet on this site will be sent with a Content-Type:'text/html;charset=utf-8' header. You may also wish to use Rivet files as index files for directories. In that case, you would do the following: DirectoryIndex index.html index.htm index.shtml index.cgi index.tcl index.rvt For other directives that Rivet provides for Apache configuration, please see .
rivet-3.2.1/tests/env_methods.tcl000664 001750 001750 00000000472 14141530732 017604 0ustar00manghimanghi000000 000000 set envvar [::rivet::var_qs get envvar] set v1 [::rivet::env $envvar] ::rivet::load_env loadenv set v2 $loadenv($envvar) set comp [string match $v1 $v2] if {$comp} { set msg OK } else { set msg "env: $v1, load_env: $v2" } puts -nonewline "$envvar: $msg" rivet-3.2.1/doc/html/env.html000664 001750 001750 00000005663 14142162543 016623 0ustar00manghimanghi000000 000000 env

Name

env — Returns the value a single "environmental variable".

Synopsis

::rivet::env ?environment_variable_name?

Description

::rivet::env resolves a single environment variable and returns its value or an empty string if the environment variable name in the argument is not defined. This command is the recommended way to resolve an environment variable leaving ::rivet::load_env to debugging and development operations.

rivet-3.2.1/cmake/cmake_extra_modules/FindAPACHE.cmake000664 001750 001750 00000003360 14141530732 023241 0ustar00manghimanghi000000 000000 # # APACHE_FOUND - System has APACHE # APACHE_INCLUDE_DIR - The APACHE include directory # # APACHE_LOCATION # setting this enables search for apache libraries / headers in this location # # Include directories # find_path(APACHE_INCLUDE_DIR NAMES httpd.h PATH_SUFFIXES httpd apache apache2 HINTS ${APACHE_INCLUDE_DIR_HINTS} ${APACHE_ROOT}/include) # Tryto find apxs, in order to get more information... find_program(APACHE_APXS_BIN NAMES apxs apxs2 apxs.exe apxs2.exe PATH_SUFFIXES httpd apache apache2 HINTS ${APACHE_ROOT}/bin) if(NOT DEFINED APACHE_MODULE_DIR) if(APACHE_APXS_BIN) EXEC_PROGRAM(${APACHE_APXS_BIN} ARGS -q LIBEXECDIR OUTPUT_VARIABLE APACHE_MODULE_DIR) else(APACHE_APXS_BIN) find_path(APACHE_MODULE_DIR NAMES mod_alias.so mod_auth_basic.so HINTS ${APACHE_MODULE_DIR_HINTS} ${APACHE_ROOT}/modules) endif(APACHE_APXS_BIN) endif(NOT DEFINED APACHE_MODULE_DIR) if(NOT DEFINED APACHE_LIB_DIR) message(STATUS "not found") if(APACHE_APXS_BIN) EXEC_PROGRAM(${APACHE_APXS_BIN} ARGS -q LIBDIR OUTPUT_VARIABLE APACHE_LIB_DIR ) else(APACHE_APXS_BIN) ## Use the bin dir, inside Apache server... find_path(APACHE_LIB_DIR NAMES httpd httpd.exe HINTS ${APACHE_LIB_DIR_HINTS} ${APACHE_ROOT}/bin) endif(APACHE_APXS_BIN) endif(NOT DEFINED APACHE_LIB_DIR) include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set APACHE_FOUND to TRUE if # all listed variables are TRUE find_package_handle_standard_args(APACHE DEFAULT_MSG APACHE_INCLUDE_DIR ) mark_as_advanced(APACHE_INCLUDE_DIR) mark_as_advanced(APACHE_MODULE_DIR) mark_as_advanced(APACHE_LIB_DIR) rivet-3.2.1/doc/000775 001750 001750 00000000000 14142162576 014175 5ustar00manghimanghi000000 000000 rivet-3.2.1/tests/include.html000664 001750 001750 00000000251 14141530732 017071 0ustar00manghimanghi000000 000000
row 1
row 2

ܸ(EUC-JP Japanese text)

rivet-3.2.1/rivet/rivet-tcl/xml.tcl000664 001750 001750 00000004437 14141530732 017776 0ustar00manghimanghi000000 000000 # # xml.tcl -- # # Syntax: # # ::rivet::xml string ?tag ?attr val? ?attr val?? ?tag ?attr val? ?attr val?? # # or # # ::rivet::xml ?tag ?attr val? ?attr val?? # # Example 1: # # trivial nested markup fragment # # ::rivet::xml Test b i # <= Test # # Example 2: # # XHTML Element with attributes # # ::rivet::xml Test [list div class box id testbox] b i # <=
Test
# # Example 3 # # ::rivet::xml "anything ..." div [list a href "http://..../" title "info message"] # <= # # Example 4 # # ::rivet::xml "" [list a attr1 val1 attr2 val2] [list b attr1 val1 attr2 val2] # <= # # Example 5 # # single self closing element # # ::rivet::xml [list a attr1 val1 attr2 val2] # <= # namespace eval ::rivet { proc xml {textstring args} { set single_element [::rivet::lempty $args] if {$single_element} { set tags_list [list $textstring] if {[::rivet::lempty $tags_list]} { return "" } } else { set tags_list $args } set tags_stack {} set el {} set xmlout "" foreach el $tags_list { set el [lassign $el tag] lappend tags_stack $tag append xmlout "<$tag" foreach {attrib attrib_v} $el { append xmlout " $attrib=\"$attrib_v\"" } append xmlout ">" } if {[::rivet::lempty $tags_stack]} { return $textstring } elseif {$single_element} { # variable 'el' keeps the last (innermost) attribute-value list if {[::rivet::lempty $el] == 1} { set xmlout [string replace $xmlout end end " />"] } else { set xmlout [string replace $xmlout end end "/>"] } if {[llength $tags_stack] > 1} { set xmlout [append xmlout ""] } return $xmlout } else { return [append xmlout "$textstring"] } } } rivet-3.2.1/rivet/rivet-tcl/random.tcl000664 001750 001750 00000001655 14141530732 020455 0ustar00manghimanghi000000 000000 ### ## random [seed | value ] ## ## Generate a random number using only Tcl code. This proc tries to ## emulate what the TclX random function does. If we don't have TclX ## though, this is a decent substitute. ## ## Note: random predates the existence of Tcl's built-in rand() function, ## that is a part of the expr command -- programmers should consider using ## Tcl's built-in rand() function as an alternative to this command. ## ## $Id$ ## ### namespace eval ::rivet { proc random {args} { global _ran if {[llength $args] > 1} { set _ran [lindex $args 1] } else { set period 233280 if {[info exists _ran]} { set _ran [expr { ($_ran*9301 + 49297) % $period }] } else { set _ran [expr { [clock seconds] % $period } ] } return [expr { int($args*($_ran/double($period))) } ] } } } rivet-3.2.1/src/mod_rivet_ng/rivet_prefork_mpm.c000664 001750 001750 00000017170 14141530732 022567 0ustar00manghimanghi000000 000000 /* rivet_prefork_mpm.c: dynamically loaded MPM aware functions for prefork module */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include #include "mod_rivet.h" #include "mod_rivet_common.h" #include "mod_rivet_generator.h" #include "mod_rivet_cache.h" #include "httpd.h" #include "rivetChannel.h" #include "apache_config.h" #include "rivet.h" #include "rivetCore.h" #include "worker_prefork_common.h" extern DLLIMPORT mod_rivet_globals* module_globals; extern DLLIMPORT apr_threadkey_t* rivet_thread_key; extern module rivet_module; rivet_thread_private* Rivet_VirtualHostsInterps (rivet_thread_private* private); /* -- PreforkBridge_Finalize */ apr_status_t PreforkBridge_Finalize (void* data) { rivet_thread_private* private; server_rec* s = (server_rec*) data; RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key,private) ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, s, "Running prefork bridge finalize method"); // No, we don't do any clean up anymore as we are just shutting this process down // Rivet_ProcessorCleanup(private); return OK; } /* -- PreforkBridge_ChildInit: bridge child process initialization * */ void PreforkBridge_ChildInit (apr_pool_t* pool, server_rec* server) { rivet_server_conf* rsc = RIVET_SERVER_CONF (module_globals->server->module_config); rivet_thread_private* private; ap_assert (apr_threadkey_private_create (&rivet_thread_key, NULL, pool) == APR_SUCCESS); /* * This is the only execution thread in this process so we create * the Tcl thread private data here. In a fork capable OS * private data should have been created by the httpd parent process */ private = Rivet_ExecutionThreadInit(); private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific)); private->ext->interps = apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp)); /* we now establish the full rivet core command set for the root interpreter */ Rivet_InitCore (module_globals->server_interp->interp,private); /* The root interpreter is created without a rivet cache (that wouldn't make sense * in that context. We create the cache now */ module_globals->server_interp->cache_size = rsc->default_cache_size; if (module_globals->server_interp->cache_size < 0) { module_globals->server_interp->cache_size = RivetCache_DefaultSize(); } module_globals->server_interp->cache_free = module_globals->server_interp->cache_size; ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,server,"root interpreter cache size: %d (free: %d)", module_globals->server_interp->cache_size, module_globals->server_interp->cache_free); RivetCache_Create(module_globals->pool,module_globals->server_interp); #ifdef RIVET_NAMESPACE_IMPORT { char* tcl_import_cmd = "namespace eval :: { namespace import -force ::rivet::* }\n"; Tcl_Eval (module_globals->server_interp->interp,tcl_import_cmd); } #endif /* * We proceed creating the vhost interpreters database */ if (Rivet_VirtualHostsInterps(private) == NULL) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME ": Tcl Interpreters creation fails"); exit(1); } } /* * -- PreforkBridge_Request * * The prefork implementation of this function is basically a wrapper of * Rivet_SendContent. The real job is fetching the thread private data * * Arguments: * * request_rec* rec * * Returned value: * * HTTP status code (see the Apache HTTP web server documentation) */ int PreforkBridge_Request (request_rec* r,rivet_req_ctype ctype) { rivet_thread_private* private; /* fetching the thread private data to be passed to Rivet_SendContent */ RIVET_PRIVATE_DATA_NOT_NULL (rivet_thread_key, private); private->ctype = ctype; private->req_cnt++; private->r = r; return Rivet_SendContent(private); } /* * -- MPM_MasterInterp * * * */ rivet_thread_interp* MPM_MasterInterp(server_rec* server) { rivet_thread_private* private; int tcl_status; RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key, private); module_globals->server_interp->channel = private->channel; /* * We are returning the interpreter inherited from * the parent process. The fork preserves the internal status * of the process, math engine status included. This fact implies * the random number generator has the same seed and every * child process for which SeparateVirtualInterps would generate * the same random number sequence. We therefore reseed the RNG * calling a Tcl script fragment */ tcl_status = Tcl_Eval(module_globals->server_interp->interp,"expr {srand([clock clicks] + [pid])}"); if (tcl_status != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME ": Tcl interpreter random number generation reseeding failed"); } return module_globals->server_interp; } /* * -- PreforkBridge_ExitHandler * * Just calling Tcl_Exit * * Arguments: * int code * * Side Effects: * * the thread running the Tcl script will exit */ int PreforkBridge_ExitHandler(rivet_thread_private* private) { Tcl_Exit(private->exit_status); /* actually we'll never get here but we return * the Tcl return code anyway to silence the * compilation warning */ return TCL_OK; } rivet_thread_interp* PreforkBridge_Interp (rivet_thread_private* private, rivet_server_conf* conf, rivet_thread_interp* interp) { if (interp != NULL) { private->ext->interps[conf->idx] = interp; } return private->ext->interps[conf->idx]; } /* * -- PreforkBridge_ServerInit * * Bridge server wide inizialization: * */ int PreforkBridge_ServerInit (apr_pool_t* pPool,apr_pool_t* pLog,apr_pool_t* pTemp,server_rec* s) { /* Whether single_thread_exit is 1 or 0 doesn't make any difference for * the prefork bridge, we set the default value anyway in case it hadn't been * set already in the configuration */ if (module_globals->single_thread_exit == SINGLE_THREAD_EXIT_UNDEF) { module_globals->single_thread_exit = 0; } /* The root interpreter is created without a rivet cache (that wouldn't make sense * in that context. We create the cache now */ if (module_globals->server_interp->cache_size) { RivetCache_Create(pPool,module_globals->server_interp); } return OK; } /* Table of bridge control functions */ DLLEXPORT RIVET_MPM_BRIDGE { PreforkBridge_ServerInit, PreforkBridge_ChildInit, PreforkBridge_Request, PreforkBridge_Finalize, PreforkBridge_ExitHandler, PreforkBridge_Interp }; rivet-3.2.1/doc/html/read_file.html000664 001750 001750 00000004762 14142162544 017745 0ustar00manghimanghi000000 000000 read_file

Name

read_file — Read the entire contents of a file and return it as a string.

Synopsis

::rivet::read_file ?file name?

Description

This is a utility command which loads the entire content of a file and returns it as a result.

rivet-3.2.1/doc/html/cookie.html000664 001750 001750 00000013054 14142162543 017275 0ustar00manghimanghi000000 000000 cookie

Name

cookie — get, set and delete cookies.

Synopsis

::rivet::cookie ?set? ?cookieName? ??cookiValue?? ?-days expireInDays? ?-hours expireInHours? ?-minutes expireInMinutes? ?-expires Wdy, DD-Mon-YYYY HH:MM:SS GMT? ?-path uriPathCookieAppliesTo? ?-secure 1/0? ?-HttpOnly 1/0?
::rivet::cookie ?get? ?cookieName?
::rivet::cookie ?delete? ?cookieName?
::rivet::cookie ?unset? ?cookieName?

Description

cookie 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.

cookie delete will set the timeout value to -1 minutes - deleting the cookie in the browser.

cookie unset will remove the defined cookie in the server (perhaps preparatory to checking/resetting the cookie).

The command has a number of switches setting a cookie attributes

rivet-3.2.1/doc/examples/download.tcl000664 001750 001750 00000003214 14141530732 020316 0ustar00manghimanghi000000 000000 # Code example for the transmission of a pdf file. if {[::rivet::var exists pdfname]} { set pdfname [::rivet::var get pdfname] # let's build the full path to the pdf file. The 'pdf_repository' # directory must be readable by the apache children set pdf_full_path [file join $pdf_repository ${pdfname}.pdf] if {[file exists $pdf_full_path]} { # Before the file is sent we inform the client about the file type and # file name. The client can be proposed a filename different from the # original one. In this case, this is the point where a new file name # must be generated. ::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 # client. The following 4 lines of code can be replaced by any code # 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 # 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) ::rivet::headers add Content-Length [string length $pdf] # Let's send the actual file content puts $pdf } else { source pdf_not_found_error.rvt } } else { source parameter_not_defined_error.rvt } rivet-3.2.1/src/rivet.h000664 001750 001750 00000007254 14141530732 015521 0ustar00manghimanghi000000 000000 /* rivet.h: */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef _RIVET_H_ #define _RIVET_H_ #include #include "rivet_types.h" typedef int rivet_req_ctype; /* This is for windows. */ #ifdef BUILD_rivet #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #endif /* BUILD_rivet */ #define MINSTRLEN(s1,s2) strlen(s1) < strlen(s2) ? strlen(s1) : strlen(s2) #define STREQU(s1,s2) (s1[0] == s2[0] && strcmp(s1, s2) == 0) #define STRNEQU(s1,s2) (s1[0] == s2[0] && strncmp(s1, s2, strlen(s2)) == 0) #define RIVET_NS "::rivet" #define RIVET_TCL_PACKAGE "rivet" #define RIVETLIB_TCL_PACKAGE "rivetlib" #define RIVET_MSG_BUFFER_SIZE 512 /* Macros to access and check thread private data */ #define RIVET_PRIVATE_DATA(thread_key,private_p) \ ap_assert (apr_threadkey_private_get ((void **)&private_p,thread_key) == APR_SUCCESS); #define RIVET_PRIVATE_DATA_NOT_NULL(thread_key,private_p) \ RIVET_PRIVATE_DATA(thread_key,private_p) \ ap_assert (private_p != NULL); /* macros defining Tcl commands */ #define TCL_CMD_HEADER(cmd) \ static int cmd(\ ClientData clientData,\ Tcl_Interp *interp,\ int objc,\ Tcl_Obj *CONST objv[]) #define TCL_OBJ_CMD( name, func ) \ Tcl_CreateObjCommand( interp, /* Tcl interpreter */\ name, /* Function name in Tcl */\ func, /* C function name */\ NULL, /* Client Data */\ (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */) /* RIVET_OBJ_CMD creates a command in the RIVET_NS namespace. Commands * are exported from the RIVET_NS (::rivet) namespace in the init.tcl * script accordingly to configuration switches passed to ./configure * (see configure.ac) */ /* We now pass the thread private data to the * Tcl command's ClientData */ #define RIVET_OBJ_CMD( name, func, private_p) \ Tcl_CreateObjCommand( interp, /* Tcl interpreter */\ RIVET_NS "::" name, /* Function name in Tcl */\ func, /* C function name */\ private_p, /* Client Data */\ (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */); #define RIVET_EXPORT_CMD(interp,ns,cmdname) Tcl_Export(interp,ns,cmdname,0); /* * Pointer in r is checked and in case Rivet_NoRequestRec is * called returning TCL_ERROR. This macro is used (and often * is the first code like) in commands that must ascertain * the request_rec object pointer in globals is valid * (when a request processing ends it's set to NULL) */ #define CHECK_REQUEST_REC(p,cmd_name) \ if (p == NULL) return TCL_OK;\ if (p->r == NULL)\ {\ Rivet_NoRequestRec(interp,Tcl_NewStringObj(cmd_name,-1));\ return TCL_ERROR;\ } EXTERN int Rivet_Init(Tcl_Interp *interp); EXTERN int Rivet_InitList(Tcl_Interp *interp); EXTERN int Rivet_InitCrypt(Tcl_Interp *interp); EXTERN int Rivet_InitWWW(Tcl_Interp *interp); #endif /* _RIVET_H_ */ rivet-3.2.1/rivet/packages/commserver/commserver.tcl000664 001750 001750 00000002630 14141530732 023400 0ustar00manghimanghi000000 000000 # commserver.tcl -- # This forks off an external server process with 'comm' loaded in it, # for use as an IPC system. # Copyright 2003-2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # $Id$ package provide commserver 0.1 namespace eval ::commserver { set Port 35100 set scriptlocation [info script] set wait 5 } proc ::commserver::start {} { variable Port variable scriptlocation variable wait # Attempt to launch server. exec [info nameofexecutable] \ [file join [file dirname $scriptlocation] server.tcl] $Port & set starttime [clock seconds] # If we don't get a connection in $wait seconds, abort. while { [clock seconds] - $starttime < $wait } { if { ![catch { comm::comm send $Port { puts stderr "Commserver server started on $Port" } }] } { return } } error "Connection to $Port failed after $wait seconds of trying." }rivet-3.2.1/doc/html/internals.html000664 001750 001750 00000061644 14142162544 020034 0ustar00manghimanghi000000 000000 Rivet Internals

Rivet Internals

This section easily falls out of date, as new code is added, old code is removed, and changes are made. The best place to look is the source code itself. If you are interested in the changes themselves, the Subversion revision control system (svn) can provide you with information about what has been happening with the code.

Rivet approach to Apache Multiprocessing Models

The Apache HTTP web server has an extremely modular architecture that made it very popular among web developers. Most of the server features can be implemented in external modules, including some of the way the server interfaces to the operative system. The multiprocessing modules are meant to provide different models for distributing the server workload but also to cope with different operative systems having their specific architectures and services.

From the very beginning mod_rivet was designed to work with the prefork MPM MPM (Multi Processing Module) which assumes the OS to have 'fork' capabilities. This prerequisite basically restricted mod_rivet to work only with Unix-like operative systems. Starting with version 3.0 we reorganized mod_rivet to offer a design that could work together with more MPM and hopefully pave the way to support different OS that have no 'fork' call. At the same time we tried to preserve some of the basic features of mod_rivet when working with the prefork MPM, chiefly the feature of the Unix fork system call of 'cloning' a parent process memory into its child, thus allowing fast initialization of interpreters.

The central design of mod_rivet now relies on the idea of MPM bridges, loadable modules that are responsible to adapt the module procedural design to a given class of Apache MPMs. This design is open to the development of more MPM bridges coping with different multi-processing models but also to the development of different approaches to resource consumption and workload balance. Currently we have 3 bridges:

  • rivet_prefork_mpm.c: a bridge for the prefork MPM
  • rivet_worker_mpm.c: a threaded bridge creating a pool of threads each running Tcl interpreters and communicating with the worker MPM threads through a thread safe queue. This bridge is needed by the worker MPM and by any the winnt MPM on Windows.
  • rivet_lazy_mpm.c: a threaded bridge where Tcl threads are started on demand. The bridge creates no threads and Tcl interpreters at start up, only when requests come in Tcl execution threads are created. This bridge is explained in detail in the the section called “Example: the Lazy bridge”. Since the resource demand at startup is minimal this bridge should suit development machines that go through frequent web server restarts.

mod_rivet MPM Bridge callbacks

A bridge is a loadable library implementing different ways to handle specific features needed to mod_rivet. It was originally meant as a way to handle the prefork/worker/event MPM specificities, at the same time avoiding the need to stuff the code with conditional statements that would have implied useless complexity (an instance of the Apache web server can run only an MPM at a time), error prone programming and performance costs. New bridges could be imagined also to implement different models of workload and resource management (like the resources demanded by the Tcl interpreters). We designed an interface between the core of mod_rivet and its MPM bridges based on a set of functions defined in the rivet_bridge_table structure.

typedef struct _mpm_bridge_table {
    RivetBridge_ServerInit    *mpm_server_init;
    RivetBridge_ChildInit     *mpm_child_init;
    RivetBridge_Request       *mpm_request;
    RivetBridge_Finalize      *mpm_finalize;
    RivetBridge_Exit_Handler  *mpm_exit_handler;
    RivetBridge_Thread_Interp *mpm_thread_interp;
} rivet_bridge_table;

  • mpm_server_init: pointer to any specific server inititalization function. This field can be NULL if no bridge specific initialization is needed. The core of mod_rivet runs the ServerInitScript before calling this function.
  • mpm_child_init: Bridge specific child process initialization. If the pointer is assigned with a non-NULL value the function is called by Rivet_ChildInit.
  • mpm_request: This pointer must be a valid function pointer to the content generator implemented by the bridge. If the pointer is not defined the Apache web server will stop at start up. This condition is motivated by the need of avoiding useless testing of the pointer. The fundamental purpose of a content generator module (like mod_rivet) is to respond to requests creating content, thus whatever it is a content generating function must exist (during the early stages of development you can create a simple test function for that). In a threaded MPM this function typically prepares the request processing stuffing somewhere the pointer to the request_rec structure passed by the web server and then it calls some method to communicate these data to the Tcl execution thread waiting for result to be returned. The prefork bridge is an exception since there are no threads and the bridge calls directly Rivet_SendContent
  • mpm_finalize: pointer to a finalization function called during a child process exit. This function is registered as child process memory pool cleanup function. If the pointer is NULL the pool is given a default cleanup function (apr_pool_cleanup_null) defined in src/mod_rivet/mod_rivet.c. For instance the finalize function in the worker MPM bridge notifies a supervisor thread demanding the whole pool of threads running Tcl interpreters to orderly exit. This pointer can be NULL if the bridge has no special need when a child process must exit (unlikely if you have multiple threads running)
  • mpm_exit_handler: mod_rivet replaces the core exit command with a new one (::rivet::exit). This command must handle the process exit in the best possible way for the bridge and the threading model it implements (for the 2 current threaded bridges this implies signaling the threads to exit). The ::rivet::exit actually doesn't terminate the process, but interrupts execution returning a specific error code commands ::rivet::catch and ::rivet::try can detect. Before the process is terminated the AbortScript script is fired and ::rivet::abort_code returns a message describing the exit condition. For instance the worker MPM bridge the finalize function is called after the current thread itself is set up for termination. See function Rivet_ExitCmd in rivetCore.c to have details on how and at what stage this callback is invoked.
  • mpm_thread_interp must be a function returning the interpreter object (a pointer to record of type rivet_thread_interp) associated to a given configuration as stored in a rivet_server_conf* object. This element was temporarily introduced in the mpm_bridge_table table and should be accessed through the macro RIVET_PEEK_INTERP.
    interp_obj = RIVET_PEEK_INTERP(private,private->conf);
    Every bridge implementation should have its own way to store interpreter data and manage their status. So this macro (and associated function) should hide from the module core function the specific approach followed in a particular bridge

Server Initialization and MPM Bridge

RivetChan

The RivetChan system was created in order to have an actual Tcl channel that we could redirect standard output to. This enables us use, for instance, the regular puts command in .rvt pages. It works by creating a channel that buffers output, and, at predetermined times, passes it on to Apache's I/O system. Tcl's regular standard output is replaced with an instance of this channel type, so that, by default, output will go to the web page.

The global Command

Rivet aims to run standard Tcl code with as few surprises as possible. At times this involves some compromises - in this case regarding the global command. The problem is that the command will create truly global variables. If the user is just cut'n'pasting some Tcl code into Rivet, they most likely just want to be able to share the variable in question with other procs, and don't really care if the variable is actually persistant between pages. The solution we have created is to create a proc ::request::global that takes the place of the global command in Rivet templates. If you really need a true global variable, use either ::global or add the :: namespace qualifier to variables you wish to make global.

Page Parsing, Execution and Caching

When a Rivet page is requested, it is transformed into an ordinary Tcl script by parsing the file for the <? ?> processing instruction tags. Everything outside these tags becomes a large puts statement, and everything inside them remains Tcl code.

Each .rvt file is evaluated in its own ::request namespace, so that it is not necessary to create and tear down interpreters after each page. By running in its own namespace, though, each page will not run afoul of local variables created by other scripts, because they will be deleted automatically when the namespace goes away after Apache finishes handling the request.

[Note]Note
One current problem with this system is that while variables are garbage collected, file handles are not, so that it is very important that Rivet script authors make sure to close all the files they open.

After a script has been loaded and parsed into it's "pure Tcl" form, it is also cached, so that it may be used in the future without having to reload it (and re-parse it) from the disk. The number of scripts stored in memory is configurable. This feature can significantly improve performance.

Extending Rivet by developing C code procedures

Rivet endows the Tcl interpreter with new commands serving as interface between the application layer and the Apache web server. Many of these commands are meaningful only when a HTTP request is under way and therefore a request_rec object allocated by the framework is existing and was passed to mod_rivet as argument of a callback. In case commands have to gain access to a valid request_rec object the C procedure must check if such a pointer exists and it's initialized with valid data. For this purpose the procedure handling requests (Rivet_SendContent) makes a copy of such pointer and keeps it in an internal structure. The copy is set to NULL just before returning to the framework, right after mod_rivet's has carried out its request processing. When the pointer copy is NULL the module is outside any request processing and this condition invalidates the execution of many of the Rivet commands. In case they are called (for example in a ChildInitScript, GlobalInitScript, ServerInitScript or ChildExitScript) they fail with a Tcl error you can handle with a catch command.

For this purpose in src/rivet.h the macro CHECK_REQUEST_REC was defined accepting two arguments: the thread private data object and the command name. If the pointer is NULL the macro calls Tcl_NoRequestRec and returns TCL_ERROR causing the command to fail. These are the steps to follow in order to write a new C language command for mod_rivet

  • Define the command and associated C language procedure in src/mod_rivet_ng/rivetCore.c using the macro RIVET_OBJ_CMD
    RIVET_OBJ_CMD("mycmd",Rivet_MyCmd,private)
    This macro ensures the command is defined as ::rivet::mycmd and its ClientData pointer is defined with the thread private data
  • Add the code of Rivet_MyCmd to src/mod_rivet_ng/rivetCore.c (in case the code resides in a different file also src/Makefile.am should be changed to tell the build system how to compile the code and link it into mod_rivet.so)
  • If the code must have access to the request record in private->r use the macro THREAD_PRIVATE_DATA in order to claim the thread private data, then check for the validity of the pointer using the macro CHECK_REQUEST_REC(private,"::rivet::<cmd_name>")
    TCL_CMD_HEADER(Rivet_MyCmd)
    {
        /* we have to get the thread private data */
        
        THREAD_PRIVATE_DATA(private)
    
    	/* if ::rivet::mycmd works within a request processing we have
    	 * to check if 'private' is carrying a non null request_rec pointer
    	 */
        
        CHECK_REQUEST_REC(private,"::rivet::mycmd");
        ....
        
        return TCL_OK;
    }
  • Add a test for this command in tests/checkfails.tcl. For instance
    ...
    check_fail no_body
    check_fail virtual_filename unkn
    check_fail my_cmd <arg1> <arg2>
    ....
    Where <arg1> <arg2> are optional arguments in case the command has different forms depending on the arguments. Then, if ::rivet::mycmd must fail also tests/failtest.tcl should modified as
    virtual_filename->1
    mycmd->1
    The value associated to the test must be 0 in case the command doesn't need to test the private->r pointer.

Debugging Rivet and Apache

If you are interested in hacking on Rivet, you're welcome to contribute! Invariably, when working with code, things go wrong, and it's necessary to do some debugging. In a server environment like Apache, it can be a bit more difficult to find the right way to do this. Here are some techniques to try.

The first thing you should know is that Apache can be launched as a single process with the -X argument:

httpd -X
.

On Linux, one of the first things to try is the system call tracer, strace. You don't even have to recompile Rivet or Apache for this to work.

strace -o /tmp/outputfile -S 1000 httpd -X

This command will run httpd in the system call tracer, which leaves its output (there is potentially a lot of it) in /tmp/outputfile. The -S option tells strace to only record the first 1000 bytes of a syscall. Some calls such as write can potentially be much longer than this, so you may want to increase this number. The results are a list of all the system calls made by the program. You want to look at the end, where the failure presumably occured, to see if you can find anything that looks like an error. If you're not sure what to make of the results, you can always ask on the Rivet development mailing list.

If strace (or its equivalent on your operating system) doesn't answer your question, it may be time to debug Apache and Rivet. To do this, you will need to rebuild mod_rivet. First of all you have to configure the build by running the ./configure script with the -enable-symbols option and after you have set the CFLAGS and LDFLAGS environment variables

export CFLAGS="-g -O0"
export LDFLAGS="-g"
./configure --enable-symbols ......
make
make install

Arguments to ./configure must fit your Apache HTTP web server installation. See the output produced by

./configure --help

And check the the section called “Apache Rivet 3.2 Installation” page to have further information. Since it's easier to debug a single process, we'll still run Apache in single process mode with -X:

@ashland [~] $ gdb /usr/sbin/apache.dbg
GNU gdb 5.3-debian
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-linux"...
(gdb) run -X
Starting program: /usr/sbin/apache.dbg -X
[New Thread 16384 (LWP 13598)]
.
.
.

When your apache session is up and running, you can request a web page with the browser, and see where things go wrong (if you are dealing with a crash, for instance).

rivet-3.2.1/src/mod_rivet_ng/rivetInspect.c000664 001750 001750 00000030770 14141530732 021515 0ustar00manghimanghi000000 000000 /* * rivetConf.c - Functions for accessing Rivet configuration variables * * Functions in this file implement core function to be called mainly * by the Rivet_InspectCmd function, which implments command 'inspect' * */ /* Copyright 2002-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include #include #include #include #include #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_main.h" #include "util_script.h" #include "http_config.h" #include "http_log.h" #include "mod_rivet.h" static const char* loglevel_defs[] = { "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug", }; /* These arrays must be kept aligned. confDirectives must be NULL terminated */ static const char* confDirectives[] = { "ServerInitScript", "GlobalInitScript", "ChildInitScript", "ChildExitScript", "BeforeScript", "AfterScript", "AfterEveryScript", "AbortScript", "ErrorScript", "UploadMaxSize", "UploadDirectory", "UploadFilesToVar", "SeparateVirtualInterps", "SeparateChannels", "HonorHeaderOnlyRequests", "MpmBridge", "RequestHandler", "ExportRivetNS", "ImportRivetNS", NULL }; enum confIndices { server_init_script, global_init_script, child_init_script, child_exit_script, before_script, after_script, after_every_script, abort_script, error_script, upload_max, upload_directory, upload_files_to_var, separate_virtual_interps, separate_channels, honor_header_only_requests, mpm_bridge, request_handler, export_rivet_ns, import_rivet_ns, conf_index_terminator }; extern mod_rivet_globals* module_globals; /* * -- Rivet_ReadConfParameter * * This procedure reads a single field named par_name from * rivet_server_conf structure and returns a Tcl_Obj pointer * containing the field value. See confDirectives for a list * of possible names. If the procedure is queried for a non * existing field a NULL is returned. * * Arguments: * * - interp: pointer to the current Tcl interpreter structure * - rsc: a pointer to a rivet_server_conf structure * - par_name: parameter name (as listed in confDirectives) * * Returned value: * * - A Tcl_Obj pointer to the parameter value. A NULL * pointer works as a signal for an error (invalid parameter) * - If the parameter value in the configuration is undefined * then the procedure returns an empty string * */ Tcl_Obj* Rivet_ReadConfParameter ( Tcl_Interp* interp, rivet_server_conf* rsc, Tcl_Obj* par_name) { int parameter_i; Tcl_Obj* int_value = NULL; char* string_value = NULL; if (Tcl_GetIndexFromObj(interp, par_name, confDirectives, "", 0, ¶meter_i) == TCL_ERROR) { return NULL; } switch (parameter_i) { case server_init_script: string_value = (char *)module_globals->rivet_server_init_script; break; case global_init_script: string_value = rsc->rivet_global_init_script; break; case child_init_script: string_value = rsc->rivet_child_init_script; break; case child_exit_script: string_value = rsc->rivet_child_exit_script; break; case request_handler: string_value = rsc->request_handler; break; case before_script: string_value = rsc->rivet_before_script; break; case after_script: string_value = rsc->rivet_after_script; break; case after_every_script: string_value = rsc->after_every_script; break; case abort_script: string_value = rsc->rivet_abort_script; break; case error_script: string_value = rsc->rivet_error_script; break; case upload_directory: string_value = (char *)rsc->upload_dir; break; case mpm_bridge: string_value = (char *)module_globals->mpm_bridge; break; case upload_max: int_value = Tcl_NewIntObj(rsc->upload_max); break; case upload_files_to_var: int_value = Tcl_NewIntObj(rsc->upload_files_to_var); break; case separate_virtual_interps: int_value = Tcl_NewIntObj(module_globals->separate_virtual_interps); break; case separate_channels: int_value = Tcl_NewIntObj(module_globals->separate_channels); break; case honor_header_only_requests: int_value = Tcl_NewIntObj(rsc->honor_header_only_reqs); break; case export_rivet_ns: int_value = Tcl_NewIntObj(rsc->export_rivet_ns); break; case import_rivet_ns: int_value = Tcl_NewIntObj(rsc->import_rivet_ns); break; default: return NULL; } /* * In the configuration record any integer valued parameter has a defined integer default, whereas * string parameters have NULL as default. If we got here but both the these pointers are NULL * it means a valid string valued configuration parameter was inspected but since it's NULL we * return an empty string */ if ((string_value == NULL) && (int_value == NULL)) { return Tcl_NewStringObj("",-1); } else if (string_value != NULL) { /* otherwise if string_value is defined we return it as Tcl_Obj*/ return Tcl_NewStringObj(string_value,-1); } else { /* there is no other possible case: int_value must be returned */ return int_value; } } /* * Rivet_ReadConfTable: * * This procedure builds a key-value list from an apr table * It's called by Rivet_BuildConfDictionary to read theRivet * configuration tables but it can work for every apr table * * Arguments: * * - interp: Tcl_Interp pointer * - table: an apr_table_t pointer * */ static Tcl_Obj* Rivet_ReadConfTable (Tcl_Interp* interp, apr_table_t* table) { Tcl_Obj* key; Tcl_Obj* val; apr_array_header_t *arr; apr_table_entry_t *elts; int nelts,i; int tcl_status = TCL_OK; Tcl_Obj* keyval_list = Tcl_NewObj(); //Tcl_IncrRefCount(keyval_list); arr = (apr_array_header_t*) apr_table_elts( table ); elts = (apr_table_entry_t *) arr->elts; nelts = arr->nelts; for (i = 0; i < nelts; i++) { key = Tcl_NewStringObj( elts[i].key, -1); val = Tcl_NewStringObj( elts[i].val, -1); Tcl_IncrRefCount(key); Tcl_IncrRefCount(val); tcl_status = Tcl_ListObjAppendElement (interp,keyval_list,key); if (tcl_status == TCL_ERROR) { Tcl_DecrRefCount(keyval_list); Tcl_DecrRefCount(key); Tcl_DecrRefCount(val); return NULL; } tcl_status = Tcl_ListObjAppendElement (interp,keyval_list,val); if (tcl_status == TCL_ERROR) { Tcl_DecrRefCount(keyval_list); Tcl_DecrRefCount(key); Tcl_DecrRefCount(val); return NULL; } Tcl_DecrRefCount(key); Tcl_DecrRefCount(val); } return keyval_list; } /* * -- Rivet_BuildConfDictionary * * Parameters set in the configuration files are collected in three * APR tables by Rivet_ServerConf,Rivet_DirConf and Rivet_UserConf. * * Arguments: * * - interp: Tcl_Interp pointer * - rivet_conf: pointer to a rivet_server_conf structure as * returned by Rivet_GetConf * * Returned value: * * - Tcl dictionary storing the dir/user/server configuration. The * dictionary refCount is incremented * */ Tcl_Obj* Rivet_BuildConfDictionary ( Tcl_Interp* interp, rivet_server_conf* rivet_conf) { apr_table_t* conf_tables[3]; Tcl_Obj* keyval_list = NULL; Tcl_Obj* key_list[2]; int it; Tcl_Obj* conf_dict = Tcl_NewObj(); static const char* section_names[] = { "dir", "user", "server" }; enum { dir_conf_section, user_conf_section, server_conf_section }; conf_tables[0] = rivet_conf->rivet_dir_vars; conf_tables[1] = rivet_conf->rivet_user_vars; conf_tables[2] = rivet_conf->rivet_server_vars; // Tcl_IncrRefCount(conf_dict); for (it=0; it < 3; it++) { keyval_list = Rivet_ReadConfTable(interp,conf_tables[it]); if (keyval_list != NULL) { int i; Tcl_Obj** objArrayPnt; int objArrayCnt; Tcl_Obj* val; Tcl_IncrRefCount(keyval_list); key_list[0] = Tcl_NewStringObj(section_names[it],-1); Tcl_IncrRefCount(key_list[0]); Tcl_ListObjGetElements(interp,keyval_list,&objArrayCnt,&objArrayPnt); for (i=0; i < objArrayCnt; i+=2) { key_list[1] = objArrayPnt[i]; val = objArrayPnt[i+1]; Tcl_IncrRefCount(key_list[1]); Tcl_IncrRefCount(val); Tcl_DictObjPutKeyList(interp,conf_dict,2,key_list,val); Tcl_DecrRefCount(key_list[1]); Tcl_DecrRefCount(val); } Tcl_DecrRefCount(key_list[0]); Tcl_DecrRefCount(keyval_list); } else { return NULL; } } return conf_dict; } /* * Rivet_CurrentConfDict * * This function is called by Rivet_InspectCmd which implements command * '::rivet::inspect -all'. The function returns a dictionary where every * parameter name (confDirectives) is associated to its value stored in * the rivet_server_conf as returned by Rivet_GetConf * * Arguments: * * - interp: Tcl interpreter pointer * - rivet_conf: a pointer to a rivet_server_conf structure * * Returned value_ * * - a Tcl_Obj* pointer to a dictionary. The function is guaranteed to * return a Tcl_Obj pointer * */ Tcl_Obj* Rivet_CurrentConfDict ( Tcl_Interp* interp, rivet_server_conf* rivet_conf) { Tcl_Obj* dictObj = Tcl_NewObj(); Tcl_Obj* par_name; const char** p; for (p = confDirectives; (*p) != NULL; p++) { Tcl_Obj* par_value; par_name = Tcl_NewStringObj(*p,-1); Tcl_IncrRefCount(par_name); par_value = Rivet_ReadConfParameter(interp,rivet_conf,par_name); ap_assert(par_value != NULL); Tcl_IncrRefCount(par_value); Tcl_DictObjPut(interp,dictObj,par_name,par_value); Tcl_DecrRefCount(par_value); Tcl_DecrRefCount(par_name); } return dictObj; } /* * -- Rivet_CurrentServerRec * * ::rivet::inspect provides also some basic access to * fields of the server_rec object. * * */ Tcl_Obj* Rivet_CurrentServerRec (Tcl_Interp* interp, server_rec* s ) { Tcl_Obj* dictObj; Tcl_Obj* field_name; Tcl_Obj* field_value; dictObj = Tcl_NewObj(); field_value = Tcl_NewStringObj(s->server_hostname,-1); field_name = Tcl_NewStringObj("hostname",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); field_value = Tcl_NewStringObj(s->error_fname,-1); field_name = Tcl_NewStringObj("errorlog",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); field_value = Tcl_NewStringObj(s->server_admin,-1); field_name = Tcl_NewStringObj("admin",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); field_value = Tcl_NewStringObj(s->path,-1); field_name = Tcl_NewStringObj("server_path",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); field_value = Tcl_NewIntObj(s->is_virtual); field_name = Tcl_NewStringObj("virtual",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); field_value = Tcl_NewStringObj(loglevel_defs[s->log.level],-1); field_name = Tcl_NewStringObj("loglevel",-1); Tcl_DictObjPut(interp,dictObj,field_name,field_value); return dictObj; } rivet-3.2.1/doc/html/help.html000664 001750 001750 00000013476 14142162544 016765 0ustar00manghimanghi000000 000000 Resources - How to Get Help

Resources - How to Get Help

Mailing Lists

The Rivet mailing list is the first place you should turn for help. If you haven't found the solution to your problem in the documentation or you have a question, idea, or comment about the Rivet code itself send email to . To subscribe to the list, post email to .

The mailing list archives are available at http://mail-archives.apache.org/mod_mbox/tcl-rivet-dev/

Newsgroup

The news:comp.lang.tcl newsgroup is a good place to ask about Tcl questions in general. Rivet developers also follow the newsgroup, but it's best to ask Rivet-specific questions on the Rivet list.

Web Sites

There are several web sites that cover Apache and Tcl extensively.

Bug Tracking System

Apache Rivet uses the Apache Bug Tracking system at http://issues.apache.org/bugzilla/. Here, you can report problems, or check and see if existing issues are already known and being dealt with.

IRC

Occasionally, someone from the Rivet team is on IRC at irc.freenode.net, channel #tcl.

Editing Rivet Template Files

Rivet makes available code for two popular editors, emacs and vim to facilitate the editing of Rivet template files. The key concept is that the editor is aware of the <? and ?> tags and switches back and forth between Tcl and HTML modes as the cursor moves. These files, two-mode-mode.el and rvt.vim are available in the contrib/ directory.

rivet-3.2.1/src/mod_rivet_ng/rivet_lazy_mpm.c000664 001750 001750 00000041646 14141530732 022103 0ustar00manghimanghi000000 000000 /* rivet_lazy_mpm.c: dynamically loaded MPM aware functions for threaded MPM */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include #include #include #include #include #include #include #include #include "mod_rivet.h" #include "mod_rivet_common.h" #include "mod_rivet_generator.h" #include "rivetChannel.h" #include "apache_config.h" extern DLLIMPORT mod_rivet_globals* module_globals; extern DLLIMPORT apr_threadkey_t* rivet_thread_key; extern DLLIMPORT module rivet_module; enum { init, idle, processing, thread_exit, done }; /* lazy bridge Tcl thread status and communication variables */ typedef struct lazy_tcl_worker { apr_thread_mutex_t* mutex; apr_thread_cond_t* condition; int status; apr_thread_t* thread_id; server_rec* server; request_rec* r; int ctype; int ap_sts; rivet_server_conf* conf; /* rivet_server_conf* record */ } lazy_tcl_worker; /* virtual host thread queue descriptor */ typedef struct vhost_iface { int threads_count; /* total number of running and idle threads */ apr_thread_mutex_t* mutex; /* mutex protecting 'array' */ apr_array_header_t* array; /* LIFO array of lazy_tcl_worker pointers */ } vhost; /* Lazy bridge internal status data */ typedef struct mpm_bridge_status { apr_thread_mutex_t* mutex; int server_shutdown; /* the child process is shutting down */ vhost* vhosts; /* array of vhost descriptors */ } mpm_bridge_status; /* lazy bridge thread private data extension */ typedef struct mpm_bridge_specific { rivet_thread_interp* interp; /* thread Tcl interpreter object */ int keep_going; /* thread loop controlling variable */ /* the request_rec and TclWebRequest * * are copied here to be passed to a * * channel */ } mpm_bridge_specific; enum { child_global, child_init, child_exit }; #define MOD_RIVET_QUEUE_SIZE 100 static void Lazy_RunConfScript (rivet_thread_private* private,lazy_tcl_worker* w,int init) { Tcl_Obj* tcl_conf_script; Tcl_Interp* interp = private->ext->interp->interp; void* function = NULL; switch (init) { case child_global: function = w->conf->rivet_global_init_script; break; case child_init: function = w->conf->rivet_child_init_script; break; case child_exit: function = w->conf->rivet_child_exit_script; } if (function) { tcl_conf_script = Tcl_NewStringObj(function,-1); Tcl_IncrRefCount(tcl_conf_script); if (Tcl_EvalObjEx(interp,tcl_conf_script, 0) != TCL_OK) { char* errmsg = "rivet_lazy_mpm.so: Error in configuration script: %s"; server_rec* root_server = module_globals->server; ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL,root_server, errmsg, function); ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL,root_server, "errorCode: %s", Tcl_GetVar(interp, "errorCode", 0)); ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL,root_server, "errorInfo: %s", Tcl_GetVar(interp, "errorInfo", 0)); } Tcl_DecrRefCount(tcl_conf_script); } } /* * -- request_processor * * The lazy bridge worker thread. This thread prepares its control data and * will serve requests addressed to a given virtual host. Virtual host server * data are stored in the lazy_tcl_worker structure stored in the generic * pointer argument 'data' * */ static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data) { lazy_tcl_worker* w = (lazy_tcl_worker*) data; rivet_thread_private* private; int idx; rivet_server_conf* rsc; /* The server configuration */ rsc = RIVET_SERVER_CONF(w->server->module_config); /* Rivet_ExecutionThreadInit creates and returns the thread private data. */ private = Rivet_ExecutionThreadInit(); /* A bridge creates and stores in private->ext its own thread private * data. The lazy bridge is no exception. We just need a flag controlling * the execution and an intepreter control structure */ private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific)); private->ext->keep_going = 1; //private->ext->interp = Rivet_NewVHostInterp(private->pool,w->server); RIVET_POKE_INTERP(private,rsc,Rivet_NewVHostInterp(private->pool,rsc->default_cache_size)); private->ext->interp->channel = private->channel; /* The worker thread can respond to a single request at a time therefore must handle and register its own Rivet channel */ Tcl_RegisterChannel(private->ext->interp->interp,*private->channel); /* From the rivet_server_conf structure we determine what scripts we * are using to serve requests */ private->ext->interp->scripts = Rivet_RunningScripts (private->pool,private->ext->interp->scripts,rsc); /* This is the standard Tcl interpreter initialization */ Rivet_PerInterpInit(private->ext->interp,private,w->server,private->pool); /* The child initialization is fired. Beware of the terminologic * trap: we inherited from fork capable systems the term 'child' * meaning 'child process'. In this case the child init actually * is a worker thread initialization, because in a threaded module * this is the agent playing the same role a child process plays * with the prefork bridge */ Lazy_RunConfScript(private,w,child_init); idx = w->conf->idx; /* After the thread has run the configuration script we increment the threads counter */ apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex); (module_globals->mpm->vhosts[idx].threads_count)++; apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex); /* The thread is now set up to serve request within the the * do...while loop controlled by private->keep_going */ apr_thread_mutex_lock(w->mutex); do { while ((w->status != init) && (w->status != thread_exit)) { apr_thread_cond_wait(w->condition,w->mutex); } if (w->status == thread_exit) { private->ext->keep_going = 0; continue; } w->status = processing; /* Content generation */ private->req_cnt++; private->ctype = w->ctype; private->r = w->r; w->ap_sts = Rivet_SendContent(private); // if (module_globals->mpm->server_shutdown) continue; w->status = done; apr_thread_cond_signal(w->condition); while (w->status == done) { apr_thread_cond_wait(w->condition,w->mutex); } /* rescheduling itself in the array of idle threads */ apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex); *(lazy_tcl_worker **) apr_array_push(module_globals->mpm->vhosts[idx].array) = w; apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex); } while (private->ext->keep_going); apr_thread_mutex_unlock(w->mutex); Lazy_RunConfScript(private,w,child_exit); ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,w->server,"processor thread orderly exit"); apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex); (module_globals->mpm->vhosts[idx].threads_count)--; apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex); apr_thread_exit(thd,APR_SUCCESS); return NULL; } /* * -- create_worker * * Utility function to allocate a worker thread control structure * (lazy_tcl_worker) and start a thread. The worker thread code * is in the request_processor function * */ static lazy_tcl_worker* create_worker (apr_pool_t* pool,server_rec* server) { lazy_tcl_worker* w; w = apr_pcalloc(pool,sizeof(lazy_tcl_worker)); w->status = idle; w->server = server; ap_assert(apr_thread_mutex_create(&w->mutex,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS); ap_assert(apr_thread_cond_create(&w->condition, pool) == APR_SUCCESS); apr_thread_create(&w->thread_id, NULL, request_processor, w, module_globals->pool); return w; } /* * -- LazyBridge_ChildInit * * child process initialization. This function prepares the process * data structures for virtual hosts and threads management * */ void LazyBridge_ChildInit (apr_pool_t* pool, server_rec* server) { apr_status_t rv; server_rec* s; server_rec* root_server = module_globals->server; module_globals->mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status)); /* This mutex is only used to consistently carry out these * two tasks * * - set the exit status of a child process (hopefully will be * unnecessary when Tcl is able again of calling * Tcl_DeleteInterp safely) * - control the server_shutdown flag. Actually this is * not entirely needed because once set this flag * is never reset to 0 * */ rv = apr_thread_mutex_create(&module_globals->mpm->mutex, APR_THREAD_MUTEX_UNNESTED,pool); ap_assert(rv == APR_SUCCESS); /* the mpm->vhosts array is created with as many entries as the number of * configured virtual hosts */ module_globals->mpm->vhosts = (vhost *) apr_pcalloc(pool,module_globals->vhosts_count*sizeof(vhost)); ap_assert(module_globals->mpm->vhosts != NULL); /* * Each virtual host descriptor has its own mutex controlling * the queue of available threads */ for (s = root_server; s != NULL; s = s->next) { int idx; apr_array_header_t* array; rivet_server_conf* rsc = RIVET_SERVER_CONF(s->module_config); idx = rsc->idx; rv = apr_thread_mutex_create(&module_globals->mpm->vhosts[idx].mutex, APR_THREAD_MUTEX_UNNESTED,pool); ap_assert(rv == APR_SUCCESS); array = apr_array_make(pool,0,sizeof(void*)); ap_assert(array != NULL); module_globals->mpm->vhosts[idx].array = array; module_globals->mpm->vhosts[idx].threads_count = 0; } module_globals->mpm->server_shutdown = 0; } /* -- LazyBridge_Request * * The lazy bridge HTTP request function. This function * stores the request_rec pointer into the lazy_tcl_worker * structure which is used to communicate with a worker thread. * Then the array of idle threads is checked and if empty * a new thread is created by calling create_worker */ int LazyBridge_Request (request_rec* r,rivet_req_ctype ctype) { lazy_tcl_worker* w; int ap_sts; rivet_server_conf* conf = RIVET_SERVER_CONF(r->server->module_config); apr_array_header_t* array; apr_thread_mutex_t* mutex; mutex = module_globals->mpm->vhosts[conf->idx].mutex; array = module_globals->mpm->vhosts[conf->idx].array; apr_thread_mutex_lock(mutex); /* This request may have come while the child process was * shutting down. We cannot run the risk that incoming requests * may hang the child process by keeping its threads busy, * so we simply return an HTTP_INTERNAL_SERVER_ERROR. * This is hideous and explains why the 'exit' commands must * be avoided at any costs when programming with mod_rivet */ if (module_globals->mpm->server_shutdown == 1) { ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, MODNAME ": http request aborted during child process shutdown"); apr_thread_mutex_unlock(mutex); return HTTP_INTERNAL_SERVER_ERROR; } /* If the array is empty we create a new worker thread */ if (apr_is_empty_array(array)) { w = create_worker(module_globals->pool,r->server); //(module_globals->mpm->vhosts[conf->idx].threads_count)++; } else { w = *(lazy_tcl_worker**) apr_array_pop(array); } apr_thread_mutex_unlock(mutex); /* Locking the thread descriptor structure mutex */ apr_thread_mutex_lock(w->mutex); w->r = r; w->ctype = ctype; w->status = init; w->conf = conf; apr_thread_cond_signal(w->condition); /* we wait for the Tcl worker thread to finish its job */ while (w->status != done) { apr_thread_cond_wait(w->condition,w->mutex); } ap_sts = w->ap_sts; w->status = idle; w->r = NULL; apr_thread_cond_signal(w->condition); apr_thread_mutex_unlock(w->mutex); return ap_sts; } /* -- LazyBridge_Interp: lazy bridge accessor to the interpreter database * */ rivet_thread_interp* LazyBridge_Interp (rivet_thread_private* private, rivet_server_conf* conf, rivet_thread_interp* interp) { if (interp != NULL) { private->ext->interp = interp; } return private->ext->interp; } /* * -- LazyBridge_Finalize * * Bridge thread and resources shutdown * */ apr_status_t LazyBridge_Finalize (void* data) { int idx; server_rec* server = (server_rec*) data; rivet_server_conf* conf = RIVET_SERVER_CONF(server->module_config); module_globals->mpm->server_shutdown = 1; for (idx = 0; idx < module_globals->vhosts_count; idx++) { int try; int count; apr_array_header_t* array; apr_thread_mutex_t* mutex; mutex = module_globals->mpm->vhosts[idx].mutex; array = module_globals->mpm->vhosts[idx].array; /* we need to lock the vhost data mutex */ apr_thread_mutex_lock(mutex); count = module_globals->mpm->vhosts[idx].threads_count; apr_thread_mutex_unlock(mutex); try = 0; while ((try++ < 3) && (count > 0)) { ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,server,"waiting for %d thread to exit",count); if ((conf->idx == idx) && (count == 1)) { break; } while (!apr_is_empty_array(array)) { lazy_tcl_worker* w; w = *(lazy_tcl_worker**) apr_array_pop(array); apr_thread_mutex_lock(w->mutex); w->r = NULL; w->status = thread_exit; apr_thread_cond_signal(w->condition); apr_thread_mutex_unlock(w->mutex); } apr_thread_mutex_lock(mutex); count = module_globals->mpm->vhosts[idx].threads_count; apr_thread_mutex_unlock(mutex); apr_sleep(1000); } } return APR_SUCCESS; } /* * -- LazyBridge_ExitHandler * * * */ int LazyBridge_ExitHandler(rivet_thread_private* private) { /* This is not strictly necessary, because this command will * eventually terminate the whole processes */ /* This will force the current thread to exit */ private->ext->keep_going = 0; if (!module_globals->single_thread_exit) { /* We now tell the supervisor to terminate the Tcl worker * thread pool to exit and is sequence the whole process * to shutdown by calling exit() */ LazyBridge_Finalize(private->r->server); } return TCL_OK; } /* * -- LazyBridge_ServerInit * * Bridge server wide inizialization: * * We set the default value of the flag single_thread_exit * stored in the module globals * */ int LazyBridge_ServerInit (apr_pool_t* pPool,apr_pool_t* pLog,apr_pool_t* pTemp,server_rec* s) { if (module_globals->single_thread_exit == SINGLE_THREAD_EXIT_UNDEF) { module_globals->single_thread_exit = 1; } return OK; } /* Table of bridge control functions */ DLLEXPORT RIVET_MPM_BRIDGE { LazyBridge_ServerInit, LazyBridge_ChildInit, LazyBridge_Request, LazyBridge_Finalize, LazyBridge_ExitHandler, LazyBridge_Interp }; rivet-3.2.1/doc/images/blank.png000664 001750 001750 00000000566 14141530732 017236 0ustar00manghimanghi000000 000000 PNG  IHDRL\gAMA a-IDATxA 0MF4 z;3'kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` 5kX` `fHfIENDB`rivet-3.2.1/tests/docroot2/vhost2.rvt000664 001750 001750 00000000370 14141530732 020277 0ustar00manghimanghi000000 000000 " puts "::childinit2 exists
" } elseif {[info exists ::beforescript2]} { ?>Virtual Host2 Test" } ?> rivet-3.2.1/config.h.in000664 001750 001750 00000013031 14142162471 015443 0ustar00manghimanghi000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* configure command string */ #undef CONFIGURE_CMD /* we are building mod_rivet with optional code */ #undef DEBUG_BUILD /* Display Rivet version in Apache signature */ #undef DISPLAY_VERSION /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Do we have ? */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Do we have ? */ #undef HAVE_NET_ERRNO_H /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Is 'struct dirent64' in ? */ #undef HAVE_STRUCT_DIRENT64 /* Is 'struct stat64' in ? */ #undef HAVE_STRUCT_STAT64 /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Is off64_t in ? */ #undef HAVE_TYPE_OFF64_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Honor HEAD requests */ #undef HEAD_REQUESTS /* Rivet Tcl package version */ #undef INIT_VERSION /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Max size of data in POST operations */ #undef MAX_POST /* No Compiler support for module scope symbols */ #undef MODULE_SCOPE /* yes, MPM worker single thread */ #undef MPM_SINGLE_TCL_THREAD /* The path to a working tclsh executable */ #undef NAMEOFEXECUTABLE /* commands will not be exported */ #undef NAMESPACE_EXPORT /* good, no automatic import will be done */ #undef NAMESPACE_IMPORT /* Do we have ? */ #undef NO_DIRENT_H /* Do we have ? */ #undef NO_DLFCN_H /* Do we have ? */ #undef NO_ERRNO_H /* Do we have ? */ #undef NO_FLOAT_H /* Do we have ? */ #undef NO_LIMITS_H /* Do we have ? */ #undef NO_STDLIB_H /* Do we have ? */ #undef NO_STRING_H /* Do we have ? */ #undef NO_SYS_WAIT_H /* Do we have ? */ #undef NO_VALUES_H /* No description provided for NO_VIZ... */ #undef NO_VIZ /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The path to the rivet tcl library */ #undef RIVETLIB_DESTDIR /* mod_rivet core */ #undef RIVET_CORE /* Separate Channels for virtual hosts */ #undef SEPARATE_CHANNELS /* one interpreter per child */ #undef SEPARATE_VIRTUAL_INTERPS /* requests will be serialized */ #undef SERIALIZE_HTTP_REQUESTS /* Is this a static build? */ #undef STATIC_BUILD /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Is memory debugging enabled? */ #undef TCL_MEM_DEBUG /* Are we building with threads enabled? */ #undef TCL_THREADS /* Are wide integers to be implemented with C 'long's? */ #undef TCL_WIDE_INT_IS_LONG /* What type should be used to define wide integers? */ #undef TCL_WIDE_INT_TYPE /* UNDER_CE version */ #undef UNDER_CE /* Path to the disk directory where uploads are saved */ #undef UPLOAD_DIR /* uploads go to files */ #undef UPLOAD_FILES_TO_VAR /* Do we want to use the threaded memory allocator? */ #undef USE_THREAD_ALLOC /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE /* Add the _LARGEFILE64_SOURCE flag when building */ #undef _LARGEFILE64_SOURCE /* Add the _LARGEFILE_SOURCE64 flag when building */ #undef _LARGEFILE_SOURCE64 /* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS /* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS /* Do we want the reentrant OS API? */ #undef _REENTRANT /* Do we want the thread-safe OS API? */ #undef _THREAD_SAFE /* _WIN32_WCE version */ #undef _WIN32_WCE /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif rivet-3.2.1/tests/binary.rvt000664 001750 001750 00000000650 14141530732 016604 0ustar00manghimanghi000000 000000 rivet-3.2.1/doc/rivet-nochunk.xsl000664 001750 001750 00000002725 14141530732 017517 0ustar00manghimanghi000000 000000 rivet-3.2.1/doc/examples/upload.html000664 001750 001750 00000000253 14141530732 020155 0ustar00manghimanghi000000 000000
rivet-3.2.1/doc/asf_logo.gif000664 001750 001750 00000016157 14141530732 016457 0ustar00manghimanghi000000 000000 GIF89ad~fff̙3olJff3OEfffOf3{7O33fffPPPf3333fN@EσYf/XTJϷTffffuf3ff3JmvdfffVPEOVNjE H̙f|~cv3fǰdlԮifIvt33gt|tA{F|{7-}L"Bjx̙OKVE휃0*PjOV]~ff33{M VJqYOCLVAMY UQPw{}Hm~_!tr lT=GQx|N\n{8QuNNNlUHiïNy/f3fQ̙!,d@H*\ȰÇ#JHŋ3jx1,HP8  =p(Pϟ@ JQ:(3ǧ a8 WhB+x FAK͛شB`ǀGfF!@ 5ᆄ+V(`f&<qbwRt@:uL@# Xz+1u@k̗q[W&tkA yB KE ``>CpA 7 W.t7CsjG(hB z6eh^k&U - }(\m]F% @4F +P"QY‘H^A4@W} X_A)P S h@Y lfolq9KkFm#*TxL-VWBf J(xhG{|dp\P (ܰ)74܀DCJRSYGk[by]w.Øk$E\* a&n} D`;=[CMvz7/y?}uwHD/}>͓~Y/ A BgoC@9P̠2,/Bp`FBUՂ%7&70` qXѡ3W1AW@PO/ӜB+xFʉKsVQGez ϤYm|~^ѱ!: <`Zo>06fE"D=I"E* YPpOM^D >AԻmkcB3JWB,3^~kw1 TMؖ -A*ʍ6q(BW(H! GGFdk6Ǔ bA4Ѐء m`9K0^Mk DC8)- hB~P-s!D ]\2Es!`R-,EЀnv@7@S@h %!OHjD@CKBCNpHJ) [ׄTs>Ǖ1{2JC14,c߳mHhd`Qz3:$tCYb:le؍ru臽vc5 .k^zasnZ?G$ժLݡ-qzC6wLj7]겖UucDz2~@s˳ۄδtil~X$򖱤-HZ!"3mo D  ǹQxvϋ1lJN0q#_[I.wL@!/N>2!C$uAo~dm%Pᄏҝ+%Hfz:>5Hb1%kvtwo ڈ#B3h$* h3ELarđ` 6a.vWA1w/X'cWmpyq6X/|!_~Krf $+A5(+lG0A~(3Gmh@M[Jkj@ ,4HQɷ [vF'v 1fK]wI8j޲ V}]a1`"[ 8]hypNOG ن-mxˁRSI'*"ljw0R DUoBv@Ӷp7O M^R4}SST!uHNdc0"Q77 syC1~ P4(@PbPvGzg^uujUgeWrLK/1y[Y\ȅB &g0}(4)NBE*g.7ef&O@UOX% <9|nՄ1:"% W${f%gF;؄R@@=4mcROYX&`osqM4S4-E&XԅdTsWdp^ap/!N]u)apraLOq pO׃B@A9d>*"w\r{Jh_c\{WxUWKqɂ2ypUO0 >BsS٤~ 'lq vtBTv`irPu)1"m&iqW8WdΤ,)ג4ْwWS'CȂ$\L;95G!w$I^a:@qDYQodfKpdVqb]c9K!C5Y?g_V7ҕ]1|LCu%A1sg+4\g9d 8NUW8VyhuK]SX闊4&:ݕ,AL0ty㚥YC!v5i6IRI|a'x3 hV)ǩoi]S^_CgǙLhz^v:i*sY^$LBhq7exguٕFJf`lE  WR&7RVeOS%dg]lW7#ha%#f!7b1v63q0<22&624{6$-6ZIʜ D1ee<ifeDӥAdp$n?Y7$1cd9Î`ZQ/y4֡SL?) = S2کjZD:ڪgcr w,20<=:G ` !%`2P2@ ^H8^J RJ1kii'0'B "ĆEtyTi"x%_m&ER;lwln)PF}LGL_V('RpԮ] gCj gCIv1{}ŒLa?aб?e7WsSr@KUBZ ៨ k6i3isQDA$xs*Ү7'4D)>" 4z:8ZI؄ֵ FF~`#pNkD葨v$RBG1,,}THwI+,}qKw[qsKWpą4DEP#.E5l \K2s48%uez߱iǛhZ3| 0IBV9t $4pD}l"x!1WM!;J3~Wn7«Gqa3\ķ9{$Q 4|rc̿Y3zk8,qCroW}dh!Xʎm]1pnD"TLJ,/2T{.1Z_tWe̼PE1kJ7J'˥|8slX"!HI,pTt$BOǑkrya a$ QMÒP Cmv*0b"tIL+E$Bln}B'GW1+pPpRP@R=ZȿwiH:iǒRMɼ[M{?E^0]vƢ,;@E0&,P.Ru҂ۄxNa"0QE`SKehA`&M0/ Z鎚hOQ`čHas9 qV8;WG50 {p.os6Ex=CMcM `&vTP5/v$)WOH8GpL!KPYPO`tO&0޼qCta#/tM.X,!crҝ& WXs, ?0),a/&U/P}G.0ْm0~ NH;NMWP90p4uku|%1 1ԥ41;FBACiwAQ 0zV^/}oO_ XDŽ5\N` <1GUsd)i`Iݞ 4aaN 1᳇EauXX8^VvrBmawVM^9UXcɄٿ {A 0$H0À D0a@BC hq-`Aɏ%0aCD1M9I0Č) š0L8re̚YQVtVK%{rNNxq@^OjsCy,)pEia<1eLK0ʕxTVވ8g݁beYUC+U\J1}}yuŹOca-S>91d;6춠I'FË:semW >h㋮ .!I;M+žZAAlSQ9 /$1b#>yͿ-22$fS*ro5c !'#z3# ؼHI6O=׌TjȐ,h.D. S5'4uB>&QҳG1QʱpTSOMU8m@肽-X}$_.ٲeXafmڎZj[pw\r5\tUL+ե6dX]z]{|YQ:]3j_7asABaD_ ~ч 1He4EJwҩ H^ $*hD<%iy%%3kRT^+)cׅ0@wX'x-jP^f 'Zfb{kۘ꫒xkk,lT֓k71,n N BA$bV:sQJ;h3߃#\ƫr*u7_w:-Ȼԍݛ_zǾw7׽+ f%}MUΊp?p܍6E0e- 榷H,H?و$ |AX@T1ZNL JYN3eKNJE|{^wCOZ q-_g:@!&QKdbD(FQS4^@;rivet-3.2.1/rivet/packages/dio/sql.tcl000664 001750 001750 00000021513 14141530732 020407 0ustar00manghimanghi000000 000000 # sql.tcl -- SQL code generator # Copyright 2002-2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This class provides a way to abstract to some extent the # SQL code generation. It's supposed to provide a bridge to # different implementation in various backends for specific # functionalities # package require Itcl ### catch { ::itcl::delete class ::DIO::Sql } ### namespace eval ::Aida { proc generator {backend} { } ::itcl::class Sql { public variable backend public variable what public variable table constructor { backend } { } private method where_clause {where_arguments} public method build_select_query {table row_d} public method quote {field_value} protected method field_value {table_name field_name val} { return "'[quote $val]'" } public method build_insert_query {table row_d} public method build_update_query {table row_d} } # -- build_insert_query # # ::itcl::body Sql::build_insert_query {table row_d} { set vars [dict keys $row_d] foreach field $vars { lappend vals [$this field_value $table $field [dict get $row_d $field]] } return "INSERT INTO $table ([join $vars {,}]) VALUES ([join $vals {,}])" } # -- build_update_query # # ::itcl::body Sql::build_update_query {table row_d} { foreach field [dict keys $row_d] { lappend rowfields "$field=[field_value $table $field [dict get $row_d $field]]" } return "UPDATE $table SET [join $rowfields {,}]" } # build_where_clause # # ::itcl::body Sql::where_clause {where_expr} { set sql "" for {set i 0} {$i < [llength [dict keys $where_expr]]} {incr i} { set d [dict get $where_expr $i] set col [dict get $d column] set op [dict get $d operator] if {$i > 0} { append sql " [dict get $d logical]" } switch $op { "eq" { set sqlop "=" } "ne" { set sqlop "!=" } "lt" { set sqlop "<" } "gt" { set sqlop ">" } "le" { set sqlop "<=" } "ge" { set sqlop ">=" } "notnull" { append sql " $col IS NOT NULL" continue } "null" { append sql " $col IS NULL" continue } } set predicate [dict get $d predicate] if {[::string first {%} $predicate] != -1} { append sql " $col LIKE [$this field_value $table $col [[string range $predicate 1 end]]" } else { append sql " $col$sqlop[$this field_value $table $col $predicate]" } } return $sql } # # quote - given a string, return the same string with any single # quote characters preceded by a backslash # ::itcl::body Sql::quote {field_value} { regsub -all {'} $field_value {\'} field_value return $field_value } # build_select_query - build a select query based on given arguments, # which can include a table name, a select statement, switches to # turn on boolean AND or OR processing, and possibly # some key-value pairs that cause the where clause to be # generated accordingly ::itcl::body Sql::build_select_query {args} { set bool AND set first 1 set req "" set table $from_table set what "*" set parser_st state0 set condition_count 0 set where_expr [dict create] # for each argument passed us... # (we go by integers because we mess with the index depending on # what we find) #puts "args: $args" for {set i 0} {$i < [llength $args]} {incr i} { # fetch the argument we're currently processing set elem [lindex $args $i] # puts "cycle: $i (elem: $elem, status: $parser_st, first: $first)" switch $parser_st { state0 { switch -- [::string tolower $elem] { # -table and -select don't drive the parser state machine # and whatever they have as arguments on the command # line they're set "-table" { # -table -- identify which table the query is about set table [lindex $args [incr i]] } "-select" { # -select - set what [lindex $args [incr i]] } "-or" - "-and" { if {$first} { return -code error "$elem can not be the first element of a where clause" } else { incr condition_count dict set where_expr $condition_count logical [string range $elem 1 end] set parser_st where_op } } default { if {[::string index $elem 0] == "-"} { if {!$first} { incr condition_count } dict set where_expr $condition_count column [string range $elem 1 end] set first 0 set parser_st where_op } else { return -code error "Error: expected -" } } } } where_op { switch -- [string tolower $elem] { "-lt" - "-gt" - "-ne" - "-eq" { dict set where_expr $condition_count operator [string range $elem 1 end] set parser_st cond_predicate } "-null" - "-notnull" { dict set where_expr $condition_count operator [string range $elem 1 end] set parser_st state0 } default { if {[::string index $elem 0] == "-"} { dict set where_expr $condition_count column [string range $elem 1 end] } else { dict set where_expr $condition_count operator "eq" dict set where_expr $condition_count predicate $elem set parser_st state0 } } } } cond_predicate { switch -- [string tolower $elem] { "-expr" { dict set where_expr $condition_count predicate [lindex $args [incr i]] } default { # convert any asterisks to percent signs in the # value field regsub -all {\*} $elem {%} elem dict set where_expr $condition_count predicate $elem } } set parser_st state0 } default { return -code error "invalid parser status" } } } set sql "SELECT $what from $table WHERE[$this where_clause $where_expr]" return $sql } } rivet-3.2.1/src/mod_rivet_ng/000775 001750 001750 00000000000 14141530732 016663 5ustar00manghimanghi000000 000000 rivet-3.2.1/STATUS000664 001750 001750 00000001103 14141530732 014361 0ustar00manghimanghi000000 000000 tcl-rivet STATUS: Committers: ========== Massimo Manghi George Petasis Brice Hamon Work in progress: ================ *) Rivet 3.2: *) Rivet 'quattuor' branch (to become Rivet 4.0) *) Installation Min Required Platform Tcl Version Ok? -------- ----------- --- Debian Tcl 8.6 Yes Ubuntu Tcl 8.6 Yes CentOS Tcl 8.6 Yes Suse Tcl 8.6 Yes FreeBSD Tcl 8.6 Yes Windows 10 Tcl 8.6 Yes rivet-3.2.1/tests/get.rvt000664 001750 001750 00000002047 14141530732 016101 0ustar00manghimanghi000000 000000 0 } { if { [::rivet::var exists foobar] } { puts "\[::rivet::var get foobar\] = [::rivet::var get foobar]\n" puts "\[::rivet::var_qs get foobar\] = [::rivet::var_qs get foobar]\n" } if { [::rivet::var exists xst] } { puts "\[::rivet::var exists xst\]\[::rivet::var exists noxst\] = [::rivet::var exists xst] [::rivet::var exists noxst]\n" puts "\[::rivet::var_qs exists xst\]\[::rivet::var_qs exists noxst\] = [::rivet::var_qs exists xst] [::rivet::var_qs exists noxst]\n" } if { [::rivet::var exists Ms] } { puts "\[::rivet::var get Ms\] = [::rivet::var get Ms]\n" } if { [::rivet::var exists lstvar1] } { puts "\[::rivet::var get lstvar1\] = [::rivet::var get lstvar1]\n" } if { [::rivet::var exists lstvar2] } { puts "\[::rivet::var list lstvar2\] = [::rivet::var list lstvar2]\n" } puts "\[::rivet::var get xst foo\] = [::rivet::var get xst foo]" } else { puts "\[::rivet::var get xst\] = [::rivet::var get xst]" } ?> rivet-3.2.1/doc/html/abort_code.html000664 001750 001750 00000005525 14142162543 020131 0ustar00manghimanghi000000 000000 abort_code

Name

abort_code — Returns the code passed to abort_page earlier during the request processing

Synopsis

::rivet::abort_code

Description

Usage of this command is meaningful only in a script set as AbortScript or AfterEveryScript. abort_code returns the value of the optional parameter passed to abort_page earlier in the same request processing.

rivet-3.2.1/doc/html/wrapline.html000664 001750 001750 00000005620 14142162544 017646 0ustar00manghimanghi000000 000000 wrapline

Name

wrapline — Split the line into multiple lines by splitting on space characters

Synopsis

::rivet::wrapline ?string? ?maxlen? html

Description

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.

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.

rivet-3.2.1/rivet/packages/README000664 001750 001750 00000000257 14141530732 017213 0ustar00manghimanghi000000 000000 ### ## rivet/packages - Version-independent packages for the Rivet Apache module. ## ### This directory contains version-independent packages for Rivet. More to come later. rivet-3.2.1/rivet/rivet-tcl/wrap.tcl000664 001750 001750 00000003214 14141530732 020137 0ustar00manghimanghi000000 000000 ### ## ## wrap - Split a string on newlines. For each line, wrap the line at a space ## character to be equal to or shorter than the maximum length value passed. ## ## if a third argument called "-html" is present, the string is put together ## with html
line breaks, otherwise it's broken with newlines. ## ## $Id$ ## ### namespace eval ::rivet { proc wrap {string maxlen {html ""}} { set splitstring {} foreach line [split $string "\n"] { lappend splitstring [wrapline $line $maxlen $html] } if {$html == "-html"} { return [join $splitstring "
"] } else { return [join $splitstring "\n"] } } ## ## wrapline -- 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. ## ## If the third argument, "-html", is present, return the result with ## the lines separated by html
line breaks, otherwise the lines ## are returned separated by newline characters. ## proc wrapline {line maxlen {html ""}} { set string [split $line " "] set newline [list [lindex $string 0]] foreach word [lrange $string 1 end] { if {[string length $newline]+[string length $word] > $maxlen} { lappend lines [join $newline " "] set newline {} } lappend newline $word } lappend lines [join $newline " "] if {$html == "-html"} { return [join $lines
] } else { return [join $lines "\n"] } } } rivet-3.2.1/doc/html/000755 001750 001750 00000000000 14142162544 015132 5ustar00manghimanghi000000 000000 rivet-3.2.1/tests/docroot2/afterscript.tcl000664 001750 001750 00000000123 14141530732 021343 0ustar00manghimanghi000000 000000 # afterscript.tcl -- afterscript for tests # $Id$ puts -nonewline "afterscript2" rivet-3.2.1/src/request/apache_request.c000664 001750 001750 00000046076 14141530732 021051 0ustar00manghimanghi000000 000000 /* apache_request.c -- Apache multipart form data handling */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include #include #include #include #include #include "apache_request.h" #include "apache_multipart_buffer.h" int fill_buffer(multipart_buffer *self); /* needed for mozilla hack */ static void req_plustospace(char *str) { register int x; for(x=0;str[x];x++) if(str[x] == '+') str[x] = ' '; } static int util_read(ApacheRequest *req, const char **rbuf) { request_rec *r = req->r; int rc = OK; if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) { return rc; } if (ap_should_client_block(r)) { char buff[HUGE_STRING_LEN]; int len_read; apr_off_t rpos; apr_off_t rsize; apr_off_t length = r->remaining; rpos = 0; if (length > req->post_max && req->post_max > 0) { ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)", (int)length, req->post_max); return HTTP_REQUEST_ENTITY_TOO_LARGE; } *rbuf = apr_pcalloc(r->pool, length + 1); while ((len_read = ap_get_client_block(r, buff, sizeof(buff))) > 0) { if ((rpos + len_read) > length) { rsize = length - rpos; } else { rsize = len_read; } memcpy((char*)*rbuf + rpos, buff, rsize); rpos += rsize; } } return rc; } char *ApacheRequest_script_name(ApacheRequest *req) { request_rec *r = req->r; char *tmp; if (r->path_info && *r->path_info) { int path_info_start = ap_find_path_info(r->uri, r->path_info); tmp = (char*) apr_pstrndup(r->pool, r->uri, path_info_start); } else { tmp = r->uri; } return tmp; } char *ApacheRequest_script_path(ApacheRequest *req) { return ap_make_dirstr_parent(req->r->pool, ApacheRequest_script_name(req)); } const char *ApacheRequest_param(ApacheRequest *req, const char *key) { ApacheRequest_parse(req); return (char*) apr_table_get(req->parms, key); } static int make_params(void *data, const char *key, const char *val) { //array_header *arr = (array_header *)data; apr_array_header_t *arr = (apr_array_header_t *)data; //*(char **)apr_push_array(arr) = (char *)val; *(char **)apr_array_push(arr) = (char *)val; return 1; } //array_header *ApacheRequest_params(ApacheRequest *req, const char *key) apr_array_header_t *ApacheRequest_params(ApacheRequest *req, const char *key) { //array_header *values = ap_make_array(req->r->pool, 4, sizeof(char *)); apr_array_header_t *values = apr_array_make(req->r->pool, 4, sizeof(char *)); ApacheRequest_parse(req); apr_table_do(make_params, (void*)values, req->parms, key, NULL); return values; } char *ApacheRequest_params_as_string(ApacheRequest *req, const char *key) { char *retval = NULL; //array_header *values = ApacheRequest_params(req, key); apr_array_header_t *values = ApacheRequest_params(req, key); int i; for (i=0; inelts; i++) { retval = (char*) apr_pstrcat(req->r->pool, retval ? retval : "", ((char **)values->elts)[i], (i == (values->nelts - 1)) ? NULL : ", ", NULL); } return retval; } //table *ApacheRequest_query_params(ApacheRequest *req, ap_pool *p) apr_table_t *ApacheRequest_query_params(ApacheRequest *req, /*ap_pool*/apr_pool_t *p) { //array_header *a = ap_palloc(p, sizeof *a); //array_header *b = (array_header *)req->parms; apr_array_header_t *a = apr_palloc(p, sizeof *a); apr_array_header_t *b = (apr_array_header_t *)req->parms; a->elts = b->elts; a->nelts = req->nargs; a->nalloc = a->nelts; /* COW hack: array push will induce copying */ //a->elt_size = sizeof(table_entry); //return (table *)a; a->elt_size = sizeof(apr_table_entry_t); return (apr_table_t *)a; } apr_table_t *ApacheRequest_post_params(ApacheRequest *req, apr_pool_t *p) { apr_array_header_t *a = apr_palloc(p, sizeof *a); apr_array_header_t *b = (apr_array_header_t *)req->parms; a->elts = (void *)( (apr_table_entry_t *)b->elts + req->nargs ); a->nelts = b->nelts - req->nargs; a->nalloc = a->nelts; /* COW hack: array push will induce copying */ a->elt_size = sizeof(apr_table_entry_t); return (apr_table_t *)a; } ApacheUpload *ApacheUpload_new(ApacheRequest *req) { ApacheUpload *upload = (ApacheUpload *) apr_pcalloc(req->r->pool, sizeof(ApacheUpload)); upload->next = NULL; upload->name = NULL; upload->info = NULL; upload->fp = NULL; upload->size = 0; upload->req = req; return upload; } ApacheUpload *ApacheUpload_find(ApacheUpload *upload, char *name) { ApacheUpload *uptr; for (uptr = upload; uptr; uptr = uptr->next) { if (strEQ(uptr->name, name)) { return uptr; } } return NULL; } ApacheRequest *ApacheRequest_new(apr_pool_t *pool) { ApacheRequest *req = (ApacheRequest *) apr_pcalloc(pool, sizeof(ApacheRequest)); req->status = OK; req->parms = apr_table_make(pool, DEFAULT_TABLE_NELTS); req->upload = NULL; req->post_max = -1; req->disable_uploads = 0; req->upload_hook = NULL; req->hook_data = NULL; req->temp_dir = NULL; req->raw_post = NULL; req->parsed = 0; req->r = NULL; req->nargs = 0; return req; } ApacheRequest *ApacheRequest_init(ApacheRequest* req, request_rec *r) { req->status = OK; apr_table_clear(req->parms); req->upload = NULL; req->post_max = -1; req->disable_uploads = 0; req->upload_hook = NULL; req->hook_data = NULL; req->temp_dir = NULL; req->raw_post = NULL; req->parsed = 0; req->r = r; req->nargs = 0; return req; } static char x2c(const char *what) { register char digit; #ifndef CHARSET_EBCDIC digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0')); digit *= 16; digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0')); #else /*CHARSET_EBCDIC*/ char xstr[5]; xstr[0]='0'; xstr[1]='x'; xstr[2]=what[0]; xstr[3]=what[1]; xstr[4]='\0'; digit = os_toebcdic[0xFF & ap_strtol(xstr, NULL, 16)]; #endif /*CHARSET_EBCDIC*/ return (digit); } static unsigned int utf8_convert(char *str) { long x = 0; int i = 0; while (i < 4 ) { if ( apr_isxdigit(str[i]) != 0 ) { if( apr_isdigit(str[i]) != 0 ) { x = x * 16 + str[i] - '0'; } else { str[i] = tolower( str[i] ); x = x * 16 + str[i] - 'a' + 10; } } else { return 0; } i++; } if(i < 3) return 0; return (x); } static int ap_unescape_url_u(char *url) { register int x, y, badesc, badpath; badesc = 0; badpath = 0; for (x = 0, y = 0; url[y]; ++x, ++y) { if (url[y] != '%'){ url[x] = url[y]; } else { if(url[y + 1] == 'u' || url[y + 1] == 'U'){ unsigned int c = utf8_convert(&url[y + 2]); y += 5; if(c < 0x80){ url[x] = c; } else if(c < 0x800) { url[x] = 0xc0 | (c >> 6); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x10000){ url[x] = (0xe0 | (c >> 12)); url[++x] = (0x80 | ((c >> 6) & 0x3f)); url[++x] = (0x80 | (c & 0x3f)); } else if(c < 0x200000){ url[x] = 0xf0 | (c >> 18); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x4000000){ url[x] = 0xf8 | (c >> 24); url[++x] = 0x80 | ((c >> 18) & 0x3f); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x8000000){ url[x] = 0xfe | (c >> 30); url[++x] = 0x80 | ((c >> 24) & 0x3f); url[++x] = 0x80 | ((c >> 18) & 0x3f); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } } else { if (!apr_isxdigit(url[y + 1]) || !apr_isxdigit(url[y + 2])) { badesc = 1; url[x] = '%'; } else { url[x] = x2c(&url[y + 1]); y += 2; if (url[x] == '/' || url[x] == '\0') badpath = 1; } } } } url[x] = '\0'; if (badesc) return HTTP_BAD_REQUEST; else if (badpath) return HTTP_NOT_FOUND; else return OK; } //static int urlword_dlm[] = {'&', ';', 0}; static char *my_urlword(apr_pool_t *p, const char **line) { char *res = NULL; const char *pos = *line; char ch; while ( (ch = *pos) != '\0' && ch != ';' && ch != '&') { ++pos; } res = (char*) apr_pstrndup(p, *line, pos - *line); while (ch == ';' || ch == '&') { ++pos; ch = *pos; } *line = pos; return res; } static void split_to_parms(ApacheRequest *req, const char *data) { request_rec *r = req->r; const char *val; while (*data && (val = my_urlword(r->pool, &data))) { const char *key = ap_getword(r->pool, &val, '='); req_plustospace((char*)key); ap_unescape_url_u((char*)key); req_plustospace((char*)val); ap_unescape_url_u((char*)val); apr_table_add(req->parms, key, val); } } int ApacheRequest___parse(ApacheRequest *req) { request_rec *r = req->r; const char *ct = apr_table_get(r->headers_in, "Content-type"); int result; if (r->args) { split_to_parms(req, r->args); req->nargs = ((apr_array_header_t *)req->parms)->nelts; } if ((r->method_number == M_POST) && ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) { // //ap_log_rerror(REQ_INFO, "content-type: `%s'", ct); // result = ApacheRequest_parse_multipart(req,ct); } else { result = ApacheRequest_parse_urlencoded(req); } req->parsed = 1; return result; } int ApacheRequest_parse_urlencoded(ApacheRequest *req) { request_rec *r = req->r; int rc = OK; if (r->method_number == M_POST || r->method_number == M_PUT || r->method_number == M_DELETE) { const char *data = NULL; /* const char *type; type = apr_table_get(r->headers_in, "Content-Type"); if (!strncaseEQ(type, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH) && !strncaseEQ(type, TEXT_XML_ENCTYPE, TEXT_XML_ENCTYPE_LENGTH)) { return DECLINED; } */ if ((rc = util_read(req, &data)) != OK) { return rc; } if (data) { req->raw_post = (char*) data; /* Give people a way of getting at the raw data. */ split_to_parms(req, data); } } return OK; } static apr_status_t remove_tmpfile(void *data) { ApacheUpload *upload = (ApacheUpload *) data; // ApacheRequest *req = upload->req; //TODO: fix ap_pfclose //if( ap_pfclose(req->r->pool, upload->fp) ) //TODO: fix logging apr_log_rerror //apr_log_rerror(REQ_ERROR,"[libapreq] close error on '%s'", upload->tempname); #ifndef DEBUG if( remove(upload->tempname) ) { //TODO: fix logging apr_log_rerror //apr_log_rerror(REQ_ERROR,"[libapreq] remove error on '%s'", upload->tempname); } #endif // free(upload->tempname); return 0; } apr_file_t *ApacheRequest_tmpfile(ApacheRequest *req, ApacheUpload *upload) { request_rec *r = req->r; apr_file_t *fp = NULL; char *name = NULL; char *file = NULL ; const char *tempdir; apr_status_t rv; tempdir = req->temp_dir; /* file = (char *)apr_palloc(r->pool,sizeof(apr_time_t)); */ file = apr_psprintf(r->pool,"%u.XXXXXX", (unsigned int)r->request_time); rv = apr_temp_dir_get(&tempdir,r->pool); if (rv != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "No temp dir!"); return NULL; } rv = apr_filepath_merge(&name,tempdir,file,APR_FILEPATH_NATIVE,r->pool); if (rv != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "File path error!"); return NULL; } rv = apr_file_mktemp(&fp,name,0,r->pool); if (rv != APR_SUCCESS) { char* errorBuffer = (char*) apr_palloc(r->pool,256); ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "Failed to open temp file: %s",apr_strerror(rv,errorBuffer,256)); return NULL; } upload->fp = fp; upload->tempname = name; apr_pool_cleanup_register (r->pool, (void *)upload, remove_tmpfile, apr_pool_cleanup_null); return fp; } int ApacheRequest_parse_multipart(ApacheRequest *req,const char* ct) { request_rec* r = req->r; int rc = OK; apr_off_t length; char* boundary; multipart_buffer* mbuff; ApacheUpload* upload = NULL; apr_status_t status; char error[1024]; if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) { return rc; } if (!ap_should_client_block(r)) { return rc; } if ((length = r->remaining) > req->post_max && req->post_max > 0) { ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)", (int)length,req->post_max); return HTTP_REQUEST_ENTITY_TOO_LARGE; } do { size_t blen; boundary = ap_getword(r->pool, &ct, '='); if (boundary == NULL) return DECLINED; blen = strlen(boundary); if (blen == 0 || blen < strlen("boundary")) return DECLINED; boundary += blen - strlen("boundary"); } while (strcasecmp(boundary,"boundary") != 0); boundary = ap_getword_conf(r->pool, &ct); if (!(mbuff = multipart_buffer_new(boundary, length, r))) { return DECLINED; } while (!multipart_buffer_eof(mbuff)) { apr_table_t* header = (apr_table_t*) multipart_buffer_headers(mbuff); const char* cd; const char* param = NULL; const char* filename=NULL; char buff[FILLUNIT]; size_t blen; if (!header) { #ifdef DEBUG ap_log_rerror(REQ_ERROR,"Silently dropping remaining '%ld' bytes", r->remaining); #endif do { } while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 ); return OK; } if ((cd = apr_table_get(header, "Content-Disposition"))) { const char *pair; while (*cd && (pair = ap_getword(r->pool, &cd, ';'))) { const char *key; while (apr_isspace(*cd)) { ++cd; } if (ap_ind(pair, '=')) { key = ap_getword(r->pool, &pair, '='); if(strcaseEQ(key, "name")) { param = ap_getword_conf(r->pool, &pair); } else if(strcaseEQ(key, "filename")) { filename = ap_getword_conf(r->pool, &pair); } } } if (!filename) { char *value = multipart_buffer_read_body(mbuff); apr_table_add(req->parms, param, value); continue; } if (!param) continue; /* shouldn't happen, but just in case. */ if (req->disable_uploads) { #if DEBUG ap_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden"); #endif return HTTP_FORBIDDEN; } apr_table_add(req->parms, param, filename); if (upload) { upload->next = ApacheUpload_new(req); upload = upload->next; } else { upload = ApacheUpload_new(req); req->upload = upload; } if (! req->upload_hook && ! ApacheRequest_tmpfile(req, upload) ) { return HTTP_INTERNAL_SERVER_ERROR; } upload->info = header; upload->filename = (char*)apr_pstrdup(req->r->pool, filename); upload->name = (char*)apr_pstrdup(req->r->pool, param); /* mozilla empty-file (missing CRLF) hack */ fill_buffer(mbuff); if( strEQN(mbuff->buf_begin, mbuff->boundary, strlen(mbuff->boundary)) ) { r->remaining -= 2; continue; } while ((blen = multipart_buffer_read(mbuff, buff, sizeof(buff)))) { apr_size_t bytes_to_write = (apr_size_t) blen; status = apr_file_write(upload->fp,buff,&bytes_to_write); if (status != 0) { apr_strerror(status,error,1024); return HTTP_INTERNAL_SERVER_ERROR; } upload->size += blen; } } } return OK; } #define Mult_s 1 #define Mult_m 60 #define Mult_h (60*60) #define Mult_d (60*60*24) #define Mult_M (60*60*24*30) #define Mult_y (60*60*24*365) static int expire_mult(char s) { switch (s) { case 's': return Mult_s; case 'm': return Mult_m; case 'h': return Mult_h; case 'd': return Mult_d; case 'M': return Mult_M; case 'y': return Mult_y; default: return 1; }; } static time_t expire_calc(char *time_str) { int is_neg = 0, offset = 0; char buf[256]; int ix = 0; if (*time_str == '-') { is_neg = 1; ++time_str; } else if (*time_str == '+') { ++time_str; } else if (strcaseEQ(time_str, "now")) { /*ok*/ } else { return 0; } /* wtf, ap_isdigit() returns false for '1' !? */ while (*time_str && (apr_isdigit(*time_str) || (*time_str == '1'))) { buf[ix++] = *time_str++; } buf[ix] = '\0'; offset = atoi(buf); return time(NULL) + (expire_mult(*time_str) * (is_neg ? (0 - offset) : offset)); } char *ApacheUtil_expires(apr_pool_t *p, char *time_str, int type) { time_t when; struct tm *tms; int sep = (type == EXPIRES_HTTP) ? ' ' : '-'; if (!time_str) { return NULL; } when = expire_calc(time_str); if (!when) { return (char*) apr_pstrdup(p, time_str); } tms = gmtime(&when); return (char*) apr_psprintf(p, "%s, %.2d%c%s%c%.2d %.2d:%.2d:%.2d GMT", apr_day_snames[tms->tm_wday], tms->tm_mday, sep, apr_month_snames[tms->tm_mon], sep, tms->tm_year + 1900, tms->tm_hour, tms->tm_min, tms->tm_sec); } char *ApacheRequest_expires(ApacheRequest *req, char *time_str) { return ApacheUtil_expires(req->r->pool, time_str, EXPIRES_HTTP); } rivet-3.2.1/tests/channel.tcl000664 001750 001750 00000000061 14141530732 016673 0ustar00manghimanghi000000 000000 puts -nonewline [fconfigure stdout -buffersize] rivet-3.2.1/doc/convert_examples.tcl.in000664 001750 001750 00000002662 14141530732 020662 0ustar00manghimanghi000000 000000 # convert_examples.tcl -- # # # reads the examples dir, checks if a file has been already converted # in and compares their mtimes. If the file in # is more recent the target dir is recreated. # The script uses Rivet's escape_sgml_chars to convert examples code # into text suitable to be inclued and displayed in XML/XHTML # documentation # NOTICE: This script requires Rivet, its scripts and # libraries to be in the auto_path. # usage: # # tclsh ./convert_examples # # $Id$ # lappend auto_path @RIVET_TCL_TARGET@ lappend auto_path [file join @RIVET_TCL_TARGET@ rivet-tcl] package require rivetlib set source_dir examples set target_dir examples-sgml if {![info exists source_examples]} { set source_examples [glob [file join $source_dir *.*]] puts "escaping $source_examples to SGML compatible form" } foreach example $source_examples { set exam_name [file tail $example] set example_sgml [file join $target_dir $exam_name] set example_sgml_exists [file exists $example_sgml] if {!$example_sgml_exists || \ ([file mtime $example] > [file mtime $example_sgml])} { puts -nonewline "$example needs to be escaped..." set example_text [string trim [::rivet::read_file $example]] set example_sgml_fid [open $example_sgml w+] puts $example_sgml_fid [::rivet::escape_sgml_chars $example_text] close $example_sgml_fid puts "done" } } rivet-3.2.1/acinclude.m4000755 001750 001750 00000001600 14141530732 015607 0ustar00manghimanghi000000 000000 # # Rivet build stuff # # $Id$ # # # Include the TEA standard macro set # #builtin([include],[tclconfig/tcl.m4]) m4_include([tclconfig/tcl.m4]) # # Include the libtool macro set # m4_include([tclconfig/libtool.m4]) # # Add here whatever m4 macros you want to define for your package # m4_include([m4/ax_prefix_config_h.m4]) # # check for apache base directory # AC_DEFUN([APACHE_DIR],[ AC_ARG_WITH( apache, [ --with-apache[=DIR] Apache server directory], , [with_apache="no"] ) AC_MSG_CHECKING(for Apache directory) if test "$with_apache" = "no"; then AC_MSG_ERROR( Specify the apache using --with-apache) else # make sure that a well known include file exists if test -e $with_apache/include/httpd.h; then apache_dir=$with_apache AC_MSG_RESULT(APACHE found!) else AC_MSG_ERROR( $with_apache not found. ) fi fi ]) rivet-3.2.1/tests/get.test000664 001750 001750 00000005343 14141530732 016247 0ustar00manghimanghi000000 000000 # $Id$ ::tcltest::test getvariables-1.1 {GET variables} { set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ] regexp -line {\[::rivet::var get foobar\] = goober$} [ ::http::data $page ] match set match } {[::rivet::var get foobar] = goober} ::tcltest::test getvariables-1.2 {GET variables - exists} { set page [ ::http::geturl "${urlbase}get.rvt?xst=1" ] regexp -line {\[::rivet::var exists xst\]\[::rivet::var exists noxst\] = 1 0$} [ ::http::data $page ] match set match } {[::rivet::var exists xst][::rivet::var exists noxst] = 1 0} ::tcltest::test getvariables-1.3 {GET variables - doesn't exist} { set page [ ::http::geturl "${urlbase}get.rvt" ] regexp -line {\[::rivet::var get xst\] = } [ ::http::data $page ] match set match } {[::rivet::var get xst] = } ::tcltest::test getvariables-1.4 {GET variables - default value} { set page [ ::http::geturl "${urlbase}get.rvt?defaulttest=1" ] regexp {^\[::rivet::var get xst foo\] = foo} [ ::http::data $page ] match set match } {[::rivet::var get xst foo] = foo} ::tcltest::test getvariables-1.5 {GET variables - var_qs exists} { set page [ ::http::geturl "${urlbase}get.rvt?xst=1" ] regexp -line {\[::rivet::var_qs exists xst\]\[::rivet::var_qs exists noxst\] = 1 0$} [ ::http::data $page ] match set match } {[::rivet::var_qs exists xst][::rivet::var_qs exists noxst] = 1 0} ::tcltest::test getvariables-2.1 {GET variables + I18N} { set page [ ::http::geturl "${urlbase}get.rvt?Ms=T" ] regexp -line {^\[::rivet::var get Ms\] = T$} [ ::http::data $page ] match set match } {[::rivet::var get Ms] = T} ::tcltest::test getvariables-2.2 {GET variables + I18N + encoding} { set page [ ::http::geturl [ format "${urlbase}get.rvt?%s" [ ::http::formatQuery Ms T ] ] ] regexp -line {^\[::rivet::var get Ms\] = T$} [ ::http::data $page ] match set match } {[::rivet::var get Ms] = T} ::tcltest::test getvariables-3.1 {GET multi-value variable} { set page [ ::http::geturl "${urlbase}get.rvt?lstvar1=a&lstvar1=b&lstvar1=c+d" ] regexp -line {\[::rivet::var get lstvar1\] = a b c d$} [ ::http::data $page ] match set match } {[::rivet::var get lstvar1] = a b c d} ::tcltest::test getvariables-3.2 {GET multi-value variable as list} { set page [ ::http::geturl "${urlbase}get.rvt?lstvar2=a&lstvar2=b&lstvar2=c+d" ] regexp -line {\[::rivet::var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match set match } {[::rivet::var list lstvar2] = a b {c d}} ::tcltest::test getvariables-4.1 {var_qs} { set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ] regexp -line {\[::rivet::var_qs get foobar\] = goober$} [::http::data $page] match set match } {[::rivet::var_qs get foobar] = goober} rivet-3.2.1/doc/examples-sgml/download.tcl000664 001750 001750 00000003277 14141530732 021267 0ustar00manghimanghi000000 000000 # Code example for the transmission of a pdf file. if {[::rivet::var exists pdfname]} { set pdfname [::rivet::var get pdfname] # let's build the full path to the pdf file. The 'pdf_repository' # directory must be readable by the apache children set pdf_full_path [file join $pdf_repository ${pdfname}.pdf] if {[file exists $pdf_full_path]} { # Before the file is sent we inform the client about the file type and # file name. The client can be proposed a filename different from the # original one. In this case, this is the point where a new file name # must be generated. ::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 # client. The following 4 lines of code can be replaced by any code # 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 # 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) ::rivet::headers add Content-Length [string length $pdf] # Let's send the actual file content puts $pdf } else { source pdf_not_found_error.rvt } } else { source parameter_not_defined_error.rvt } rivet-3.2.1/doc/examples/000775 001750 001750 00000000000 14141530732 016003 5ustar00manghimanghi000000 000000 rivet-3.2.1/doc/xml/help.xml000664 001750 001750 00000005706 14141530732 016447 0ustar00manghimanghi000000 000000
Resources - How to Get Help
Mailing Lists The Rivet mailing list is the first place you should turn for help. If you haven't found the solution to your problem in the documentation or you have a question, idea, or comment about the Rivet code itself send email to rivet-dev@tcl.apache.org. To subscribe to the list, post email to rivet-dev-subscribe@tcl.apache.org. The mailing list archives are available at
Newsgroup The newsgroup is a good place to ask about Tcl questions in general. Rivet developers also follow the newsgroup, but it's best to ask Rivet-specific questions on the Rivet list.
Web Sites There are several web sites that cover Apache and Tcl extensively. is the home for the Apache Tcl project. Go there for the latest versions of our software (if you aren't reading these pages off of the site!). is the first place to go for questions about the Apache web server. is the canonical site for Tcl information. is the Tcl'ers Wiki, a free-form place to search for answers and ask for help.
Bug Tracking System Apache Rivet uses the Apache Bug Tracking system at . Here, you can report problems, or check and see if existing issues are already known and being dealt with.
IRC Occasionally, someone from the Rivet team is on IRC at irc.freenode.net, channel #tcl.
Editing Rivet Template Files Rivet makes available code for two popular editors, emacs and vim to facilitate the editing of Rivet template files. The key concept is that the editor is aware of the <? and ?> tags and switches back and forth between Tcl and HTML modes as the cursor moves. These files, two-mode-mode.el and rvt.vim are available in the contrib/ directory.
rivet-3.2.1/contrib/README000664 001750 001750 00000000722 14141530732 015741 0ustar00manghimanghi000000 000000 README file for 'contrib', directory that stores various contribution that don't fit well in the current distribution of Rivet ======================================================================= $Id: $ ======================================================================= rvt.vim: Syntax highlighting of rvt files in Vim form.tcl: TclOO form package (contributed by Clif Flynt) two-mode-mode.el: Switches between tcl and sgml(html) modes (David Welton) rivet-3.2.1/doc/html/makeurl.html000664 001750 001750 00000006633 14142162544 017472 0ustar00manghimanghi000000 000000 makeurl

Name

makeurl — construct url's based on hostname, port.

Synopsis

::rivet::makeurl ?filename?

Description

Create a self referencing URL from a filename. makeurl can be used in three ways

  • With no arguments the current script URL is returned
  • The argument is a relative path: the command returns the argument prefixed with the current script's URL
  • The argument is an absolute path: the full URL to the resource is returned

Example with an absolute path:

::rivet::makeurl /tclp.gif

returns http://[hostname]:[port]/tclp.gif. where hostname and port are the hostname and port of the server in question. The protocol prefix is inferred from the protocol in the URL referencing the script.

rivet-3.2.1/doc/html/diodisplay_package.html000664 001750 001750 00000136343 14142162544 021650 0ustar00manghimanghi000000 000000 DIODisplay

Name

DIODisplay — Database Interface Objects Display Class

Synopsis

DIODisplay (objectName | #auto) (-option | option | -option | option | ...)

Description

DIODisplay is an HTML display class that uses a DIO object to do the database work and a form object to do the displaying.

Options

-DIO dioObject
The DIO object to be used in conjunction with this display object. This is a required field.
-cleanup (1 | 0)
If cleanup is true, when the display object is shown, it will automatically destroy the DIO object, the form object and itself. Default is true.
-confirmdelete (1 | 0)
If confirmdelete is true, attempting to delete a record from the database first requires that the user confirm that they wish to delete it. If it is false, deletion occurs without prompting the user. Defaults to true.
-errorhandler procName
The name of a procedure to handle errors when they occur. During the processing of requests and pages, sometimes unexpected errors can occur. This procedure will handle any errors. It is called with a single argument, the error string. Use of the Tcl errorInfo and errorCode variables is also recommended though.
If no errorhandler is specified, the handle_error method within the Display object will handle the error.
-fields fieldList
Specify a list of fields to be used in this object. The fields list is actually created by using the field command to add fields to the display, but this option can be useful to sometimes over-set the list of fields created.
-form formObject
A Rivet form object to use when displaying a form. If one is not specified, the display object will automatically create one when it is necessary.
-functions functionList
A list of functions to be displayed in the main menu. This is a list of functions the user is allowed to execute.
-pagesize pageSize
How many records to show per page on a search or list. Default is 25.
-rowfields fieldList
A list of fields to display in each row of a search or list. When a search or list is conducted and the resulting rows are displayed, this list will limit which fields are displayed. Default is all fields.
-rowfunctions functionList
A list of functions to display in each row of a search or list.
-searchfields fieldList
A list of fields to allow a user to search by. This list will appear in the main screen as a drop-down box of fields the user can search on.
-title title
The title of the display object. This will be output as the title of the HTML document.

DIO Display Object Commands

objectName cleanup ?value?
Return the current cleanup value. If value is specified, it sets a new value for the cleanup option.
objectName delete key
Delete the specified key from the database.
The default action of this method is to call the DIO object's delete command. This method can be overridden.
objectName destroy
Destroy the diodisplay object.
objectName DIO ?value?
Return the current DIO value. If value is specified, it sets a new value for DIO.
objectName errorhandler ?value?
Return the current errorhandler value. If value is specified, it sets a new value for errorhandler.
objectName fetch key arrayName
Fetch the specified key from the database and store it as an array in arrayName.
The default of this method is to call the DIO object's fetch command. This method can be overridden.
objectName field fieldName (-arg | arg...)
Create a new field object and add it to the display. When a field is added to the display, a new object of the DIODisplayField class is created with its values. See [FIXME - LINK] DIO Display Fields for options and values.
objectName fields ?value?
Return the current fields value. If value is specified, it sets a new value for fields.
objectName form ?value?
Return the current form value. If value is specified, it sets a new value for form.
objectName function functionName
Add a new function to the list of possible functions. The display object will only execute methods and procs which are defined as functions by the object. This is to protect the program from executing a different procedure other than what is allowed. The function command adds a new function to the list of allowable functions.
objectName functions ?value?
Return the current functions value. If value is specified, it sets a new value for functions. See [FIXME - LINK DIO Display Functions] for a list of default functions.
objectName pagesize ?value?
Return the current form pagesize. If value is specified, it sets a new value for pagesize.
objectName rowfields ?value?
Return the current form rowfields. If value is specified, it sets a new value for rowfields.
objectName rowfooter
Output the footer of a list of rows to the web page.
This method can be overridden.
objectName rowfunctions ?value?
Return the current rowfunctions value. If value is specified, it sets a new value for rowfunctions.
objectName rowheader
Output the header of a list of rows to the web page. By default, this is an HTML table with a top row listing the fields in the table.
This method can be overridden.
objectName searchfields ?value?
Return the current searchfields value. If value is specified, it sets a new value for searchfields.
objectName show
Show the display object.
This is the main method of the display class. It looks for a variable called mode to be passed in through a form response and uses that mode to execute the appropriate function. If mode is not given, the Main function is called.
This function should be called for every page.
objectName showform
Display the form of the object.
This method displays the form for this display object. It is used in the Add and Edit methods but can be called separately if needed.
This method can be overridden if the default look of a form needs to be changed. By default, the form displayed is simply the fields in a table, in order.
objectName showrow arrayName
Display a single row of a resulting list or search.
This method is used to display a single row while displaying the result of a list or search. arrayName is a fetched array of the record.
This method can be overriden if the default look of a row needs to be changed. By default, each row is output as a table row with each field as a table data cell.
objectName showview
Display the view of the object.
This method displays the view for this display object. It is used in the Details methods but can be called separately if needed.
This method can be overridden if the default look of a view needs to be changed. By default, the view displayed is simply the fields in a table, in order.
objectName store arrayName
Store the specified arrayName in the database.
The default of this method is to call the DIO object's store command. This method can be overridden.
objectName text ?value?
Return the current text value. If value is specified, it sets a new value for text.
objectName title ?value?
Return the current title value. If value is specified, it sets a new value for title.
objectName type ?value?
Return the current type value. If value is specified, it sets a new value for type.
objectName value ?value?
Return the current value value. If value is specified, it sets a new value for value.

DIO Display Functions

These functions are called from the show method when a form response variable called mode is set. If no mode has been set, the default mode is Main. The show method will handle the necessary switching of functions. The show method also handles checking to make sure the function given is a true function. If not, an error message is displayed. New functions can be added as methods or by use of the function command, and any of the default functions can be overridden with new methods to create an entirely new class. These are the default functions provided.

Add
Show a form that allows the user to add a new entry to the database. This function calls showform to display the form for adding the entry.
Cancel
The Cancel function does nothing but redirect back to the Main function. This is handy for forms which have a cancel button to point to.
Delete
If confirmdelete is true (the default), the Delete function will ask the user if they're sure they want to delete the record from the database. If confirmdelete is false, or if the user confirms they wish to delete, this function calls the DoDelete function to do the actual deletion of a record.
Details
Display the view of a single record from the database. This function calls the showview method to display a single record from the database.
DoDelete
This function actually deletes a record from the database. Once it has deleted the record, it redirects the user back to the Main function.
Edit
Show a form that allows the user to edit an existing entry to the database. This function calls showform to display the form for editing the entry and fills in the fields with the values retrieved from the database.
List
This function lists the entires contents of the database. Each record is output in a row using the showrow method.
Main
This function is the main function of the display object. If there is no mode, or once most commands complete, the user will be redirected to this function. The default Main function displays a list of functions the user can execute, a list of searchfields the user can search on, and a query field. This query field is used by all of the other functions to determine what the user is trying to find.
In the case of a search, query specifies what string the user is looking for in the specified search field. In the case of delete, details or edit, the query specifies the database key to access.
Save
This function saves any data passed to using the store method. This is primarily used by the add and edit commands to store the results of the form the user has filled out.
Search
This function searches the database for any row whose searchBy field matches query. Once any number of records are found, Search displays the results in rows.

DIO Display Fields

Display fields are created with the field command of the DIODisplay object. Each field is created as a new DIODisplayField object or as a subclass of DIODisplayField. The standard form fields use the standard field class, while specialized field types use a class with different options but still supports all of the same commands and values a generic field does.

displayObject field fieldname (-option | option...)

These are the standard options supported by field types:

-formargs arguments
When a field is created, any argument which is not a standard option is assumed to be an argument passed to the form object when the field is shown in a form. These arguments are all appended to the formargs variable. You can use this option to override or add options after the initial creation of an object
-readonly (1 | 0)
If readonly is set to true, the field will not display a form entry when displaying in a form.
-text text
The text displayed next to the form or view field. By default, DIODisplay tries to figure out a pretty way to display the field name. This text will override that default and display whatever is specified.
-type fieldType
The type of field this is. This type is used when creating the field in the form object. fieldType can be any of the accepted form field types. See [FIXME - LINK DIO Field Types] for a list of types available.

All other arguments, unless specified in an individual field type, are passed directly to the form object when the field is created. So, you can pass -size or -maxsize to specify the length and maximum length of the field entry. Or, if type were textarea, you could define -rows and -cols to specify its row and column count.

DIO Display Field Types

The following is a list of recognized field types by DIODisplay. Some are standard HTML form fields, and others are DIODisplay fields which execute special actions and functions.

rivet-3.2.1/tests/redirect.rvt000664 001750 001750 00000000406 14141530732 017120 0ustar00manghimanghi000000 000000 rivet-3.2.1/doc/html/entities.html000664 001750 001750 00000004631 14142162544 017652 0ustar00manghimanghi000000 000000 RivetEntities

RivetEntities

Introduction

The RivetEntities package was kindly provided by Harald Oehlmann and is largely taken from a simple yet clever encoder/decoder of HTML entities starting from a utf-8 character string. The original code writted by Andy Goth is at http://wiki.tcl.tk/26403. Package entities extends the functionality in the original code combining it with Tcl's 'encoding' command to encode/decode from any supported encoding

rivet-3.2.1/cmake/CMakeLists.txt000664 001750 001750 00000053331 14141530732 017245 0ustar00manghimanghi000000 000000 # Georgios Petasis, petasis@iit.demokritos.gr # The minimum version of cmake required. This may work also in 2.8, # but I have not tested. My cmake is version 3.9.0. cmake_minimum_required(VERSION 3.2 FATAL_ERROR) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() # Rivet version: # In order to avoid chasing around multiple definition of the module version we infer # this information from the file VERSION, which must stay in the project root directory # and assuming we are working from a direct child directory SET ( RIVET_TOP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." ) # Read the file named VERSION from the top Rivet directory... FILE ( READ "${RIVET_TOP_DIR}/VERSION" RIVET_VERSION_FROM_FILE ) STRING ( REGEX MATCH "([0-9]+)\.([0-9]+)\.([0-9]+)" _ ${RIVET_VERSION_FROM_FILE} ) SET ( RIVET_MAJOR_VERSION ${CMAKE_MATCH_1} ) SET ( RIVET_MINOR_VERSION ${CMAKE_MATCH_2} ) SET ( RIVET_PATCH_VERSION ${CMAKE_MATCH_3} ) MESSAGE ( STATUS "Rivet version: ${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}.${RIVET_PATCH_VERSION}" ) set(RIVET_VERSION ${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}.${RIVET_PATCH_VERSION}) set(INIT_VERSION ${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}) # Rivetlib version: set(RIVETLIB_PACKAGE "rivetlib") set(RIVETLIB_PACKAGE_VERSION ${INIT_VERSION}) # The arguments argument are optional, declares version and language # (in this case C). project(Rivet VERSION ${RIVET_VERSION} LANGUAGES C) # User options... # =========================================================================== set(with-tclsh "" CACHE FILEPATH "location of a working tclsh executable") set(with-tcl "" CACHE PATH "directory containing tcl configuration (tclConfig.sh)") set(with-post-max 0 CACHE STRING "BYTES Maximum size of data to be sent with a POST") set(with-rivet-core "mod_rivet_ng" CACHE STRING "mod_rivet core directory") set(with-upload-dir "/tmp" CACHE STRING "Default directory for uploads") option(version-display "Display Rivet version in Apache signature" OFF) option(head-requests "Returns real headers in response to a HEAD request" OFF) option(single-thread "forces the worker brigde to create a single thread (debug)" OFF) option(rivet-commands-export "prevent export from ::rivet namespace" ON) option(import-rivet-commands "requires explicit namespace import" OFF) option(virtual-interps-separation "to turn on virtual host separation" OFF) option(requests-serialization "Forces HTTP requests serialization among threads(debug)" OFF) option(upload-var "whether files are uploaded to Tcl variables" ON) option(BUILD_SHARED_LIBS "build and link with shared libraries" ON) option(TCL_THREADS "build with threads" ON) option(TCL_MEM_DEBUG "build with memory debugging" OFF) include(CMakeDependentOption) CMAKE_DEPENDENT_OPTION(BUILD_STATIC_LIBS "build as static library" ON "NOT BUILD_SHARED_LIBS" OFF) # Offer the user the choice of overriding the installation directories set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries") set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables") set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files") if(WIN32 AND NOT CYGWIN) set(DEF_INSTALL_CMAKE_DIR CMake) else() set(DEF_INSTALL_CMAKE_DIR lib/CMake/Rivet) endif() set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() # Use GNU install directories include(GNUInstallDirs) # Rivet source files... # =========================================================================== set(RIVET_SRC_DIR "${PROJECT_SOURCE_DIR}/../src") set(RIVET_LIB_DIR "${PROJECT_SOURCE_DIR}/../rivet") set(RIVET_CORE ${with-rivet-core}) set(rivetparser_sources ${RIVET_SRC_DIR}/parser/rivetParser.c ${RIVET_SRC_DIR}/parser/parserPkgInit.c ) set(rivetlib_sources ${RIVET_SRC_DIR}/librivet/rivetList.c ${RIVET_SRC_DIR}/librivet/rivetCrypt.c ${RIVET_SRC_DIR}/librivet/rivetWWW.c ${RIVET_SRC_DIR}/librivet/rivetPkgInit.c ) set(rivet_worker_mpm_sources ${RIVET_SRC_DIR}/${RIVET_CORE}/rivet_worker_mpm.c ${RIVET_SRC_DIR}/${RIVET_CORE}/worker_prefork_common.c ) set(rivet_prefork_mpm_sources ${RIVET_SRC_DIR}/${RIVET_CORE}/rivet_prefork_mpm.c ${RIVET_SRC_DIR}/${RIVET_CORE}/worker_prefork_common.c ) set(rivet_lazy_mpm_sources ${RIVET_SRC_DIR}/${RIVET_CORE}/rivet_lazy_mpm.c ) set(mod_rivet_sources ${RIVET_SRC_DIR}/${RIVET_CORE}/mod_rivet.c ${RIVET_SRC_DIR}/request/apache_multipart_buffer.c ${RIVET_SRC_DIR}/request/apache_request.c ${RIVET_SRC_DIR}/${RIVET_CORE}/rivetCore.c ${RIVET_SRC_DIR}/${RIVET_CORE}/rivetInspect.c ${RIVET_SRC_DIR}/${RIVET_CORE}/rivetChannel.c ${RIVET_SRC_DIR}/parser/rivetParser.c ${RIVET_SRC_DIR}/${RIVET_CORE}/TclWebapache.c ${RIVET_SRC_DIR}/${RIVET_CORE}/apache_config.c ${RIVET_SRC_DIR}/${RIVET_CORE}/mod_rivet_cache.c ${RIVET_SRC_DIR}/${RIVET_CORE}/mod_rivet_common.c ${RIVET_SRC_DIR}/${RIVET_CORE}/mod_rivet_generator.c ) # Add build targets... # =========================================================================== add_library(mod_rivet ${mod_rivet_sources}) add_library(rivetparser ${rivetparser_sources}) add_library(rivetlib ${rivetlib_sources}) add_library(rivet_worker_mpm ${rivet_worker_mpm_sources}) add_library(rivet_prefork_mpm ${rivet_prefork_mpm_sources}) add_library(rivet_lazy_mpm ${rivet_lazy_mpm_sources}) add_library(rivet::parser ALIAS rivetparser) add_library(rivet::lib ALIAS rivetparser) add_library(rivet::rivet ALIAS mod_rivet) add_library(rivet::worker_mpm ALIAS rivet_worker_mpm) add_library(rivet::prefork_mpm ALIAS rivet_prefork_mpm) add_library(rivet::lazy_mpm ALIAS rivet_lazy_mpm) SET ( RIVET_LIB_SUFFIX ".so" ) SET ( RIVET_LIB_PREFIX "lib" ) SET_TARGET_PROPERTIES(mod_rivet PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) SET_TARGET_PROPERTIES(rivet_worker_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) SET_TARGET_PROPERTIES(rivet_prefork_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) SET_TARGET_PROPERTIES(rivet_lazy_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) SET_TARGET_PROPERTIES(rivetparser PROPERTIES PREFIX ${RIVET_LIB_PREFIX}) SET_TARGET_PROPERTIES(rivetlib PROPERTIES PREFIX ${RIVET_LIB_PREFIX}) # Definitions... # =========================================================================== target_compile_definitions (rivetparser PRIVATE HAVE_CONFIG_H=1 USE_TCL_STUBS=1 START_TAG="" ) target_compile_definitions (rivetlib PRIVATE HAVE_CONFIG_H=1 USE_TCL_STUBS=1 START_TAG="" ) target_compile_definitions (rivet_worker_mpm PRIVATE HAVE_CONFIG_H=1 ) target_compile_definitions (rivet_prefork_mpm PRIVATE HAVE_CONFIG_H=1 ) target_compile_definitions (rivet_lazy_mpm PRIVATE HAVE_CONFIG_H=1 ) target_compile_definitions (mod_rivet PRIVATE HAVE_CONFIG_H=1 START_TAG="" ) # =========================================================================== # Locate needed packages... # =========================================================================== list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_extra_modules") include(checks) # Locate Tcl... # =========================================================================== MESSAGE ( STATUS "Searching for Tcl..." ) if (NOT "${with-tcl}" STREQUAL "") MESSAGE ( STATUS " Tcl lib directory manually set by -Dwith-tcl=" ${with-tcl} ) get_filename_component(RIVET_TCL_ROOT "${with-tcl}" DIRECTORY) MESSAGE ( STATUS " Setting Tcl root to: " ${RIVET_TCL_ROOT} ) set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${RIVET_TCL_ROOT} ) set (TCL_ROOT ${RIVET_TCL_ROOT}) set (TclStub_ROOT ${RIVET_TCL_ROOT}) endif () if (NOT "${with-tclsh}" STREQUAL "") MESSAGE ( STATUS " Tclsh manually set by -Dwith-tclsh=" ${with-tclsh} ) set (TCL_TCLSH ${with-tclsh}) endif () FIND_PACKAGE ( TCL 8.6.1 REQUIRED ) FIND_PACKAGE ( TclStub 8.6.1 REQUIRED ) MESSAGE ( STATUS " TCL_TCLSH: " ${TCL_TCLSH} ) MESSAGE ( STATUS " TCL_INCLUDE_PATH: " ${TCL_INCLUDE_PATH} ) MESSAGE ( STATUS " TCL_LIBRARY: " ${TCL_LIBRARY} ) MESSAGE ( STATUS " TCL_STUB_LIBRARY: " ${TCL_STUB_LIBRARY} ) # Locate Apache... # =========================================================================== MESSAGE ( STATUS "Searching for Apache..." ) find_package(APACHE REQUIRED) MESSAGE ( STATUS " APACHE_INCLUDE_DIR: " ${APACHE_INCLUDE_DIR} ) MESSAGE ( STATUS " APACHE_MODULE_DIR: " ${APACHE_MODULE_DIR} ) MESSAGE ( STATUS " APACHE_LIB_DIR: " ${APACHE_LIB_DIR} ) # Locate Apr... # =========================================================================== MESSAGE ( STATUS "Searching for Apr..." ) find_package(APR REQUIRED) MESSAGE ( STATUS " APR_INCLUDE_DIR: " ${APR_INCLUDE_DIR} ) MESSAGE ( STATUS " APR_LIBRARY: " ${APR_LIBRARY} ) MESSAGE ( STATUS " APRUTIL_INCLUDE_DIR: " ${APRUTIL_INCLUDE_DIR} ) MESSAGE ( STATUS " APRUTIL_LIBRARY: " ${APRUTIL_LIBRARY} ) find_package(Threads) # Set up include directories... # =========================================================================== set(RIVET_GENERATE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) set(RIVET_GENERATE_DIR ${PROJECT_BINARY_DIR}/generated) set(RIVET_INCLUDE_DIRS_PUBLIC "${TCL_INCLUDE_PATH}" "${APACHE_INCLUDE_DIR}" "${APR_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" ) set(RIVET_INCLUDE_DIRS_PRIVATE "${RIVET_SRC_DIR}" "${RIVET_SRC_DIR}/${RIVET_CORE}" "${RIVET_SRC_DIR}/parser" "${RIVET_SRC_DIR}/request" "${RIVET_GENERATE_DIR}" "${PROJECT_BINARY_DIR}" ) target_include_directories(rivetparser PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) target_include_directories(rivetlib PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) target_include_directories(rivet_worker_mpm PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) target_include_directories(rivet_prefork_mpm PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) target_include_directories(rivet_lazy_mpm PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) target_include_directories(mod_rivet PUBLIC ${RIVET_INCLUDE_DIRS_PUBLIC} PRIVATE ${RIVET_INCLUDE_DIRS_PRIVATE}) # Set up libraries... # =========================================================================== target_link_libraries(rivetparser ${TCL_STUB_LIBRARY}) target_link_libraries(rivetlib ${TCL_STUB_LIBRARY}) target_link_libraries(mod_rivet ${TCL_LIBRARY}) if(WIN32) # Under Windows, we need to link with all libraries, even libhttpd.lib MESSAGE ( STATUS "Searching for libhttpd.lib (Windows)..." ) FIND_LIBRARY(APACHE_HTTPD_LIBRARY libhttpd libhttpd.lib NAMES ${APACHE_HTTPD_NAMES} PATHS ${APACHE_HTTPD_LIBRARY_HINTS} ${APACHE_ROOT}/lib ) MESSAGE ( STATUS " APACHE_HTTPD_LIBRARY: " ${APACHE_HTTPD_LIBRARY} ) # Export all symbols from mod_rivet #SET_TARGET_PROPERTIES(mod_rivet PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) target_link_libraries(mod_rivet ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} ) target_link_libraries(rivet_worker_mpm ${APR_LIBRARY} ${APRUTIL_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) target_link_libraries(rivet_prefork_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) target_link_libraries(rivet_lazy_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) # rivet_worker_mpm.c uses round(), which is available in C99 SET_TARGET_PROPERTIES(rivet_worker_mpm PROPERTIES C_STANDARD 99) if(MSVC) # Libraries linked with tclstubs.lib library, cannot use /SAFESEH SET_TARGET_PROPERTIES(rivetparser PROPERTIES LINK_FLAGS /SAFESEH:NO ) SET_TARGET_PROPERTIES(rivetlib PROPERTIES LINK_FLAGS /SAFESEH:NO ) endif(MSVC) endif(WIN32) # Handle user options... # =========================================================================== MESSAGE( STATUS "Rivet version ${RIVET_VERSION}:") MESSAGE( STATUS " Core in use: " ${RIVET_CORE}) set(CONFIGURE_CMD "cmake -${CMAKE_ARGC} ${CMAKE_ARGV0}") if(version-display) set(DISPLAY_VERSION 1) else(version-display) set(DISPLAY_VERSION 0) endif() if(head-requests) set(HEAD_REQUESTS 1) endif() set(MAX_POST ${with-post-max}) if(single-thread) set(MPM_SINGLE_TCL_THREAD 1) endif() set(NAMEOFEXECUTABLE ${TCL_TCLSH}) if(import-rivet-commands) message(STATUS " Forcing Rivet to import commands from ::rivet namespace") set(NAMESPACE_IMPORT 1) endif() if(rivet-commands-export) message(STATUS " Forcing Rivet to export commands from ::rivet namespace") set(NAMESPACE_EXPORT 1) endif() set(SEPARATE_CHANNELS 0) if(virtual-interps-separation) set(SEPARATE_VIRTUAL_INTERPS 1) endif() if(requests-serialization) set(SERIALIZE_HTTP_REQUESTS 1) endif() if(upload-var) set(UPLOAD_FILES_TO_VAR 1) endif() set(UPLOAD_DIR ${with-upload-dir}) # Location of the Rivet library... # =========================================================================== if(NOT DEFINED RIVETLIB_DESTDIR) set(RIVETLIB_DESTDIR "${APACHE_LIB_DIR}/rivet${RIVET_VERSION}") endif(NOT DEFINED RIVETLIB_DESTDIR) if(TCL_THREADS) set(TCL_THREADS 1) if(NOT WIN32) set(USE_THREAD_ALLOC 1) set(_REENTRANT 1) set(_THREAD_SAFE 1) STRING (REGEX MATCH "SunOS" PROJECT_OS_SunOS ${CMAKE_SYSTEM_NAME}) if(PROJECT_OS_SunOS) set(_POSIX_PTHREAD_SEMANTICS 1) endif(PROJECT_OS_SunOS) endif(NOT WIN32) endif(TCL_THREADS) # Definitions... # =========================================================================== if(_REENTRANT) target_compile_definitions(rivetparser PRIVATE _REENTRANT=1) target_compile_definitions(rivetlib PRIVATE _REENTRANT=1) target_compile_definitions(rivet_worker_mpm PRIVATE _REENTRANT=1) target_compile_definitions(rivet_prefork_mpm PRIVATE _REENTRANT=1) target_compile_definitions(rivet_lazy_mpm PRIVATE _REENTRANT=1) target_compile_definitions(mod_rivet PRIVATE _REENTRANT=1) endif(_REENTRANT) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_compile_definitions(rivetparser PRIVATE LINUX=1) target_compile_definitions(rivetlib PRIVATE LINUX=1) target_compile_definitions(rivet_worker_mpm PRIVATE LINUX=1) target_compile_definitions(rivet_prefork_mpm PRIVATE LINUX=1) target_compile_definitions(rivet_lazy_mpm PRIVATE LINUX=1) target_compile_definitions(mod_rivet PRIVATE LINUX=1) endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") # Set variables for generating config files... # =========================================================================== set(RIVET_AC_APPLE_UNIVERSAL_BUILD ${AC_APPLE_UNIVERSAL_BUILD}) set(RIVET_CONFIGURE_CMD ${CONFIGURE_CMD}) set(RIVET_DISPLAY_VERSION ${DISPLAY_VERSION}) set(RIVET_HAVE_DLFCN_H ${HAVE_DLFCN_H}) set(RIVET_HAVE_INTTYPES_H ${HAVE_INTTYPES_H}) set(RIVET_HAVE_LIMITS_H ${HAVE_LIMITS_H}) set(RIVET_HAVE_LSEEK64 ${HAVE_LSEEK64}) set(RIVET_HAVE_MEMORY_H ${HAVE_MEMORY_H}) set(RIVET_HAVE_NET_ERRNO_H ${HAVE_NET_ERRNO_H}) set(RIVET_HAVE_OPEN64 ${HAVE_OPEN64}) set(RIVET_HAVE_STDINT_H ${HAVE_STDINT_H}) set(RIVET_HAVE_STDLIB_H ${HAVE_STDLIB_H}) set(RIVET_HAVE_STRINGS_H ${HAVE_STRINGS_H}) set(RIVET_HAVE_STRING_H ${HAVE_STRING_H}) set(RIVET_HAVE_SYS_PARAM_H ${HAVE_SYS_PARAM_H}) set(RIVET_HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H}) set(RIVET_HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}) set(RIVET_HAVE_UNISTD_H ${HAVE_UNISTD_H}) set(RIVET_HEAD_REQUESTS ${HEAD_REQUESTS}) set(RIVET_MPM_SINGLE_TCL_THREAD ${MPM_SINGLE_TCL_THREAD}) set(RIVET_NAMESPACE_EXPORT ${NAMESPACE_EXPORT}) set(RIVET_NAMESPACE_IMPORT ${NAMESPACE_IMPORT}) set(RIVET_HAVE_DIRENT_H ${HAVE_DIRENT_H}) set(RIVET_NO_DIRENT_H ${NO_DIRENT_H}) set(RIVET_NO_DLFCN_H ${NO_DLFCN_H}) set(RIVET_NO_ERRNO_H ${NO_ERRNO_H}) set(RIVET_NO_FLOAT_H ${NO_FLOAT_H}) set(RIVET_HAVE_LIMITS_H ${HAVE_LIMITS_H}) set(RIVET_NO_LIMITS_H ${NO_LIMITS_H}) set(RIVET_NO_STDLIB_H ${NO_STDLIB_H}) set(RIVET_NO_STRING_H ${NO_STRING_H}) set(RIVET_NO_SYS_WAIT_H ${NO_SYS_WAIT_H}) set(RIVET_NO_VALUES_H ${NO_VALUES_H}) set(RIVET_NO_VIZ ${NO_VIZ}) set(RIVET_SEPARATE_CHANNELS ${SEPARATE_CHANNELS}) set(RIVET_SEPARATE_VIRTUAL_INTERPS ${SEPARATE_VIRTUAL_INTERPS}) set(RIVET_SERIALIZE_HTTP_REQUESTS ${SERIALIZE_HTTP_REQUESTS}) set(RIVET_STATIC_BUILD ${STATIC_BUILD}) set(RIVET_STDC_HEADERS ${STDC_HEADERS}) set(RIVET_TCL_MEM_DEBUG ${TCL_MEM_DEBUG}) set(RIVET_TCL_THREADS ${TCL_THREADS}) set(RIVET_TCL_WIDE_INT_IS_LONG ${TCL_WIDE_INT_IS_LONG}) set(RIVET_TCL_WIDE_INT_TYPE ${TCL_WIDE_INT_TYPE}) set(RIVET_UNDER_CE ${UNDER_CE}) set(RIVET_UPLOAD_FILES_TO_VAR ${UPLOAD_FILES_TO_VAR}) set(RIVET_UPLOAD_DIR ${UPLOAD_DIR}) set(RIVET_USE_THREAD_ALLOC ${USE_THREAD_ALLOC}) set(RIVET__ISOC99_SOURCE ${_ISOC99_SOURCE}) set(RIVET__LARGEFILE64_SOURCE ${_LARGEFILE64_SOURCE}) set(RIVET__LARGEFILE_SOURCE64 ${_LARGEFILE_SOURCE64}) set(RIVET__OE_SOCKETS ${_OE_SOCKETS}) set(RIVET__POSIX_PTHREAD_SEMANTICS ${_POSIX_PTHREAD_SEMANTICS}) set(RIVET__REENTRANT ${_REENTRANT}) set(RIVET__THREAD_SAFE ${_THREAD_SAFE}) set(RIVET__WIN32_WCE ${_WIN32_WCE}) set(RIVET__XOPEN_SOURCE_EXTENDED ${_XOPEN_SOURCE_EXTENDED}) set(RIVET_HAVE_ROUND ${HAVE_ROUND}) set(RIVET_NO_HAVE_ROUND ${NO_HAVE_ROUND}) # Generate headers rivet_config.h, config.h # =========================================================================== MESSAGE(STATUS "Generating: " ${RIVET_GENERATE_DIR}/rivet_config.h) configure_file("${PROJECT_SOURCE_DIR}/cmake_extra_modules/rivet_config.h.cmake" "${RIVET_GENERATE_DIR}/rivet_config.h" ) MESSAGE(STATUS "Generating: " ${RIVET_GENERATE_DIR}/config.h) configure_file("${PROJECT_SOURCE_DIR}/cmake_extra_modules/config.h.cmake" "${RIVET_GENERATE_DIR}/config.h" ) # Generate init.tcl # =========================================================================== MESSAGE(STATUS "Generating: " ${RIVET_GENERATE_DIR}/init.tcl) configure_file("${RIVET_LIB_DIR}/init.tcl.in" "${RIVET_GENERATE_DIR}/init.tcl" @ONLY) # =========================================================================== # Installation section... # =========================================================================== MESSAGE ( STATUS "==========================================================================" ) MESSAGE ( STATUS "Rivet ${RIVET_VERSION} will be installed in the following " "directories:" ) MESSAGE ( STATUS " + mod_rivet.so: " ${APACHE_MODULE_DIR} ) MESSAGE ( STATUS " (to override this location, use -DAPACHE_MODULE_DIR=...)") MESSAGE ( STATUS " + Rivet library: " ${RIVETLIB_DESTDIR} ) MESSAGE ( STATUS " (to override this location, use -DAPACHE_LIB_DIR=... or") MESSAGE ( STATUS " -DRIVETLIB_DESTDIR=...)") MESSAGE ( STATUS "==========================================================================" ) # Library mod_rivet (mod_rivet.so) must be installed in the directory Apache2 # searches for modules... # =========================================================================== if(WIN32) install(TARGETS mod_rivet EXPORT Rivet_mod_rivet RUNTIME DESTINATION ${APACHE_MODULE_DIR}) else(WIN32) install(TARGETS mod_rivet EXPORT Rivet_mod_rivet LIBRARY DESTINATION ${APACHE_MODULE_DIR}) endif(WIN32) # Install mpms... # =========================================================================== install(TARGETS rivet_worker_mpm rivet_prefork_mpm rivet_lazy_mpm EXPORT Rivet_MPMs ARCHIVE DESTINATION ${RIVETLIB_DESTDIR}/mpm LIBRARY DESTINATION ${RIVETLIB_DESTDIR}/mpm RUNTIME DESTINATION ${RIVETLIB_DESTDIR}/mpm) # Install libraries... # =========================================================================== install(TARGETS rivetparser rivetlib EXPORT Rivet_Libraries ARCHIVE DESTINATION ${RIVETLIB_DESTDIR} LIBRARY DESTINATION ${RIVETLIB_DESTDIR} RUNTIME DESTINATION ${RIVETLIB_DESTDIR}) # Install library files... # =========================================================================== install(FILES ${RIVET_GENERATE_DIR}/init.tcl ${RIVET_LIB_DIR}/default_request_handler.tcl ${RIVET_LIB_DIR}/pkgIndex.tcl DESTINATION ${RIVETLIB_DESTDIR}) # Install library directories... # =========================================================================== install(DIRECTORY ${RIVET_LIB_DIR}/rivet-tcl DESTINATION ${RIVETLIB_DESTDIR}) install(DIRECTORY ${RIVET_LIB_DIR}/packages/asciiglyphs ${RIVET_LIB_DIR}/packages/calendar ${RIVET_LIB_DIR}/packages/dio ${RIVET_LIB_DIR}/packages/entities ${RIVET_LIB_DIR}/packages/form ${RIVET_LIB_DIR}/packages/formbroker ${RIVET_LIB_DIR}/packages/session ${RIVET_LIB_DIR}/packages/tclrivet DESTINATION ${RIVETLIB_DESTDIR}/packages) # Regenerate pkgIndex.tcl in all libraries... # =========================================================================== SET ( RIVET_LIBS_ARCH ${RIVETLIB_DESTDIR} ) file(WRITE ${RIVETLIB_DESTDIR}/regenerate_pkgIndex.tcl "puts \"Regenerating pkgIndex.tcl in [pwd]:\" file delete {*}[glob [file join packages * pkgIndex.tcl]] pkgIndex.tcl pkg_mkIndex -verbose [pwd] init.tcl packages/*/*.tcl *[info sharedlibextension]" ) install(CODE " execute_process(COMMAND ${TCL_TCLSH} regenerate_pkgIndex.tcl WORKING_DIRECTORY ${RIVETLIB_DESTDIR}) file(REMOVE ${RIVETLIB_DESTDIR}/regenerate_pkgIndex.tcl) " ) rivet-3.2.1/README.freebsd000664 001750 001750 00000001632 14141530732 015713 0ustar00manghimanghi000000 000000 $Id$ Rivet can be built under FreeBSD without any special tweaks. Rivet is a port in the FreeBSD ports tree. To build the latest one supported there, cd to /usr/ports/www/mod_rivet and do a make install or equivalent. To build from source, first you need to build and install Tcl and Apache... cd /usr/ports/lang/tcl85 make make install cd /usr/ports/www/apache22 make make install Since the maintainer of the Tcl stuff in the FreeBSD ports tree has chosen to have Tcl build in such a way that there can be multiple different versions on a system at the same time, stuff isn't quite in the expected place. Run configure in this directory with the following parameters: ./configure --with-tcl=/usr/local/lib/tcl8.5 If you want to build with debugging symbols enabled for debugging Apache and mod_rivet with gdb or whatever, add "--enable-symbols" to the above. Your mileage may vary. rivet-3.2.1/Makefile.am000664 001750 001750 00000010442 14141530732 015455 0ustar00manghimanghi000000 000000 # # top-level Makefile.am for Apache Rivet: gets turned into a Makefile.in by automake # # $Id$ # # 2007/12/25: Added target uninistall-local that removes the tcl stuff (mxmanghi) # 2010/06/22: target instal-data-local searches for pkgIndex.tcl files and deletes them # before invoking pkg_mkIndex. # 2013/01/20: removing libtool created .la files ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = LICENSE contrib doc rivet win/nmakehlp.c src/testing.c src/TclWebcgi.c SUBDIRS = src doc RIVETLIB_DESTDIR = $(DESTDIR)@RIVET_TCL_TARGET@ RIVET_PACKAGES = $(RIVETLIB_DESTDIR)/packages AM_DISTCHECK_CONFIGURE_FLAGS = --with-tcl=${TCL_BIN_DIR} --with-rivet-target-dir=${RIVETLIB_DESTDIR} --with-apxs=${APXS_PREFIX}/bin/apxs # I expect this symbol sooner or later to be handled by configure for arch dependent builds # Current value is the rivetlib directory RIVET_LIBS_ARCH = libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck install-data-local: install-binaries install-packages install-binaries: echo 'running target install-binaries ($(RIVETLIB_DESTDIR))' $(mkinstalldirs) $(RIVETLIB_DESTDIR) $(mkinstalldirs) $(RIVETLIB_DESTDIR)/rivet-tcl $(install_sh) -C -m 644 $(builddir)/rivet/init.tcl $(RIVETLIB_DESTDIR) $(install_sh) -C -m 644 $(builddir)/rivet/default_request_handler.tcl $(RIVETLIB_DESTDIR) $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/rivet-tcl/*) $(RIVETLIB_DESTDIR)/rivet-tcl #cp -rv $(srcdir)/rivet/packages $(RIVETLIB_DESTDIR)/ #-( cd $(RIVETLIB_DESTDIR); rm -f *.la; \ # echo 'eval pkg_mkIndex -verbose [pwd] init.tcl [glob [file join packages * *.tcl] [file join $(RIVET_LIBS_ARCH) *[info sharedlibextension]]]' | @TCLSH_PROG@ ; ) uninstall-local: echo 'running target uninstall-local ($(RIVETLIB_DESTDIR))' rm -f $(RIVETLIB_DESTDIR)/init.tcl rm -fr $(RIVETLIB_DESTDIR)/rivet-tcl rm -f $(RIVETLIB_DESTDIR)/librivetlib.so rm -f $(RIVETLIB_DESTDIR)/librivetparser.so rm -fr $(RIVETLIB_DESTDIR)/packages rm -f $(RIVETLIB_DESTDIR)/pkgIndex.tcl @if [ -e $(RIVETLIB_DESTDIR)/mpm/ ] && [ -d $(RIVETLIB_DESTDIR)/mpm/ ]; then \ rm -fr $(RIVETLIB_DESTDIR)/mpm ; \ else \ echo "Directory $(RIVETLIB_DESTDIR)/mpm not existing"; \ fi @if [ -e $(RIVETLIB_DESTDIR) ] && [ -d $(RIVETLIB_DESTDIR) ]; then \ rmdir $(RIVETLIB_DESTDIR); \ else \ echo "Directory $(RIVETLIB_DESTDIR) not existing"; \ fi install-packages: echo 'running target install-packages ($(RIVETLIB_DESTDIR))' $(mkinstalldirs) $(RIVET_PACKAGES)/asciiglyphs $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/asciiglyphs/*) $(RIVET_PACKAGES)/asciiglyphs/ $(mkinstalldirs) $(RIVET_PACKAGES)/calendar $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/calendar/*) $(RIVET_PACKAGES)/calendar/ $(mkinstalldirs) $(RIVET_PACKAGES)/dio $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/dio/*) $(RIVET_PACKAGES)/dio/ $(mkinstalldirs) $(RIVET_PACKAGES)/entities $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/entities/*) $(RIVET_PACKAGES)/entities/ $(mkinstalldirs) $(RIVET_PACKAGES)/form $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/form/*) $(RIVET_PACKAGES)/form/ $(mkinstalldirs) $(RIVET_PACKAGES)/formbroker $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/formbroker/*) $(RIVET_PACKAGES)/formbroker/ $(mkinstalldirs) $(RIVET_PACKAGES)/session $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/session/*) $(RIVET_PACKAGES)/session/ $(mkinstalldirs) $(RIVET_PACKAGES)/tclrivet $(install_sh) -C -m 644 $(shell /bin/ls $(srcdir)/rivet/packages/tclrivet/*) $(RIVET_PACKAGES)/tclrivet/ -( cd $(RIVETLIB_DESTDIR); rm -f *.la; \ echo 'eval file delete [glob [file join packages * pkgIndex.tcl]] pkgIndex.tcl' | @TCLSH_PROG@ ; \ echo 'eval pkg_mkIndex -verbose [pwd] init.tcl [glob [file join packages * *.tcl] [file join $(RIVET_LIBS_ARCH) *[info sharedlibextension]]]' | @TCLSH_PROG@ ; ) uninstall-packages: echo 'running target uninstall-packages ($(RIVETLIB_DESTDIR))' rm -f $(RIVETLIB_DESTDIR)/pkgIndex.tcl rm -fr $(RIVETLIB_DESTDIR)/packages rm -fr $(RIVETLIB_DESTDIR)/rivet-tcl rm -f $(RIVETLIB_DESTDIR)/*so @if [ -z '$(wildcard $(RIVETLIB_DESTDIR)/*)' ]; then \ echo 'removing directory $(RIVETLIB_DESTDIR)' @rmdir $(RIVETLIB_DESTDIR); \ fi # distclean-local: rm -fr rivet_config.h rm -fr _configs.sed rivet-3.2.1/m4/000775 001750 001750 00000000000 14141530732 013740 5ustar00manghimanghi000000 000000 rivet-3.2.1/cmake/000775 001750 001750 00000000000 14141530732 014500 5ustar00manghimanghi000000 000000 rivet-3.2.1/m4/ax_split_version.m4000664 001750 001750 00000002370 14141530732 017574 0ustar00manghimanghi000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_split_version.html # =========================================================================== # # SYNOPSIS # # AX_SPLIT_VERSION # # DESCRIPTION # # Splits a version number in the format MAJOR.MINOR.POINT into its # separate components. # # Sets the variables. # # LICENSE # # Copyright (c) 2008 Tom Howard # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 9 AC_DEFUN([AX_SPLIT_VERSION],[ AC_REQUIRE([AC_PROG_SED]) AX_MAJOR_VERSION=`echo "$VERSION" | $SED 's/\([[^.]][[^.]]*\).*/\1/'` AX_MINOR_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'` AX_POINT_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'` AC_MSG_CHECKING([Major version]) AC_MSG_RESULT([$AX_MAJOR_VERSION]) AC_MSG_CHECKING([Minor version]) AC_MSG_RESULT([$AX_MINOR_VERSION]) AC_MSG_CHECKING([Point version]) AC_MSG_RESULT([$AX_POINT_VERSION]) ]) rivet-3.2.1/doc/examples/table.rvt000664 001750 001750 00000000460 14141530732 017627 0ustar00manghimanghi000000 000000 \n" for {set i 1} { $i <= 8 } {incr i} { puts "\n" for {set j 1} {$j <= 8} {incr j} { set num [ expr $i * $j * 4 - 1] puts [ format " $num $num $num \n" \ $num $num $num ] } puts "\n" } puts "\n" ?> rivet-3.2.1/doc/html/fb.html000664 001750 001750 00000046730 14142162544 016423 0ustar00manghimanghi000000 000000 FormBroker

Name

FormBroker — Form broker object creator

Synopsis

::FormBroker create ?-quoting quoting_procedure? ?variable1 descriptor? ?variable2 descriptor? ?...?

Description

The command returns a reference to a form broker object by creating a representation of the form data using the list of variable descriptors passed to method create. Each descriptor is a list of parameter or parameter-value pairs that must begin with the {variable_name variable_type} pair as only requirement. A formbroker object provide native support for integer, unsigned integer, string, boolean and email data types. The programmer can defined new data types and provide in the descriptor a reference to a validation procedure for that type.

The optional ?-quoting quoting_procedure? switch defines an external procedure to quote or reformat the response values. The quoting procedure is any procedure accepting a single string argument and returning its quoted value. A most basic example is the FormBroker default quoting procedure

proc force_quote {str} {
    return "'$str'"
}

Other parameters of a descriptors are

  • type: the data type of the variable
  • bounds: limits of a variable value. The meanining of bounds depends on the variable type. For an integer is the maximum absolute value for that variable (for an unsigned the lower limit is invariably 0), for a string is the maximum length of the string. The parameter bounds has no effect on an email data type
  • constrain: boolean value telling the variable has to be forced to fulfill the constrain imposed by bounds. This field is bidirectional in that it can be used by the validator to force the variable value rewriting
  • validator: name of the specialized validator for this variable
  • default: default value of the variable if not set in a response array. When a variable is given a default value the form validation will not fail on the fact that this variable may be missing from the form response array
  • quote: the variable value has to be quoted when written back in the response array
  • validator: name of the validator procedure. The procedure can be any Tcl procedure accepting as argument the name of a dictionary holding the variable internal representation.

An example of a form accepting four variable, one for each native type of a form broker object

 % set fbroker [::FormBroker create {var1 integer} {var2 unsigned} {var3 string} {var4 integer bounds {-10 100}}]
::FormBroker::form0

Form broker object methods

The central method of a form broker object is validate

formBroker_object validate ?-forcequote? response ?response copy?
The method validate takes as argument the name of an array of variables in the way this is produced by command load_response returning a form response. The optional argument -forcequote causes the variable values to be rewritten and quoted. If the optional argument response copy is present the validated response is copied in this array instead of the input response array.
If the form data have been validated the method validate returns true
Example of form data validation (assuming ::rivet::load_response is loading the array response with data taken from a form non displayed here)
% package require formbroker
% set fbroker [::FormBroker create {var1 integer} {var2 unsigned} {var3 string} {var4 integer bounds {-10 100}}]
::FormBroker::form0

% ::rivet::load_response
% parray response
response(var1) = -10
response(var2) = 20
response(var3) = a string
response(var4) = 50

# let's keep a copy of the response

% array set response_copy [array get response]

# form data validation

% $fbroker validate response
true
% $fbroker validate -forcequote response
% parray response
response(var1) = '-10'
response(var2) = '20'
response(var3) = 'a string'
response(var4) = '50'

# restore response original value

% array set response [array get response_copy]
% $fbroker validate -forcequote response response_copy
true
% parray response
response(var1) = -10
response(var2) = 20
response(var3) = a string
response(var4) = 50
% parray response_copy 
response_copy(var1) = '-10'
response_copy(var2) = '20'
response_copy(var3) = 'a string'
response_copy(var4) = '50'

# a form object has to be destroyed if it's not needed anymore

% $fbroker destroy
formBroker_object failing
In case the validation fails method failing returns a list of variable_name - error_condition pairs for each variable whose value failed to validate and was impossible to fix. This list is suitable to populate an array or used directly as a dictionary
% package require formbroker
1.0
% set fbroker [::FormBroker create {var1 integer} \
         {var2 unsigned} \
         {var3 string} \
         {var4 integer}]
::FormBroker::form0
% ::rivet::load_response

# let's suppose we have an incomplete response
% parray response
response(var1) = '100'
response(var2) = '20'
response(var3) = 'a string'
% $fbroker validate response
false
$fbroker failing
var4 MISSING_VAR

# this can be prevented by assigning a variable a default value

% set fbroker [::FormBroker create {var1 integer} \
                                   {var2 unsigned} \
                                   {var3 string} \
                                   {var4 integer default 0}]						
::FormBroker::form1
% $fbroker validate response
true
% parray response
response(var1) = 100
response(var2) = 20
response(var3) = a string
response(var4) = 0

% set fbroker [::FormBroker create {var1 integer} \
                                   {var2 unsigned} \
                                   {var3 string length 10 constrain} \
                                   {var4 integer bounds {-10 100}}]
::FormBroker::form2
% ::rivet::load_response

# this time the response has invalid data

% parray response
response(var1) = 'aaaaa'
response(var2) = '-20'
response(var3) = 'a longer string that breaks the 10 chars max limit imposed'
response(var4) = '150'
% $fbroker validate response
false
% $fbroker failing
var1 NOT_INTEGER var2 FB_OUT_OF_BOUNDS var4 FB_OUT_OF_BOUNDS
Notice that even though $response(var3) exceeds the 10 characters max length imposed to variable var3 this variable is not in the list returned by failing because the 'constrain' attribute forced the truncation of the string. In fact this applies also to the integer and unsigned values
% package require formbroker
% set fbroker [::FormBroker create {var1 integer bounds 10 constrain} \
                                   {var2 unsigned constrain} \
                                   {var3 string length 10 constrain} \
                                   {var4 integer bounds {-10 100} constrain}]
::FormBroker::form0
% ::rivet::load_response
% parray response
response(var1) = abcdef
response(var2) = -20
response(var3) = a longer string that breaks the 10 chars max limit imposed
response(var4) = 150
% $fbroker validate response response_copy
false
% $fbroker failing
var1 NOT_INTEGER
% parray response_copy 
response_copy(var2) = 0
response_copy(var3) = a longer s
response_copy(var4) = 100
The variable var1 could not be constrained because the input value "abcdef" is fundamentally incompatible
formBroker_object response ?response_array_name?
The response method fills the array whose name is passed as optional argument with the last response processing. If this argument is omitted the method creates an array named response.
This method can be called also if no form response validation has taken place: it simply populates the array with the default values assigned to the form variables. As such is a way to create form default arrays to initialize forms created with the form package.
set fbroker [::FormBroker create {var1 integer default 0} \
                                 {var2 unsigned default 1} \
                                 {var3 string} \
                                 {var4 integer default 0}]
% $fbroker response a
% parray a
a(var1) = 0
a(var2) = 1
a(var4) = 0
formBroker_object reset
The method resets the object to its initial defaults

Writing a custom variable validator

The form broker is by no means restricted to work only with its native data types: you may define your own form variable types and have them validated with their own variable validator.

A validator is a function accepting a dictionary as single argument and must return either FB_OK, if the variable value is valid, or any other used defined error code. The dictionary argument stores the variable descriptor used internally by the form broker.

Suppose you're writing a form text entry that demands as input a network interface MAC address. A MAC address is represented by 6 hexadecimal octets separated by either a - (Windows convention) or : (Unix, Mac convention). The procedure validate_mac checks the validity of the mac address and if validation is successful it transforms its representation into the Unix form. By setting the key constrain in the dictionary mac_address_d the procedure is telling the form broker to copy the transformed value back in the input response array

proc validate_mac {_mac_address_d} {
    upvar $_mac_address_d mac_address_d

    dict with mac_address_d {
		  
        set var [string trim $var]
        if {[regexp {^[[:xdigit:]]{2}([:-][[:xdigit:]]{2}){5}$} $var]} {

            set var [string tolower $var]

            # we normalize the mac address to the Unix form.
            # The dash '-' characters in the windows representation 
            # are replaced by columns ':'

            set var [regsub -all -- {-} $var :]

            # the 'constrain' field is bidirectional:
            # it tells the validator to curb/change the value
            # within bonds/forms/representation. By setting it the
            # validator tells the FormBroker to copy the value
            # back in the response array

            set constrain 1
            return FB_OK

         } else {

            return FB_WRONG_MAC

         }

    }

}
% set fbroker [::FormBroker create {mac mac_address validator validate_mac}]
% ::rivet::load_response r
% parray r
r(mac) = 00-A1-B2-C3-D4-C5
% $fbroker validate r
true
% parray r
r(mac) = 00:a1:b2:c3:d4:c5
rivet-3.2.1/rivet/rivet-tcl/tclIndex000664 001750 001750 00000004570 14141530732 020165 0ustar00manghimanghi000000 000000 # Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(::incr0) [list interp alias {} ::incr0 {} ::incr] set auto_index(::rivet::html) [list source [file join $dir html.tcl]] set auto_index(::rivet::random) [list source [file join $dir random.tcl]] set auto_index(::rivet::rivet_command_document) [list source [file join $dir rivet_command_document.tcl]] set auto_index(::rivet::putsnnl) [list source [file join $dir putsnnl.tcl]] set auto_index(::rivet::load_response) [list source [file join $dir load_response.tcl]] set auto_index(::rivet::debug) [list source [file join $dir debug.tcl]] set auto_index(::rivet::clock_to_rfc850_gmt) [list source [file join $dir cookie.tcl]] set auto_index(::rivet::make_cookie_attributes) [list source [file join $dir cookie.tcl]] set auto_index(::rivet::cookie) [list source [file join $dir cookie.tcl]] set auto_index(::rivet::lempty) [list source [file join $dir lempty.tcl]] set auto_index(::rivet::import_switch_args) [list source [file join $dir import_switch_args.tcl]] set auto_index(::rivet::lmatch) [list source [file join $dir lmatch.tcl]] set auto_index(::rivet::read_file) [list source [file join $dir read_file.tcl]] set auto_index(::rivet::import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]] set auto_index(::rivet::parray) [list source [file join $dir parray.tcl]] set auto_index(::rivet::wrap) [list source [file join $dir wrap.tcl]] set auto_index(::rivet::wrapline) [list source [file join $dir wrap.tcl]] set auto_index(::rivet::parray_table) [list source [file join $dir parray_table.tcl]] set auto_index(::rivet::load_cookies) [list source [file join $dir load_cookies.tcl]] set auto_index(::rivet::http_accept) [list source [file join $dir http_accept.tcl]] set auto_index(::rivet::xml) [list source [file join $dir xml.tcl]] set auto_index(::rivet::redirect) [list source [file join $dir redirect.tcl]] set auto_index(::rivet::catch) [list source [file join $dir catch.tcl]] set auto_index(::rivet::try) [list source [file join $dir try.tcl]] set auto_index(::rivet::url_query) [list source [file join $dir url_query.tcl]] rivet-3.2.1/doc/html/apache_log_error.html000664 001750 001750 00000005445 14142162543 021324 0ustar00manghimanghi000000 000000 apache_log_error

Name

apache_log_error — log messages to the Apache error log

Synopsis

::rivet::apache_log_error ?priority? ?message?

Description

The apache_log_error command logs a message to the Apache error log, whose name and location have been set by the ErrorLog directive.

Priority must be one of debug, info, notice, warning, err, crit, alert, or emerg.

rivet-3.2.1/src/mod_rivet_ng/rivetChannel.h000664 001750 001750 00000002627 14141530732 021465 0ustar00manghimanghi000000 000000 /* rivetChannel.h - definitions for the Rivet Tcl channel */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef _RIVET_CHANNEL_H_ #define _RIVET_CHANNEL_H_ /* Functions for mod_dtcl Tcl output channel .*/ extern int closeproc(ClientData, Tcl_Interp *); extern int inputproc(ClientData, char *, int, int *); extern int outputproc(ClientData, char *, int, int *); extern int setoptionproc(ClientData, Tcl_Interp *, char *, char *); /* extern int getoptionproc(ClientData, Tcl_Interp *, char *, Tcl_DString *); */ extern void watchproc(ClientData, int); extern int gethandleproc(ClientData, int, ClientData *); extern Tcl_ChannelType RivetChan; #endif rivet-3.2.1/doc/html/images/warning.png000644 001750 001750 00000002331 14142162544 020551 0ustar00manghimanghi000000 000000 PNG  IHDRשPLTE!)1BJRZks{{{RRZZ{{99JJ11))))))!!p;bKGDHIDATxm}o0M5%%m szP^UDKnk[;һ?0n!qCtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignaturec42b7d2d564aab588891979703f02b45OߓtEXtPage24x24+0+0r[ 1IENDB`rivet-3.2.1/rivet/packages/dio/dio_Tdbc.tcl000664 001750 001750 00000013110 14141530732 021311 0ustar00manghimanghi000000 000000 # dio_Tdbc.tcl -- Tdbc compatibility layer # # Copyright 2000-2005 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # DIO compatibility layer with Tdbc # # $Id$ # package provide dio_Tdbc 0.1 namespace eval DIO { ::itcl::class Tdbc { inherit Database private variable dbhandle public variable interface "Tdbc" private common conncnt 0 public variable backend "" { if {$backend == "mysql"} { package require tdbc::mysql } elseif {$backend == "postgres"} { package require tdbc::postgres } elseif {$backend == "sqlite3"} { package require tdbc::sqlite3 } elseif {$backend == "odbc"} { package require tdbc::odbc } elseif {$backend == ""} { return -code error "DIO Tdbc needs a backend be specified" } else { return -code error "backend '$backend' not supported" } } # -- destructor # # constructor {args} { eval configure $args } { if {[catch {package require tdbc}]} { return -code error "No Tdbc package available" } eval configure $args if {[lempty $db]} { if {[lempty $user]} { set user $::env(USER) } set db $user } } destructor { close } # --close # # we take inspiration from the DIO_Mysql class for handling # the basic connection data public method close {} { if {![info exists dbhandle]} { return } catch { $dbhandle close } unset dbhandle } # -- open # # Opening a connection with this class means that the member # variable specifying the backend was properly set # public method open {} { if {$backend == ""} { return -code error "no backend set" } set command [::list ::tdbc::${backend}::connection create tdbc[incr conncnt]] if {![lempty $user]} { lappend command -user $user } if {![lempty $pass]} { lappend command -password $pass } if {![lempty $port]} { lappend command -port $port } if {![lempty $host]} { lappend command -host $host } if {![lempty $db]} { lappend command -database $db } if {[catch { set dbhandle [eval $command] } e]} { return -code error $e } return -code ok } # -- exec # # sql code central method. A statement object # is created from the sql string and then executed # public method exec {sql} { if {![info exists dbhandle]} { $this open } set sqlstat [$dbhandle prepare $sql] if {[catch {set res [$sqlstat execute]} err]} { set obj [result Tdbc -error 1 -errorinfo $err] } else { set obj [result Tdbc -resultid $res \ -sqlstatement $sqlstat \ -numrows [$res rowcount] \ -fields [::list [$res columns]]] } #$res nextlist cols #puts "rows: [$res rowcount]" #puts "cols: $cols" return $obj } # -- execute # # extended version of the standard DIO method exec that # makes room for an extra argument storing the dictionary # of variables to be substituted in the SQL statement # public method execute {sql {substitute_d ""}} { if {![info exists dbhandle]} { $this open } set sqlstat [$dbhandle prepare $sql] if {$substitute_d != ""} { set cmd [list $sqlstat execute $substitude_d] } else { set cmd [list $sqlstat execute] } if {[catch {set res [eval $cmd]} err} { set obj [result Tdbc -error 1 -errorinfo $err] } else { set obj [result Tdbc -resultid $res \ -numrows [$res rowcount] \ -fields [$res columns]] } $sqlstat close return $obj } # -- handle # # accessor to the internal connection handle. # public method handle {} { return $dbhandle } } # # -- Class TdbcResult # # Class wrapping a Tdbc resultset object and adapting it # to the DIO Results interface # ::itcl::class TdbcResult { inherit Result public variable sqlstatement constructor {args} { eval configure $args } destructor { catch {$sqlstatement close} } # -- nextrow # # Returns the list of values selected by a SQL command. # Values appear in the list with the same order of # the columns names returned by the 'columns' object command # public method nextrow {} { $resultid nextlist v return $v } } } rivet-3.2.1/tests/catch.rvt000664 001750 001750 00000001567 14141530732 016412 0ustar00manghimanghi000000 000000 should never get here if AbortScript is definedOK rivet-3.2.1/rivet/packages/tclrivet/parse.tcl000755 001750 001750 00000001132 14141530732 021777 0ustar00manghimanghi000000 000000 #!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # Parse a rivet file and execute it. if {![info exists argv]} { return } # more consistent manipulation of auto_path as suggested by # Harald Oehlmann. Fixes bug #52898 set auto_path [linsert $auto_path 0 [file dirname [info script]]] package require tclrivet proc main {} { global argv for {set i 0} {$i < [llength $argv] - 1} {incr i} { source [lindex $argv $i] } set script [rivet::parserivet [lindex $argv end]] if { [catch {eval $script } err] } { puts "Error: $err" } } main rivet-3.2.1/doc/examples/hello1.rvt000664 001750 001750 00000000025 14141530732 017721 0ustar00manghimanghi000000 000000 rivet-3.2.1/rivet/rivet-tcl/lempty.tcl000664 001750 001750 00000000465 14141530732 020505 0ustar00manghimanghi000000 000000 ### ## lempty ## ## Returns 1 if is empty or 0 if it has any elements. This command ## emulates the TclX lempty command. ## ## $Id$ ## ### namespace eval ::rivet { proc lempty {list} { if {[catch {llength $list} len]} { return 0 } return [expr {$len == 0}] } } rivet-3.2.1/doc/html/images/remote.png000644 001750 001750 00000001067 14142162544 020404 0ustar00manghimanghi000000 000000 PNG  IHDR rgAMA asRGB cHRMz&u0`:pQ<PLTE|9H )wvr%" #5 "Op((Z$ y{{ :Tyzy+-?!% $11TcyyxZ1Rc((%#,)ҽ)* )"Gb{%+  vtoYy'tRNS@fbKGDH pHYsHHFk>pIDAT-0-X*x.ނhe2y a3OTM i$ilZ;(WX+1fnώR'&/v~g o$%tEXtdate:create2012-10-01T18:27:32+02:00Qrz%tEXtdate:modify2012-10-01T18:27:32+02:00 IENDB`rivet-3.2.1/rivet/packages/session/000775 001750 001750 00000000000 14141530732 020012 5ustar00manghimanghi000000 000000 rivet-3.2.1/doc/html/images/note.png000644 001750 001750 00000000752 14142162544 020056 0ustar00manghimanghi000000 000000 PNG  IHDRb$bKGD#2IDATxe!0 E}K C tAQCACQA+g4mɌoK. qc  D="s %dǜH1y%M8fK wֵ>i6g-NpYtL#ߟ ab;U#2V} ԣrVx]zTT1O H4]o zΧg"ӒNHlUu߯9 #include "apache_request.h" /* * TclWeb.c -- * Common API layer. */ /* $Id$ */ /* Tcl 8.4 migration. */ #ifndef CONST84 # define CONST84 #endif /* Error wrappers */ #define ER1 "

\n"
#define ER2 "

\n" #define DEFAULT_HEADER_TYPE "text/html" #define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z" /* Creates a TclWebRequest object */ TclWebRequest* TclWeb_NewRequestObject (apr_pool_t *p); /* *----------------------------------------------------------------------------- * * TclWeb_InitRequest -- * Initializes the request structure. * *----------------------------------------------------------------------------- */ int TclWeb_InitRequest(rivet_thread_private* private, Tcl_Interp *interp); /* *----------------------------------------------------------------------------- * * TclWeb_SendHeaders -- * Sends HTTP headers. * * Results: * HTTP headers output. Things like cookies may no longer be manipulated. * *----------------------------------------------------------------------------- */ int TclWeb_SendHeaders(TclWebRequest *req); INLINE int TclWeb_StopSending(TclWebRequest *req); int TclWeb_SetHeaderType(char *header, TclWebRequest *req); int TclWeb_PrintHeaders(TclWebRequest *req); int TclWeb_PrintError(CONST84 char *errstr, int htmlflag, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_HeaderSet -- * Sets HTTP headers. * *----------------------------------------------------------------------------- */ int TclWeb_HeaderSet(char *header, char *val, TclWebRequest *req); void TclWeb_OutputHeaderSet(char *header, char *val, TclWebRequest *req); const char* TclWeb_OutputHeaderGet(char *header, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_HeaderSet -- * Adds an HTTP headers. * *----------------------------------------------------------------------------- */ int TclWeb_HeaderAdd(char *header, char *val, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_SetStatus -- * Sets status number (200, 404) for reply. * *----------------------------------------------------------------------------- */ int TclWeb_SetStatus(int status, TclWebRequest *req); int TclWeb_MakeURL(Tcl_Obj *result, char *filename, TclWebRequest *req); int TclWeb_GetVar(Tcl_Obj *result, char *varname, int source, TclWebRequest *req); int TclWeb_GetVarAsList(Tcl_Obj *result, char *varname, int source, TclWebRequest *req); int TclWeb_VarExists(Tcl_Obj *result, char *varname, int source, TclWebRequest *req); int TclWeb_VarNumber(Tcl_Obj *result, int source, TclWebRequest *req); int TclWeb_GetVarNames(Tcl_Obj *result, int source, TclWebRequest *req); int TclWeb_GetAllVars(Tcl_Obj *result, int source, TclWebRequest *req); int TclWeb_GetEnvVars(Tcl_Obj *envvar, rivet_thread_private *p); int TclWeb_GetHeaderVars(Tcl_Obj *headersvar, rivet_thread_private *p); /* *----------------------------------------------------------------------------- * * TclWeb_PrepareUpload -- * * Do any preperation necessary for file uploads. This must be * performed before other upload operations. * * Results: * * Stores, if necessary, additional, initialized information in the * TclWebRequest structure. * *----------------------------------------------------------------------------- */ int TclWeb_PrepareUpload(char *varname, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadChannel -- * * It opens a new channel and sets its translation and encoding as binary * The channel name is retuned as result in the interpreter pointed by req->interp * * Results: * * Makes the channel name available to the script level * *----------------------------------------------------------------------------- */ int TclWeb_UploadChannel(char *varname, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadSave -- * * Saves the uploaded file in 'filename'. * *----------------------------------------------------------------------------- */ int TclWeb_UploadSave(char *varname, Tcl_Obj *filename, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadData -- * * Returns the uploaded data to the Tcl script level. * * If the config parameter upload_files_to_var is not set the procedure * returs an error * *----------------------------------------------------------------------------- */ int TclWeb_UploadData(char *varname, TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadSize -- * * Returns the size of the data uploaded. * *----------------------------------------------------------------------------- */ int TclWeb_UploadSize(TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadType -- * * Returns the mime type of the file uploaded. * *----------------------------------------------------------------------------- */ int TclWeb_UploadType(TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadFilename -- * * Returns the original filename of the uploaded data, on the client side. * * Results: * * Returns the filename to the script level * *----------------------------------------------------------------------------- */ int TclWeb_UploadFilename(TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadTempname -- * * Returns the name of the temp file the uploaded data was stored in. * * Results: * * the 'tempname' is returned to the script level * *----------------------------------------------------------------------------- */ int TclWeb_UploadTempname(TclWebRequest *req); /* *----------------------------------------------------------------------------- * * TclWeb_UploadNames -- * * Fetch names of all the uploaded variables. * * Results: * * Stores the names of the variables in the list 'names'. * *----------------------------------------------------------------------------- */ int TclWeb_UploadNames(TclWebRequest *req); int TclWeb_Escape(char *out, char *in, int len, void *var); int TclWeb_UnEscape(char *out, char *in, int len, void *var); int TclWeb_EscapeShellCommand(char *out, char *in, TclWebRequest *req); char *TclWeb_StringToUtf(char *in, TclWebRequest *req); Tcl_Obj * TclWeb_StringToUtfToObj(char *in, TclWebRequest *req); char *TclWeb_GetEnvVar(rivet_thread_private *,char *); char *TclWeb_GetVirtualFile( TclWebRequest *req, char *virtualname ); /* output/write/flush? */ /* error (log) ? */ #endif /* TCLWEB_H */ rivet-3.2.1/tests/parse.test000664 001750 001750 00000001565 14141530732 016604 0ustar00manghimanghi000000 000000 # $Id$ set testfilename1 parse.rvt ::tcltest::test parse-1.1 {Parse command} { set page [ ::http::geturl "${urlbase}$testfilename1" ] ::http::data $page } { Parse Test

Parse Test

Hello, World - El Burro Sabe Ms Que T!

ܸ(EUC-JP Japanese text)

} set testfilename2 parsestring.rvt ::tcltest::test parse-1.2 {Parse command} { set page [ ::http::geturl "${urlbase}$testfilename2" ] ::http::data $page } { Parse String Test

Parse String Test

Hello, World - El Burro Sabe Ms Que T!

ܸ(EUC-JP Japanese text)

} rivet-3.2.1/tests/shorthand.test000664 001750 001750 00000000373 14141530732 017460 0ustar00manghimanghi000000 000000 # $Id: $ ::tcltest::test shorthand-1.1 {shorthand expression for simple output} { set page [::http::geturl "${urlbase}shorthand.rvt"] set match [::http::data $page] set match } {
testing <?= ... ?> shorthand expression
} rivet-3.2.1/doc/xml/formbroker.xml000664 001750 001750 00000041173 14141530732 017665 0ustar00manghimanghi000000 000000
The Form Broker
Introduction The FormBroker package creates instances of form data description objects. These objects instances have a simple set of methods to validate and control data as typically posted by HTML forms, thus data represented as the map of form variables to their values. In Rivet this association can be obtained either calling ::rivet::load_response or ::rivet::var (form variables can be selectively read also calling ::rivet::var_post or ::rivet::var_qs) The FormBroker package is still experimental. Basic functionalities and interface are not likely to change but internal details and implementation could be redesigned in future releases. More specifically the external validator mechanism will likely need design improvements.
FormBroker Form broker object creator ::FormBroker create ... Description The command returns a reference to a form broker object by creating a representation of the form data using the list of variable descriptors passed to method create. Each descriptor is a list of parameter or parameter-value pairs that must begin with the {variable_name variable_type} pair as only requirement. A formbroker object provide native support for integer, unsigned integer, string, boolean and email data types. The programmer can defined new data types and provide in the descriptor a reference to a validation procedure for that type. The optional -quoting quoting_procedure switch defines an external procedure to quote or reformat the response values. The quoting procedure is any procedure accepting a single string argument and returning its quoted value. A most basic example is the FormBroker default quoting procedure proc force_quote {str} { return "'$str'" } Other parameters of a descriptors are type: the data type of the variable bounds: limits of a variable value. The meanining of bounds depends on the variable type. For an integer is the maximum absolute value for that variable (for an unsigned the lower limit is invariably 0), for a string is the maximum length of the string. The parameter bounds has no effect on an email data type constrain: boolean value telling the variable has to be forced to fulfill the constrain imposed by bounds. This field is bidirectional in that it can be used by the validator to force the variable value rewriting validator: name of the specialized validator for this variable default: default value of the variable if not set in a response array. When a variable is given a default value the form validation will not fail on the fact that this variable may be missing from the form response array quote: the variable value has to be quoted when written back in the response array validator: name of the validator procedure. The procedure can be any Tcl procedure accepting as argument the name of a dictionary holding the variable internal representation. An example of a form accepting four variable, one for each native type of a form broker object % set fbroker [::FormBroker create {var1 integer} {var2 unsigned} {var3 string} {var4 integer bounds {-10 100}}] ::FormBroker::form0 Form broker object methods The central method of a form broker object is validate formBroker_object validate response response copy The method validate takes as argument the name of an array of variables in the way this is produced by command ::rivet::load_response returning a form response. The optional argument -forcequote causes the variable values to be rewritten and quoted. If the optional argument response copy is present the validated response is copied in this array instead of the input response array. If the form data have been validated the method validate returns true Example of form data validation (assuming ::rivet::load_response is loading the array response with data taken from a form non displayed here) % package require formbroker % set fbroker [::FormBroker create {var1 integer} {var2 unsigned} {var3 string} {var4 integer bounds {-10 100}}] ::FormBroker::form0 % ::rivet::load_response % parray response response(var1) = -10 response(var2) = 20 response(var3) = a string response(var4) = 50 # let's keep a copy of the response % array set response_copy [array get response] # form data validation % $fbroker validate response true % $fbroker validate -forcequote response % parray response response(var1) = '-10' response(var2) = '20' response(var3) = 'a string' response(var4) = '50' # restore response original value % array set response [array get response_copy] % $fbroker validate -forcequote response response_copy true % parray response response(var1) = -10 response(var2) = 20 response(var3) = a string response(var4) = 50 % parray response_copy response_copy(var1) = '-10' response_copy(var2) = '20' response_copy(var3) = 'a string' response_copy(var4) = '50' # a form object has to be destroyed if it's not needed anymore % $fbroker destroy formBroker_object failing In case the validation fails method failing returns a list of variable_name - error_condition pairs for each variable whose value failed to validate and was impossible to fix. This list is suitable to populate an array or used directly as a dictionary % package require formbroker 1.0 % set fbroker [::FormBroker create {var1 integer} \ {var2 unsigned} \ {var3 string} \ {var4 integer}] ::FormBroker::form0 % ::rivet::load_response # let's suppose we have an incomplete response % parray response response(var1) = '100' response(var2) = '20' response(var3) = 'a string' % $fbroker validate response false $fbroker failing var4 MISSING_VAR # this can be prevented by assigning a variable a default value % set fbroker [::FormBroker create {var1 integer} \ {var2 unsigned} \ {var3 string} \ {var4 integer default 0}] ::FormBroker::form1 % $fbroker validate response true % parray response response(var1) = 100 response(var2) = 20 response(var3) = a string response(var4) = 0 % set fbroker [::FormBroker create {var1 integer} \ {var2 unsigned} \ {var3 string length 10 constrain} \ {var4 integer bounds {-10 100}}] ::FormBroker::form2 % ::rivet::load_response # this time the response has invalid data % parray response response(var1) = 'aaaaa' response(var2) = '-20' response(var3) = 'a longer string that breaks the 10 chars max limit imposed' response(var4) = '150' % $fbroker validate response false % $fbroker failing var1 NOT_INTEGER var2 FB_OUT_OF_BOUNDS var4 FB_OUT_OF_BOUNDS Notice that even though $response(var3) exceeds the 10 characters max length imposed to variable var3 this variable is not in the list returned by failing because the 'constrain' attribute forced the truncation of the string. In fact this applies also to the integer and unsigned values % package require formbroker % set fbroker [::FormBroker create {var1 integer bounds 10 constrain} \ {var2 unsigned constrain} \ {var3 string length 10 constrain} \ {var4 integer bounds {-10 100} constrain}] ::FormBroker::form0 % ::rivet::load_response % parray response response(var1) = abcdef response(var2) = -20 response(var3) = a longer string that breaks the 10 chars max limit imposed response(var4) = 150 % $fbroker validate response response_copy false % $fbroker failing var1 NOT_INTEGER % parray response_copy response_copy(var2) = 0 response_copy(var3) = a longer s response_copy(var4) = 100 The variable var1 could not be constrained because the input value "abcdef" is fundamentally incompatible formBroker_object response The response method fills the array whose name is passed as optional argument with the last response processing. If this argument is omitted the method creates an array named response. This method can be called also if no form response validation has taken place: it simply populates the array with the default values assigned to the form variables. As such is a way to create form default arrays to initialize forms created with the form package. set fbroker [::FormBroker create {var1 integer default 0} \ {var2 unsigned default 1} \ {var3 string} \ {var4 integer default 0}] % $fbroker response a % parray a a(var1) = 0 a(var2) = 1 a(var4) = 0 formBroker_object reset The method resets the object to its initial defaults Writing a custom variable validator The form broker is by no means restricted to work only with its native data types: you may define your own form variable types and have them validated with their own variable validator. A validator is a function accepting a dictionary as single argument and must return either FB_OK, if the variable value is valid, or any other used defined error code. The dictionary argument stores the variable descriptor used internally by the form broker. Suppose you're writing a form text entry that demands as input a network interface MAC address. A MAC address is represented by 6 hexadecimal octets separated by either a - (Windows convention) or : (Unix, Mac convention). The procedure validate_mac checks the validity of the mac address and if validation is successful it transforms its representation into the Unix form. By setting the key constrain in the dictionary mac_address_d the procedure is telling the form broker to copy the transformed value back in the input response array proc validate_mac {_mac_address_d} { upvar $_mac_address_d mac_address_d dict with mac_address_d { set var [string trim $var] if {[regexp {^[[:xdigit:]]{2}([:-][[:xdigit:]]{2}){5}$} $var]} { set var [string tolower $var] # we normalize the mac address to the Unix form. # The dash '-' characters in the windows representation # are replaced by columns ':' set var [regsub -all -- {-} $var :] # the 'constrain' field is bidirectional: # it tells the validator to curb/change the value # within bonds/forms/representation. By setting it the # validator tells the FormBroker to copy the value # back in the response array set constrain 1 return FB_OK } else { return FB_WRONG_MAC } } } % set fbroker [::FormBroker create {mac mac_address validator validate_mac}] % ::rivet::load_response r % parray r r(mac) = 00-A1-B2-C3-D4-C5 % $fbroker validate r true % parray r r(mac) = 00:a1:b2:c3:d4:c5
rivet-3.2.1/tests/tclfile.tcl000664 001750 001750 00000000121 14141530732 016702 0ustar00manghimanghi000000 000000 # test file for plain .tcl files puts " - El Burro Sabe Ms Que T!" rivet-3.2.1/src/Makefile.in000664 001750 001750 00000235000 14142162472 016257 0ustar00manghimanghi000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for Rivet # Copyright 2004-2005 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #SUBDIRS = @rivet_core@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_split_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/tclconfig/tcl.m4 \ $(top_srcdir)/tclconfig/libtool.m4 \ $(top_srcdir)/m4/ax_prefix_config_h.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(apxs_libexecdir)" \ "$(DESTDIR)$(lib_libexecdir)" "$(DESTDIR)$(lib_libmpmdir)" LTLIBRARIES = $(apxs_libexec_LTLIBRARIES) $(lib_libexec_LTLIBRARIES) \ $(lib_libmpm_LTLIBRARIES) librivetlib_la_DEPENDENCIES = am__dirstamp = $(am__leading_dot)dirstamp am_librivetlib_la_OBJECTS = librivet/librivetlib_la-rivetList.lo \ librivet/librivetlib_la-rivetCrypt.lo \ librivet/librivetlib_la-rivetWWW.lo \ librivet/librivetlib_la-rivetPkgInit.lo librivetlib_la_OBJECTS = $(am_librivetlib_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = librivetlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librivetlib_la_LDFLAGS) $(LDFLAGS) -o \ $@ librivetparser_la_DEPENDENCIES = am_librivetparser_la_OBJECTS = \ parser/librivetparser_la-rivetParser.lo \ parser/librivetparser_la-parserPkgInit.lo librivetparser_la_OBJECTS = $(am_librivetparser_la_OBJECTS) librivetparser_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librivetparser_la_LDFLAGS) $(LDFLAGS) \ -o $@ mod_rivet_la_DEPENDENCIES = am_mod_rivet_la_OBJECTS = @rivet_core@/mod_rivet_la-mod_rivet.lo \ @apache_request@/mod_rivet_la-apache_multipart_buffer.lo \ @apache_request@/mod_rivet_la-apache_request.lo \ @rivet_commands@/mod_rivet_la-rivetCore.lo \ @rivet_commands@/mod_rivet_la-rivetInspect.lo \ @rivet_channel@/mod_rivet_la-rivetChannel.lo \ parser/mod_rivet_la-rivetParser.lo \ @rivet_core@/mod_rivet_la-TclWebapache.lo \ @rivet_core@/mod_rivet_la-apache_config.lo \ @rivet_core@/mod_rivet_la-mod_rivet_common.lo \ @rivet_core@/mod_rivet_la-mod_rivet_generator.lo \ @rivet_core@/mod_rivet_la-mod_rivet_cache.lo mod_rivet_la_OBJECTS = $(am_mod_rivet_la_OBJECTS) mod_rivet_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(mod_rivet_la_LDFLAGS) $(LDFLAGS) -o $@ rivet_lazy_mpm_la_DEPENDENCIES = am_rivet_lazy_mpm_la_OBJECTS = \ @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo rivet_lazy_mpm_la_OBJECTS = $(am_rivet_lazy_mpm_la_OBJECTS) rivet_lazy_mpm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(rivet_lazy_mpm_la_LDFLAGS) $(LDFLAGS) \ -o $@ rivet_prefork_mpm_la_DEPENDENCIES = am_rivet_prefork_mpm_la_OBJECTS = \ @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo \ @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo rivet_prefork_mpm_la_OBJECTS = $(am_rivet_prefork_mpm_la_OBJECTS) rivet_prefork_mpm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(rivet_prefork_mpm_la_LDFLAGS) \ $(LDFLAGS) -o $@ rivet_worker_mpm_la_DEPENDENCIES = am_rivet_worker_mpm_la_OBJECTS = \ @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo \ @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo rivet_worker_mpm_la_OBJECTS = $(am_rivet_worker_mpm_la_OBJECTS) rivet_worker_mpm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(rivet_worker_mpm_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/tclconfig/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Plo \ @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Plo \ @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Plo \ @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Plo \ @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Plo \ @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Plo \ @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Plo \ @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Plo \ @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Plo \ @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Plo \ @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Plo \ librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Plo \ librivet/$(DEPDIR)/librivetlib_la-rivetList.Plo \ librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Plo \ librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Plo \ parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Plo \ parser/$(DEPDIR)/librivetparser_la-rivetParser.Plo \ parser/$(DEPDIR)/mod_rivet_la-rivetParser.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(librivetlib_la_SOURCES) $(librivetparser_la_SOURCES) \ $(mod_rivet_la_SOURCES) $(rivet_lazy_mpm_la_SOURCES) \ $(rivet_prefork_mpm_la_SOURCES) $(rivet_worker_mpm_la_SOURCES) DIST_SOURCES = $(librivetlib_la_SOURCES) $(librivetparser_la_SOURCES) \ $(mod_rivet_la_SOURCES) $(rivet_lazy_mpm_la_SOURCES) \ $(rivet_prefork_mpm_la_SOURCES) $(rivet_worker_mpm_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/tclconfig/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APR_CPPFLAGS = @APR_CPPFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LDFLAGS = @APR_LDFLAGS@ APU_INCLUDES = @APU_INCLUDES@ APU_LDFLAGS = @APU_LDFLAGS@ APXS_CPPFLAGS = @APXS_CPPFLAGS@ APXS_CPPFLAGS_SHLIB = @APXS_CPPFLAGS_SHLIB@ APXS_INCLUDES = @APXS_INCLUDES@ APXS_LDFLAGS = @APXS_LDFLAGS@ APXS_LD_SHLIB = @APXS_LD_SHLIB@ APXS_LIBEXECDIR = @APXS_LIBEXECDIR@ APXS_LIBS = @APXS_LIBS@ APXS_PREFIX = @APXS_PREFIX@ APXS_SYSCONFDIR = @APXS_SYSCONFDIR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CELIB_DIR = @CELIB_DIR@ CFLAGS = @CFLAGS@ CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INIT_VERSION = @INIT_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ LD_LIBRARY_PATH_VAR = @LD_LIBRARY_PATH_VAR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATH_LIBS = @MATH_LIBS@ MAX_POST = @MAX_POST@ MKDIR_P = @MKDIR_P@ MOD_RIVET_INCLUDES = @MOD_RIVET_INCLUDES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CFLAGS = @PKG_CFLAGS@ PKG_HEADERS = @PKG_HEADERS@ PKG_INCLUDES = @PKG_INCLUDES@ PKG_LIBS = @PKG_LIBS@ PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ RIVETLIB_PACKAGE = @RIVETLIB_PACKAGE@ RIVETLIB_PACKAGE_VERSION = @RIVETLIB_PACKAGE_VERSION@ RIVET_BASE_INCLUDE = @RIVET_BASE_INCLUDE@ RIVET_SOURCE_BASE = @RIVET_SOURCE_BASE@ RIVET_TCL_TARGET = @RIVET_TCL_TARGET@ RIVET_UPLOAD_DIR = @RIVET_UPLOAD_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_BUILD = @SHARED_BUILD@ SHELL = @SHELL@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DBGX = @TCL_DBGX@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_THREADS = @TCL_THREADS@ TCL_VERSION = @TCL_VERSION@ VC_MANIFEST_EMBED_DLL = @VC_MANIFEST_EMBED_DLL@ VC_MANIFEST_EMBED_EXE = @VC_MANIFEST_EMBED_EXE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apache_include = @apache_include@ apache_request = @apache_request@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ rivet_channel = @rivet_channel@ rivet_commands = @rivet_commands@ rivet_core = @rivet_core@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_apr_config = @with_apr_config@ with_apu_config = @with_apu_config@ with_apxs = @with_apxs@ lib_libexecdir = @RIVET_TCL_TARGET@ lib_libexec_LTLIBRARIES = librivetparser.la librivetlib.la # # Rivet Parser Library # librivetparser_la_SOURCES = parser/rivetParser.c parser/parserPkgInit.c parser/rivetParser.h librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version librivetparser_la_LIBADD = @APXS_LIBS@ librivetparser_la_CPPFLAGS = @apache_include@ -I$(srcdir)/@rivet_core@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='""' -DUSE_TCL_STUBS # # Rivet Library # librivetlib_la_SOURCES = librivet/rivetList.c librivet/rivetCrypt.c librivet/rivetWWW.c librivet/rivetPkgInit.c librivetlib_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ @APU_LDFLAGS@ -module -avoid-version librivetlib_la_LIBADD = @APXS_LIBS@ librivetlib_la_CPPFLAGS = -I$(srcdir)/@rivet_core@ -I$(srcdir)/@apache_request@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APU_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='""' -DUSE_TCL_STUBS apxs_libexecdir = @APXS_LIBEXECDIR@ apxs_libexec_LTLIBRARIES = mod_rivet.la mod_rivet_la_SOURCES = @rivet_core@/mod_rivet.c \ @apache_request@/apache_multipart_buffer.c \ @apache_request@/apache_multipart_buffer.h \ @apache_request@/apache_request.c \ @apache_request@/apache_request.h \ @rivet_commands@/rivetCore.c \ @rivet_commands@/rivetInspect.c \ @rivet_channel@/rivetChannel.c \ parser/rivetParser.c \ @rivet_core@/TclWebapache.c \ @rivet_core@/apache_config.c \ @rivet_core@/mod_rivet_common.c \ @rivet_core@/mod_rivet_generator.c \ @rivet_core@/mod_rivet_cache.c \ @rivet_core@/apache_config.h \ @rivet_core@/mod_rivet_cache.h \ @rivet_core@/mod_rivet_common.h \ @rivet_core@/mod_rivet_generator.h \ @rivet_core@/mod_rivet.h \ @rivet_core@/rivetChannel.h \ @rivet_core@/rivetCore.h \ @rivet_core@/rivet_types.h \ @rivet_core@/worker_prefork_common.h \ rivet.h \ TclWeb.h mod_rivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version mod_rivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@ mod_rivet_la_CPPFLAGS = -I$(srcdir) -I$(srcdir)/@rivet_core@ -I$(srcdir)/@rivet_channel@ -I$(srcdir)/parser -I$(srcdir)/@apache_request@ @apache_include@ -I. @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ @APU_INCLUDES@ -DSTART_TAG='""' lib_libmpmdir = @RIVET_TCL_TARGET@/mpm lib_libmpm_LTLIBRARIES = rivet_worker_mpm.la rivet_prefork_mpm.la rivet_lazy_mpm.la rivet_worker_mpm_la_SOURCES = @rivet_core@/rivet_worker_mpm.c @rivet_core@/worker_prefork_common.c rivet_worker_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version rivet_worker_mpm_la_LIBADD = @APXS_LIBS@ rivet_worker_mpm_la_CPPFLAGS = @apache_include@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ @APU_INCLUDES@ -I$(srcdir)/@apache_request@ -I$(srcdir) -I$(srcdir)/@rivet_core@ rivet_prefork_mpm_la_SOURCES = @rivet_core@/rivet_prefork_mpm.c @rivet_core@/worker_prefork_common.c rivet_prefork_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version rivet_prefork_mpm_la_LIBADD = @APXS_LIBS@ rivet_prefork_mpm_la_CPPFLAGS = @apache_include@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ @APU_INCLUDES@ -I$(srcdir)/@apache_request@ -I$(srcdir) -I$(srcdir)/@rivet_core@ rivet_lazy_mpm_la_SOURCES = @rivet_core@/rivet_lazy_mpm.c rivet_lazy_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version rivet_lazy_mpm_la_LIBADD = @APXS_LIBS@ rivet_lazy_mpm_la_CPPFLAGS = @apache_include@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ @APU_INCLUDES@ -I$(srcdir)/@apache_request@ -I$(srcdir) -I$(srcdir)/@rivet_core@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-apxs_libexecLTLIBRARIES: $(apxs_libexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(apxs_libexec_LTLIBRARIES)'; test -n "$(apxs_libexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(apxs_libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(apxs_libexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(apxs_libexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(apxs_libexecdir)"; \ } uninstall-apxs_libexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(apxs_libexec_LTLIBRARIES)'; test -n "$(apxs_libexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(apxs_libexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(apxs_libexecdir)/$$f"; \ done clean-apxs_libexecLTLIBRARIES: -test -z "$(apxs_libexec_LTLIBRARIES)" || rm -f $(apxs_libexec_LTLIBRARIES) @list='$(apxs_libexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-lib_libexecLTLIBRARIES: $(lib_libexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_libexec_LTLIBRARIES)'; test -n "$(lib_libexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(lib_libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(lib_libexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(lib_libexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(lib_libexecdir)"; \ } uninstall-lib_libexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_libexec_LTLIBRARIES)'; test -n "$(lib_libexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(lib_libexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(lib_libexecdir)/$$f"; \ done clean-lib_libexecLTLIBRARIES: -test -z "$(lib_libexec_LTLIBRARIES)" || rm -f $(lib_libexec_LTLIBRARIES) @list='$(lib_libexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-lib_libmpmLTLIBRARIES: $(lib_libmpm_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_libmpm_LTLIBRARIES)'; test -n "$(lib_libmpmdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(lib_libmpmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(lib_libmpmdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(lib_libmpmdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(lib_libmpmdir)"; \ } uninstall-lib_libmpmLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_libmpm_LTLIBRARIES)'; test -n "$(lib_libmpmdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(lib_libmpmdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(lib_libmpmdir)/$$f"; \ done clean-lib_libmpmLTLIBRARIES: -test -z "$(lib_libmpm_LTLIBRARIES)" || rm -f $(lib_libmpm_LTLIBRARIES) @list='$(lib_libmpm_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } librivet/$(am__dirstamp): @$(MKDIR_P) librivet @: > librivet/$(am__dirstamp) librivet/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) librivet/$(DEPDIR) @: > librivet/$(DEPDIR)/$(am__dirstamp) librivet/librivetlib_la-rivetList.lo: librivet/$(am__dirstamp) \ librivet/$(DEPDIR)/$(am__dirstamp) librivet/librivetlib_la-rivetCrypt.lo: librivet/$(am__dirstamp) \ librivet/$(DEPDIR)/$(am__dirstamp) librivet/librivetlib_la-rivetWWW.lo: librivet/$(am__dirstamp) \ librivet/$(DEPDIR)/$(am__dirstamp) librivet/librivetlib_la-rivetPkgInit.lo: librivet/$(am__dirstamp) \ librivet/$(DEPDIR)/$(am__dirstamp) librivetlib.la: $(librivetlib_la_OBJECTS) $(librivetlib_la_DEPENDENCIES) $(EXTRA_librivetlib_la_DEPENDENCIES) $(AM_V_CCLD)$(librivetlib_la_LINK) -rpath $(lib_libexecdir) $(librivetlib_la_OBJECTS) $(librivetlib_la_LIBADD) $(LIBS) parser/$(am__dirstamp): @$(MKDIR_P) parser @: > parser/$(am__dirstamp) parser/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) parser/$(DEPDIR) @: > parser/$(DEPDIR)/$(am__dirstamp) parser/librivetparser_la-rivetParser.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/librivetparser_la-parserPkgInit.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) librivetparser.la: $(librivetparser_la_OBJECTS) $(librivetparser_la_DEPENDENCIES) $(EXTRA_librivetparser_la_DEPENDENCIES) $(AM_V_CCLD)$(librivetparser_la_LINK) -rpath $(lib_libexecdir) $(librivetparser_la_OBJECTS) $(librivetparser_la_LIBADD) $(LIBS) @rivet_core@/$(am__dirstamp): @$(MKDIR_P) @rivet_core@ @: > @rivet_core@/$(am__dirstamp) @rivet_core@/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) @rivet_core@/$(DEPDIR) @: > @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-mod_rivet.lo: @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @apache_request@/$(am__dirstamp): @$(MKDIR_P) @apache_request@ @: > @apache_request@/$(am__dirstamp) @apache_request@/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) @apache_request@/$(DEPDIR) @: > @apache_request@/$(DEPDIR)/$(am__dirstamp) @apache_request@/mod_rivet_la-apache_multipart_buffer.lo: \ @apache_request@/$(am__dirstamp) \ @apache_request@/$(DEPDIR)/$(am__dirstamp) @apache_request@/mod_rivet_la-apache_request.lo: \ @apache_request@/$(am__dirstamp) \ @apache_request@/$(DEPDIR)/$(am__dirstamp) @rivet_commands@/$(am__dirstamp): @$(MKDIR_P) @rivet_commands@ @: > @rivet_commands@/$(am__dirstamp) @rivet_commands@/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) @rivet_commands@/$(DEPDIR) @: > @rivet_commands@/$(DEPDIR)/$(am__dirstamp) @rivet_commands@/mod_rivet_la-rivetCore.lo: \ @rivet_commands@/$(am__dirstamp) \ @rivet_commands@/$(DEPDIR)/$(am__dirstamp) @rivet_commands@/mod_rivet_la-rivetInspect.lo: \ @rivet_commands@/$(am__dirstamp) \ @rivet_commands@/$(DEPDIR)/$(am__dirstamp) @rivet_channel@/$(am__dirstamp): @$(MKDIR_P) @rivet_channel@ @: > @rivet_channel@/$(am__dirstamp) @rivet_channel@/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) @rivet_channel@/$(DEPDIR) @: > @rivet_channel@/$(DEPDIR)/$(am__dirstamp) @rivet_channel@/mod_rivet_la-rivetChannel.lo: \ @rivet_channel@/$(am__dirstamp) \ @rivet_channel@/$(DEPDIR)/$(am__dirstamp) parser/mod_rivet_la-rivetParser.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-TclWebapache.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-apache_config.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-mod_rivet_common.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-mod_rivet_generator.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/mod_rivet_la-mod_rivet_cache.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) mod_rivet.la: $(mod_rivet_la_OBJECTS) $(mod_rivet_la_DEPENDENCIES) $(EXTRA_mod_rivet_la_DEPENDENCIES) $(AM_V_CCLD)$(mod_rivet_la_LINK) -rpath $(apxs_libexecdir) $(mod_rivet_la_OBJECTS) $(mod_rivet_la_LIBADD) $(LIBS) @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) rivet_lazy_mpm.la: $(rivet_lazy_mpm_la_OBJECTS) $(rivet_lazy_mpm_la_DEPENDENCIES) $(EXTRA_rivet_lazy_mpm_la_DEPENDENCIES) $(AM_V_CCLD)$(rivet_lazy_mpm_la_LINK) -rpath $(lib_libmpmdir) $(rivet_lazy_mpm_la_OBJECTS) $(rivet_lazy_mpm_la_LIBADD) $(LIBS) @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) rivet_prefork_mpm.la: $(rivet_prefork_mpm_la_OBJECTS) $(rivet_prefork_mpm_la_DEPENDENCIES) $(EXTRA_rivet_prefork_mpm_la_DEPENDENCIES) $(AM_V_CCLD)$(rivet_prefork_mpm_la_LINK) -rpath $(lib_libmpmdir) $(rivet_prefork_mpm_la_OBJECTS) $(rivet_prefork_mpm_la_LIBADD) $(LIBS) @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo: \ @rivet_core@/$(am__dirstamp) \ @rivet_core@/$(DEPDIR)/$(am__dirstamp) rivet_worker_mpm.la: $(rivet_worker_mpm_la_OBJECTS) $(rivet_worker_mpm_la_DEPENDENCIES) $(EXTRA_rivet_worker_mpm_la_DEPENDENCIES) $(AM_V_CCLD)$(rivet_worker_mpm_la_LINK) -rpath $(lib_libmpmdir) $(rivet_worker_mpm_la_OBJECTS) $(rivet_worker_mpm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f @apache_request@/*.$(OBJEXT) -rm -f @apache_request@/*.lo -rm -f @rivet_channel@/*.$(OBJEXT) -rm -f @rivet_channel@/*.lo -rm -f @rivet_commands@/*.$(OBJEXT) -rm -f @rivet_commands@/*.lo -rm -f @rivet_core@/*.$(OBJEXT) -rm -f @rivet_core@/*.lo -rm -f librivet/*.$(OBJEXT) -rm -f librivet/*.lo -rm -f parser/*.$(OBJEXT) -rm -f parser/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@@apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@librivet/$(DEPDIR)/librivetlib_la-rivetList.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/librivetparser_la-rivetParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/mod_rivet_la-rivetParser.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< librivet/librivetlib_la-rivetList.lo: librivet/rivetList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librivet/librivetlib_la-rivetList.lo -MD -MP -MF librivet/$(DEPDIR)/librivetlib_la-rivetList.Tpo -c -o librivet/librivetlib_la-rivetList.lo `test -f 'librivet/rivetList.c' || echo '$(srcdir)/'`librivet/rivetList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) librivet/$(DEPDIR)/librivetlib_la-rivetList.Tpo librivet/$(DEPDIR)/librivetlib_la-rivetList.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='librivet/rivetList.c' object='librivet/librivetlib_la-rivetList.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librivet/librivetlib_la-rivetList.lo `test -f 'librivet/rivetList.c' || echo '$(srcdir)/'`librivet/rivetList.c librivet/librivetlib_la-rivetCrypt.lo: librivet/rivetCrypt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librivet/librivetlib_la-rivetCrypt.lo -MD -MP -MF librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Tpo -c -o librivet/librivetlib_la-rivetCrypt.lo `test -f 'librivet/rivetCrypt.c' || echo '$(srcdir)/'`librivet/rivetCrypt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Tpo librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='librivet/rivetCrypt.c' object='librivet/librivetlib_la-rivetCrypt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librivet/librivetlib_la-rivetCrypt.lo `test -f 'librivet/rivetCrypt.c' || echo '$(srcdir)/'`librivet/rivetCrypt.c librivet/librivetlib_la-rivetWWW.lo: librivet/rivetWWW.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librivet/librivetlib_la-rivetWWW.lo -MD -MP -MF librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Tpo -c -o librivet/librivetlib_la-rivetWWW.lo `test -f 'librivet/rivetWWW.c' || echo '$(srcdir)/'`librivet/rivetWWW.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Tpo librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='librivet/rivetWWW.c' object='librivet/librivetlib_la-rivetWWW.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librivet/librivetlib_la-rivetWWW.lo `test -f 'librivet/rivetWWW.c' || echo '$(srcdir)/'`librivet/rivetWWW.c librivet/librivetlib_la-rivetPkgInit.lo: librivet/rivetPkgInit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librivet/librivetlib_la-rivetPkgInit.lo -MD -MP -MF librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Tpo -c -o librivet/librivetlib_la-rivetPkgInit.lo `test -f 'librivet/rivetPkgInit.c' || echo '$(srcdir)/'`librivet/rivetPkgInit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Tpo librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='librivet/rivetPkgInit.c' object='librivet/librivetlib_la-rivetPkgInit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librivet/librivetlib_la-rivetPkgInit.lo `test -f 'librivet/rivetPkgInit.c' || echo '$(srcdir)/'`librivet/rivetPkgInit.c parser/librivetparser_la-rivetParser.lo: parser/rivetParser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetparser_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parser/librivetparser_la-rivetParser.lo -MD -MP -MF parser/$(DEPDIR)/librivetparser_la-rivetParser.Tpo -c -o parser/librivetparser_la-rivetParser.lo `test -f 'parser/rivetParser.c' || echo '$(srcdir)/'`parser/rivetParser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/librivetparser_la-rivetParser.Tpo parser/$(DEPDIR)/librivetparser_la-rivetParser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/rivetParser.c' object='parser/librivetparser_la-rivetParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetparser_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parser/librivetparser_la-rivetParser.lo `test -f 'parser/rivetParser.c' || echo '$(srcdir)/'`parser/rivetParser.c parser/librivetparser_la-parserPkgInit.lo: parser/parserPkgInit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetparser_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parser/librivetparser_la-parserPkgInit.lo -MD -MP -MF parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Tpo -c -o parser/librivetparser_la-parserPkgInit.lo `test -f 'parser/parserPkgInit.c' || echo '$(srcdir)/'`parser/parserPkgInit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Tpo parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/parserPkgInit.c' object='parser/librivetparser_la-parserPkgInit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librivetparser_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parser/librivetparser_la-parserPkgInit.lo `test -f 'parser/parserPkgInit.c' || echo '$(srcdir)/'`parser/parserPkgInit.c @rivet_core@/mod_rivet_la-mod_rivet.lo: @rivet_core@/mod_rivet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-mod_rivet.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Tpo -c -o @rivet_core@/mod_rivet_la-mod_rivet.lo `test -f '@rivet_core@/mod_rivet.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/mod_rivet.c' object='@rivet_core@/mod_rivet_la-mod_rivet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-mod_rivet.lo `test -f '@rivet_core@/mod_rivet.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet.c @apache_request@/mod_rivet_la-apache_multipart_buffer.lo: @apache_request@/apache_multipart_buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @apache_request@/mod_rivet_la-apache_multipart_buffer.lo -MD -MP -MF @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Tpo -c -o @apache_request@/mod_rivet_la-apache_multipart_buffer.lo `test -f '@apache_request@/apache_multipart_buffer.c' || echo '$(srcdir)/'`@apache_request@/apache_multipart_buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Tpo @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@apache_request@/apache_multipart_buffer.c' object='@apache_request@/mod_rivet_la-apache_multipart_buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @apache_request@/mod_rivet_la-apache_multipart_buffer.lo `test -f '@apache_request@/apache_multipart_buffer.c' || echo '$(srcdir)/'`@apache_request@/apache_multipart_buffer.c @apache_request@/mod_rivet_la-apache_request.lo: @apache_request@/apache_request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @apache_request@/mod_rivet_la-apache_request.lo -MD -MP -MF @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Tpo -c -o @apache_request@/mod_rivet_la-apache_request.lo `test -f '@apache_request@/apache_request.c' || echo '$(srcdir)/'`@apache_request@/apache_request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Tpo @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@apache_request@/apache_request.c' object='@apache_request@/mod_rivet_la-apache_request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @apache_request@/mod_rivet_la-apache_request.lo `test -f '@apache_request@/apache_request.c' || echo '$(srcdir)/'`@apache_request@/apache_request.c @rivet_commands@/mod_rivet_la-rivetCore.lo: @rivet_commands@/rivetCore.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_commands@/mod_rivet_la-rivetCore.lo -MD -MP -MF @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Tpo -c -o @rivet_commands@/mod_rivet_la-rivetCore.lo `test -f '@rivet_commands@/rivetCore.c' || echo '$(srcdir)/'`@rivet_commands@/rivetCore.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Tpo @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_commands@/rivetCore.c' object='@rivet_commands@/mod_rivet_la-rivetCore.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_commands@/mod_rivet_la-rivetCore.lo `test -f '@rivet_commands@/rivetCore.c' || echo '$(srcdir)/'`@rivet_commands@/rivetCore.c @rivet_commands@/mod_rivet_la-rivetInspect.lo: @rivet_commands@/rivetInspect.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_commands@/mod_rivet_la-rivetInspect.lo -MD -MP -MF @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Tpo -c -o @rivet_commands@/mod_rivet_la-rivetInspect.lo `test -f '@rivet_commands@/rivetInspect.c' || echo '$(srcdir)/'`@rivet_commands@/rivetInspect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Tpo @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_commands@/rivetInspect.c' object='@rivet_commands@/mod_rivet_la-rivetInspect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_commands@/mod_rivet_la-rivetInspect.lo `test -f '@rivet_commands@/rivetInspect.c' || echo '$(srcdir)/'`@rivet_commands@/rivetInspect.c @rivet_channel@/mod_rivet_la-rivetChannel.lo: @rivet_channel@/rivetChannel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_channel@/mod_rivet_la-rivetChannel.lo -MD -MP -MF @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Tpo -c -o @rivet_channel@/mod_rivet_la-rivetChannel.lo `test -f '@rivet_channel@/rivetChannel.c' || echo '$(srcdir)/'`@rivet_channel@/rivetChannel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Tpo @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_channel@/rivetChannel.c' object='@rivet_channel@/mod_rivet_la-rivetChannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_channel@/mod_rivet_la-rivetChannel.lo `test -f '@rivet_channel@/rivetChannel.c' || echo '$(srcdir)/'`@rivet_channel@/rivetChannel.c parser/mod_rivet_la-rivetParser.lo: parser/rivetParser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parser/mod_rivet_la-rivetParser.lo -MD -MP -MF parser/$(DEPDIR)/mod_rivet_la-rivetParser.Tpo -c -o parser/mod_rivet_la-rivetParser.lo `test -f 'parser/rivetParser.c' || echo '$(srcdir)/'`parser/rivetParser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/mod_rivet_la-rivetParser.Tpo parser/$(DEPDIR)/mod_rivet_la-rivetParser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/rivetParser.c' object='parser/mod_rivet_la-rivetParser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parser/mod_rivet_la-rivetParser.lo `test -f 'parser/rivetParser.c' || echo '$(srcdir)/'`parser/rivetParser.c @rivet_core@/mod_rivet_la-TclWebapache.lo: @rivet_core@/TclWebapache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-TclWebapache.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Tpo -c -o @rivet_core@/mod_rivet_la-TclWebapache.lo `test -f '@rivet_core@/TclWebapache.c' || echo '$(srcdir)/'`@rivet_core@/TclWebapache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/TclWebapache.c' object='@rivet_core@/mod_rivet_la-TclWebapache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-TclWebapache.lo `test -f '@rivet_core@/TclWebapache.c' || echo '$(srcdir)/'`@rivet_core@/TclWebapache.c @rivet_core@/mod_rivet_la-apache_config.lo: @rivet_core@/apache_config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-apache_config.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Tpo -c -o @rivet_core@/mod_rivet_la-apache_config.lo `test -f '@rivet_core@/apache_config.c' || echo '$(srcdir)/'`@rivet_core@/apache_config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/apache_config.c' object='@rivet_core@/mod_rivet_la-apache_config.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-apache_config.lo `test -f '@rivet_core@/apache_config.c' || echo '$(srcdir)/'`@rivet_core@/apache_config.c @rivet_core@/mod_rivet_la-mod_rivet_common.lo: @rivet_core@/mod_rivet_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-mod_rivet_common.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Tpo -c -o @rivet_core@/mod_rivet_la-mod_rivet_common.lo `test -f '@rivet_core@/mod_rivet_common.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/mod_rivet_common.c' object='@rivet_core@/mod_rivet_la-mod_rivet_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-mod_rivet_common.lo `test -f '@rivet_core@/mod_rivet_common.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_common.c @rivet_core@/mod_rivet_la-mod_rivet_generator.lo: @rivet_core@/mod_rivet_generator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-mod_rivet_generator.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Tpo -c -o @rivet_core@/mod_rivet_la-mod_rivet_generator.lo `test -f '@rivet_core@/mod_rivet_generator.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_generator.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/mod_rivet_generator.c' object='@rivet_core@/mod_rivet_la-mod_rivet_generator.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-mod_rivet_generator.lo `test -f '@rivet_core@/mod_rivet_generator.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_generator.c @rivet_core@/mod_rivet_la-mod_rivet_cache.lo: @rivet_core@/mod_rivet_cache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/mod_rivet_la-mod_rivet_cache.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Tpo -c -o @rivet_core@/mod_rivet_la-mod_rivet_cache.lo `test -f '@rivet_core@/mod_rivet_cache.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_cache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Tpo @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/mod_rivet_cache.c' object='@rivet_core@/mod_rivet_la-mod_rivet_cache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rivet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/mod_rivet_la-mod_rivet_cache.lo `test -f '@rivet_core@/mod_rivet_cache.c' || echo '$(srcdir)/'`@rivet_core@/mod_rivet_cache.c @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo: @rivet_core@/rivet_lazy_mpm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_lazy_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Tpo -c -o @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo `test -f '@rivet_core@/rivet_lazy_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_lazy_mpm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Tpo @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/rivet_lazy_mpm.c' object='@rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_lazy_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/rivet_lazy_mpm_la-rivet_lazy_mpm.lo `test -f '@rivet_core@/rivet_lazy_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_lazy_mpm.c @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo: @rivet_core@/rivet_prefork_mpm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_prefork_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Tpo -c -o @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo `test -f '@rivet_core@/rivet_prefork_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_prefork_mpm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Tpo @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/rivet_prefork_mpm.c' object='@rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_prefork_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/rivet_prefork_mpm_la-rivet_prefork_mpm.lo `test -f '@rivet_core@/rivet_prefork_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_prefork_mpm.c @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo: @rivet_core@/worker_prefork_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_prefork_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Tpo -c -o @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo `test -f '@rivet_core@/worker_prefork_common.c' || echo '$(srcdir)/'`@rivet_core@/worker_prefork_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Tpo @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/worker_prefork_common.c' object='@rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_prefork_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/rivet_prefork_mpm_la-worker_prefork_common.lo `test -f '@rivet_core@/worker_prefork_common.c' || echo '$(srcdir)/'`@rivet_core@/worker_prefork_common.c @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo: @rivet_core@/rivet_worker_mpm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_worker_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Tpo -c -o @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo `test -f '@rivet_core@/rivet_worker_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_worker_mpm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Tpo @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/rivet_worker_mpm.c' object='@rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_worker_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/rivet_worker_mpm_la-rivet_worker_mpm.lo `test -f '@rivet_core@/rivet_worker_mpm.c' || echo '$(srcdir)/'`@rivet_core@/rivet_worker_mpm.c @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo: @rivet_core@/worker_prefork_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_worker_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo -MD -MP -MF @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Tpo -c -o @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo `test -f '@rivet_core@/worker_prefork_common.c' || echo '$(srcdir)/'`@rivet_core@/worker_prefork_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Tpo @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='@rivet_core@/worker_prefork_common.c' object='@rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rivet_worker_mpm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o @rivet_core@/rivet_worker_mpm_la-worker_prefork_common.lo `test -f '@rivet_core@/worker_prefork_common.c' || echo '$(srcdir)/'`@rivet_core@/worker_prefork_common.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf @apache_request@/.libs @apache_request@/_libs -rm -rf @rivet_channel@/.libs @rivet_channel@/_libs -rm -rf @rivet_commands@/.libs @rivet_commands@/_libs -rm -rf @rivet_core@/.libs @rivet_core@/_libs -rm -rf librivet/.libs librivet/_libs -rm -rf parser/.libs parser/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(apxs_libexecdir)" "$(DESTDIR)$(lib_libexecdir)" "$(DESTDIR)$(lib_libmpmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f @apache_request@/$(DEPDIR)/$(am__dirstamp) -rm -f @apache_request@/$(am__dirstamp) -rm -f @rivet_channel@/$(DEPDIR)/$(am__dirstamp) -rm -f @rivet_channel@/$(am__dirstamp) -rm -f @rivet_commands@/$(DEPDIR)/$(am__dirstamp) -rm -f @rivet_commands@/$(am__dirstamp) -rm -f @rivet_core@/$(DEPDIR)/$(am__dirstamp) -rm -f @rivet_core@/$(am__dirstamp) -rm -f librivet/$(DEPDIR)/$(am__dirstamp) -rm -f librivet/$(am__dirstamp) -rm -f parser/$(DEPDIR)/$(am__dirstamp) -rm -f parser/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-apxs_libexecLTLIBRARIES clean-generic \ clean-lib_libexecLTLIBRARIES clean-lib_libmpmLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -f @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Plo -rm -f @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Plo -rm -f @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Plo -rm -f @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Plo -rm -f @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetList.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Plo -rm -f parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Plo -rm -f parser/$(DEPDIR)/librivetparser_la-rivetParser.Plo -rm -f parser/$(DEPDIR)/mod_rivet_la-rivetParser.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-lib_libmpmLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-apxs_libexecLTLIBRARIES \ install-lib_libexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f @apache_request@/$(DEPDIR)/mod_rivet_la-apache_multipart_buffer.Plo -rm -f @apache_request@/$(DEPDIR)/mod_rivet_la-apache_request.Plo -rm -f @rivet_channel@/$(DEPDIR)/mod_rivet_la-rivetChannel.Plo -rm -f @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetCore.Plo -rm -f @rivet_commands@/$(DEPDIR)/mod_rivet_la-rivetInspect.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-TclWebapache.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-apache_config.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_cache.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_common.Plo -rm -f @rivet_core@/$(DEPDIR)/mod_rivet_la-mod_rivet_generator.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_lazy_mpm_la-rivet_lazy_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-rivet_prefork_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_prefork_mpm_la-worker_prefork_common.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-rivet_worker_mpm.Plo -rm -f @rivet_core@/$(DEPDIR)/rivet_worker_mpm_la-worker_prefork_common.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetCrypt.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetList.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetPkgInit.Plo -rm -f librivet/$(DEPDIR)/librivetlib_la-rivetWWW.Plo -rm -f parser/$(DEPDIR)/librivetparser_la-parserPkgInit.Plo -rm -f parser/$(DEPDIR)/librivetparser_la-rivetParser.Plo -rm -f parser/$(DEPDIR)/mod_rivet_la-rivetParser.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-apxs_libexecLTLIBRARIES \ uninstall-lib_libexecLTLIBRARIES \ uninstall-lib_libmpmLTLIBRARIES .MAKE: install-am install-data-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-apxs_libexecLTLIBRARIES clean-generic \ clean-lib_libexecLTLIBRARIES clean-lib_libmpmLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-apxs_libexecLTLIBRARIES \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-lib_libexecLTLIBRARIES install-lib_libmpmLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-apxs_libexecLTLIBRARIES \ uninstall-lib_libexecLTLIBRARIES \ uninstall-lib_libmpmLTLIBRARIES .PRECIOUS: Makefile # Removing libtool .la files from installation install-data-hook: echo 'target install-data-hook: removing unwanted libtool .la files from $(lib_libexecdir) $(apxs_libexecdir) $(lib_libmpmdir)' rm -f $(DESTDIR)$(lib_libexecdir)/*.la rm -f $(DESTDIR)$(apxs_libexecdir)/*.la rm -f $(DESTDIR)$(lib_libmpmdir)/*.la uninstall: echo 'target uninstall: removing shared libraries from $(lib_libexecdir) $(apxs_libexecdir) $(lib_libmpmdir)' rm -f $(DESTDIR)$(lib_libmpmdir)/*.so rm -f $(DESTDIR)$(lib_libexecdir)/*.so rm -f $(DESTDIR)$(apxs_libexecdir)/mod_rivet.so # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rivet-3.2.1/tests/hello.rvt000664 001750 001750 00000000213 14141530732 016416 0ustar00manghimanghi000000 000000

ܸ(EUC-JP Japanese text)

rivet-3.2.1/src/librivet/rivetWWW.c000664 001750 001750 00000025171 14141530732 017737 0ustar00manghimanghi000000 000000 /* * rivetWWW.c - Rivet commands designed for use with the world wide web. */ /* Copyright 2002-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* $Id$ */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include #include /* Function prototypes are defined with EXTERN. Since we are in the same DLL, * no need to keep this extern... */ #ifdef EXTERN # undef EXTERN # define EXTERN #endif /* EXTERN */ #include "rivet.h" #ifdef WIN32 #define snprintf _snprintf #endif /* *----------------------------------------------------------------------------- * * Rivet_HexToDigit -- * Helper function to convert a hex character into the equivalent integer. * * Results: * The integer, or -1 if an illegal hex character is encountered. * *----------------------------------------------------------------------------- */ static int Rivet_HexToDigit(int c) { if (c >= 'a' && c <= 'f') { return (c - 'a' + 10); } if (c >= 'A' && c <= 'F') { return (c - 'A' + 10); } if (c >= '0' && c <= '9') { return (c - '0'); } return (-1); } /* *----------------------------------------------------------------------------- * * Rivet_UnescapeStringCmd -- * Implements the TCL unescape_string command: * unescape_string string * * Results: * Standard TCL results. * *----------------------------------------------------------------------------- */ TCL_CMD_HEADER( Rivet_UnescapeStringCmd ) { char *origString, *newString, *origStringP, *newStringP; int origLength; int digit1, digit2; if ( objc != 2 ) { Tcl_WrongNumArgs( interp, 1, objv, "string" ); return TCL_ERROR; } origString = Tcl_GetStringFromObj( objv[1], &origLength ); newString = Tcl_Alloc( (unsigned)origLength + 1); /* for all the characters in the source string */ for (origStringP = origString, newStringP = newString; *origStringP != '\0'; origStringP++) { char c = *origStringP; char c2; /* map plus to space */ if (c == '+') { *newStringP++ = ' '; continue; } /* if there's a percent sign, decode the two-character * hex sequence that follows and copy it to the target * string */ if (c == '%') { digit1 = Rivet_HexToDigit(c = *++origStringP); digit2 = Rivet_HexToDigit(c2 = *++origStringP); if (digit1 == -1 || digit2 == -1) { char buf[3]; snprintf (buf,3,"%c%c",c,c2); Tcl_AppendResult( interp, Tcl_GetStringFromObj( objv[0], NULL ), ": bad char in hex sequence %", buf, (char *)NULL ); return TCL_ERROR; } *newStringP++ = (digit1 * 16 + digit2); continue; } /* it wasn't a plus or percent, just copy the char across */ *newStringP++ = c; } /* Don't forget to null-terminate the target string */ *newStringP = '\0'; Tcl_SetObjResult( interp, Tcl_NewStringObj( newString, -1 ) ); Tcl_Free(newString); return TCL_OK; } /* *----------------------------------------------------------------------------- * * Rivet_DigitToHex * Helper function to convert a number 0 - 15 into the equivalent hex * character. * * Results: * The integer, or -1 if an illegal hex character is encountered. * *----------------------------------------------------------------------------- */ static int Rivet_DigitToHex(int c) { if (c < 10) { return c + '0'; } return c - 10 + 'a'; } /* *----------------------------------------------------------------------------- * * Rivet_EscapeStringCmd -- * Implements the TCL escape_string command: * escape_string string * * Results: * Standard TCL results. * *----------------------------------------------------------------------------- */ TCL_CMD_HEADER( Rivet_EscapeStringCmd ) { char *origString, *newString, *origStringP, *newStringP; int origLength; if ( objc != 2 ) { Tcl_WrongNumArgs( interp, 1, objv, "string" ); return TCL_ERROR; } origString = Tcl_GetStringFromObj( objv[1], &origLength ); /* If they sent us an empty string, we're done */ if (origLength == 0) return TCL_OK; newString = (char *)Tcl_Alloc( (unsigned)origLength * 3 + 1 ); /* for all the characters in the source string */ for (origStringP = origString, newStringP = newString; *origStringP != '\0'; origStringP++) { char c = *origStringP; if (isalnum ((int)c)) { *newStringP++ = c; } else if (c == ' ') { *newStringP++ = '+'; } else { *newStringP++ = '%'; *newStringP++ = Rivet_DigitToHex((c >> 4) & 0x0f); *newStringP++ = Rivet_DigitToHex(c & 0x0f); } } /* Don't forget to null-terminate the target string */ *newStringP = '\0'; Tcl_SetObjResult( interp, Tcl_NewStringObj( newString, -1 ) ); Tcl_Free(newString); return TCL_OK; } /* *----------------------------------------------------------------------------- * * Rivet_EscapeSgmlCharsCmd -- * Implements the TCL escape_sgml_chars command: * escape_sgml_chars string * * Results: * Standard TCL results. * *----------------------------------------------------------------------------- */ TCL_CMD_HEADER( Rivet_EscapeSgmlCharsCmd ) { char *origString, *newString, *origStringP, *newStringP; int origLength; if( objc != 2 ) { Tcl_WrongNumArgs( interp, 1, objv, "string" ); return TCL_ERROR; } origString = Tcl_GetStringFromObj( objv[1], &origLength ); /* If they sent us an empty string, we're done */ if (origLength == 0) return TCL_OK; newString = (char *)Tcl_Alloc( (unsigned)origLength * 6 + 1 ); /* for all the characters in the source string */ for (origStringP = origString, newStringP = newString; *origStringP != '\0'; origStringP++) { char c = *origStringP; switch(c) { case '&': *newStringP++ = '&'; *newStringP++ = 'a'; *newStringP++ = 'm'; *newStringP++ = 'p'; *newStringP++ = ';'; break; case '<': *newStringP++ = '&'; *newStringP++ = 'l'; *newStringP++ = 't'; *newStringP++ = ';'; break; case '>': *newStringP++ = '&'; *newStringP++ = 'g'; *newStringP++ = 't'; *newStringP++ = ';'; break; case '\'': *newStringP++ = '&'; *newStringP++ = '#'; *newStringP++ = '3'; *newStringP++ = '9'; *newStringP++ = ';'; break; case '"': *newStringP++ = '&'; *newStringP++ = 'q'; *newStringP++ = 'u'; *newStringP++ = 'o'; *newStringP++ = 't'; *newStringP++ = ';'; break; default: *newStringP++ = c; break; } } /* Don't forget to null-terminate the target string */ *newStringP = '\0'; Tcl_SetObjResult( interp, Tcl_NewStringObj( newString, -1 ) ); Tcl_Free(newString); return TCL_OK; } /* *----------------------------------------------------------------------------- * * Rivet_EscapeShellCommandCmd -- * Implements the TCL www_escape_shell_command command: * www_escape_shell_command string * * Results: * Standard TCL results. * *----------------------------------------------------------------------------- */ TCL_CMD_HEADER( Rivet_EscapeShellCommandCmd ) { char *origString, *newString, *origStringP, *newStringP, *checkP; int origLength; if( objc != 2) { Tcl_WrongNumArgs( interp, 1, objv, "string" ); return TCL_ERROR; } origString = Tcl_GetStringFromObj( objv[1], &origLength ); newString = Tcl_Alloc( (unsigned)origLength * 2 + 1 ); /* for all the characters in the source string */ for (origStringP = origString, newStringP = newString; *origStringP != '\0'; origStringP++) { char c = *origStringP; /* if the character is a shell metacharacter, quote it */ for (checkP = "&;`'|*?-~<>^()[]{}$\\"; *checkP != '\0'; checkP++) { if (c == *checkP) { *newStringP++ = '\\'; break; } } *newStringP++ = c; } /* Don't forget to null-terminate the target string */ *newStringP = '\0'; Tcl_SetObjResult( interp, Tcl_NewStringObj( newString, -1 ) ); Tcl_Free(newString); return TCL_OK; } /* *----------------------------------------------------------------------------- * Rivet_InitWWW -- * * Initialize the WWW functions. * * These functions have been examined and are believed to be safe for use * in safe interpreters, as they process strings only. *----------------------------------------------------------------------------- */ #if RIVET_NAMESPACE_EXPORT == 1 extern Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp); #endif int Rivet_InitWWW( Tcl_Interp *interp) { RIVET_OBJ_CMD ("unescape_string",Rivet_UnescapeStringCmd,NULL); RIVET_OBJ_CMD ("escape_string",Rivet_EscapeStringCmd,NULL); RIVET_OBJ_CMD ("escape_sgml_chars",Rivet_EscapeSgmlCharsCmd,NULL); RIVET_OBJ_CMD ("escape_shell_command",Rivet_EscapeShellCommandCmd,NULL); #if RIVET_NAMESPACE_EXPORT == 1 { Tcl_Namespace* rivet_ns = Rivet_GetNamespace(interp); RIVET_EXPORT_CMD(interp,rivet_ns,"unescape_string"); RIVET_EXPORT_CMD(interp,rivet_ns,"escape_string"); RIVET_EXPORT_CMD(interp,rivet_ns,"escape_sgml_chars"); RIVET_EXPORT_CMD(interp,rivet_ns,"escape_shell_command"); } #endif return TCL_OK; } rivet-3.2.1/doc/html/escape_string.html000664 001750 001750 00000005340 14142162544 020652 0ustar00manghimanghi000000 000000 escape_string

Name

escape_string — convert a string into escaped characters.

Synopsis

::rivet::escape_string ?string?

Description

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.

This is useful for quoting strings that are going to be part of a URL.

rivet-3.2.1/tests/virtualhost.test000664 001750 001750 00000017116 14141530732 020055 0ustar00manghimanghi000000 000000 # virtualhost.test -- test virtual host setups. # $Id$ set docroot1 [file join [pwd] docroot1] set docroot2 [file join [pwd] docroot2] set vhostconf { #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 DocumentRoot $docroot2 ServerName vhost2 } # Make sure virtual hosts work. ::tcltest::test vhost-1.1 {basic virtual host} { apachetest::start {} $vhostconf { set page1 [::http::geturl "${urlbase}basic1.rvt" -headers [list Host vhost1]] set page2 [::http::geturl "${urlbase}basic2.rvt" -headers [list Host vhost2]] set match1 [::http::data $page1] set match2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } list [string match {Virtual Host1 Test*} $match1] \ [string match {Virtual Host2 Test*} $match2] } {1 1} # Try virtual hosts with and without a childinitscript. ::tcltest::test vhost-2.1 {virtual host w/ ChildInitScript} { set data {} apachetest::start {} { RivetServerConf SeparateVirtualInterps off RivetServerConf ChildInitScript "source [file join $docroot1 childinit.tcl]" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page2 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page1 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data "[::http::data $page1][::http::data $page2]" ::http::cleanup $page1 ::http::cleanup $page2 } # puts ">>>$data<<<" regexp "::childinit1 exists.*::childinit2 exists" $data match } 1 # Test out a ChildInitScript that is only in a vhost. ::tcltest::test vhost-2.2 {virtual host w/ ChildInitScript in vhost} { set data {} apachetest::start {} { #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page {} lappend page [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] lappend page [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] foreach p $page { lappend data [::http::data $p] ::http::cleanup $p } } # set data regexp "vhost2 hello world
\n::childinit2 exists
" $data match } 1 # Test out a beforescript in a virtual host. ::tcltest::test vhost-3.1 {virtual host w/ BeforeScript} { set data {} apachetest::start {} { RivetServerConf BeforeScript "source [file join $docroot1 beforescript.tcl]" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf BeforeScript "source [file join $docroot2 beforescript.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } list [regexp "^beforescript2\nVirtual Host2 Test" $data1 match] \ [regexp "^beforescript1\nVirtual Host1 Test" $data2 match] # list $data1 $data2 } {1 1} # Turn on separate interpreters per virtual host. ::tcltest::test vhost-4.1 {virtual host w/ separate interps} { set data {} apachetest::start {} { RivetServerConf SeparateVirtualInterps on #NameVirtualHost 127.0.0.1 RivetServerConf ChildInitScript "set ::childinit1 1" DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "set ::childinit2 1" DocumentRoot $docroot2 ServerName vhost2 } { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } # puts "--$data1--" # puts "--$data2--" list \ [regexp "vhost2 hello world
\n::childinit2 exists
" $data1 match] \ [regexp "vhost1 hello world
\n::childinit1 exists
" $data2 match] # list $data1 $data2 } {1 1} # Run through a list of config options, the files they use and the # regexps that match the results. # Format: directive, file, 2 regexps to match set configs { ChildInitScript childinit.tcl "vhost2 hello world
\n::childinit2 exists
\n::childinit1 exists
\n" \ "vhost1 hello world
\n::childinit1 exists
\n::childinit2 exists
" BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test" AfterScript afterscript.tcl "afterscript2" "afterscript1" } set i 1 foreach {conf file re1 re2} $configs { ::tcltest::test vhost-5.$i [list vhost with $conf] { apachetest::start {} " RivetServerConf SeparateVirtualInterps off RivetServerConf $conf \"source [file join $docroot1 $file]\" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf $conf \"source [file join $docroot2 $file]\" DocumentRoot $docroot2 ServerName vhost2 " { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } #puts "--$re1--\n--$data1--" #puts "--$re2--\n--$data2--" list [regexp $re1 $data1 match] [regexp $re1 $data1 match] #list $data1 $data2 } {1 1} } set configs { ChildInitScript childinit.tcl "vhost2 hello world
\n::childinit2 exists
\n" "vhost1 hello world
\n::childinit1 exists
\n" BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test" AfterScript afterscript.tcl "afterscript2" "afterscript1" } # Now run through a similar list, using per vhost interps. set i 1 foreach {conf file re1 re2} $configs { ::tcltest::test vhost-6.$i [list vhost with $conf and SeparateVirtualInterps] { apachetest::start {} " RivetServerConf SeparateVirtualInterps on RivetServerConf $conf \"source [file join $docroot1 $file]\" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf $conf \"source [file join $docroot2 $file]\" DocumentRoot $docroot2 ServerName vhost2 " { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } #puts "--$re1--\n--$data1--" #puts "--$re2--\n--$data2--" list [regexp $re1 $data1 match] [regexp $re1 $data1 match] } {1 1} incr i } rivet-3.2.1/LICENSE000664 001750 001750 00000026136 14141530732 014435 0ustar00manghimanghi000000 000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. rivet-3.2.1/rivet/packages/formbroker/formbroker.tcl000664 001750 001750 00000060234 14141530732 023360 0ustar00manghimanghi000000 000000 # -- formbroker.tcl # # Form validation and sanitation tool. Developed starting from # code initially donated by Karl Lehenbauer (Flightaware.com) # # Copyright 2017 The Rivet Team # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. namespace eval FormBroker { variable form_definitions [dict create] variable form_list [dict create] variable string_quoting force_quote variable form_count 0 # # response_security_error - issue an error with errorCode # # set appropriate -- we expect the rivet error handler # to catch this and do the right thing # proc response_security_error {type message} { error $message "" [list RIVET SECURITY $type $message] } # # force_response_integers - error if any of named vars in response doesn't exist # # or isn't an integer # proc force_response_integers {_response args} { upvar $_response response require_response_vars response {*}$args foreach var $args { if {![regexp {[0-9-]*} response($var)]} { response_security_error NOT_INTEGER "illegal content in $var" } if {![scan $response($var) %d response($var)]} { response_security_error NOT_INTEGER "illegal content in $var" } } } # # force_response_integer_in_range - error if var in response isn't an integer # or if it isn't in range # proc force_response_integer_in_range {_response var lowest highest} { upvar $_response response force_response_integers response $var if {$response($var) < $lowest || $response($var) > $highest} { response_security_error "OUT_OF_RANGE" "$var out of range" } } # -- force_quote # proc force_quote {str} { return "'$str'" } # -- force_sanitize_response_strings proc force_sanitize_response_strings {_response args} { } # # force_quote_response_strings - sanitize and pg_quote all the specified strings in the array # proc force_quote_response_strings {_response args} { upvar $_response response force_sanitize_response_strings response {*}$args foreach var $args { set response($var) [$string_quoting $response($var)] } } # # -- force_quote_response_unfilteredstrings - rewrite named response # elements pg_quoted # proc force_quote_response_unfilteredstrings {_response args} { upvar $_response response require_response_vars response {*}$args foreach var $args { set response($var) [$string_quoting $response($var)] } } # -- base validators proc validate_string {_var_d} { upvar $_var_d var_d set valid FB_OK dict with var_d { if {$bounds > 0} { if {($nonempty == 1) && ($var == "")} { set valid FB_EMPTY_STRING } elseif {$constrain} { set var [string range $var 0 $bounds-1] } elseif {[string length $var] > $bounds} { set valid FB_STRING_TOO_LONG } } } return $valid } # -- validate_integer # # integer validation checks whether # # 1- the representation *is* an integer # 2- if buonds exist the value must be between [-bound,bound] # 3- if the bounds is a list of 2 elements the value must # be between them # # If needed the variable is constrained within the bounds. # proc validate_integer {_var_d} { upvar $_var_d var_d #puts "var_d: $var_d" set valid FB_OK dict with var_d { if {![string is integer $var]} { return NOT_INTEGER } if {[llength $bounds] == 2} { ::lassign $bounds min_v max_v if {$constrain} { set var [expr min($var,$max_v)] set var [expr max($var,$min_v)] set valid FB_OK } elseif {($var > $max_v) || ($var < $min_v)} { set valid FB_OUT_OF_BOUNDS } else { set valid FB_OK } } elseif {([llength $bounds] == 1) && ($bounds > 0)} { if {$constrain} { set var [expr min($bounds,$var)] set var [expr max(-$bounds,$var)] set valid FB_OK } elseif {(abs($var) > $bounds)} { set valid FB_OUT_OF_BOUNDS } else { set valid FB_OK } } } return $valid } proc validate_unsigned {_var_d} { upvar $_var_d var_d dict with var_d { if {![string is integer $var]} { return NOT_INTEGER } if {[llength $bounds] == 2} { ::lassign $bounds min_v max_v if {$constrain} { set var [expr min($var,$max_v)] set var [expr max($var,$min_v)] set valid FB_OK } elseif {($var > $max_v) || ($var < $min_v)} { set valid FB_OUT_OF_BOUNDS } else { set valid FB_OK } } elseif {([llength $bounds] == 1) && \ ($bounds > 0)} { if {$constrain} { set var [expr max(0,$var)] set var [expr min($bounds,$var)] set valid FB_OK } elseif {($var > $bounds) || ($var < 0)} { set valid FB_OUT_OF_BOUNDS } else { set valid FB_OK } } else { if {$constrain} { set var [expr max(0,$var)] set valid FB_OK } elseif {$var < 0} { set valid FB_OUT_OF_BOUNDS } else { set valid FB_OK } } } return $valid } proc validate_email {_var_d} { upvar $_var_d var_d dict with var_d { if {[regexp -nocase {[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}} $var]} { return FB_OK } else { return FB_INVALID_EMAIL } } } proc validate_boolean {_var_d} { upvar $_var_d var_d dict with var_d { if {[string is boolean $var]} { if {$constrain} { set var [string is true $var] } return FB_OK } else { return FB_INVALID_BOOLEAN } } } proc validate_variable_representation {_var_d} { upvar $_var_d var_d variable form_definitions set validator [dict get $var_d validator] if {[info commands $validator] == ""} { set validator ::FormBroker::validate_string } set validation [$validator var_d] dict set var_d field_validation $validation return [string match $validation FB_OK] } proc validate_var {form_name var_name var_value {force_quoting "-noforcequote"}} { variable form_definitions upvar $var_value value set force_quote_var [string match $force_quoting "-forcequote"] set variable_d [dict get $form_definitions $form_name $var_name] dict set variable_d var $value set valid [validate_variable_representation variable_d] set value [dict get $variable_d var] if {[dict get $variable_d force_quote] || $force_quote_var} { set value [$string_quoting $value] } return $valid } # -- bounds_consistency # # During the form creation stage this method is called # to correct possible inconsistencies with a field bounds # definition # proc bounds_consistency {field_type _bounds} { upvar $_bounds bounds switch $field_type { integer { if {[llength $bounds] == 1} { set bounds [list [expr -abs($bounds)] [expr abs($bounds)]] } elseif {[llength $bounds] > 1} { lassign $bounds l1 l2 set bounds [list [expr min($l1,$l2)] [expr max($l1,$l2)]] } else { set bounds 0 } } unsigned { if {[llength $bounds] == 1} { set bounds [list 0 [expr abs($bounds)]] } elseif {[llength $bounds] > 1} { lassign $bounds l1 l2 if {$l1 < 0} { set l1 0 } if {$l2 < 0} { set l2 0 } set bounds [list [expr min($l1,$l2)] [expr max($l1,$l2)]] } else { set bounds 0 } } } } # -- form_definition # # currently this call returns the dictionary # of form field definitions. It's not meant to be # used in regular development. It's supposed to be # private to the FormBroker package # and it may go away with future developments or # change its interface and returned value proc form_definition {form_name} { variable form_definitions return [dict get $form_definitions $form_name] } # -- validation_error # # returns the result of the last validation # operation called on for this form. # proc validation_error {form_name} { variable form_list return [dict get $form_list $form_name form_validation] } # -- failing # # returns a list of variable-status pairs for each # field in a form that did not validate # proc failing {form_name} { set res {} dict for {field field_d} [form_definition $form_name] { dict with field_d { if {$field_validation != "FB_OK"} { lappend res $field $field_validation } } } return $res } # -- result # # accessor to the form field definitions. This procedure # too is not (at least temporarily) to be called from # outside the package # proc result {form_name form_field} { variable form_definitions return [dict get $form_definitions $form_name $form_field] } # --require_response_vars # # error if any of the specified are not in the response # proc require_response_vars {form_name _response} { upvar $_response response variable form_definitions set missing_vars 0 dict for {var variable_d} [dict get $form_definitions $form_name] { if {![info exists response($var)]} { dict with form_definitions $form_name $var { # if the variable was not in the response # but a default was set then we copy this # value in the variable descriptor and # the response array as well if {[info exists default]} { set response($var) $default set var $default } else { set field_validation MISSING_VAR set missing_vars 1 } } } } if {$missing_vars} { response_security_error MISSING_VAR \ "var $var not present in $_response" } } # -- validate # # proc validate { form_name args } { variable form_definitions variable form_list variable string_quoting set force_quote_vars 0 set arguments $args if {[llength $arguments] == 0} { error "missing required arguments" } elseif {[llength $arguments] > 3} { error "error calling validate, usage: validate ?-forcequote? response ?copy_response?" } while {[llength $arguments]} { set arguments [::lassign $arguments a] if {$a == "-forcequote"} { set force_quote_vars 1 } elseif {![array exists response]} { upvar $a response } else { upvar $a filtered_response array set filtered_response {} } } if {![array exists response]} { error "error calling validate, usage: validate ?-forcequote? response ?copy_response?" } # we now go ahead validating the response variables set form_valid true set vars_to_validate [dict get $form_list $form_name vars] if {[catch { require_response_vars $form_name response } er eopts]} { #puts "$er $eopts" dict set form_list $form_name form_validation FB_MISSING_VARS return false } # field validation dict with form_list $form_name { set form_validation FB_OK } set form_d [dict get $form_definitions $form_name] #puts "form_d: $form_d" array unset response_a dict for {var variable_d} $form_d { dict set variable_d var $response($var) if {[validate_variable_representation variable_d] == 0} { dict set form_list $form_name form_validation FB_VALIDATION_ERROR set form_valid false } else { # in case it was constrained we write the value back # into the response array if {[dict get $variable_d constrain]} { set response_a($var) [dict get $variable_d var] } else { set response_a($var) $response($var) } if {[dict get $variable_d force_quote] || $force_quote_vars} { set response_a($var) [$string_quoting [dict get $variable_d var]] } } dict set form_definitions $form_name $var $variable_d #puts "validated $var -> $variable_d" } # if 'validate' has been called with a filtered_response array # we clean it up and proceed copying the variable values into it if {[array exists filtered_response]} { array unset filtered_response array set filtered_response [array get response_a] } else { array set response [array get response_a] } return $form_valid } # -- response # # proc response {form_name {resp_a response}} { upvar $resp_a response variable form_definitions dict for {var_name var_d} [dict get $form_definitions $form_name] { catch {unset var} catch {unset default} dict with var_d { if {[info exists var]} { set response($var_name) $var } elseif {[info exists default]} { set response($var_name) $default } } } } # -- reset # # proc reset {form_name} { variable form_definitions variable form_list dict set form_list $form_name form_validation FB_OK dict for {var_name var_d} [dict get $form_definitions $form_name] { catch {dict unset var_d $var_name var} } } # -- destroy # # this method is designed to be called # by a 'trace unset' event on the variable # keeping the form description object. # proc destroy {form_name args} { variable form_definitions variable form_list dict unset form_definitions $form_name dict unset form_list $form_name namespace delete ::FormBroker::${form_name} #puts "destroy of $form_name finished" } # -- create # # creates a form object starting from a list of element descriptors # # the procedure accept a list of single descriptors, being each # descriptor a sub-list itself # # - field_name # - type (string, integer, unsigned, email, base64) # - a list of the following keywords and related values # # - bounds # - bounds [low high] # - check_routine [validation routine] # - length [max length] # proc create {args} { variable form_definitions variable form_list variable form_count variable string_quoting set form_name "form${form_count}" incr form_count catch { namespace delete $form_name } namespace eval $form_name { foreach cmd { validate failing \ form_definition \ result validate_var \ destroy validation_error \ response reset } { lappend cmdmap $cmd [list [namespace parent] $cmd [namespace tail [namespace current]]] } namespace ensemble create -map [dict create {*}$cmdmap] unset cmdmap unset cmd } dict set form_definitions $form_name [dict create] dict set form_list $form_name [dict create vars {} \ form_validation FB_OK \ failing {} \ default "" \ quoting $string_quoting] while {[llength $args]} { set args [::lassign $args e] if {$e == "-quoting"} { dict with form_list $form_name { set args [::lassign $args quoting] if {[uplevel [list info proc $quoting]] == ""} { error [list RIVET INVALID_QUOTING_PROC \ "Non existing quoting proc '$quoting'"] } set string_quoting $quoting } continue } # each variable (field) definition must start with the # variable name and variable type. Every other variable # specification argument can be listed in arbitrary order # with the only constraint that argument values must follow # an argument name. If an argument is specified multiple times # the last definition overrides the former ones set e [::lassign $e field_name field_type] # the 'vars' dictionary field stores the # order of form fields in which they are processed # (in general this order would be destroyed by the Tcl's hash # tables) dict with form_list $form_name {::lappend vars $field_name} # this test would handle the case of the most simple possible # variable definition (just the variable name) if {$field_type == ""} { set field_type string } dict set form_definitions $form_name $field_name \ [list type $field_type \ bounds 0 \ constrain 0 \ validator [namespace current]::validate_string \ force_quote 0 \ nonempty 0 \ field_validation FB_OK] dict with form_definitions $form_name $field_name { switch $field_type { integer { set validator [namespace current]::validate_integer } unsigned { set validator [namespace current]::validate_unsigned } email { set validator [namespace current]::validate_email } boolean { set validator [namespace current]::validate_boolean } string - default { set validator [namespace current]::validate_string } } # while {[llength $e] > 0} { set e [::lassign $e field_spec] switch $field_spec { check_routine - validator { set e [::lassign $e validator] } maxlength - bounds { set e [::lassign $e bounds] bounds_consistency $field_type bounds } default { set e [::lassign $e default] # we must not assume the variable 'default' # exists in the dictionary because we # set it only in this code branch dict set form_definitions $form_name $field_name default $default } nonempty { # this flag forces the formbroker to # signal empty strings as form data errors set nonemtpy 1 } constrain { set constrain 1 } noconstrain { set constrain 0 } quote { set force_quote 1 } } } # let's check for possible inconsitencies between # data type and default value. For this purpose # we create a copy of the variable dictionary # representation then we call the validator on it set variable_d [dict get $form_definitions $form_name $field_name] dict set variable_d var $default if {[$validator variable_d] != "FB_OK"} { dict unset form_definitions $form_name $field_name default } } } return [namespace current]::$form_name } # -- form_exists # # check the existence of the form named 'form_name' in the form broker # database. The check is done by simply checking one of dictionaries that # keep the internal database of form definitions proc form_exists {form_command_name} { variable form_definitions return [dict exists $form_definitions [namespace tail $form_command_name]] } proc creategc {varname args} { set formv [uplevel [list set $varname [::FormBroker::create {*}$args]]] uplevel [list trace add variable $varname unset \ [list [namespace current]::destroy [namespace tail $formv]]] return $formv } namespace export * namespace ensemble create } package provide formbroker 1.0.1 rivet-3.2.1/configure.ac000664 001750 001750 00000100421 14141530732 015704 0ustar00manghimanghi000000 000000 #!/bin/sh dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run when building Rivet dnl to configure the system for the local environment. dnl dnl You need at least autoconf 2.59 dnl # #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([Rivet],[m4_esyscmd_s([cat VERSION])],[rivet-dev@tcl.apache.org]) TEA_INIT([3.9]) # we are storing here the configure command line, as recursive # invocations change the value of the shell variables $0 $* CONFIGURE_CMD="$0 $*" AC_CONFIG_AUX_DIR(tclconfig) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # AX_PREFIX_CONFIG_H is a macro taken from the autotools macro archive. # The typical configure generated 'config.h' can be renamed and # preprocessor symbols in it can be prefixed in order to avoid clashes # with Apache's config.h # # As of today (27 Sept 2008) this macro is not part of autotools and # it's in the 'm4' directory # AX_PREFIX_CONFIG_H([rivet_config.h],[rivet]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # # Init automake stuff # AC_DISABLE_STATIC AM_INIT_AUTOMAKE([foreign subdir-objects]) # establishing a landmark in the directory hierarchy as per # autotools design. This is what AC_CONFIG_SRCDIR is meant to do # I arbitrarily choose src/rivet.h as landmark, moving this file # to a different directory or deleting it implies this line has to # change AC_CONFIG_SRCDIR([src/rivet.h]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER # # For automake to be happy, we also need AC_PROG_LIBTOOL # # the LIBTOOL_DEPS macro sets up for automatic updating of the # libtool script if it becomes out of date, as per libtool docs # AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- # Unused: src/TclWeb.c #TEA_ADD_SOURCES([src/TclWebcgi.c src/TclWebapache.c src/apache_multipart_buffer.c src/apache_request.c src/mod_rivet.c src/parserPkgInit.c src/rivetChannel.c src/rivetCore.c src/rivetCrypt.c src/rivetList.c src/rivetParser.c src/rivetPkgInit.c src/rivetWWW.c win/nmakehlp.c src/testing.c]) #TEA_ADD_HEADERS([src/TclWeb.h src/apache_multipart_buffer.h src/apache_request.h src/mod_rivet.h src/rivet.h src/rivetChannel.h src/rivetParser.h]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- # removed AC_DEFINE(BUILD_rivet....) as per TEA 3.9 (Massimo Manghi 20100825) if test "${TEA_PLATFORM}" = "windows" ; then # AC_DEFINE(BUILD_rivet,1,[Define to define the BUILD_rivet define (?)]) CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" # #TEA_ADD_SOURCES([win/winFile.c]) # #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="pkgIndex.tcl" # #TEA_ADD_SOURCES([unix/unixFile.c]) # #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # # stubs are causing segmentation violations when mod_rivet is getting # loaded into apache. it would be nice if we did no stubs for this and # still did stubs for librivet and librivetparser, which seem to be OK. # #AC_DEFINE(USE_TCL_STUBS,1,[Define to link against the Tcl stub library]) #AC_DEFINE(USE_TK_STUBS) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl # file during the install process. Don't run the TCLSH_PROG through # ${CYGPATH} because it's being used directly by make. # Require that we use a tclsh shell version 8.2 or later since earlier # versions have bugs in the pkg_mkIndex routine. # Add WISH as well if this is a Tk extension. #-------------------------------------------------------------------- # We have to either find a working tclsh or be told where it is # using --with-tclsh AC_ARG_WITH(tclsh, [ --with-tclsh=FILE location of a working tclsh executable], with_tclsh=${withval}) # # allow them to override the tclsh we think we found # if test x"${with_tclsh}" != x ; then AC_MSG_CHECKING([for tclsh]) if test -f "${with_tclsh}" ; then TCLSH_PROG=${with_tclsh} AC_MSG_RESULT([manually set by --with-tclsh=$TCLSH_PROG]) else AC_MSG_ERROR([No tclsh at place specified by --with-tclsh (${with_tclsh})]) fi AC_SUBST(TCLSH_PROG) else TEA_PROG_TCLSH fi #TEA_PROG_WISH # apache base directory AC_DEFUN([APACHE],[ AC_MSG_CHECKING(for Apache base) AC_ARG_WITH( apache, [ --with-apache[=DIR] Apache server base directory],, [with_apache="/usr/local/apache2"] ) apache_base="${with_apache}" AC_MSG_RESULT([$apache_base]) ]) # # We have to either find apxs or be told where it is using --with-apxs # AC_DEFUN([CHECK_APXS],[ AC_MSG_CHECKING(for Apache apxs) AC_ARG_WITH( apxs, [ --with-apxs=FILE location of Apache apxs tool], [if test -x "${with_apxs}" ; then apxs_found="${with_apxs}" AC_MSG_RESULT([$apxs_found]) fi] , [ APXS_NAMES=apxs for apxs_file in ${APXS_NAMES}; do for apxs_path in bin sbin; do if test -x "${apache_base}"/"${apxs_path}"/"${apxs_file}"; then apxs_found="${apache_base}"/"${apxs_path}"/"${apxs_file}" break 2 fi done done if test x"$apxs_found" = x; then AC_PATH_PROGS(with_apxs, apxs) if test "${with_apxs+set}" = set ; then apxs_found="${with_apxs}" fi fi if test x"${apxs_found}" = x; then AC_MSG_ERROR([Could not find apxs. apxs must be in your PATH or you must specify the location of the apxs script using --with-apxs]) else AC_MSG_RESULT([$apxs_found]) fi ] ) if test "${apxs_found+set}" = set ; then dnl At this point we already have apr sorted out export PATH=$PATH:`dirname $apxs_found` APXS_CPPFLAGS=`${apxs_found} -q CFLAGS` AC_SUBST(APXS_CPPFLAGS) APXS_LDFLAGS=`${apxs_found} -q LDFLAGS_SHLIB` AC_SUBST(APXS_LDFLAGS) APXS_LIBS=`${apxs_found} -q LIBS_SHLIB` AC_SUBST(APXS_LIBS) APXS_INCLUDES=-I`${apxs_found} -q INCLUDEDIR` AC_SUBST(APXS_INCLUDES) APXS_CPPFLAGS_SHLIB=`${apxs_found} -q CFLAGS_SHLIB` AC_SUBST(APXS_CPPFLAGS_SHLIB) APXS_LD_SHLIB=`${apxs_found} -q LD_SHLIB` AC_SUBST(APXS_LD_SHLIB) APXS_LIBEXECDIR=`${apxs_found} -q LIBEXECDIR` AC_SUBST(APXS_LIBEXECDIR) APXS_SYSCONFDIR=`${apxs_found} -q SYSCONFDIR` AC_SUBST(APXS_SYSCONFDIR) APXS_PREFIX=`${apxs_found} -q PREFIX` AC_SUBST(APXS_PREFIX) else AC_MSG_ERROR([Could not find apxs. apxs must be in your PATH or you must specify the location of the apxs script using --with-apxs]) fi ]) AC_DEFUN([APACHE_INCLUDES],[ AC_ARG_WITH( apache_include, [ --with-apache-include[=DIR] Apache server directory], [apache_include="${with_apache_include}"] ,[apache_include="${APXS_INCLUDES}"] ) AC_SUBST(apache_include) ]) AC_DEFUN([APR_HANDLING],[ AC_MSG_CHECKING(for Apache apr) AC_ARG_WITH( apr_config, [ --with-apr-config=FILE apr portable apr-1-config path], [if test -x "${with_apr_config}"; then apr_found="${with_apr_config}" fi] , [if test -x "${apache_base}/bin/apr-1-config" ; then apr_found="${apache_base}/bin/apr-1-config" elif test -x "${apache_base}/sbin/apr-1-config" ; then apr_found="${apache_base}/sbin/apr-1-config" elif test "${apache_base+set}" = set; then AC_PATH_PROGS(with_apr_config, apr-1-config) if test "${with_apr_config+set}" = set ; then apr_found="${with_apr_config}" fi else AC_MSG_ERROR( Specify the apr-1-config path using --with-apr-config, 1) fi] ) if test "${apr_found+set}" = set ; then AC_MSG_RESULT([$apr_found]) dnl At this point we already have apr sorted out dnl It actually calls another script, so the PATH needs to be set. export PATH=$PATH:`dirname ${apr_found}` APR_CPPFLAGS=`${apr_found} --cppflags` AC_SUBST(APR_CPPFLAGS) APR_INCLUDES=`${apr_found} --includes` AC_SUBST(APR_INCLUDES) APR_LDLFAGS=`${apr_found} --link-libtool --libs` AC_SUBST(APR_LDFLAGS) else AC_MSG_ERROR([Could not find apr-1-config. apr-1-config must be in your PATH or you must specify the location of the apr script using --with-apr-config]) fi ]) # -- APU_HANDLING # # calling apu-1-config to determine where apr-utils includes # and library are # AC_DEFUN([APU_HANDLING],[ AC_MSG_CHECKING(for Apache apu) AC_ARG_WITH( apu_config, [ --with-apu-config=FILE apu portable apu-1-config path], [if "${with_apu_config}" --version; then apu_found="${with_apu_config}" fi] , [if apu-1-config --version; then apu_found=apu-1-config elif test -x "${apache_base}/bin/apu-1-config" ; then apu_found="${apache_base}/bin/apu-1-config" elif test -x "${apache_base}/sbin/apu-1-config" ; then apu_found="${apache_base}/sbin/apu-1-config" elif test "${apache_base+set}" = set; then AC_PATH_PROGS(with_apu_config, apu-1-config) if test "${with_apu_config+set}" = set ; then apu_found="${with_apu_config}" fi else AC_MSG_ERROR( Specify the apu-1-config path or program name using --with-apu-config, 1) fi] ) if test "${apu_found+set}" = set ; then AC_MSG_RESULT([$apu_found_]) dnl At this point we already have apu sorted out dnl It actually calls another script, so the PATH needs to be set. export PATH=$PATH:`dirname ${apu_found}` APU_INCLUDES=`${apu_found} --includes` AC_SUBST(APU_INCLUDES) APU_LDLFAGS=`${apu_found} --link-libtool --libs` AC_SUBST(APU_LDFLAGS) else AC_MSG_ERROR([Could not find apu-1-config. apu-1-config must be in your PATH or you must specify the location of the apu script using --with-apu-config]) fi ]) #-------------------------------------------------------------------- # 6-Dec-2011: Introducing new ::rivet namespace. Some components # (namely RivetTcl, providing Tcl level initialization) are required # within mod_rivet.c. Unfortunalely Tcl < 8.5.10 shared # libs exporting names could clash with Apache's binary own names. # Hence we have to make sure we are running a Tcl compatible version. # (See Tcl bug #3216070). # # Effect: If you're running Tcl < 8.5.10 we refuse to build Rivet... AX_COMPARE_VERSION([$TCL_VERSION$TCL_PATCH_LEVEL],[lt],[8.5.10],[ AC_MSG_ERROR([Rivet 2.1 requires Tcl > 8.5.10 (current is $TCL_VERSION$TCL_PATCH_LEVEL)]) ] , [ AC_MSG_NOTICE([we are building Rivet with Tcl $TCL_VERSION$TCL_PATCH_LEVEL]) ]) print_fileevent_msg="0" AX_COMPARE_VERSION([$TCL_VERSION$TCL_PATCH_LEVEL],[lt],[8.5.15],[ print_fileevent_msg="1" ] , ) AX_COMPARE_VERSION([$TCL_VERSION],[eq],[8.6],[ if test "$TCL_PATCH_LEVEL" = ".0" ; then print_fileevent_msg="1" fi ] , ) # MOD_RIVET_CORE # # Determining the path to the mod_rivet.* source files # AC_DEFUN([MOD_RIVET_CORE],[ AC_ARG_WITH( rivet_core, [ --with-rivet-core[=path] mod_rivet core directory],, [with_rivet_core="mod_rivet_ng"] ) AC_MSG_CHECKING([mod_rivet core]) #if [[ -d "src/${with_rivet_core}" ]]; then # rivet_core=$(pwd)/src/${with_rivet_core} #else # rivet_core=${with_rivet_core} #fi rivet_core=${with_rivet_core} # by default we search the channel and core commands # implementation in the same directory. This can # be superseded by other macros default_rivet_commands=${rivet_core} default_rivet_channel=${rivet_core} #AC_CONFIG_FILES([src/${rivet_core}/Makefile]) AC_SUBST(rivet_core) AC_MSG_RESULT([$rivet_core]) ]) # AC_DEFUN([HANDLE_TCL_PACKAGE_PATH],[ # shamelessly stolen from TEA_LOAD_TCLCONFIG AC_MSG_CHECKING([Debian TCL_PACKAGE_PATH workaround]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # If we have multiple paths, pull the first one, add end slash if needed res=`echo ${TCL_PACKAGE_PATH} | \ grep '[[^\]] ' | \ sed -e 's/\([[^\]]\)\( \)\(.*\)$/\1/' -e 's/\([[^\/]]\)$/\1\//' ` if test x"${res}" != x; then TCL_PACKAGE_PATH=${res} AC_SUBST(TCL_PACKAGE_PATH) fi ]) AC_DEFUN([GET_RIVET_BASE], [ RIVET_BASE_INCLUDE=`pwd`/src AC_SUBST(RIVET_BASE_INCLUDE) RIVET_SOURCE_BASE=`pwd`/src AC_SUBST(RIVET_SOURCE_BASE) ]) # APACHE_REQUEST # # Choosing where is located the code for handling Apache request data (like # form data etc). Default: 'request' AC_DEFUN([APACHE_REQUEST],[ AC_ARG_WITH( apache_request, [ --with-apache-request=DIR path to rivet HTML form and urlencoded data handler],, [with_apache_request="request"] ) AC_MSG_CHECKING([code for HTML form and urlencoded data handling]) apache_request=${with_apache_request} AC_SUBST(apache_request) AC_MSG_RESULT([$apache_request]) ]) # RIVET_CORE_CMDS # # selecting non default directory for Rivet code commands core # AC_DEFUN([RIVET_CORE_CMDS],[ AC_ARG_WITH( rivet_commands, [ --with-rivet-commands[=dir] path to Rivet core commands code],, [with_rivet_commands=$default_rivet_commands] ) AC_MSG_CHECKING([for Rivet core commands code]) rivet_commands=${with_rivet_commands} AC_SUBST(rivet_commands) AC_MSG_RESULT([$rivet_commands]) ]) # RIVET_CHANNEL # # selecting the Rivet channel code directory AC_DEFUN([RIVET_CHANNEL],[ AC_ARG_WITH( rivet_channel, [ --with-rivet-channel=DIR Rivet channel code path ],, [with_rivet_channel=$default_rivet_channel] ) AC_MSG_CHECKING([for Rivet channel code path]) rivet_channel=${with_rivet_channel} AC_SUBST(rivet_channel) AC_MSG_RESULT([$rivet_channel]) ]) # RIVET_TCL_LIB # # AC_DEFUN([RIVET_TCL_LIB],[ AC_ARG_WITH( rivet_target_dir, [ --with-rivet-target-dir=DIR Rivet tcl and binary libraries target dir ],, with_rivet_target_dir="${apache_base}/lib/rivet${PACKAGE_VERSION}" ) AC_MSG_CHECKING([for Rivet libraries target]) RIVET_TCL_TARGET=${with_rivet_target_dir} AC_SUBST(RIVET_TCL_TARGET) AC_MSG_RESULT([$with_rivet_target_dir]) ]) # DISPLAY_RIVET_VERSION # # --enable-version-display=[yes|no] (default: no) # switches on version number display in Apache's signature. # AC_DEFUN([DISPLAY_RIVET_VERSION],[ AC_ARG_ENABLE( version_display, [ --enable-version-display Display Rivet version in Apache signature], [ signature_version_display=$enable_version_display ], [ signature_version_display="no" ] ) AC_MSG_CHECKING([whether rivet version is printed in Apache signature]) if test "$signature_version_display" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(DISPLAY_VERSION,1,[Display Rivet version in Apache signature]) else AC_MSG_RESULT([no, Rivet version will be hidden]) AC_DEFINE(DISPLAY_VERSION,0,[Display Rivet version in Apache signature]) fi ]) # UPLOAD_DIRECTORY # # Adds '--with-upload-dir=DIR' to configure's arguments # # let's make configuration of the upload directory more flexible for windows builds # (in case someone steps forward and takes up the Windows port) # The upload directory can be changed in the configuration, but we give the # user/packager the chance to set a default at compile time. # Default: /tmp AC_DEFUN([UPLOAD_DIRECTORY],[ AC_ARG_WITH( upload_dir, [ --with-upload-dir=DIR Default directory for uploads],, with_upload_dir="/tmp" ) AC_MSG_CHECKING(where Rivet will save uploads) RIVET_UPLOAD_DIR=${with_upload_dir} AC_SUBST(RIVET_UPLOAD_DIR) AC_MSG_RESULT([$with_upload_dir]) ]) # HONOR_HEAD_REQUESTS (--enable-head-requests) # Rivet answers to HEAD requests with a standard response to avoid the whole workload # of generating the content of a page with to the sole purpose of returning the HTTP # headers.To test the configuration or scripts that manipulate the headers it # can be useful to let Rivet honor a HEAD request as if the whole content was # generated so that the real headers are returned (this can be set in configuration # by adding "RivetServerConf HonorHeaderOnlyRequests yes" to the server configuration) # # Default: no AC_DEFUN([HONOR_HEAD_REQUESTS],[ AC_ARG_ENABLE( head_requests, [ --enable-head-requests Returns real headers in response to a HEAD request], [ honor_head_requests=$enable_head_requests ], [ honor_head_requests="no"] ) AC_MSG_CHECKING([if Rivet has to honor HEAD requests]) if test "$honor_head_requests" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(HEAD_REQUESTS,1,[Honor HEAD requests]) else AC_MSG_RESULT([no, Rivet will shunt HEAD requests]) AC_DEFINE(HEAD_REQUESTS,0,[Honor HEAD requests]) fi ]) # SINGLE_WORKER_TCL_THREAD # # This options is used by the worker MPM bridge for debugging. # When enabled rivet_worker_bridge will create a single Tcl interp thread instead # of the a whole pool of them # # Defautl: no AC_DEFUN([SINGLE_WORKER_TCL_THREAD],[ AC_ARG_ENABLE( single_thread, [ --enable-single-thread forces the worker brigde to create a single thread (debug)], [ single_thread=$enable_single_thread ], [ single_thread="no"] ) AC_MSG_CHECKING([if the worker MPM bridge will run in single thread mode]) if test "$single_thread" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(MPM_SINGLE_TCL_THREAD,1,[yes, MPM worker single thread]) else AC_MSG_RESULT([no, maximal number of Tcl threads]) fi ]) # -- SERIALIZE_HTTP_REQUEST # # The macro defines the symbol SERIALIZE_HTTP_REQUESTS and cooperates # with macro HTTP_REQUESTS_PROC. This option is useful only # for debugging (avoids threads concurrency). See the code of the # worker bridge to see the preprocessor macros cooperating to # attain this feature # # Default: no AC_DEFUN([HTTP_REQUESTS_MUTEX],[ AC_ARG_ENABLE( requests_serialization, [ --enable-requests-serialization Forces HTTP requests serialization among threads(debug)], [ requests_serialization=$enable_requests_serialization ], [ requests_serialization="no" ] ) AC_MSG_CHECKING([if we want the worker bridge to serialize HTTP requests]) if test "$requests_serialization" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(SERIALIZE_HTTP_REQUESTS,1,[requests will be serialized]) else AC_MSG_RESULT([no, HTTP requests will not be serialized]) fi ]) # -- RIVET_DEBUG_BUILD # # Defining a symbol for conditional inclusion of code for debugging purposes # # Default: no # AC_DEFUN([BUILD_DEBUG_CODE],[ AC_ARG_ENABLE( rivet_debug_build, [ --enable-rivet-debug-build Includes optional debugging code], [ rivet_debug_build=$enable_rivet_debug_build ], [ rivet_debug_build="no" ] ) AC_MSG_CHECKING([if we are building mod_rivet for debugging]) if test "$rivet_debug_build" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(DEBUG_BUILD,1,[we are building mod_rivet with optional code]) else AC_MSG_RESULT([no, ordinary build]) fi ]) # RIVET_COMMANDS_EXPORT (--enable-rivet-commands-export). # Enable export of commands in Rivet's namespace. Definining this symbols # sets the boolean configuration variable rivet_commands_export # Default: yes AC_DEFUN([RIVET_COMMANDS_EXPORT],[ AC_ARG_ENABLE( rivet-commands-export, [ --disable-rivet-commands-export to prevent export from ::rivet namespace], [ rivet_commands_export=$enable_rivet_commands_export ], [ rivet_commands_export="yes"] ) AC_MSG_CHECKING([if the commands in ::rivet namespace will be exported]) if test "$rivet_commands_export" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(NAMESPACE_EXPORT,1,[commands will be exported]) else AC_MSG_RESULT([no]) AC_DEFINE(NAMESPACE_EXPORT,0,[commands will not be exported]) fi ]) # IMPORT_RIVET_COMMANDS (--enable-import-rivet-commands). # For compatibility the module can be compiled and installed forcing rivet # to import commands from ::rivet into the global namespace. # Default: no AC_DEFUN([IMPORT_RIVET_COMMANDS],[ AC_ARG_ENABLE( import-rivet-commands, [ --enable-import-rivet-commands requires explicit namespace import], [ import_rivet_commands=$enable_import_rivet_commands], [ import_rivet_commands="no"] ) AC_MSG_CHECKING([if ::rivet namespace will be automatically imported for compatibility]) if test "$import_rivet_commands" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(NAMESPACE_IMPORT,1,[commands will be imported into the global namespace]) else AC_MSG_RESULT([no]) AC_DEFINE(NAMESPACE_IMPORT,0,[good, no automatic import will be done]) fi ]) # SEPARATE_VIRTUAL_INTERPS (--enable-virtual-interps-separation) # Virtual hosts get their own interpreter and configuration. Different # applications running on different virtual hosts don't mix up variables # and namespaces, avoiding conflicts. # Default: no AC_DEFUN([VIRTUAL_INTERPS_SEPARATION],[ AC_ARG_ENABLE( virtual-interps-separation, [ --enable-virtual-interps-separation to turn on virtual host separation], [ separate_virtual_interps=$enable_virtual_interps_separation ], [ separate_virtual_interps="no"] ) AC_MSG_CHECKING([whether Rivet will create an interpreter for each virtual host]) if test "$separate_virtual_interps" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(SEPARATE_VIRTUAL_INTERPS,1,[virtual hosts will have their own interp]) else AC_MSG_RESULT([no]) AC_DEFINE(SEPARATE_VIRTUAL_INTERPS,0,[one interpreter per child]) fi ]) # POST_MAX_SIZE (--with-post-max) # Maximum size of data posted by a form # Default: 0=unlimited AC_DEFUN([POST_MAX_SIZE],[ AC_ARG_WITH( post_max, [ --with-post-max=BYTES Maximum size of data to be sent with a POST],, with_post_max=0 ) AC_MSG_CHECKING([maximum size of a POST]) MAX_POST=${with_post_max} AC_SUBST(MAX_POST) if test $with_post_max = 0; then AC_MSG_RESULT([unlimited size]) else AC_MSG_RESULT([$with_post_max]) fi ]) # UPLOAD_TO_VAR (--enable-upload-var) # Enables upload of files into Tcl variables # Default: 1=enabled AC_DEFUN([UPLOAD_TO_VAR],[ AC_ARG_ENABLE( upload-var, [ --disable-upload-var to disable automatic upload to variables ], [ upload_var=$enable_upload_var ], [ upload_var="yes"] ) AC_MSG_CHECKING([whether files are uploaded to Tcl variables]) if test "$upload_var" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(UPLOAD_FILES_TO_VAR,1,[Files are uploaded to Tcl variables]) else AC_MSG_RESULT([no]) AC_DEFINE(UPLOAD_FILES_TO_VAR,0,[uploads go to files]) fi ]) #APACHE_VERSION MOD_RIVET_CORE GET_RIVET_BASE APACHE CHECK_APXS APACHE_INCLUDES APR_HANDLING APU_HANDLING RIVET_TCL_LIB DISPLAY_RIVET_VERSION UPLOAD_DIRECTORY HONOR_HEAD_REQUESTS VIRTUAL_INTERPS_SEPARATION POST_MAX_SIZE UPLOAD_TO_VAR IMPORT_RIVET_COMMANDS APACHE_REQUEST RIVET_CORE_CMDS RIVET_CHANNEL SINGLE_WORKER_TCL_THREAD HTTP_REQUESTS_MUTEX BUILD_DEBUG_CODE AC_HEADER_STDBOOL # Let's separate the point version from the major and minor version # to build a Rivet version to be substituted as basic version for # package Rivet, central initialization of the Tcl environment VERSION=${PACKAGE_VERSION} AX_SPLIT_VERSION AC_DEFINE_UNQUOTED(INIT_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}",[Rivet Tcl package version]) AC_MSG_NOTICE([Rivet package version is ${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}]) AC_SUBST(INIT_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}") AC_SUBST(RIVETLIB_PACKAGE,"rivetlib",[rivetlib package name]) AC_SUBST(RIVETLIB_PACKAGE_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}") if test $import_rivet_commands = "yes"; then AC_MSG_NOTICE([forcing Rivet to export commands from ::rivet namespace]) AC_DEFINE(NAMESPACE_EXPORT,1,[commands will be exported]) else RIVET_COMMANDS_EXPORT fi AC_C_INLINE #AC_SUBST(apache_version_dir) AC_SUBST(MOD_RIVET_INCLUDES) AC_DEFINE_UNQUOTED(RIVETLIB_DESTDIR,"${RIVET_TCL_TARGET}",[The path to the rivet tcl library]) AC_DEFINE_UNQUOTED(NAMEOFEXECUTABLE,"${TCLSH_PROG}",[The path to a working tclsh executable]) AC_DEFINE_UNQUOTED(UPLOAD_DIR,"${RIVET_UPLOAD_DIR}",[Path to the disk directory where uploads are saved]) AC_DEFINE_UNQUOTED(MAX_POST,[$MAX_POST],[Max size of data in POST operations]) AC_DEFINE_UNQUOTED(SEPARATE_CHANNELS,0,[Separate Channels for virtual hosts]) AC_DEFINE_UNQUOTED(CONFIGURE_CMD,"${CONFIGURE_CMD}",[configure command string]) AC_DEFINE_UNQUOTED(RIVET_CORE,"${rivet_core}",[mod_rivet core]) # We need to use the package path for the installation procedure. On #Debian linux TCL_PACKAGE_PATH may have more than one path in the #TCL_PACKAGE_PATH variable, so we have to handle this HANDLE_TCL_PACKAGE_PATH AC_SUBST(TCL_PACKAGE_PATH) # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting the AC variables in. Include these here. #-------------------------------------------------------------------- AC_CONFIG_FILES([Makefile src/Makefile rivet/init.tcl doc/Makefile doc/convert_examples.tcl doc/rivet.xml]) #case $apache_version_dir in # apache-1) AC_CONFIG_FILES([Makefile src/Makefile src/apache-1/Makefile doc/Makefile]) ;; # apache-2) AC_CONFIG_FILES([Makefile src/Makefile src/apache-2/Makefile doc/Makefile]) ;; #esac AC_OUTPUT if test "$print_fileevent_msg" = "1"; then AC_MSG_NOTICE([========================================================================]) AC_MSG_NOTICE([ WARNING!]) AC_MSG_NOTICE([========================================================================]) AC_MSG_NOTICE([The Tcl notifier (and consequently the event loop) does not work with]) AC_MSG_NOTICE([Rivet running Tcl $TCL_VERSION$TCL_PATCH_LEVEL and the 'prefork' MPM of Apache.]) AC_MSG_NOTICE([In order to have asynchronous I/O working the required versions are:]) AC_MSG_NOTICE([ - threaded builds: Tcl >= 8.5.15 (8.5 version) or Tcl >= 8.6.1]) AC_MSG_NOTICE([ - any non-threaded build of Tcl >= 8.5.10]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Nonetheless Rivet scripts work with Tcl >= 8.5.10 provided]) AC_MSG_NOTICE([you do not have to rely on the event loop to do I/O (e.g. you]) AC_MSG_NOTICE([cannot use the 'fileevent' command to set up callbacks)]) AC_MSG_NOTICE([see https://issues.apache.org/bugzilla/show_bug.cgi?id=55153]) AC_MSG_NOTICE([========================================================================]) fi rivet-3.2.1/rivet/packages/form/form.tcl000664 001750 001750 00000033652 14141530732 020752 0ustar00manghimanghi000000 000000 # form.tcl -- generate forms automatically. # Copyright 2002-2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package require Itcl package provide form 1.0 # # Rivet form class # ::itcl::class form { constructor {args} { # first of all we make sure DefaultValues is an array array set DefaultValues {} # set the form method to be a post and the action to be # a refetching of the current page set arguments(method) post set arguments(action) [::rivet::env DOCUMENT_URI] # use $this for the type for form-global stuff like form arguments import_data form $this arguments $args if {[info exists arguments(defaults)]} { # make the public variable contain the name of the array # we are sucking default values out of set defaults $arguments(defaults) upvar 1 $arguments(defaults) callerDefaults array set DefaultValues [array get callerDefaults] unset arguments(defaults) } } destructor { } method destroy {} { ::itcl::delete object $this } # # import_data -- given a field type, field name, name of an array, and a # list of key-value pairs, prepend any default key-value pairs, # set a default value if one exists, then store the resulting # key-value pairs in the named array # protected method import_data {type name arrayName list} { upvar 1 $arrayName data # # If there are elements in the defaultArgs array for the # specified type, combine them with the list of key-value # pairs, putting the DefaultArgs values first so the # key-value pairs from list can possibly override them. # if {[info exists DefaultArgs($type)]} { set list [concat $DefaultArgs($type) $list] } # # if there is a default value for the name stored in the # DefaultValues array in this class, set the value # element of the array the caller named to contain that # value # if {[info exists DefaultValues($name)]} { set data(value) $DefaultValues($name) } # # if we don't have an even number of key-value pairs, # that just ain't right # if {[llength $list] % 2} { return -code error "Unmatched key-value pairs" } # # for each key-value pair in the list, strip the first # dash character from the key part and map it to lower # case, then use that as the key for the passed-in # array and store the corresonding value in there # # we also prep and return the list of key-value pairs, normalized # with the lowercase thing # set return "" foreach {var val} $list { set var [string range [string tolower $var] 1 end] set data($var) $val if {($var == "values") || ($var == "labels")} { continue } lappend return -$var $val } return $return } # # argstring - given an array name, construct a string of the # style key1="data1" key2="data2" etc for each key value pair in the # array # protected method argstring {arrayName} { upvar 1 $arrayName data set string "" foreach arg [lsort [array names data]] { append string " $arg=\"$data($arg)\"" } return $string } # # default_value -- if only a name is given, returns a default value # for that name if one exists else an empty list. # # if a name and a value are given, the default value is set to that # name (and the new default value is returned). # method default_value {name {newValue ""}} { if {[::rivet::lempty $newValue]} { if {![info exists DefaultValues($name)]} { return } return $DefaultValues($name) } return [set DefaultValues($name) $newValue] } # # default_args - given a type and a variable number of arguments, # if there are no arguments other than the type, return the # element of that name from the DefaultArgs array, if that element # exists, else return an empty list. # # if a name and a value are given, sets the DefaultArgs to the variable # list of arguments. # method default_args {type args} { # if only one argument was specified if {[::rivet::lempty $args]} { if {![info exists DefaultArgs($type)]} { return } return $DefaultArgs($type) } # make sure we have an even number of key-value pairs if {[llength $args] % 2} { return -code error "Unmatched key-value pairs" } # set the DefaultArgs for the specified type return [set DefaultArgs($type) $args] } # # start - generate the
with all of its arguments # method start {{args ""}} { if {![::rivet::lempty $args]} { # replicated in constructor import_data form $this arguments $args } ::rivet::html "" } # # end - generate the
# method end {} { ::rivet::html "" } # # field - emit a field of the given field type and name, including # any default key-value pairs defined for this field type and # optional key-value pairs included with the statement # method field {type name args} { # import any default key-value pairs, then any specified in this # field declaration import_data $type $name data $args switch -- $type { "radio" - "checkbox" { # if there's a label then prepare to output it. if {[info exists data(label)]} { # if there's no id defined, generate something # unique so we can reference it. if {![info exists data(id)]} { set data(id) "autogen[incr field_cnt]" } set label "" } # ...and if the is a default value for this field # and it matches the value we have for it, make # the field show up as selected (checked) if {[info exists DefaultValues($name)] && [info exists data(value)]} { # if there is no __$var variable in the defaults we are # dealing with a single value so we don't look it up # with lsearch, but we compare the 2 variable as strings, # so that spaces in the value won't be confused as a list of # multiple elements.... if {![info exists DefaultValues(__${name})]} { if {[string match $DefaultValues($name) $data(value)]} { set data(checked) "checked" } } else { if {[lsearch $DefaultValues($name) $data(value)] >= 0} { set data(checked) "checked" } } } } } # generate the field definition set string "" if {[info exists label]} { append string $label } # ...and emit it ::rivet::html $string } # # text -- emit an HTML "text" field # method text {name args} { eval field text $name $args } # # password -- emit an HTML "password" field # method password {name args} { eval field password $name $args } # # hidden -- emit an HTML "hidden" field # method hidden {name args} { eval field hidden $name $args } # # submit -- emit an HTML "submit" field # method submit {name args} { eval field submit $name $args } # # button -- emit an HTML "button" field # method button {name args} { eval field button $name $args } # # reset -- emit an HTML "reset" button # method reset {name args} { eval field reset $name $args } # # image -- emit an HTML image field # method image {name args} { eval field image $name $args } # # checkbox -- emit an HTML "checkbox" form field # method checkbox {name args} { eval field checkbox $name $args } # # radio -- emit an HTML "radiobutton" form field # method radio {name args} { eval field radio $name $args } # # color -- emit an HTML 5 "color" form field # method color {name args} { eval field color $name $args } # # date -- emit an HTML 5 "date" form field # method date {name args} { eval field date $name $args } # # datetime -- emit an HTML 5 "datetime" form field # method datetime {name args} { eval field datetime $name $args } # # datetime_local -- emit an HTML 5 "datetime-local" form field # method datetime_local {name args} { eval field datetime-local $name $args } # # email -- emit an HTML 5 "email" form field # method email {name args} { eval field email $name $args } # # file -- emit an HTML 5 "file" form field # method file {name args} { eval field file $name $args } # # month -- emit an HTML 5 "month" form field # method month {name args} { eval field month $name $args } # # number -- emit an HTML 5 "number" form field # method number {name args} { eval field number $name $args } # # range -- emit an HTML 5 "range" form field # method range {name args} { eval field range $name $args } # # search -- emit an HTML 5 "search" form field # method search {name args} { eval field search $name $args } # # tel -- emit an HTML 5 "tel" form field # method tel {name args} { eval field tel $name $args } # # time -- emit an HTML 5 "time" form field # method time {name args} { eval field time $name $args } # # url -- emit an HTML 5 "url" form field # method url {name args} { eval field url $name $args } # # week -- emit an HTML 5 "week" form field # method week {name args} { eval field week $name $args } # # radiobuttons -- # method radiobuttons {name args} { set data(values) [list] set data(labels) [list] set list [import_data radiobuttons $name data $args] if {[::rivet::lempty $data(labels)]} { set data(labels) $data(values) } foreach label $data(labels) value $data(values) { eval radio $name $list -label $label -value $value } } # # select -- generate a selector # # part of the key value pairs can include -values with a list, # and -labels with a list and it'll populate the