#!/bin/env awk -f
+function debug(t) { printf "%s\n", t >>"/dev/stderr"; }
+
function PATH( str, seg, out ) {
while ( str ) {
seg = str;
split("", _GET); split("", _POST); split("", _REF);
split("", _HEADER); split("", _COOKIE);
- if ( ENVIRON["REQUEST_METHOD"] )
+ if ( ENVIRON["REQUEST_METHOD"] ) {
_cgilite_headers();
- else
+ } else {
_cgilite_request();
+ }
}
color: #068;
word-break: break-word;
}
-a.button {
+a.button, label.button {
font-style: inherit;
text-decoration: inherit;
color: inherit;
}
h2 { font-size: 1.125em; }
-select, input, button, textarea, a.button {
+select, input, button, textarea, a.button, label.button {
display: inline-block;
color: #000; background-color: #FFF;
border: .5pt solid;
}
input[type=number] { text-align: right; padding-right: 0; }
-button, input[type=button], a.button {
+button, input[type=button], a.button, label.button {
box-shadow: .125em .125em .25em;
cursor: pointer;
}
printf '%s\n' "$out"
}
+RXLITERAL(){
+ # sed -E 's;[].*+?^${}()|\[];\\&;g'
+ local in out=''
+ [ $# -gt 0 ] && in="$*" || in="$(cat)"
+ while [ "$in" ]; do case $in in
+ [.+^\$\{\}\(\)\[\]\*\?\|\\]*)
+ out="${out}\\${in%"${in#?}"}"; in="${in#?}";
+ ;;
+ *)out="${out}${in%%[.+^\$\{\}\(\)\[\]\*\?\|\\]*}"
+ in="${in#"${in%%[.+^\$\{\}\(\)\[\]\*\?\|\\]*}"}"
+ ;;
+ esac; done
+ printf '%s\n' "$out"
+}
+
DBM() {
local file="$1" cmd="$2"
local k v key value