Changeset: 623e81ff56d1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=623e81ff56d1
Modified Files:
        monetdb5/mal/Makefile.ag
        monetdb5/mal/mal_atom.mx
        monetdb5/mal/mal_box.mx
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_client.mx
        monetdb5/mal/mal_module.c
        monetdb5/mal/mal_module.h
        monetdb5/mal/mal_readline.mx
Branch: default
Log Message:

Merge with Aug2011 branch.


diffs (truncated from 1566 to 300 lines):

diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -28,11 +28,11 @@ lib_mal = {
        NOINST
        SOURCES = \
                mal.c mal.h \
-               mal_atom.mx \
+               mal_atom.c mal_atom.h \
                mal_authorize.c mal_authorize.h \
-               mal_box.mx \
+               mal_box.c mal_box.h \
                mal_builder.c mal_builder.h \
-               mal_client.mx \
+               mal_client.c mal_client.h \
                mal_debugger.mx \
                mal_errors.h \
                mal_exception.c mal_exception.h \
@@ -47,7 +47,7 @@ lib_mal = {
                mal_parser.mx \
                mal_profiler.mx \
                mal_properties.c mal_properties.h \
-               mal_readline.mx \
+               mal_readline.c mal_readline.h \
                mal_recycle.c mal_recycle.h \
                mal_resolve.mx \
                mal_sabaoth.c mal_sabaoth.h \
diff --git a/monetdb5/mal/mal_atom.mx b/monetdb5/mal/mal_atom.c
rename from monetdb5/mal/mal_atom.mx
rename to monetdb5/mal/mal_atom.c
--- a/monetdb5/mal/mal_atom.mx
+++ b/monetdb5/mal/mal_atom.c
@@ -1,23 +1,22 @@
-@/
-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://www.monetdb.org/Legal/MonetDBLicense
+/*
+ * 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://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * 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.
+ */
 
-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.
-@
-
-@c
 /*
  * @a M.L.Kersten
  * @- User Defined Types
@@ -74,23 +73,7 @@ All Rights Reserved.
  * the complex object structure and represent the components in
  * different BATs.
  */
-@h
-#ifndef _MAL_ATOM_H
-#define _MAL_ATOM_H
-
-/* #define MAL_ATOM_DEBUG  */
-
-#include "mal_instruction.h"
-mal_export void malAtomDefinition(str name,int tpe);
-mal_export int malAtomProperty(MalBlkPtr mb, InstrPtr pci);
-mal_export int malAtomArray(int tpe, int idx);
-mal_export int malAtomFixed(int size, int align, char *name);
-mal_export int malAtomSize(int size, int align, char *name);
-mal_export void showAtoms(stream *fd);  /* used in src/mal/mal_debugger.c */
-
-#endif /*  _MAL_ATOM_H*/
 /*
- * @+
  * Every MAL command introduced in an atom module should be checked
  * to detect overloading of a predefined function.
  * Subsequently, we update the BAT atom structure.
@@ -98,28 +81,9 @@ mal_export void showAtoms(stream *fd);  
  * enables additional functions with the same name to appear
  * as ordinary mal operators.
  *
- * @-
  * A few fields are set only once, at creation time.
  * They should be implemented with parameter-less functions.
  */
-@= setItem
-if (idcmp(@1, name) || pci->argc != 1)
-       return 0;
-else {
-       BATatoms[tpe].@2 = (*(@4 (*)(void))pci->fcn)();
-       setAtomName(pci);
-       return 1;
-}
-@
- * @-
-@= setItemInt
-if (idcmp(@1, name) || pci->argc != 1)
-       return 0;
-BATatoms[tpe].@2 = (*pci->fcn)();
-setAtomName(pci);
-return 1;
-@
-@c
 #include "monetdb_config.h"
 #include "mal_atom.h"
 #include "mal_namespace.h"
@@ -235,7 +199,13 @@ int malAtomProperty(MalBlkPtr mb, InstrP
                }
                break;
        case 's':
-               @:setItem("storage", storage, TYPE_int, long)@;
+               if (idcmp("storage", name) || pci->argc != 1)
+                       return 0;
+               else {
+                       BATatoms[tpe].storage = (*(long (*)(void))pci->fcn)();
+                       setAtomName(pci);
+                       return 1;
+               }
                break;
        case 't':
                if (idcmp("tostr", name) == 0 && pci->argc == 1) {
@@ -252,7 +222,13 @@ int malAtomProperty(MalBlkPtr mb, InstrP
                }
                break;
        case 'v':
-               @:setItem("varsized", varsized, TYPE_int, long)@
+               if (idcmp("varsized", name) || pci->argc != 1)
+                       return 0;
+               else {
+                       BATatoms[tpe].varsized = (*(long (*)(void))pci->fcn)();
+                       setAtomName(pci);
+                       return 1;
+               }
                break;
        case 'r':
                if (idcmp("read", name) == 0 && pci->argc == 1) {
diff --git a/monetdb5/mal/mal_atom.h b/monetdb5/mal/mal_atom.h
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/mal_atom.h
@@ -0,0 +1,33 @@
+/*
+ * 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://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * 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.
+ */
+
+#ifndef _MAL_ATOM_H
+#define _MAL_ATOM_H
+
+/* #define MAL_ATOM_DEBUG  */
+
+#include "mal_instruction.h"
+mal_export void malAtomDefinition(str name,int tpe);
+mal_export int malAtomProperty(MalBlkPtr mb, InstrPtr pci);
+mal_export int malAtomArray(int tpe, int idx);
+mal_export int malAtomFixed(int size, int align, char *name);
+mal_export int malAtomSize(int size, int align, char *name);
+mal_export void showAtoms(stream *fd);  /* used in src/mal/mal_debugger.c */
+
+#endif /*  _MAL_ATOM_H*/
diff --git a/monetdb5/mal/mal_box.mx b/monetdb5/mal/mal_box.c
rename from monetdb5/mal/mal_box.mx
rename to monetdb5/mal/mal_box.c
--- a/monetdb5/mal/mal_box.mx
+++ b/monetdb5/mal/mal_box.c
@@ -1,23 +1,22 @@
-@/
-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://www.monetdb.org/Legal/MonetDBLicense
+/*
+ * 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://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * 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.
+ */
 
-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.
-@
-
-@c
 /*
  * @a M.L. Kersten
  * @+ Boxed Variables
@@ -203,61 +202,12 @@ All Rights Reserved.
  * io.print(f);
  * @end example
  */
-@h
-#ifndef _MAL_BOX_H
-#define _MAL_BOX_H
-#include "mal_stack.h"
-#include "mal_instruction.h"
-
-/*#define DEBUG_MAL_BOX */
-
-typedef struct BOX {
-       MT_Lock lock;           /* provide exclusive access */
-       str name;
-       MalBlkPtr sym;
-       MalStkPtr val;
-       int dirty;              /* don't save if it hasn't been changed */
-} *Box, BoxRecord;
-
-mal_export Box findBox(str name);
-mal_export Box openBox(str name);
-mal_export int closeBox(str name, int flag);
-mal_export void destroyBox(str name);
-mal_export int saveBox(Box box, int flag);
-mal_export void loadBox(str nme);
-mal_export int releaseAllBox(Box box);
-
-mal_export int depositBox(Box box, str name, int type, ValPtr val);
-mal_export void insertToBox(Box box, str name, str val);
-mal_export int takeBox(Box box, str name, ValPtr val, int tpe);
-mal_export int bindBAT(Box box, str name, str location);
-mal_export int releaseBox(Box box, str name);
-mal_export int discardBox(Box box, str name);
-mal_export str getBoxName(Box box, lng i);
-mal_export str getBoxNames(int *bid);
-mal_export str toString(Box box, lng i);
-mal_export int nextBoxElement(Box box, lng *cursor, ValPtr v);
-
-#endif /* _MAL_BOX_H */
 /*
- * @-
  * The hierarchy of object spaces ends at the root of the tree.
  * This is a dummy element and should contain system-wide objects
  * only.
  */
-@= newBOX
-       obj= (Box) GDKzalloc(sizeof(BoxRecord));
-       obj->name= GDKstrdup(name);
-       obj->sym=  newMalBlk(MAXVARS,STMT_INCREMENT);
-       obj->val = newGlobalStack(MAXVARS);
-       if ( obj->val == NULL)
-               showException(MAL,"box.new", MAL_MALLOC_FAIL);
-       MT_lock_init(&obj->lock,"M5_box_lock");
-@
-@c
-/*
- * @-
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to