damonc 02/01/11 17:35:19
Added: rivet/packages/dtcl dtcl.tcl pkgIndex.tcl
Log:
Adding a dtcl package to the packages directory.
This package is a small compatibility layer between mod_dtcl and Rivet.
A mod_dtcl user could conceivably convert to Rivet without changing any
code by simply putting
RivetServerConf ChildInitScript "package require Dtcl"
In their configuration. All of their mod_dtcl code should work without a
change.
Revision Changes Path
1.1 tcl-rivet/rivet/packages/dtcl/dtcl.tcl
Index: dtcl.tcl
===================================================================
###
## This package is meant as a compatibility layer between Rivet and mod_dtcl.
##
## All of the mod_dtcl commands call their Rivet equivalents and return the
## proper responses.
###
package provide Dtcl 1.0
proc hgetvars {} {
uplevel {
load_env ENVS
load_cookies COOKIES
}
}
proc hputs {args} {
set nargs [llength $args]
if {$nargs < 1 || $nargs > 2} {
return -code error {wrong # args: should be "hputs ?-error? text"}
}
if {$nargs == 2} {
set string [lindex $args 1]
} else {
set string [lindex $args 0]
}
puts $string
}
proc hflush {} {
flush stdout
}
proc dtcl_info {} {
rivet_info
}
1.1 tcl-rivet/rivet/packages/dtcl/pkgIndex.tcl
Index: pkgIndex.tcl
===================================================================
package ifneeded Dtcl 1.0 [list source [file join $dir dtcl.tcl]]