+ Z_APDU *apdu = zget_APDU(odr, Z_APDU_searchResponse);
+
+ Z_Records *rec = (Z_Records *) odr_malloc(odr, sizeof(Z_Records));
+ apdu->u.searchResponse->records = rec;
+ rec->which = Z_Records_NSD;
+ rec->u.nonSurrogateDiagnostic =
+ zget_DefaultDiagFormat(
+ odr, YAZ_BIB1_DATABASE_UNAVAILABLE, database.c_str());
+ package.response() = apdu;
+ }
+ Z_GDU *gdu = init_package.response().get();
+ // we hope to get an init response
+ if (gdu && gdu->which == Z_GDU_Z3950 && gdu->u.z3950->which ==
+ Z_APDU_initResponse)
+ {
+ if (ODR_MASK_GET(gdu->u.z3950->u.initResponse->options,
+ Z_Options_namedResultSets))
+ support_named_result_sets = true;
+ }
+ else
+ {