Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14645/runtime

Modified Files:
      Tag: PF_ROX
        Makefile.ag ll_sibling.mx pf_support.mx serialize_dflt.mx 
        xrpc_client.mx xrpc_server.mx 
Added Files:
      Tag: PF_ROX
        xrpc_common.mx 
Log Message:
propagated changes of Friday 15 Feb 2008 - Monday Feb 18 2008
from the development trunk to the PF_ROX branch


--- NEW FILE: xrpc_common.mx ---
@' Copyright Notice:
@' -----------------
@'
@' The contents of this file are subject to the Pathfinder 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/PathfinderLicense-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 Pathfinder system.
@'
@' The Original Code has initially been developed by the Database &
@' Information Systems Group at the University of Konstanz, Germany and
@' is now maintained by the Database Systems Group at the Technische
@' Universitaet Muenchen, Germany.  Portions created by the University of
@' Konstanz and the Technische Universitaet Muenchen are Copyright (C)
@' 2000-2005 University of Konstanz and (C) 2005-2008 Technische
@' Universitaet Muenchen, respectively.  All Rights Reserved.
@'
@' $Id: xrpc_common.mx,v 1.1.4.2 2008/02/18 16:57:55 sjoerd Exp $
@f xrpc_common
@a Ying Zhang
@t Includes header files, definitions shared by the XRPC server and XRPC client

@h
#ifndef XRPC_COMMON_H
#define XRPC_COMMON_H

#include <mapi/mapi.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stream_socket.h>

#ifdef _WIN32   /* Windows specific */
    #include <winsock.h>
    #define snprintf _snprintf
    #ifndef __MINGW32__
        #pragma comment(lib, "ws2_32")
    #endif
#else           /* UNIX specific */
    #include <sys/select.h>
    #include <sys/types.h>      /* used by socket */
    #include <sys/socket.h>
    #include <unistd.h>
    #include <netinet/in.h> /* hton and ntoh */
    #include <arpa/inet.h>  /* dotted IP addr to and from 32-bits int */
    #include <netdb.h>      /* convert domain names into IP addr */
    #include <errno.h>
    #include <ctype.h>
#endif

#define XRPC_REQ_CALLBACK       "/xrpc"

#define MXQ_ADMIN   "http://monetdb.cwi.nl/XQuery/admin/";

#define SOAP_NS     "http://www.w3.org/2003/05/soap-envelope";
#define XDT_NS      "http://www.w3.org/2005/xpath-datatypes";
#define XS_NS       "http://www.w3.org/2001/XMLSchema";
#define XSI_NS      "http://www.w3.org/2001/XMLSchema-instance";
#define XRPC_NS     "http://monetdb.cwi.nl/XQuery";
#define XRPC_LOC    "http://monetdb.cwi.nl/XQuery/XRPC.xsd";

#define XRPC_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"  \
                    "<env:Envelope xmlns:env=\"%s\""                \
                                 " xmlns:xrpc=\"%s\""               \
                                 " xmlns:xdt=\"%s\" "               \
                                 " xmlns:xs=\"%s\""                 \
                                 " xmlns:xsi=\"%s\""                \
                                 " xsi:schemaLocation=\"%s %s\">"   \
                      "<env:Body>"                                  \
                        "<xrpc:request xrpc:module=\"%s\""          \
                                     " xrpc:location=\"%s\""        \
                                     " xrpc:method=\"%s\""          \
                                     " xrpc:arity=\"%lld\""         \
                                     " xrpc:iter-count=\"%lld\""    \
                                     " xrpc:updCall=\"%s\">"

#define XRPC_HTTP_CALL "<xrpc:call>"                                    \
                         "<xrpc:sequence>"                              \
                           "<xrpc:atomic-value xsi:type=\"xs:string\">" \
                             "%s"                                       \
                           "</xrpc:atomic-value>"                       \
                         "</xrpc:sequence>"                             \
                       "</xrpc:call>"

#define XRPC_PUT_CALL  "<xrpc:call>"                                    \
                         "<xrpc:sequence>"                              \
                           "<xrpc:atomic-value xsi:type=\"xs:string\">" \
                             "%s"                                       \
                           "</xrpc:atomic-value>"                       \
                         "</xrpc:sequence>"                             \
                         "<xrpc:sequence>"                              \
                           "<xrpc:element>%s</xrpc:element>"            \
                         "</xrpc:sequence>"                             \
                       "</xrpc:call>"

#define XRPC_FOOTER     "</xrpc:request>"   \
                      "</env:Body>"         \
                    "</env:Envelope>\n"

#endif /* XRPC_COMMON_H */


