From 5358f6142d1f59bd18a7c5a064c9b32d510a0ae3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Tue, 4 Oct 2005 15:01:08 +0000 Subject: [PATCH] better separation of PS and IS soaps (still not nice) --- org.glite.jp.index/Makefile | 3 +- org.glite.jp.index/src/soap_ops.c | 5 +++- org.glite.jp.index/src/soap_ps_calls.c | 2 +- org.glite.jp.index/src/ws_is_typeref.c | 35 +++++++++++++--------- .../src/{ws_typeref.c => ws_ps_typeref.c} | 2 +- .../src/{ws_typeref.h => ws_ps_typeref.h} | 0 6 files changed, 29 insertions(+), 18 deletions(-) rename org.glite.jp.index/src/{ws_typeref.c => ws_ps_typeref.c} (99%) rename org.glite.jp.index/src/{ws_typeref.h => ws_ps_typeref.h} (100%) diff --git a/org.glite.jp.index/Makefile b/org.glite.jp.index/Makefile index ff410f7..78e3d53 100644 --- a/org.glite.jp.index/Makefile +++ b/org.glite.jp.index/Makefile @@ -47,7 +47,8 @@ example:=jpis-test is_prefix:=jpis_ ps_prefix:=jpps_ -SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c ws_typeref.c db_ops.c\ +SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c \ + ws_ps_typeref.c ws_is_typeref.c db_ops.c \ ${is_prefix}ServerLib.c \ ${ps_prefix}ClientLib.c ${ps_prefix}C.c \ diff --git a/org.glite.jp.index/src/soap_ops.c b/org.glite.jp.index/src/soap_ops.c index 9d6f407..bf4da3c 100644 --- a/org.glite.jp.index/src/soap_ops.c +++ b/org.glite.jp.index/src/soap_ops.c @@ -9,7 +9,10 @@ #include "jpis_.nsmap" #include "soap_version.h" #include "db_ops.h" -#include "ws_typeref.h" +// XXX: avoid 2 wsdl collisions - work only because ws_ps_typeref.h +// uses common types from jpis_H.h (awful) +#include "ws_ps_typeref.h" +#include "ws_is_typeref.h" diff --git a/org.glite.jp.index/src/soap_ps_calls.c b/org.glite.jp.index/src/soap_ps_calls.c index dc61eb0..b6ca2b5 100644 --- a/org.glite.jp.index/src/soap_ps_calls.c +++ b/org.glite.jp.index/src/soap_ps_calls.c @@ -10,7 +10,7 @@ #include "conf.h" #include "db_ops.h" -#include "ws_typeref.h" +#include "ws_ps_typeref.h" #include "stdsoap2.h" diff --git a/org.glite.jp.index/src/ws_is_typeref.c b/org.glite.jp.index/src/ws_is_typeref.c index da4ed16..866ed20 100644 --- a/org.glite.jp.index/src/ws_is_typeref.c +++ b/org.glite.jp.index/src/ws_is_typeref.c @@ -7,7 +7,7 @@ #include "jpis_H.h" #include "ws_typemap.h" -#include "ws_typeref.h" +#include "ws_ps_typeref.h" static void SoapToQueryOp(const enum jptype__queryOp in, glite_jp_queryop_t *out) @@ -26,10 +26,17 @@ static void SoapToQueryOp(const enum jptype__queryOp in, glite_jp_queryop_t *out static void SoapToAttrOrig(struct soap *soap, const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out) { + assert(out); - switch ( in ) + // XXX: shlouldn't be ANY in WSDL?? + if (!in) { + *out = GLITE_JP_ATTR_ORIG_ANY; + return; + } + + switch ( *in ) { - case NULL: *out = GLITE_JP_ATTR_ORIG_ANY; break; +// case NULL: *out = GLITE_JP_ATTR_ORIG_ANY; break; case SYSTEM: *out = GLITE_JP_ATTR_ORIG_SYSTEM; break; case USER: *out = GLITE_JP_ATTR_ORIG_USER; break; case FILE_: *out = GLITE_JP_ATTR_ORIG_FILE; break; @@ -46,17 +53,17 @@ static int SoapToQueryRecordVal( { assert(in); - if (value->string) { + if (in->string) { *binary = 0; *size = 0; - *value = strdup(value->string); + *value = strdup(in->string); return 0; } - else if (value->blob) { + else if (in->blob) { *binary = 1; - *size = value->blob->__size; - memcpy(*value, value->blob->__ptr, value->blob->__size); + *size = in->blob->__size; + memcpy(*value, in->blob->__ptr, in->blob->__size); // XXX how to handle id, type, option? return 0; @@ -85,21 +92,21 @@ int glite_jpis_SoapToQueryCond( assert(in); assert(out); qr = calloc(in->__sizerecord, sizeof(*qr)); - for (i=0; i < __sizerecord; i++) { + for (i=0; i < in->__sizerecord; i++) { qr[i].attr = strdup(in->attr); - SoapToQueryOpTo(in->record[i]->op, &(qr[i].op)); + SoapToQueryOp(in->record[i]->op, &(qr[i].op)); switch (qr[i].op) { case GLITE_JP_QUERYOP_EXISTS: break; case GLITE_JP_QUERYOP_WITHIN: - SoapToQueryRecordVal(in->record[i]->value2, *(qr[i].binary), - *(qr[i].size2), *(qr[i].value2)); + SoapToQueryRecordVal(soap, in->record[i]->value2, &(qr[i].binary), + &(qr[i].size2), &(qr[i].value2)); // fall through default: - SoapToQueryRecordVal(in->record[i]->value, *(qr[i].binary), - *(qr[i].size), *(qr[i].value)); + SoapToQueryRecordVal(soap, in->record[i]->value, &(qr[i].binary), + &(qr[i].size), &(qr[i].value)); break; } diff --git a/org.glite.jp.index/src/ws_typeref.c b/org.glite.jp.index/src/ws_ps_typeref.c similarity index 99% rename from org.glite.jp.index/src/ws_typeref.c rename to org.glite.jp.index/src/ws_ps_typeref.c index 4924ee6..0c1f926 100644 --- a/org.glite.jp.index/src/ws_typeref.c +++ b/org.glite.jp.index/src/ws_ps_typeref.c @@ -7,7 +7,7 @@ #include "jpps_H.h" #include "ws_typemap.h" -#include "ws_typeref.h" +#include "ws_ps_typeref.h" static void QueryOpToSoap(const glite_jp_queryop_t in, enum jptype__queryOp *out) diff --git a/org.glite.jp.index/src/ws_typeref.h b/org.glite.jp.index/src/ws_ps_typeref.h similarity index 100% rename from org.glite.jp.index/src/ws_typeref.h rename to org.glite.jp.index/src/ws_ps_typeref.h -- 1.8.2.3