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
Got rid of a few warnings WRT signed/unsigned types
[yaz-moved-to-github.git]
/
src
/
zget.c
diff --git
a/src/zget.c
b/src/zget.c
index
27d243a
..
7e01c05
100644
(file)
--- a/
src/zget.c
+++ b/
src/zget.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: zget.c,v 1.11 2005-06-25 15:46:06 adam Exp $
*/
/**
* \file zget.c
*/
/**
* \file zget.c
@@
-10,6
+8,7
@@
*/
#include <yaz/proto.h>
*/
#include <yaz/proto.h>
+#include <yaz/oid_db.h>
Z_InitRequest *zget_InitRequest(ODR o)
{
Z_InitRequest *zget_InitRequest(ODR o)
{
@@
-35,11
+34,8
@@
Z_InitRequest *zget_InitRequest(ODR o)
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
-#ifdef YAZ_DATE_STR
- " (" YAZ_DATE_STR ")"
-#endif
-#ifdef YAZ_OS
- " " YAZ_OS
+#ifdef YAZ_VERSION_SHA1
+ " " YAZ_VERSION_SHA1
#endif
;
r->userInformationField = 0;
#endif
;
r->userInformationField = 0;
@@
-62,11
+58,8
@@
Z_InitResponse *zget_InitResponse(ODR o)
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
-#ifdef YAZ_DATE_STR
- " (" YAZ_DATE_STR ")"
-#endif
-#ifdef YAZ_OS
- " " YAZ_OS
+#ifdef YAZ_VERSION_SHA1
+ " " YAZ_VERSION_SHA1
#endif
;
r->userInformationField = 0;
#endif
;
r->userInformationField = 0;
@@
-505,7
+498,7
@@
Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
odr_malloc (o, sizeof(*dr));
Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
odr_malloc (o, sizeof(*dr));
- dr->diagnosticSetId = yaz_oidval_to_z3950oid (o, CLASS_DIAGSET, VAL_BIB1);
+ dr->diagnosticSetId = odr_oiddup(o, yaz_oid_diagset_bib_1);
dr->condition = odr_intdup(o, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->u.v2Addinfo = odr_strdup (o, addinfo ? addinfo : "");
dr->condition = odr_intdup(o, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->u.v2Addinfo = odr_strdup (o, addinfo ? addinfo : "");
@@
-550,7
+543,6
@@
Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
{
Z_External *x, *x2;
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
{
Z_External *x, *x2;
- oident oid;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
@@
-559,13
+551,10
@@
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
- oid.proto = PROTO_Z3950;
- oid.oclass = CLASS_USERINFO;
- oid.value = VAL_USERINFO1;
- x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+ x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_userInfo1;
x->which = Z_External_userInfo1;
- u = odr_malloc(odr, sizeof *u);
+ u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u);
x->u.userInfo1 = u;
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
x->u.userInfo1 = u;
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
@@
-578,9
+567,7
@@
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
- oid.oclass = CLASS_DIAGSET;
- oid.value = VAL_DIAG1;
- x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+ x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
@@
-600,7
+587,6
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
const char *addinfo)
{
Z_External *x, *x2;
const char *addinfo)
{
Z_External *x, *x2;
- oident oid;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
@@
-609,7
+595,7
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
int octet_len;
ODR encode;
int octet_len;
ODR encode;
- u = odr_malloc(odr, sizeof *u);
+ u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u);
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]);
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]);
@@
-621,10
+607,8
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
- oid.oclass = CLASS_DIAGSET;
- oid.proto = PROTO_Z3950;
- oid.value = VAL_DIAG1;
- x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+
+ x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
@@
-647,14
+631,10
@@
Z_External *zget_init_diagnostics_octet(ODR odr, int error,
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
- oid.proto = PROTO_Z3950;
- oid.oclass = CLASS_USERINFO;
- oid.value = VAL_USERINFO1;
- x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
-
+ 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->which = Z_External_octet;
x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
- x->u.octet_aligned->buf = odr_malloc(odr, octet_len);
+ 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;
memcpy(x->u.octet_aligned->buf, octet_buf, octet_len);
x->u.octet_aligned->len = octet_len;