Index: pf_support.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pf_support.mx,v
retrieving revision 1.277.4.1
retrieving revision 1.277.4.2
diff -u -d -r1.277.4.1 -r1.277.4.2
--- pf_support.mx       4 Feb 2008 11:44:08 -0000       1.277.4.1
+++ pf_support.mx       18 Feb 2008 16:57:54 -0000      1.277.4.2
@@ -1782,6 +1782,66 @@
 @
 
 @mil
+CONST AXIS_ancestor           :=  0;
+CONST AXIS_ancestor_or_self   :=  1;
+CONST AXIS_child              :=  2;
+CONST AXIS_descendant         :=  3;
+CONST AXIS_descendant_or_self :=  4;
+CONST AXIS_following          :=  5;
+CONST AXIS_following_sibling  :=  6;
+CONST AXIS_parent             :=  7;
+CONST AXIS_preceding          :=  8;
+CONST AXIS_preceding_sibling  :=  9;
+CONST AXIS_self               := 10;
+CONST AXIS_attribute          := 11;
+CONST TEST_none   := 0;
+CONST TEST_kind   := 1;
+CONST TEST_ns     := 2;
+CONST TEST_loc    := 3;
+CONST TEST_nsloc  := 4;
+CONST TEST_target := 5;
+
+PROC step (int axis, int test, bat[void,oid] iter, bat[void,oid] item, 
bat[void,oid] cont, bat[void,bat] ws, int order, chr kind, str ns, str loc, str 
tgt) : bat[void,bat]
+{
+       if (isnil(order)) order := 0;
+
+       if ((axis < AXIS_ancestor) or (axis > AXIS_attribute)) {
+               ERROR ("PROC step(): Unknown axis '%d' !", axis);
+       } else if ((test < TEST_none) or (test > TEST_target)) {
+               ERROR ("PROC step(): Unknown test '%d' !", test);
[EMAIL PROTECTED] PROC_step
+       } else if (axis = [EMAIL PROTECTED]) {
+                      if (test = TEST_none  ) {
+                       return [EMAIL PROTECTED]                  (iter, item, 
cont, ws, order);
+               } else if (test = TEST_kind  ) {
+                       return [EMAIL PROTECTED]   (iter, item, cont, ws, 
order, kind);
+               } else if (test = TEST_ns    ) {
+                       return [EMAIL PROTECTED]     (iter, item, cont, ws, 
order, ns);
+               } else if (test = TEST_loc   ) {
+                       return [EMAIL PROTECTED]    (iter, item, cont, ws, 
order, loc);
+               } else if (test = TEST_nsloc ) {
+                       return [EMAIL PROTECTED]  (iter, item, cont, ws, order, 
ns, loc);
+               } else if (test = TEST_target) {
+                       return [EMAIL PROTECTED] (iter, item, cont, ws, order, 
tgt);
+               }
[EMAIL PROTECTED]
+       @:PROC_step(ancestor)@
+       @:PROC_step(ancestor_or_self)@
+       @:PROC_step(child)@
+       @:PROC_step(descendant)@
+       @:PROC_step(descendant_or_self)@
+       @:PROC_step(following)@
+       @:PROC_step(following_sibling)@
+       @:PROC_step(parent)@
+       @:PROC_step(preceding)@
+       @:PROC_step(preceding_sibling)@
+       } else if (axis = AXIS_self) {
+               ERROR ("PROC step(): AXIS_self not supported, yet!");
+       } else if (axis = AXIS_attribute) {
+               ERROR ("PROC step(): AXIS_attribute not supported, yet!");
+       }
+}
+
 @:loop_lifted_scj_step1(parent)@
 @:loop_lifted_scj_step1(ancestor)@
 @:loop_lifted_scj_step1(ancestor_or_self)@

Index: xrpc_client.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_client.mx,v
retrieving revision 1.41
retrieving revision 1.41.4.1
diff -u -d -r1.41 -r1.41.4.1
--- xrpc_client.mx      11 Jan 2008 10:47:20 -0000      1.41
+++ xrpc_client.mx      18 Feb 2008 16:57:54 -0000      1.41.4.1
@@ -473,8 +473,6 @@
 #ifndef XRPC_CLIENT_H
 #define XRPC_CLIENT_H
 
-#include "xrpc_server.h"
-
 #define MAX_BUF_SIZE            (1024*1024)
 #define NR_RETRIES              3
 
@@ -482,8 +480,13 @@
 
 @c
 #include "pf_config.h"
+#include <gdk.h>
+#include "pathfinder.h"
+#include "pf_support.h"
+#include "shredder.h"
+#include "serialize.h"
+#include "xrpc_common.h"
 #include "xrpc_client.h"
