projects
/
yazpp-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 1.6.4
[yazpp-moved-to-github.git]
/
src
/
yaz-z-server-sr.cpp
diff --git
a/src/yaz-z-server-sr.cpp
b/src/yaz-z-server-sr.cpp
index
ed8c6c2
..
f819f69
100644
(file)
--- a/
src/yaz-z-server-sr.cpp
+++ b/
src/yaz-z-server-sr.cpp
@@
-1,8
+1,11
@@
/* This file is part of the yazpp toolkit.
/* This file is part of the yazpp toolkit.
- * Copyright (C) 1998-2009 Index Data and Mike Taylor
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/log.h>
#include <yazpp/z-server.h>
#include <yaz/log.h>
#include <yazpp/z-server.h>
@@
-12,7
+15,7
@@
Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s,
const char *resultSetName,
int start, int xnum,
Z_RecordComposition *comp,
const char *resultSetName,
int start, int xnum,
Z_RecordComposition *comp,
- int *next, int *pres,
+ Odr_int *next, Odr_int *pres,
Odr_oid *format)
{
int recno, total_length = 0, toget = xnum, dumped_records = 0;
Odr_oid *format)
{
int recno, total_length = 0, toget = xnum, dumped_records = 0;
@@
-27,7
+30,7
@@
Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s,
records->u.databaseOrSurDiagnostics = reclist;
reclist->num_records = 0;
reclist->records = list;
records->u.databaseOrSurDiagnostics = reclist;
reclist->num_records = 0;
reclist->records = list;
- *pres = Z_PRES_SUCCESS;
+ *pres = Z_PresentStatus_success;
*next = 0;
for (recno = start; reclist->num_records < toget; recno++)
*next = 0;
for (recno = start; reclist->num_records < toget; recno++)
@@
-44,7
+47,7
@@
Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s,
if (records->which != Z_Records_DBOSD)
{
if (records->which != Z_Records_DBOSD)
{
- *pres = Z_PRES_FAILURE;
+ *pres = Z_PresentStatus_failure;
return records;
}
return records;
}
@@
-65,7
+68,7
@@
Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s,
/* record is small enough, really */
if (this_length <= m_preferredMessageSize)
{
/* record is small enough, really */
if (this_length <= m_preferredMessageSize)
{
- *pres = Z_PRES_PARTIAL_2;
+ *pres = Z_PresentStatus_partial_2;
break;
}
if (this_length >= m_maximumRecordSize)
break;
}
if (this_length >= m_maximumRecordSize)
@@
-108,15
+111,15
@@
void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s,
{
bool_t *sr = (bool_t *)odr_malloc (odr_encode(), sizeof(*sr));
*sr = 1;
{
bool_t *sr = (bool_t *)odr_malloc (odr_encode(), sizeof(*sr));
*sr = 1;
-
+
int toget = 0;
int toget = 0;
-
+
Z_RecordComposition comp, *compp = 0;
int hits = *res->resultCount;
Z_RecordComposition comp, *compp = 0;
int hits = *res->resultCount;
-
- int *nulint = (int *)odr_malloc (odr_encode(), sizeof(*nulint));
+
+ Odr_int *nulint = (Odr_int *)odr_malloc (odr_encode(), sizeof(*nulint));
*nulint = 0;
*nulint = 0;
-
+
comp.which = Z_RecordComp_simple;
/* how many records does the user agent want, then? */
if (hits <= *req->smallSetUpperBound)
comp.which = Z_RecordComp_simple;
/* how many records does the user agent want, then? */
if (hits <= *req->smallSetUpperBound)
@@
-133,13
+136,14
@@
void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s,
if ((comp.u.simple = req->mediumSetElementSetNames))
compp = ∁
}
if ((comp.u.simple = req->mediumSetElementSetNames))
compp = ∁
}
-
+
if (toget && !res->records)
{
if (toget && !res->records)
{
- res->presentStatus = (int *) odr_malloc (odr_encode(), sizeof(int));
- *res->presentStatus = Z_PRES_SUCCESS;
+ res->presentStatus = (Odr_int *)
+ odr_malloc (odr_encode(), sizeof(Odr_int));
+ *res->presentStatus = Z_PresentStatus_success;
res->records =
res->records =
- pack_records(s, req->resultSetName, 1, toget, compp,
+ pack_records(s, req->resultSetName, 1, toget, compp,
res->nextResultSetPosition,
res->presentStatus,
req->preferredRecordSyntax);
res->nextResultSetPosition,
res->presentStatus,
req->preferredRecordSyntax);
@@
-167,7
+171,7
@@
void Yaz_Facility_Retrieval::fetch_via_present (Z_Server *s,
Z_PresentResponse *res)
{
res->records =
Z_PresentResponse *res)
{
res->records =
- pack_records (s, req->resultSetId,*req->resultSetStartPoint,
+ pack_records (s, req->resultSetId,*req->resultSetStartPoint,
*req->numberOfRecordsRequested,
req->recordComposition,
res->nextResultSetPosition,
*req->numberOfRecordsRequested,
req->recordComposition,
res->nextResultSetPosition,
@@
-183,7
+187,7
@@
int Yaz_Facility_Retrieval::init(Z_Server *s, Z_InitRequest *initRequest,
{
Z_Options *req = initRequest->options;
Z_Options *res = initResponse->options;
{
Z_Options *req = initRequest->options;
Z_Options *res = initResponse->options;
-
+
if (ODR_MASK_GET(req, Z_Options_search))
ODR_MASK_SET(res, Z_Options_search);
if (ODR_MASK_GET(req, Z_Options_present))
if (ODR_MASK_GET(req, Z_Options_search))
ODR_MASK_SET(res, Z_Options_search);
if (ODR_MASK_GET(req, Z_Options_present))
@@
-204,7
+208,7
@@
ODR Yaz_Facility_Retrieval::odr_decode()
}
int Yaz_Facility_Retrieval::recv(Z_Server *s, Z_APDU *apdu_request)
}
int Yaz_Facility_Retrieval::recv(Z_Server *s, Z_APDU *apdu_request)
-{
+{
Z_APDU *apdu_response;
m_odr_encode = s->odr_encode();
m_odr_decode = s->odr_decode();
Z_APDU *apdu_response;
m_odr_encode = s->odr_encode();
m_odr_decode = s->odr_decode();