X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_sru_to_z3950.cpp;h=494a9447e4ac5ec154d8e7f679d5ee3276d67489;hb=55fdfbb42225f71fb791bb8f9ec033ca0fddbe44;hp=ff15d8e9966a87cfdbf07c8dcf405598a44535e5;hpb=fc881acd97f7302976646f7d197d45d86469e243;p=metaproxy-moved-to-github.git diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index ff15d8e..494a944 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -869,7 +869,13 @@ int yf::SRUtoZ3950::Impl::z3950_build_query( const Z_SRW_searchRetrieveRequest *req ) const { - if (req->query_type == Z_SRW_query_type_cql) + if ( +#ifdef Z_SRW_query_type_cql + req->query_type == Z_SRW_query_type_cql +#else + !strcmp(req->queryType, "cql") +#endif + ) { Z_External *ext = (Z_External *) odr_malloc(odr_en, sizeof(*ext)); @@ -878,22 +884,39 @@ int yf::SRUtoZ3950::Impl::z3950_build_query( ext->indirect_reference = 0; ext->descriptor = 0; ext->which = Z_External_CQL; - ext->u.cql = odr_strdup(odr_en, req->query.cql); + ext->u.cql = odr_strdup(odr_en, +#ifdef Z_SRW_query_type_cql + req->query.cql +#else + req->query +#endif + ); z_query->which = Z_Query_type_104; z_query->u.type_104 = ext; return 0; } - if (req->query_type == Z_SRW_query_type_pqf) + if ( +#ifdef Z_SRW_query_type_pqf + req->query_type == Z_SRW_query_type_pqf +#else + !strcmp(req->queryType, "pqf") +#endif + ) { Z_RPNQuery *RPNquery; YAZ_PQF_Parser pqf_parser; pqf_parser = yaz_pqf_create (); - RPNquery = yaz_pqf_parse (pqf_parser, odr_en, req->query.pqf); - + RPNquery = yaz_pqf_parse (pqf_parser, odr_en, +#ifdef Z_SRW_query_type_pqf + req->query.pqf +#else + req->query +#endif + ); yaz_pqf_destroy(pqf_parser); if (!RPNquery) @@ -946,7 +969,7 @@ static mp::filter::Base* filter_creator() } extern "C" { - struct metaproxy_1_filter_struct metaproxy_1_filter_sru_to_z3950 = { + struct metaproxy_1_filter_struct metaproxy_1_filter_sru_z3950 = { 0, "sru_z3950", filter_creator