-#include <stream_socket.h>
 
 #define errCheck(iterc, argc, ws,                                      \
             fvid, fiter, fitem, fkind,                                 \

Index: serialize_dflt.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/serialize_dflt.mx,v
retrieving revision 1.44
retrieving revision 1.44.4.1
diff -u -d -r1.44 -r1.44.4.1
--- serialize_dflt.mx   11 Jan 2008 10:47:20 -0000      1.44
+++ serialize_dflt.mx   18 Feb 2008 16:57:54 -0000      1.44.4.1
@@ -37,9 +37,10 @@
 
 #include "pf_config.h"
 #include "serialize.h"
-#include "xrpc_server.h"
 /* contains dummy callback functions */
 #include "serialize_null.h"
+#include "pathfinder.h"
+#include "xrpc_common.h"
 
 /* a lot of characters, static strings, and their sizes 
    (the idea is to reuse constant character pointers during

Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/Makefile.ag,v
retrieving revision 1.83.4.1
retrieving revision 1.83.4.2
diff -u -d -r1.83.4.1 -r1.83.4.2
--- Makefile.ag 4 Feb 2008 11:44:07 -0000       1.83.4.1
+++ Makefile.ag 18 Feb 2008 16:57:53 -0000      1.83.4.2
@@ -101,7 +101,9 @@
 
 lib__xrpc_client = {
         DIR = libdir/MonetDB4
-        SOURCES = xrpc_client.mx
+        SOURCES = \
+                                 xrpc_common.mx \
+                                 xrpc_client.mx
         LIBS = \
                           libserialize $(PF_LIBS) $(SOCKET_LIBS) 
./lib_pf_support ./lib_pathfinder \
                           $(MONETDB_LIBS) -lbat -lstream $(MONETDB4_LIBS) 
-lmonet \
@@ -112,6 +114,7 @@
         DIR = libdir/MonetDB4
         SOURCES = \
                                  shttpd.c shttpd.h \
+                                 xrpc_common.mx \
                                  xrpc_server.mx
         LIBS = \
                 ../compiler/libcompiler1 \

Index: xrpc_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.58
retrieving revision 1.58.4.1
diff -u -d -r1.58 -r1.58.4.1
--- xrpc_server.mx      11 Jan 2008 10:47:20 -0000      1.58
+++ xrpc_server.mx      18 Feb 2008 16:57:55 -0000      1.58.4.1
@@ -137,99 +137,30 @@
 #ifndef XRPC_SERVER_H
 #define XRPC_SERVER_H
 
-#include <gdk.h>
-#include <mapi/mapi.h>
-#include <time.h>
-
-#ifdef _WIN32   /* Windows specific */
-    #include <winsock.h>
-    #define snprintf _snprintf
-    #ifndef __MINGW32__
-        #pragma comment(lib, "ws2_32")
-    #endif
-#else           /* UNIX specific */
-    #include <sys/select.h>
-    #include <sys/types.h>     /* used by socket */
-    #include <sys/socket.h>
-    #include <unistd.h>
-    #include <netinet/in.h> /* hton and ntoh */
-    #include <arpa/inet.h>  /* dotted IP addr to and from 32-bits int */
-    #include <netdb.h>      /* convert domain names into IP addr */
-    #include <errno.h>
-    #include <ctype.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pathfinder.h"
-#include "pf_support.h"
-#include "shredder.h"
-#include "serialize.h"
-#include "shttpd.h"
-
-#define XRPC_REQ_CALLBACK       "/xrpc"
 #define XRPC_DOC_CALLBACK       "/xrpc/doc"
 #define XRPC_ADM_CALLBACK       "/xrpc/admin"
+
 #define ERR403                  "403 Forbidden"
 #define ERR404                  "404 Bad Request"
 #define ERR500                  "500 Internal Server Error"
+
 #define OUT_OF_MEM              "Internal Receiver Error: out-of memory"
 #define NOT_WELL_FORMED         "Request XML message not well-formed"
-#define MAX_NR_PARAMS           32
 
