Changeset: 0f17935bd9d9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f17935bd9d9
Added Files:
        monetdb5/modules/atoms/batxml.c
        monetdb5/modules/atoms/batxml.h
        monetdb5/modules/atoms/batxml.mal
        monetdb5/modules/atoms/batxml.sql
        monetdb5/modules/atoms/str.c
        monetdb5/modules/atoms/str.h
        monetdb5/modules/atoms/str.mal
        monetdb5/modules/atoms/streams.c
        monetdb5/modules/atoms/streams.h
        monetdb5/modules/atoms/streams.mal
        monetdb5/modules/atoms/url.c
        monetdb5/modules/atoms/url.h
        monetdb5/modules/atoms/url.mal
        monetdb5/scheduler/run_pipeline.c
        monetdb5/scheduler/run_pipeline.h
Removed Files:
        monetdb5/modules/atoms/batxml.mx
        monetdb5/modules/atoms/str.mx
        monetdb5/modules/atoms/streams.mx
        monetdb5/modules/atoms/url.mx
        monetdb5/scheduler/run_pipeline.mx
Modified Files:
        monetdb5/mal/mal_dataflow.c
        monetdb5/modules/atoms/Makefile.ag
        monetdb5/modules/atoms/mtime.mx
        monetdb5/scheduler/Makefile.ag
Branch: default
Log Message:

De-mx most of the atoms
mtime.mx needs work to align with many mal signatures as in the kernel


diffs (truncated from 2681 to 300 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -839,7 +839,6 @@ runDFLOWworker(void *t)
                } else
                        /* always execute, it does not affect memory claims */
                        fs = nxtfs;
-               assert(fs->pc > 0);
                PARDEBUG mnstr_printf(GDKstdout, "#execute pc= %d thr= %d 
claim= " LLFMT "," LLFMT " %s\n", fs->pc, task->id, fs->argclaim, fs->hotclaim, 
fs->error ? fs->error : "");
                fs->error = DFLOWstep(task, fs);
 
diff --git a/monetdb5/modules/atoms/Makefile.ag 
b/monetdb5/modules/atoms/Makefile.ag
--- a/monetdb5/modules/atoms/Makefile.ag
+++ b/monetdb5/modules/atoms/Makefile.ag
@@ -25,33 +25,24 @@ MTSAFE
 lib_atoms = {
        NOINST
        SOURCES = \
-               batxml.mx \
-               blob.c blob.h \
-               color.c color.h \
-               identifier.c identifier.h \
+               batxml.c \
+               blob.c \
+               color.c \
+               identifier.c \
                inet.c inet.h \
                mtime.mx \
-               streams.mx \
-               str.mx \
-               url.mx \
-               xml.c xml.h
+               streams.c \
+               str.c \
+               url.c \
+               xml.c
 }
 
 headers_mal = {
        HEADERS = mal
        DIR = libdir/monetdb5
        SOURCES = \
-               batxml.mx \
-               blob.mal \
-               color.mal \
-               identifier.mal \
-               inet.mal \
-               mtime.mx \
-               streams.mx \
-               str.mx \
-               url.mx \
-               xml.mal
+               mtime.mx 
 }
 
 EXTRA_DIST_DIR = Tests
-EXTRA_DIST = blob.mal color.mal identifier.mal inet.mal xml.mal xml.sql
+EXTRA_DIST = blob.mal color.mal identifier.mal inet.mal xml.mal xml.sql 
batxml.sql str.mal batxml.mal url.mal streams.mal
diff --git a/monetdb5/modules/atoms/batxml.mx b/monetdb5/modules/atoms/batxml.c
rename from monetdb5/modules/atoms/batxml.mx
rename to monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.mx
+++ b/monetdb5/modules/atoms/batxml.c
@@ -1,28 +1,24 @@
-@/
-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-2012 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f batxml
-
-@c
 /*
- * @a M.L. Kersten
- * @+ XML multiplexes
+ * 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-2012 MonetDB B.V.
+ * All Rights Reserved.
+*/
+/*
+ *  M.L. Kersten
+ *  XML multiplexes
  * SQL/XML requires a handful of instructions.
  * The collection of routines provided here are map operations
  * for the atom xml primitives.
@@ -35,148 +31,14 @@ All Rights Reserved.
  * The implementation is focussed on functionality. At a later stage
  * we may postpone string contstruction until it is really needed.
  */
