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

Modified Files:
        Makefile.ag serialize_dflt.mx xrpc_client.mx xrpc_server.mx 
Added Files:
        xrpc_common.mx 
Log Message:
Cleaned up the way lib_xrpc_client and lib_xrpc_server are built, put
shared stuff in a separate file xrpc_common.mx



Index: xrpc_client.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_client.mx,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- xrpc_client.mx      11 Jan 2008 10:47:20 -0000      1.41
+++ xrpc_client.mx      15 Feb 2008 23:02:43 -0000      1.42
@@ -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.45
diff -u -d -r1.44 -r1.45
--- serialize_dflt.mx   11 Jan 2008 10:47:20 -0000      1.44
+++ serialize_dflt.mx   15 Feb 2008 23:02:43 -0000      1.45
@@ -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

--- 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 2008/02/15 23:02:43 yingying 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_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- xrpc_server.mx      11 Jan 2008 10:47:20 -0000      1.58
+++ xrpc_server.mx      15 Feb 2008 23:02:43 -0000      1.59
@@ -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: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/Makefile.ag,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- Makefile.ag 11 Jan 2008 10:47:19 -0000      1.83
+++ Makefile.ag 15 Feb 2008 23:02:43 -0000      1.84
@@ -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 \


-------------------------------------------------------------------------
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