diff options
author | 2011-01-20 10:40:40 -0500 | |
---|---|---|
committer | 2011-01-20 10:40:40 -0500 | |
commit | 6ec77d7dce5bbc965d0dc44545f3f15d8a9fb181 (patch) | |
tree | 8ea100260dd57a167615ea4ec995238f6158cebe | |
parent | d6272d8c20892d1ce78c15c8e444916bb150e119 (diff) |
Patch from Vladimir Shabanov to support implicit passing of 'time' values from server to client
-rw-r--r-- | include/urweb.h | 1 | ||||
-rw-r--r-- | src/c/urweb.c | 4 | ||||
-rw-r--r-- | src/jscomp.sml | 1 | ||||
-rw-r--r-- | src/settings.sml | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/include/urweb.h b/include/urweb.h index 646aa64d..30db875b 100644 --- a/include/urweb.h +++ b/include/urweb.h @@ -123,6 +123,7 @@ uw_unit uw_Basis_urlifyInt_w(uw_context, uw_Basis_int); uw_unit uw_Basis_urlifyFloat_w(uw_context, uw_Basis_float); uw_unit uw_Basis_urlifyString_w(uw_context, uw_Basis_string); uw_unit uw_Basis_urlifyBool_w(uw_context, uw_Basis_bool); +uw_unit uw_Basis_urlifyTime_w(uw_context, uw_Basis_time); uw_unit uw_Basis_urlifyChannel_w(uw_context, uw_Basis_channel); uw_Basis_unit uw_Basis_unurlifyUnit(uw_context ctx, char **s); diff --git a/src/c/urweb.c b/src/c/urweb.c index be13b9e2..382c9d77 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -1773,6 +1773,10 @@ uw_Basis_string uw_Basis_urlifyTime(uw_context ctx, uw_Basis_time t) { return uw_Basis_urlifyInt(ctx, (uw_Basis_int)t.seconds * 1000000 + t.microseconds); } +uw_unit uw_Basis_urlifyTime_w(uw_context ctx, uw_Basis_time t) { + return uw_Basis_urlifyInt_w(ctx, (uw_Basis_int)t.seconds * 1000000 + t.microseconds); +} + uw_unit uw_Basis_urlifyString_w(uw_context ctx, uw_Basis_string s) { if (s[0] == '\0') { uw_check(ctx, 1); diff --git a/src/jscomp.sml b/src/jscomp.sml index dbbb83b2..2c00e04c 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -311,6 +311,7 @@ fun process file = | TFfi ("Basis", "string") => ("uu(t[i++])", st) | TFfi ("Basis", "char") => ("uu(t[i++])", st) | TFfi ("Basis", "int") => ("parseInt(t[i++])", st) + | TFfi ("Basis", "time") => ("parseInt(t[i++])", st) | TFfi ("Basis", "float") => ("parseFloat(t[i++])", st) | TFfi ("Basis", "channel") => ("(t[i++].length > 0 ? parseInt(t[i-1]) : null)", st) diff --git a/src/settings.sml b/src/settings.sml index 5edb1fde..c5e1f929 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -219,6 +219,7 @@ val jsFuncsBase = basisM [("alert", "alert"), ("substring", "ssub"), ("strcspn", "sspn"), ("kc", "kc"), + ("minTime", "0"), ("islower", "isLower"), ("isupper", "isUpper"), |