-@mal
 
-command xml.xml(src:bat[:oid,:str]):bat[:oid,:xml]
-address BATXMLstr2xml
-comment "Cast the string to an xml compliant string.";
 
-command xml.str(src:bat[:oid,:xml]):bat[:oid,:str]
-address BATXMLxml2str
-comment "Cast the xml to a string.";
+#define getBATdescriptor(X1,X2,X3,X4) \
+       if ((X2 = BATdescriptor(*X1)) == NULL) {\
+               X4;\
+               throw(MAL, X3, RUNTIME_OBJECT_MISSING);\
+       }
 
-command xml.document(src:bat[:oid,:str]):bat[:oid,:xml]
-address BATXMLdocument
-comment "Parse the string as an XML document.";
-
-command xml.content(src:bat[:oid,:str]):bat[:oid,:xml]
-address BATXMLcontent
-comment "Parse the string as XML element content.";
-
-command xml.comment(val:bat[:oid,:str]):bat[:oid,:xml]
-address BATXMLcomment
-comment "Create an XML comment element.";
-
-command xml.parse(doccont:str,val:bat[:oid,:str],option:str):bat[:oid,:xml]
-address BATXMLparse
-comment "Parse the XML document or element string values.";
-
-command xml.serialize(val:bat[:oid,:xml]):bat[:oid,:str]
-address BATXMLxml2str
-comment "Serialize the XML object to a string.";
-
-command xml.text(val:bat[:oid,:xml]):bat[:oid,:str]
-address BATXMLxmltext
-comment "Serialize the XML object to a string.";
-
-command xml.xquery(val:bat[:oid,:str],expr:str):bat[:oid,:xml]
-address BATXMLxquery
-comment "Execute the XQuery against the elements.";
-
-# @-
-# todo
-# command xml.table(val:bat[:oid,:str],expr:str):bat[:oid,:xml]
-# address BATXMLquery
-# comment "Execute the XQuery against the elements";
-
-command xml.pi(target:str, val:bat[:oid,:xml]):bat[:oid,:xml]
-address BATXMLpi
-comment "Construct a processing instruction.";
-
-command xml.attribute(name:str, val:bat[:oid,:str]):bat[:oid,:xml]
-address BATXMLattribute
-comment "Construct an attribute value pair.";
-
-command xml.element(name:str, s:bat[:oid,:xml]) :bat[:oid,:xml]
-address BATXMLelementSmall
-comment "The basic building block for XML elements are namespaces, attributes 
and a sequence of XML elements. The name space and the attributes may be left 
unspecified."; 
-
-command xml.options(tag:str, option:str,left:bat[:oid,:xml]):bat[:oid,:xml]
-address BATXMLoptions
-comment "Create the components including NULL conversions.";
-
-command xml.element(name:str, ns:xml, attr:xml, 
s:bat[:oid,:xml]):bat[:oid,:xml]
-address BATXMLelement
-comment "The basic building block for XML elements are namespaces, attributes 
and a sequence of XML elements. The name space and the attributes may be left 
unspecified(=nil).";
-
-command xml.concat(left:bat[:oid,:xml],right:bat[:oid,:xml] ):bat[:oid,:xml]
-address BATXMLconcat
-comment "Concatenate the XML values.";
-
-pattern xml.forest(val:bat[:oid,:xml]...):bat[:oid,:xml]
-address BATXMLforest
-comment "Construct an element list.";
-
-command 
xml.agg(val:bat[:oid,:xml],grp:bat[:oid,:oid],e:bat[:oid,:any_1]):bat[:oid,:xml]
-address BATXMLagg3
-comment "Aggregate the XML values over groups specified.";
-
-command xml.agg(val:bat[:oid,:xml],grp:bat[:oid,:oid]):bat[:oid,:xml]
-address BATXMLagg
-comment "Aggregate the XML values over groups specified.";
-
-command xml.agg(val:bat[:oid,:xml]):xml
-address BATXMLgroup
-comment "Aggregate the XML values over groups specified.";
-
-command xml.root(val:bat[:oid,:xml], version:str, 
standalone:str):bat[:oid,:xml]
-address BATXMLroot
-comment "Contruct the root nodes.";
-
-command xml.isdocument(val:bat[:oid,:str]):bat[:oid,:bit]
-address BATXMLisdocument
-comment "Validate the string as a XML document.";
-
-module batcalc;
-command xml(src:bat[:oid,:str]):bat[:oid,:xml] address BATXMLstr2xml;
-
-@include ../../modules/kernel/kprelude.mx
-@h
-/*
- * @+ Implementation
- */
-#ifndef _BATXML_H_
-#define _BATXML_H_
-#include <gdk.h>
-#include "ctype.h"
-#include <string.h>
-#include "mal_interpreter.h"
-#include "mal_function.h"
-#include "xml.h"
-
-
-#ifdef WIN32
-#ifndef LIBATOMS
-#define batxml_export extern __declspec(dllimport)
-#else
-#define batxml_export extern __declspec(dllexport)
-#endif
-#else
-#define batxml_export extern
-#endif
-
-batxml_export str BATXMLxml2str(int *ret, int *bid);
-batxml_export str BATXMLxmltext(int *ret, int *bid);
-batxml_export str BATXMLstr2xml(int *x, int *s);
-batxml_export str BATXMLdocument(int *x, int *s);
-batxml_export str BATXMLcontent(int *x, int *s);
-batxml_export str BATXMLisdocument(int *x, int *s);
-batxml_export str BATXMLelementSmall(int *x, str *name, int *s);
-batxml_export str BATXMLoptions(int *x, str *name, str *options, int *s);
-batxml_export str BATXMLcomment(int *x, int *s);
-batxml_export str BATXMLparse(int *x, str *doccont, int *s, str *option);
-batxml_export str BATXMLxquery(int *x, int *s, str *expr);
-batxml_export str BATXMLpi(int *x, str *tgt, int *s);
-batxml_export str BATXMLroot(int *ret, int *bid, str *version, str 
*standalone);
-batxml_export str BATXMLattribute(int *ret, str *name, int *bid);
-batxml_export str BATXMLelement(int *ret, str *name, xml *ns, xml *attr, int 
*bid);
-batxml_export str BATXMLconcat(int *ret, int *bid, int *rid);
-batxml_export str BATXMLforest(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
-batxml_export str BATXMLagg(int *ret, int *bid, int *grp);
-batxml_export str BATXMLagg3(int *ret, int *bid, int *grp, int *e);
-batxml_export str BATXMLgroup(xml *ret, int *bid);
-#endif /* _BATXML_H_ */
-@c
 #include "monetdb_config.h"
 #include "batxml.h"
 
@@ -340,7 +202,6 @@ BATXMLxmltext(int *ret, int *bid)
 }
 
 /*
- * @-
  * The core of the activity is str2xml, where the actual strings
  * are constructed.
  * To avoid repetitive copying we make sure that the garbage
@@ -349,7 +210,6 @@ BATXMLxmltext(int *ret, int *bid)
  * reused, the complete structure of the xml document(s) are available.
  * We merely have to collect the pieces.
  * [FOR LATER, FIRST GO FOR THE EASY IMPLEMENTATION]
- * @-
  * XML values are represented by strings already.
  */
 str
@@ -580,7 +440,6 @@ BATXMLisdocument(int *ret, int *bid)
 }
 
 /*
- * @-
  * The standard supports specific mappings for
  * NULL values,i.e. {null,absent,empty,nil,niloncontent)
  * in the context of an element and forest construction.
@@ -1225,9 +1084,9 @@ BATXMLagg3(int *ret, int *bid, int *grp,
 
        if ( buf == NULL)
                throw(MAL,"xml.agg", MAL_MALLOC_FAIL);
-       @:getBATdescriptor(ext,e,"xml.agg")@
-       @:getBATdescriptor(grp,g,"xml.agg",BBPunfix(e->batCacheid))@
-       
@:getBATdescriptor(bid,b,"xml.agg",BBPunfix(e->batCacheid);BBPunfix(g->batCacheid))@
+       getBATdescriptor(ext,e,"xml.agg",);
+       getBATdescriptor(grp,g,"xml.agg",BBPunfix(e->batCacheid));
+       
getBATdescriptor(bid,b,"xml.agg",(BBPunfix(e->batCacheid),BBPunfix(g->batCacheid)));
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to