# HG changeset patch # User Adam Chlipala # Date 1295538040 18000 # Node ID 82b204f20026b1c365b050bd96e89cd7f6d58aea # Parent 860c245a7c4dfe37076155d74156479059ebf5e4 Patch from Vladimir Shabanov to support implicit passing of 'time' values from server to client diff -r 860c245a7c4d -r 82b204f20026 include/urweb.h --- a/include/urweb.h Tue Jan 18 13:32:48 2011 -0500 +++ b/include/urweb.h Thu Jan 20 10:40:40 2011 -0500 @@ -123,6 +123,7 @@ 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 -r 860c245a7c4d -r 82b204f20026 src/c/urweb.c --- a/src/c/urweb.c Tue Jan 18 13:32:48 2011 -0500 +++ b/src/c/urweb.c Thu Jan 20 10:40:40 2011 -0500 @@ -1773,6 +1773,10 @@ 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 -r 860c245a7c4d -r 82b204f20026 src/jscomp.sml --- a/src/jscomp.sml Tue Jan 18 13:32:48 2011 -0500 +++ b/src/jscomp.sml Thu Jan 20 10:40:40 2011 -0500 @@ -311,6 +311,7 @@ | 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 -r 860c245a7c4d -r 82b204f20026 src/settings.sml --- a/src/settings.sml Tue Jan 18 13:32:48 2011 -0500 +++ b/src/settings.sml Thu Jan 20 10:40:40 2011 -0500 @@ -219,6 +219,7 @@ ("substring", "ssub"), ("strcspn", "sspn"), ("kc", "kc"), + ("minTime", "0"), ("islower", "isLower"), ("isupper", "isUpper"),