X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_sd_remove.cpp;h=cd137fe3592ce9107ea68b40ac2860016f5900ef;hb=586d78659d671683f33ec55f4a7d32b28e345ccd;hp=d7e75ea549b694bfe0f20a9f8aa244bf983372f8;hpb=46bfa80f1062328333a1fe841581938bdeb94eb7;p=metaproxy-moved-to-github.git diff --git a/src/filter_sd_remove.cpp b/src/filter_sd_remove.cpp index d7e75ea..cd137fe 100644 --- a/src/filter_sd_remove.cpp +++ b/src/filter_sd_remove.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2013 Index Data + Copyright (C) Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #include -#include namespace metaproxy_1 { namespace filter { @@ -64,6 +64,25 @@ void yf::SD_Remove::configure(const xmlNode *xmlnode, bool test_only, } } +static void diagrec_to_sutrs(WRBUF b, Z_DiagRec *diag) +{ + wrbuf_puts(b," ERROR "); + if (diag->which != Z_DiagRec_defaultFormat) + wrbuf_puts(b, "diag not in default format"); + else + { + Z_DefaultDiagFormat *e = diag->u.defaultFormat; + wrbuf_printf(b, ODR_INT_PRINTF ": %s", *e->condition, + diagbib1_str(*e->condition)); + if (e->u.v2Addinfo && *e->u.v2Addinfo) // v3Addinfo is same data + { + wrbuf_puts(b, " -- "); + wrbuf_puts(b, e->u.v2Addinfo); + } + } + wrbuf_puts(b, "\n"); +} + void yf::SD_Remove::process(mp::Package &package) const { package.move(); @@ -106,7 +125,7 @@ void yf::SD_Remove::process(mp::Package &package) const if (npr->which == Z_NamePlusRecord_surrogateDiagnostic) { WRBUF w = wrbuf_alloc(); - wrbuf_diags(w, 1, &npr->u.surrogateDiagnostic); + diagrec_to_sutrs(w, npr->u.surrogateDiagnostic); npr->which = Z_NamePlusRecord_databaseRecord; npr->u.databaseRecord = z_ext_record_sutrs(odr_en, wrbuf_buf(w),