{
ScanTermInfo my;
- int *occur = ent->u.termInfo->globalOccurrences;
+ Odr_int *occur = ent->u.termInfo->globalOccurrences;
my.m_count = occur ? *occur : 0;
if (ent->u.termInfo->term->which == Z_Term_general)
{
ScanTermInfo my;
- int *occur = ent->u.termInfo->globalOccurrences;
+ Odr_int *occur = ent->u.termInfo->globalOccurrences;
my.m_count = occur ? *occur : 0;
if (ent->u.termInfo->term->which == Z_Term_general)
Z_APDU *f_apdu_res = odr.create_presentResponse(apdu_req, 0, 0);
Z_PresentResponse *f_resp = f_apdu_res->u.presentResponse;
- yaz_log(YLOG_LOG, "Found %d+%d records in cache %p",
+ yaz_log(YLOG_LOG, "Found " ODR_INT_PRINTF "+" ODR_INT_PRINTF
+ " records in cache %p",
*req->resultSetStartPoint,
*req->numberOfRecordsRequested,
&found_set->m_record_cache);
if (b_resp->records && b_resp->records->which == Z_Records_DBOSD)
{
- yaz_log(YLOG_LOG, "Adding %d+%d records to cache %p",
+ yaz_log(YLOG_LOG, "Adding " ODR_INT_PRINTF "+" ODR_INT_PRINTF
+ " records to cache %p",
*req->resultSetStartPoint,
*f_resp->numberOfRecordsReturned,
&found_set->m_record_cache);
#include <iostream>
#include <sstream>
#include <string>
-#include <algorithm>
+/* #include <algorithm> */
#include <map>
namespace mp = metaproxy_1;
// Finally, roll on and srw'fy number of records
sru_pdu_res->u.response->numberOfRecords
- = (int *) odr_malloc(odr_en, sizeof(int *));
- *(sru_pdu_res->u.response->numberOfRecords) = *(sr->resultCount);
+ = odr_intdup(odr_en, *sr->resultCount);
// srw'fy nextRecordPosition
//sru_pdu_res->u.response->nextRecordPosition
// z3950'fy number of records requested
// protect against requesting records out of range
- *apdu->u.presentRequest->numberOfRecordsRequested
- = std::min(max_recs,
- *sru_pdu_res->u.response->numberOfRecords - start + 1);
-
+ if (max_recs < *sru_pdu_res->u.response->numberOfRecords - start + 1)
+ *apdu->u.presentRequest->numberOfRecordsRequested = max_recs;
+ else
+ *apdu->u.presentRequest->numberOfRecordsRequested =
+ *sru_pdu_res->u.response->numberOfRecords - start + 1;
+
// z3950'fy recordPacking
int record_packing = Z_SRW_recordPacking_XML;
if (sr_req->recordPacking && 's' == *(sr_req->recordPacking))
os << "-";
}
-static void dump_opt_int(std::ostream& os, const int *i)
+static void dump_opt_int(std::ostream& os, const Odr_int *i)
{
os << " ";
if (i)