projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 5.9.0
[yaz-moved-to-github.git]
/
src
/
zget.c
diff --git
a/src/zget.c
b/src/zget.c
index
a7b26e0
..
7b11217
100644
(file)
--- a/
src/zget.c
+++ b/
src/zget.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-157,7
+157,7
@@
static Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o)
{
Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *)
odr_malloc(o, sizeof(*r));
{
Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *)
odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->deleteOperationStatus = odr_intdup(o, Z_DeleteStatus_success);
r->deleteListStatuses = 0;
r->referenceId = 0;
r->deleteOperationStatus = odr_intdup(o, Z_DeleteStatus_success);
r->deleteListStatuses = 0;
@@
-171,7
+171,7
@@
static Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o)
static Z_ScanRequest *zget_ScanRequest(ODR o)
{
Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r));
static Z_ScanRequest *zget_ScanRequest(ODR o)
{
Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->num_databaseNames = 0;
r->databaseNames = 0;
r->referenceId = 0;
r->num_databaseNames = 0;
r->databaseNames = 0;
@@
-187,7
+187,7
@@
static Z_ScanRequest *zget_ScanRequest(ODR o)
static Z_ScanResponse *zget_ScanResponse(ODR o)
{
Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r));
static Z_ScanResponse *zget_ScanResponse(ODR o)
{
Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->stepSize = 0;
r->scanStatus = odr_intdup(o, Z_Scan_success);
r->referenceId = 0;
r->stepSize = 0;
r->scanStatus = odr_intdup(o, Z_Scan_success);
@@
-203,7
+203,7
@@
static Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o
{
Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *)
odr_malloc(o, sizeof(*r));
{
Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *)
odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->requestedAction = odr_intdup(o, Z_TriggerResourceControlRequest_resourceReport);
r->prefResourceReportFormat = 0;
r->referenceId = 0;
r->requestedAction = odr_intdup(o, Z_TriggerResourceControlRequest_resourceReport);
r->prefResourceReportFormat = 0;
@@
-376,7
+376,7
@@
static Z_DuplicateDetectionRequest *zget_DuplicateDetectionRequest(ODR o)
{
Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *)
odr_malloc(o, sizeof(*r));
{
Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *)
odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->num_inputResultSetIds = 0;
r->inputResultSetIds = 0;
r->referenceId = 0;
r->num_inputResultSetIds = 0;
r->inputResultSetIds = 0;
@@
-397,7
+397,7
@@
static Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o)
{
Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *)
odr_malloc(o, sizeof(*r));
{
Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *)
odr_malloc(o, sizeof(*r));
-
+
r->referenceId = 0;
r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success);
r->resultSetCount = 0;
r->referenceId = 0;
r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success);
r->resultSetCount = 0;
@@
-406,11
+406,11
@@
static Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o)
r->otherInfo = 0;
return r;
}
r->otherInfo = 0;
return r;
}
-
+
Z_APDU *zget_APDU(ODR o, int which)
{
Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r));
Z_APDU *zget_APDU(ODR o, int which)
{
Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r));
-
+
switch (r->which = which)
{
case Z_APDU_initRequest:
switch (r->which = which)
{
case Z_APDU_initRequest:
@@
-498,9
+498,9
@@
Z_APDU *zget_APDU(ODR o, int which)
Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
const char *addinfo)
{
Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
const char *addinfo)
{
- Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
- odr_malloc (o, sizeof(*dr));
-
+ Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
+ odr_malloc(o, sizeof(*dr));
+
dr->diagnosticSetId = odr_oiddup(o, yaz_oid_diagset_bib_1);
dr->condition = odr_intdup(o, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->diagnosticSetId = odr_oiddup(o, yaz_oid_diagset_bib_1);
dr->condition = odr_intdup(o, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
@@
-529,9
+529,9
@@
Z_DiagRecs *zget_DiagRecs(ODR o, int error, const char *addinfo)
Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
int error, const char *addinfo)
{
Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
int error, const char *addinfo)
{
- Z_NamePlusRecord *rec = (Z_NamePlusRecord *) odr_malloc (o, sizeof(*rec));
- Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (o, sizeof(*drec));
-
+ Z_NamePlusRecord *rec = (Z_NamePlusRecord *) odr_malloc(o, sizeof(*rec));
+ Z_DiagRec *drec = (Z_DiagRec *)odr_malloc(o, sizeof(*drec));
+
if (dbname)
rec->databaseName = odr_strdup(o, dbname);
else
if (dbname)
rec->databaseName = odr_strdup(o, dbname);
else
@@
-553,7
+553,7
@@
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
- x->indirect_reference = 0;
+ x->indirect_reference = 0;
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_userInfo1;
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_userInfo1;
@@
-576,8
+576,8
@@
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->u.diag1 = d;
d->num = 1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->u.diag1 = d;
d->num = 1;
- d->elements = (Z_DiagnosticFormat_s**) odr_malloc (odr, sizeof *d->elements);
- d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc (odr, sizeof *d->elements[0]);
+ d->elements = (Z_DiagnosticFormat_s**) odr_malloc(odr, sizeof *d->elements);
+ d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc(odr, sizeof *d->elements[0]);
e = d->elements[0];
e->which = Z_DiagnosticFormat_s_defaultDiagRec;
e = d->elements[0];
e->which = Z_DiagnosticFormat_s_defaultDiagRec;
@@
-617,8
+617,8
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->u.diag1 = d;
d->num = 1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->u.diag1 = d;
d->num = 1;
- d->elements = (Z_DiagnosticFormat_s**) odr_malloc (odr, sizeof *d->elements);
- d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc (odr, sizeof *d->elements[0]);
+ d->elements = (Z_DiagnosticFormat_s**) odr_malloc(odr, sizeof *d->elements);
+ d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc(odr, sizeof *d->elements[0]);
e = d->elements[0];
e->which = Z_DiagnosticFormat_s_defaultDiagRec;
e = d->elements[0];
e->which = Z_DiagnosticFormat_s_defaultDiagRec;
@@
-633,13
+633,10
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
- x->indirect_reference = 0;
+ x->indirect_reference = 0;
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_octet;
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_octet;
- x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
- x->u.octet_aligned->buf = (unsigned char *) odr_malloc(odr, octet_len);
- memcpy(x->u.octet_aligned->buf, octet_buf, octet_len);
- x->u.octet_aligned->len = octet_len;
+ x->u.octet_aligned = odr_create_Odr_oct(odr, octet_buf, octet_len);
odr_destroy(encode);
odr_destroy(encode);