-#define MXQ_ADMIN   "http://monetdb.cwi.nl/XQuery/admin/";
-#define SOAP_NS     "http://www.w3.org/2003/05/soap-envelope";
-#define XDT_NS      "http://www.w3.org/2005/xpath-datatypes";
-#define XS_NS       "http://www.w3.org/2001/XMLSchema";
-#define XSI_NS      "http://www.w3.org/2001/XMLSchema-instance";
-#define XRPC_NS     "http://monetdb.cwi.nl/XQuery";
-#define XRPC_LOC    "http://monetdb.cwi.nl/XQuery/XRPC.xsd";
-
-#define XRPC_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"  \
-                    "<env:Envelope xmlns:env=\"%s\""                \
-                                 " xmlns:xrpc=\"%s\""               \
-                                 " xmlns:xdt=\"%s\" "               \
-                                 " xmlns:xs=\"%s\""                 \
-                                 " xmlns:xsi=\"%s\""                \
-                                 " xsi:schemaLocation=\"%s %s\">"   \
-                      "<env:Body>"                                  \
-                        "<xrpc:request xrpc:module=\"%s\""          \
-                                     " xrpc:location=\"%s\""        \
-                                     " xrpc:method=\"%s\""          \
-                                     " xrpc:arity=\"%lld\""         \
-                                     " xrpc:iter-count=\"%lld\""    \
-                                     " xrpc:updCall=\"%s\">"
-
-#define XRPC_HTTP_CALL "<xrpc:call>"                                    \
-                         "<xrpc:sequence>"                              \
-                           "<xrpc:atomic-value xsi:type=\"xs:string\">" \
-                             "%s"                                       \
-                           "</xrpc:atomic-value>"                       \
-                         "</xrpc:sequence>"                             \
-                       "</xrpc:call>"
-
-#define XRPC_PUT_CALL  "<xrpc:call>"                                    \
-                         "<xrpc:sequence>"                              \
-                           "<xrpc:atomic-value xsi:type=\"xs:string\">" \
-                             "%s"                                       \
-                           "</xrpc:atomic-value>"                       \
-                         "</xrpc:sequence>"                             \
-                         "<xrpc:sequence>"                              \
-                           "<xrpc:element>%s</xrpc:element>"            \
-                         "</xrpc:sequence>"                             \
-                       "</xrpc:call>"
-
-#define XRPC_FOOTER     "</xrpc:request>"   \
-                      "</env:Body>"         \
-                    "</env:Envelope>\n"
+#define MAX_NR_PARAMS           32
 
 #endif /* XRPC_SERVER_H */
 
 @c
 #include "pf_config.h"
+#include <gdk.h>
+#include "pathfinder.h"
+#include "pf_support.h"
+#include "shredder.h"
+#include "serialize.h"
+#include "xrpc_common.h"
 #include "xrpc_server.h"
-#include <stream_socket.h>
+#include "shttpd.h"
 
 extern int xrpc_port;
 static int rpcd_running = 0;

Index: ll_sibling.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/ll_sibling.mx,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -d -r1.5 -r1.5.4.1
--- ll_sibling.mx       11 Jan 2008 10:47:19 -0000      1.5
+++ ll_sibling.mx       18 Feb 2008 16:57:53 -0000      1.5.4.1
@@ -305,7 +305,7 @@
         /* count sibligs for excat result BAT allocation */
         cur_lev = level[*ctx_cur];
         cur_sib = *ctx_cur + size[*ctx_cur] + 1;
-        while (cur_sib <= doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
+        while (cur_sib < doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
             num_sib += (sz >= 0);
             cur_sib += 1 + (sz & sz_msk); 
         }
@@ -316,7 +316,7 @@
             PFll_check_BAT_capacity(res, grow, res_scur, res_hcur, res_tcur);
             if (num_iter == 1) {
                 ALGODEBUG THRprintf(GDKout, "%s: 1 ctx, 1 iter\n", name);
-                while (cur_sib <= doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
+                while (cur_sib < doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
                     if (sz >= 0) {
                         @1 {
                             *res_hcur++ = min_iter;
@@ -328,7 +328,7 @@
             } else {
                 /* num_iter > 1 */
                 ALGODEBUG THRprintf(GDKout, "%s: 1 ctx, n iter\n", name);
-                while (cur_sib <= doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
+                while (cur_sib < doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
                     if (sz >= 0) {
                         @1 {
                             oid *cur_iter = iter_cur;
@@ -409,6 +409,8 @@
         @2 *stack = 0;
         oid ctx;
 
+        ALGODEBUG THRprintf(GDKout, "%s: ll_foll_sib_n_ctx( @1 , @2 )\n", 
name);
+
         stack = (@2*)GDKmalloc(sizeof(@2) * (XML_DEPTH_MAX + 1));
         if (stack == NULL) {
             GDKerror("%s: could not allocate stack of size "SZFMT".\n", name, 
sizeof(@2) * (XML_DEPTH_MAX + 1));
@@ -473,7 +475,7 @@
             cur_lev = level[ctx];
             cur_sib = ctx + size[ctx] + 1;
             /* get all remaining siblings of active item */
-            while (cur_sib <= doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
+            while (cur_sib < doc_max && ((sz = size[cur_sib]) < 0 || 
level[cur_sib] == cur_lev)) {
                 if (sz >= 0) {
                     @1 {
                         /* check, if result buffer is big enough; otherwise 
extend it */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to