Changeset: 3e8476349f67 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3e8476349f67
Modified Files:
monetdb5/modules/kernel/alarm.mal
monetdb5/modules/kernel/colcalc.h.mx
monetdb5/modules/kernel/logger.h
Branch: headless
Log Message:
Added missing files.
diffs (truncated from 358 to 300 lines):
diff --git a/monetdb5/modules/kernel/alarm.mal
b/monetdb5/modules/kernel/alarm.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/kernel/alarm.mal
@@ -0,0 +1,31 @@
+module alarm;
+
+command sleep(secs:int):void
+address ALARMsleep
+comment "sleep X secs";
+command alarm(secs:int, action:str):void
+address ALARMsetalarm
+comment "execute action in X secs";
+command timers{unsafe}() (:col[:str],:col[:str])
+address ALARMtimers
+comment "give a list of all active timers";
+command usec{unsafe}() :lng
+address ALARMusec
+comment "return cpu microseconds info";
+command time{unsafe}() :int
+address ALARMtime
+comment "time in millisecs";
+command epoch{unsafe}() :int
+address ALARMepoch
+comment "current time as unix epoch";
+command ctime{unsafe}() :str
+address ALARMctime
+comment "current time as a string";
+command prelude():void
+address ALARMprelude
+comment "Initialize alarm module";
+command epilogue():void
+address ALARMepilogue
+comment "Finalize alarm module";
+
+alarm.prelude();
diff --git a/monetdb5/modules/kernel/colcalc.h.mx
b/monetdb5/modules/kernel/colcalc.h.mx
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/kernel/colcalc.h.mx
@@ -0,0 +1,256 @@
+@f colcalc
+@h
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2011 MonetDB B.V.
+ * All Rights Reserved.
+*/
+
+/* Author(s) M.L. Kersten */
+#ifndef _COL_CALC_
+#define _COL_CALC_
+
+#include "monetdb_config.h"
+#include "gdk.h"
+#include "math.h"
+#include "mal_exception.h"
+
+#ifdef WIN32
+#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) &&
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) &&
!defined(LIBMONETDB5)
+#define colcalc_export extern __declspec(dllimport)
+#else
+#define colcalc_export extern __declspec(dllexport)
+#endif
+#else
+#define colcalc_export extern
+#endif
+
+/*
+@1: +, -, *, / basic arithmetic operator symbol
+@2: ADD, SUB, MUL, DIV basic arithmetic operator name
+@3: (bit pattern) disable/enable sorting propagation
+ 1 propagate as-is on bat,const
+ 2 propagate as-is on const,bat
+ 4 propagate reverted on bat,const (not
required/used!)
+ 8 propagate reverted on const,bat
+ 16 propagate as-is / reverted on bat,const if const
>=0 / <0
+ 32 propagate as-is / reverted on const,bat if const
>=0 / <0
+*/
+
+@= arithmeticImpl
+colcalc_export str CMDcol@1_@2_@3_@4(int *ret, int *l, int *r);
+colcalc_export str CMDcol@1cst_@2_@3_@4(int *ret, int *l, void *cst);
+colcalc_export str CMDcst@1col_@2_@3_@4(int *ret, void *cst, int *l);
+@-
+/* the normal implementation of an operator is to just stick the
+ operator between the operands */
+#define calc_abs(s) ((s) > 0 ? (s) : -(s))
+
+@= arithGrpImpl
+@:arithmeticImpl(@1,bte,bte,lng)@
+@:arithmeticImpl(@1,bte,sht,lng)@
+@:arithmeticImpl(@1,bte,int,lng)@
+@:arithmeticImpl(@1,bte,wrd,lng)@
+@:arithmeticImpl(@1,bte,lng,lng)@
+@:arithmeticImpl(@1,sht,bte,lng)@
+@:arithmeticImpl(@1,sht,sht,lng)@
+@:arithmeticImpl(@1,sht,int,lng)@
+@:arithmeticImpl(@1,sht,wrd,lng)@
+@:arithmeticImpl(@1,sht,lng,lng)@
+@:arithmeticImpl(@1,int,bte,lng)@
+@:arithmeticImpl(@1,int,sht,lng)@
+@:arithmeticImpl(@1,int,int,lng)@
+@:arithmeticImpl(@1,int,wrd,lng)@
+@:arithmeticImpl(@1,int,lng,lng)@
+@:arithmeticImpl(@1,wrd,bte,lng)@
+@:arithmeticImpl(@1,wrd,sht,lng)@
+@:arithmeticImpl(@1,wrd,int,lng)@
+@:arithmeticImpl(@1,wrd,wrd,lng)@
+@:arithmeticImpl(@1,wrd,lng,lng)@
+@:arithmeticImpl(@1,lng,bte,lng)@
+@:arithmeticImpl(@1,lng,sht,lng)@
+@:arithmeticImpl(@1,lng,int,lng)@
+@:arithmeticImpl(@1,lng,wrd,lng)@
+@:arithmeticImpl(@1,lng,lng,lng)@
+
+@:arithmeticImpl(@1,bte,bte,wrd)@
+@:arithmeticImpl(@1,bte,sht,wrd)@
+@:arithmeticImpl(@1,bte,int,wrd)@
+@:arithmeticImpl(@1,bte,wrd,wrd)@
+@:arithmeticImpl(@1,sht,bte,wrd)@
+@:arithmeticImpl(@1,sht,sht,wrd)@
+@:arithmeticImpl(@1,sht,int,wrd)@
+@:arithmeticImpl(@1,sht,wrd,wrd)@
+@:arithmeticImpl(@1,int,bte,wrd)@
+@:arithmeticImpl(@1,int,sht,wrd)@
+@:arithmeticImpl(@1,int,int,wrd)@
+@:arithmeticImpl(@1,int,wrd,wrd)@
+@:arithmeticImpl(@1,wrd,bte,wrd)@
+@:arithmeticImpl(@1,wrd,sht,wrd)@
+@:arithmeticImpl(@1,wrd,int,wrd)@
+@:arithmeticImpl(@1,wrd,wrd,wrd)@
+
+@:arithmeticImpl(@1,bte,bte,int)@
+@:arithmeticImpl(@1,bte,sht,int)@
+@:arithmeticImpl(@1,bte,int,int)@
+@:arithmeticImpl(@1,sht,bte,int)@
+@:arithmeticImpl(@1,sht,sht,int)@
+@:arithmeticImpl(@1,sht,int,int)@
+@:arithmeticImpl(@1,int,bte,int)@
+@:arithmeticImpl(@1,int,sht,int)@
+@:arithmeticImpl(@1,int,int,int)@
+
+@:arithmeticImpl(@1,bte,bte,sht)@
+@:arithmeticImpl(@1,bte,sht,sht)@
+@:arithmeticImpl(@1,sht,bte,sht)@
+@:arithmeticImpl(@1,sht,sht,sht)@
+
+@:arithmeticImpl(@1,bte,bte,bte)@
+
+@:arithmeticImpl(@1,flt,flt,dbl)@
+@:arithmeticImpl(@1,flt,dbl,dbl)@
+@:arithmeticImpl(@1,dbl,flt,dbl)@
+@:arithmeticImpl(@1,dbl,dbl,dbl)@
+
+@:arithmeticImpl(@1,flt,flt,flt)@
+
+@c
+@:arithGrpImpl(DIV)@
+@:arithGrpImpl(MUL)@
+@:arithGrpImpl(SUB)@
+@:arithGrpImpl(ADD)@
+
+/*
+ * The Modulo function doesn;t work on all types. Therefore we
+ * define here the necessary implementations separately by copying
+ * the arithmeticImpl block and removing elements not required.
+*/
+@= numeric_funcs
+colcalc_export str CMDbat@1_@2_@3_@4(int *ret, int *l, int *r);
+colcalc_export str CMDbat@1cst_@2_@3_@4(int *ret, int *l, void *cst);
+colcalc_export str CMDcst@1bat_@2_@3_@4(int *ret,void *cst, int *l);
+@c
+@:numeric_funcs(MOD,bte,bte,bte)@
+@:numeric_funcs(MOD,sht,sht,sht)@
+@:numeric_funcs(MOD,int,int,int)@
+@:numeric_funcs(MOD,wrd,wrd,wrd)@
+@:numeric_funcs(MOD,lng,lng,lng)@
+
+@:numeric_funcs(XOR,oid,oid,oid)@
+@:numeric_funcs(XOR,bte,bte,bte)@
+@:numeric_funcs(XOR,sht,sht,sht)@
+@:numeric_funcs(XOR,int,int,int)@
+@:numeric_funcs(XOR,wrd,wrd,wrd)@
+@:numeric_funcs(XOR,lng,lng,lng)@
+
+@:numeric_funcs(AND,oid,oid,oid)@
+@:numeric_funcs(AND,bte,bte,bte)@
+@:numeric_funcs(AND,sht,sht,sht)@
+@:numeric_funcs(AND,int,int,int)@
+@:numeric_funcs(AND,wrd,wrd,wrd)@
+@:numeric_funcs(AND,lng,lng,lng)@
+
+@:numeric_funcs(OR,oid,oid,oid)@
+@:numeric_funcs(OR,bte,bte,bte)@
+@:numeric_funcs(OR,sht,sht,sht)@
+@:numeric_funcs(OR,int,int,int)@
+@:numeric_funcs(OR,wrd,wrd,wrd)@
+@:numeric_funcs(OR,lng,lng,lng)@
+
+@:numeric_funcs(LSH,oid,int,oid)@
+@:numeric_funcs(LSH,bte,int,bte)@
+@:numeric_funcs(LSH,sht,int,sht)@
+@:numeric_funcs(LSH,int,int,int)@
+@:numeric_funcs(LSH,wrd,int,wrd)@
+@:numeric_funcs(LSH,lng,int,lng)@
+
+@:numeric_funcs(RSH,oid,int,oid)@
+@:numeric_funcs(RSH,bte,int,bte)@
+@:numeric_funcs(RSH,sht,int,sht)@
+@:numeric_funcs(RSH,int,int,int)@
+@:numeric_funcs(RSH,wrd,int,wrd)@
+@:numeric_funcs(RSH,lng,int,lng)@
+
+/*
+ * Unary accummulators are only called indirectly. They cannot
+ * always be defined without signature clashes, eg. -(batA,batC).
+*/
+
+colcalc_export str CMDunaryMIN(int *ret, int *bid);
+colcalc_export str CMDunaryMINMIN(int *ret, int *bid);
+colcalc_export str CMDunaryPLUSPLUS(int *ret, int *bid);
+colcalc_export str CMDunaryABS(int *ret, int *bid);
+colcalc_export str CMDunaryISNIL(int *ret, int *bid);
+
+@= baselineCode
+colcalc_export str CMD_@2_@3(int *ret, int *l, int *r);
+
+@= baselineCstCode
+colcalc_export str CMD_@2_@3_cst(int *ret, int *l, @3 *cst);
+colcalc_export str CMD_@4_cst_@3(int *ret, @3 *cst, int *l);
+
+@= operatorImpl
+ @:baselineCode(@1,@2,bit)@
+ @:baselineCode(@1,@2,bte)@
+ @:baselineCode(@1,@2,sht)@
+ @:baselineCode(@1,@2,int)@
+ @:baselineCode(@1,@2,wrd)@
+ @:baselineCode(@1,@2,lng)@
+ @:baselineCode(@1,@2,dbl)@
+ @:baselineCode(@1,@2,flt)@
+ @:baselineCode(@1,@2,oid)@
+@= operatorCstImpl
+ @:baselineCstCode(@1,@2,bit,@3)@
+ @:baselineCstCode(@1,@2,bte,@3)@
+ @:baselineCstCode(@1,@2,sht,@3)@
+ @:baselineCstCode(@1,@2,int,@3)@
+ @:baselineCstCode(@1,@2,wrd,@3)@
+ @:baselineCstCode(@1,@2,lng,@3)@
+ @:baselineCstCode(@1,@2,dbl,@3)@
+ @:baselineCstCode(@1,@2,flt,@3)@
+ @:baselineCstCode(@1,@2,oid,@3)@
+@h
+/* these 8 macros are there to be able to do prepossessor-time conditionals */
+#define OPERATOR_GE 0
+#define OPERATOR_LE 1
+#define OPERATOR_GT 2
+#define OPERATOR_LT 3
+#define OPERATOR_EQ 4
+#define OPERATOR_NEQ 5
+#define OPERATOR_AND 6
+#define OPERATOR_OR 7
+
+@:operatorImpl(>=,GE)@
+@:operatorImpl(<=,LE)@
+@:operatorImpl(>,GT)@
+@:operatorImpl(<,LT)@
+@:operatorImpl(==,EQ)@
+@:operatorImpl(!=,NEQ)@
+@:baselineCode(&&,AND,bit)@
+@:baselineCode(||,OR,bit)@
+
+@:operatorCstImpl(>=,GE,LE)@
+@:operatorCstImpl(<,LT,GT)@
+@:operatorCstImpl(>,GT,LT)@
+@:operatorCstImpl(<=,LE,GE)@
+@:operatorCstImpl(==,EQ,EQ)@
+@:operatorCstImpl(!=,NEQ,NEQ)@
+@:baselineCstCode(&&,AND,bit,AND)@
+@:baselineCstCode(||,OR,bit,OR)@
+
+colcalc_export str CMDbitbatNOT(int *ret, int *bid);
+
+#endif /* _COL_CALC_ */
diff --git a/monetdb5/modules/kernel/logger.h b/monetdb5/modules/kernel/logger.h
new file mode 100644
--- /dev/null
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list