webif/var/mongoose/lib/setup

50 lines
1.0 KiB
Plaintext
Raw Normal View History

if {![exists -proc require]} {
proc require {args} {{done {}}} {
foreach file $args {
if {$file ni $done} {
uplevel source "/mod/webif/lib/$file"
lappend $done $file
}
}
}
proc httpheader {{type "text/html"} {cache 0} {extra ""}} {{done 0}} {
if {$done} return
if {!$cache} {
puts -nonewline "Content-Type: $type; no-cache\r\n"
puts -nonewline "Expires: -1\r\n"
puts -nonewline "Pragma: no-cache\r\n"
puts -nonewline "Cache-Control: no-cache\r\n"
} else {
puts "Content-Type: $type\r\n"
}
puts -nonewline $extra
puts -nonewline "\r\n"
set done 1
}
proc header {{type "text/html"} {cache 0}} {
httpheader $type $cache
uplevel source /mod/webif/html/lib/header.jim
}
proc footer {} {
uplevel source /mod/webif/html/lib/footer.jim
}
proc mheader {} {
uplevel source /mod/webif/html/m/lib/header.jim
}
proc mfooter {} {
uplevel source /mod/webif/html/m/lib/footer.jim
}
# Replace the built-in jim {file copy} command with one that is
# largefile safe.
require filecopy
}