Update of /cvsroot/monetdb/MonetDB5/src/modules/atoms
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22590/src/modules/atoms
Modified Files:
mtime.mx
Log Message:
propagated changes of Thursday Oct 25 2007 - Monday Oct 29 2007
from the MonetDB_5-2 branch to the development trunk
Index: mtime.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/atoms/mtime.mx,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- mtime.mx 4 Oct 2007 10:37:12 -0000 1.99
+++ mtime.mx 29 Oct 2007 20:09:56 -0000 1.100
@@ -198,6 +198,12 @@
command calc.isnil(v:@1):bit
address [EMAIL PROTECTED]
comment "Nil test for @1 value";
+command calc.min(v:@1,w:@1):@1
+address [EMAIL PROTECTED]
+comment "Minimum test for @1 value";
+command calc.max(v:@1,w:@1):@1
+address [EMAIL PROTECTED]
+comment "Minimum test for @1 value";
@mal
@+ Date atom
@@ -958,6 +964,8 @@
mtime_export str MTIMEtimestamp_diff(lng *ret, timestamp *v1, timestamp *v2);
mtime_export str MTIMEtimestamp_inside_dst(bit *ret, timestamp *p, tzone *z);
mtime_export str MTIMEtimestamp_isnil(bit *retval, timestamp *val);
+mtime_export str MTIMEtimestamp_min(timestamp *ret, timestamp *v, timestamp
*w);
+mtime_export str MTIMEtimestamp_max(timestamp *ret, timestamp *v, timestamp
*w);
mtime_export str MTIMEtimestamp_EQ(bit *retval, timestamp *val1, timestamp
*val2);
mtime_export str MTIMEtimestamp_NEQ(bit *retval, timestamp *val1, timestamp
*val2);
@@ -2821,6 +2829,8 @@
}
@= compareDefAll
mtime_export str [EMAIL PROTECTED](bit *ret, @1 *v);
+mtime_export str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w);
+mtime_export str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w);
@:compareDef(EQ,==,@1)@
@:compareDef(NEQ,!=,@1)@
@:compareDef(LT,<,@1)@
@@ -2832,6 +2842,20 @@
*ret= *v == @1_nil;
return MAL_SUCCEED;
}
+str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w){
+ if( *v== @1_nil || *w== @1_nil)
+ *ret= @1_nil;
+ else
+ *ret= *v<*w ? *v: *w;
+ return MAL_SUCCEED;
+}
+str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w){
+ if( *v== @1_nil || *w== @1_nil)
+ *ret= @1_nil;
+ else
+ *ret= *v<*w ? *v: *w;
+ return MAL_SUCCEED;
+}
@:compareImpl(EQ,==,@1)@
@:compareImpl(NEQ,!=,@1)@
@:compareImpl(LT,<,@1)@
@@ -3272,6 +3296,31 @@
}
str
+MTIMEtimestamp_min(timestamp *ret, timestamp *v, timestamp *w)
+{
+ if (ts_isnil(*v) || ts_isnil(*w))
+ *ret = *ts_nilptr;
+ else
+ if( v->days < w->days || (v->days == w->days && v->msecs < w->msecs))
+ *ret= *v;
+ else
+ *ret= *w;
+ return MAL_SUCCEED;
+}
+str
+MTIMEtimestamp_max(timestamp *ret, timestamp *v, timestamp *w)
+{
+ if (ts_isnil(*v) || ts_isnil(*w))
+ *ret = *ts_nilptr;
+ else
+ if( !( v->days < w->days || (v->days == w->days && v->msecs <
w->msecs)))
+ *ret= *v;
+ else
+ *ret= *w;
+ return MAL_SUCCEED;
+}
+
+str
MTIMEtimestamp_EQ(bit *retval, timestamp *val1, timestamp *val2)
{
if (ts_isnil(*val1) || ts_isnil(*val2))
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins