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

Modified Files:
      Tag: xquery-decomposition
        Makefile.ag ll_sibling.mx serialize_dflt.mx xrpc_client.mx 
        xrpc_server.mx 
Added Files:
      Tag: xquery-decomposition
        xrpc_common.mx 
Log Message:

propagated changes of Monday Feb 11 2008 - Saturday Feb 16 2008
from the development trunk to the xquery-decomposition 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.2.2 2008/02/16 01:02:21 stmane 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: xrpc_client.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_client.mx,v
retrieving revision 1.41
retrieving revision 1.41.2.1
diff -u -d -r1.41 -r1.41.2.1
--- xrpc_client.mx      11 Jan 2008 10:47:20 -0000      1.41
+++ xrpc_client.mx      16 Feb 2008 01:02:21 -0000      1.41.2.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.2.1
diff -u -d -r1.44 -r1.44.2.1
--- serialize_dflt.mx   11 Jan 2008 10:47:20 -0000      1.44
+++ serialize_dflt.mx   16 Feb 2008 01:02:21 -0000      1.44.2.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
retrieving revision 1.83.2.1
diff -u -d -r1.83 -r1.83.2.1
--- Makefile.ag 11 Jan 2008 10:47:19 -0000      1.83
+++ Makefile.ag 16 Feb 2008 01:02:20 -0000      1.83.2.1
@@ -100,7 +100,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 \
@@ -111,6 +113,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.2.1
diff -u -d -r1.58 -r1.58.2.1
--- xrpc_server.mx      11 Jan 2008 10:47:20 -0000      1.58
+++ xrpc_server.mx      16 Feb 2008 01:02:21 -0000      1.58.2.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.2.1
diff -u -d -r1.5 -r1.5.2.1
--- ll_sibling.mx       11 Jan 2008 10:47:19 -0000      1.5
+++ ll_sibling.mx       16 Feb 2008 01:02:20 -0000      1.5.2.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