Possible compatibility problems with earlier versions marked with '*'.
+Fixes in ASN.1 compiler for C++ compatibility.
+
+* Changed member names "and", "or" and "and_not" in struct Z_Operator
+to "op_and", "op_or" and "op_and_not" to avoid conflict with C++.
+
Fixed problem with GNU readline detection on Redhat 7.0.
Added step-size for Scan backend handler.
/*
- * Copyright (c) 1995-2000, Index Data.
+ * Copyright (c) 1995-2001, Index Data.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation, in whole or in part, for any purpose, is hereby granted,
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: prt-proto.h,v 1.1 2000-10-03 12:55:50 adam Exp $
+ * $Id: prt-proto.h,v 1.2 2001-02-21 13:46:53 adam Exp $
*/
#ifndef PRT_PROTO_H
#define Z_Operator_prox 3
union
{
- Odr_null *and; /* these guys are nulls. */
- Odr_null *or;
- Odr_null *and_not;
+ Odr_null *op_and; /* these guys are nulls. */
+ Odr_null *op_or;
+ Odr_null *op_and_not;
Z_ProximityOperator *prox;
} u;
} Z_Operator;
* Europagate, 1995
*
* $Log: cclfind.c,v $
- * Revision 1.20 2000-11-16 13:03:12 adam
+ * Revision 1.21 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.20 2000/11/16 13:03:12 adam
* Function ccl_rpn_query sets attributeSet to Bib-1.
*
* Revision 1.19 2000/11/16 09:58:02 adam
ccl_assert (n);
if (set)
{
- n->set = malloc (strlen(set)+1);
+ n->set = (char*) malloc (strlen(set)+1);
strcpy (n->set, set);
}
else
* Europagate, 1995
*
* $Log: cclqfile.c,v $
- * Revision 1.7 2001-01-24 11:55:31 adam
+ * Revision 1.8 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.7 2001/01/24 11:55:31 adam
* Fixed nasty bug introduced by previous commit (attribute sets not
* properly allocated).
*
pair[pair_no*2+1] = value;
if (setp)
{
- attsets[pair_no] = malloc (strlen(qual_spec)+1);
+ attsets[pair_no] = (char*) malloc (strlen(qual_spec)+1);
strcpy (attsets[pair_no], qual_spec);
}
else
/*
* $Log: admin.c,v $
- * Revision 1.8 2000-04-17 14:21:38 adam
+ * Revision 1.9 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.8 2000/04/17 14:21:38 adam
* WIN32 update.
*
* Revision 1.7 2000/04/05 07:39:54 adam
{
Z_Segment *segment;
Z_NamePlusRecord *rec;
- Odr_oct *oct = odr_malloc (out, sizeof(*oct));
+ Odr_oct *oct = (Odr_oct *) odr_malloc (out, sizeof(*oct));
if (!apdu)
{
rec->u.intermediateFragment->u.notExternallyTagged = oct;
oct->len = oct->size = status.st_size;
- oct->buf = odr_malloc (out, oct->size);
+ oct->buf = (unsigned char *) odr_malloc (out, oct->size);
fread (oct->buf, 1, oct->size, inf);
fclose (inf);
* See the file LICENSE for details.
*
* $Log: client.c,v $
- * Revision 1.113 2001-02-21 09:41:15 adam
+ * Revision 1.114 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.113 2001/02/21 09:41:15 adam
* Fixed problem with old codecs.
*
* Revision 1.112 2001/02/20 11:25:32 adam
r->u.single_ASN1_type = (Odr_oct *)
odr_malloc (out, sizeof(*r->u.single_ASN1_type));
- r->u.single_ASN1_type->buf = odr_malloc (out, item_request_size);
+ r->u.single_ASN1_type->buf = (unsigned char *)
+ odr_malloc (out, item_request_size);
r->u.single_ASN1_type->len = item_request_size;
r->u.single_ASN1_type->size = item_request_size;
memcpy (r->u.single_ASN1_type->buf, item_request_buf,
r->u.single_ASN1_type = (Odr_oct *)
odr_malloc (out, sizeof(*r->u.single_ASN1_type));
- r->u.single_ASN1_type->buf = odr_malloc (out, ill_request_size);
+ r->u.single_ASN1_type->buf = (unsigned char *)
+ odr_malloc (out, ill_request_size);
r->u.single_ASN1_type->len = ill_request_size;
r->u.single_ASN1_type->size = ill_request_size;
memcpy (r->u.single_ASN1_type->buf, ill_request_buf, ill_request_size);
req->termListAndStartPoint->term->u.general)
{
req->termListAndStartPoint->term->u.general->buf =
- odr_strdup(out, term);
+ (unsigned char *) odr_strdup(out, term);
req->termListAndStartPoint->term->u.general->len =
req->termListAndStartPoint->term->u.general->size =
strlen(term);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: tcpip.c,v $
- * Revision 1.35 2000-11-27 15:17:40 adam
+ * Revision 1.36 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.35 2000/11/27 15:17:40 adam
* Using SSLeay_add_all_algorithms instead of OpenSSL_add_all_algorithms.
*
* Revision 1.34 2000/11/23 10:58:32 adam
void *cd)
{
struct sockaddr_in addr;
+#ifdef __cplusplus
+ socklen_t len = sizeof(addr);
+#else
int len = sizeof(addr);
+#endif
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_IDLE)
* See the file LICENSE for details.
*
* $Log: ill-get.c,v $
- * Revision 1.7 2001-02-20 11:25:32 adam
+ * Revision 1.8 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.7 2001/02/20 11:25:32 adam
* Added ill_get_APDU and ill_get_Cancel.
*
* Revision 1.6 2000/08/10 08:41:26 adam
ODR o = gc->odr;
char element[128];
const char *v;
- bool_t *r = odr_malloc (o, sizeof(*r));
+ bool_t *r = (bool_t *) odr_malloc (o, sizeof(*r));
strcpy(element, name);
if (sub)
ODR o = gc->odr;
char element[128];
const char *v;
- int *r = odr_malloc (o, sizeof(*r));
+ int *r = (int *) odr_malloc (o, sizeof(*r));
strcpy(element, name);
if (sub)
{
char element[128];
ODR o = gc->odr;
- ILL_Person_Or_Institution_Symbol *p = odr_malloc (o, sizeof(*p));
+ ILL_Person_Or_Institution_Symbol *p =
+ (ILL_Person_Or_Institution_Symbol *) odr_malloc (o, sizeof(*p));
strcpy(element, name);
if (sub)
{
char element[128];
ODR o = gc->odr;
- ILL_Name_Of_Person_Or_Institution *p = odr_malloc (o, sizeof(*p));
+ ILL_Name_Of_Person_Or_Institution *p =
+ (ILL_Name_Of_Person_Or_Institution *) odr_malloc (o, sizeof(*p));
strcpy(element, name);
if (sub)
if (!strcmp (v, "request"))
{
r->which = ILL_APDU_ILL_Request;
- r->u.ILL_Request = ill_get_ILLRequest(gc, name, sub);
+ r->u.illRequest = ill_get_ILLRequest(gc, name, sub);
}
else if (!strcmp (v, "cancel"))
{
# Config File for ILL
-# $Id: ill.tcl,v 1.2 2000-01-15 09:38:51 adam Exp $
+# $Id: ill.tcl,v 1.3 2001-02-21 13:46:53 adam Exp $
# ----------------------------------------------------------
# Prefix Specifications
#
set map($m,ILL-Service-Type) Service_Type
set map($m,Service_Date_Time_0) Service_Date_this
set map($m,Service_Date_Time_1) Service_Date_original
-set map($m,Overdue_0) Overdue_Extension
+set map($m,Overdue_0) Overdue_ExtensionS
+set membermap($m,APDU,ILL-Request) {APDU_ILL_Request illRequest}
+set membermap($m,APDU,ILL-Answer) {APDU_ILL_Answer illAnswer}
# ----------------------------------------------------------
set m Z39.50-extendedService-ItemOrder-ItemRequest-1
/*
- * Copyright (c) 1995-2000, Index Data
+ * Copyright (c) 1995-2001, Index Data
* See the file LICENSE for details.
*
* $Log: odr.c,v $
- * Revision 1.33 2000-02-29 13:44:55 adam
+ * Revision 1.34 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.33 2000/02/29 13:44:55 adam
* Check for config.h (currently not generated).
*
* Revision 1.32 2000/01/31 13:15:21 adam
#include <yaz/xmalloc.h>
#include <yaz/odr.h>
-Odr_null *ODR_NULLVAL = "NULL"; /* the presence of a null value */
+Odr_null *ODR_NULLVAL = (Odr_null *) "NULL"; /* the presence of a null value */
Odr_null *odr_nullval (void)
{
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_read.c,v $
- * Revision 1.35 2000-12-05 14:44:25 adam
+ * Revision 1.36 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.35 2000/12/05 14:44:25 adam
* Readers skips <! ...> sections.
*
* Revision 1.34 2000/12/05 10:06:23 adam
c = (*get_byte)(fh);
if (!c || c == '>' || c == '/')
break;
- *pp = p = nmem_malloc (m, sizeof(*p));
+ *pp = p = (data1_xattr *) nmem_malloc (m, sizeof(*p));
p->next = 0;
pp = &p->next;
p->value = 0;
}
wrbuf_putc (wrbuf, '\0');
len = wrbuf_len(wrbuf);
- p->name = nmem_malloc (m, len);
+ p->name = (char*) nmem_malloc (m, len);
strcpy (p->name, wrbuf_buf(wrbuf));
if (c == '=')
{
}
wrbuf_putc (wrbuf, '\0');
len = wrbuf_len(wrbuf);
- p->value = nmem_malloc (m, len);
+ p->value = (char*) nmem_malloc (m, len);
strcpy (p->value, wrbuf_buf(wrbuf));
if (c == '"')
c = (*get_byte)(fh);
* See the file LICENSE for details.
*
* $Log: seshigh.c,v $
- * Revision 1.113 2001-01-30 21:34:17 adam
+ * Revision 1.114 2001-02-21 13:46:53 adam
+ * C++ fixes.
+ *
+ * Revision 1.113 2001/01/30 21:34:17 adam
* Added step-size for Scan backend interface.
*
* Revision 1.112 2001/01/29 09:38:22 adam
char options[100];
xfree (assoc->init);
- assoc->init = xmalloc (sizeof(*assoc->init));
+ assoc->init = (bend_initrequest *) xmalloc (sizeof(*assoc->init));
yaz_log(LOG_LOG, "Got initRequest");
if (req->implementationId)
* These functions should be merged.
*/
-static void set_addinfo (Z_DefaultDiagFormat *dr, char *addinfo)
+static void set_addinfo (Z_DefaultDiagFormat *dr, char *addinfo, ODR odr)
{
#if ASN_COMPILED
dr->which = Z_DefaultDiagFormat_v2Addinfo;
- dr->u.v2Addinfo = addinfo ? addinfo : "";
+ dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : "");
#else
dr->which = Z_DiagForm_v2AddInfo;
- dr->addinfo = addinfo ? addinfo : "";
+ dr->addinfo = odr_strdup (odr, addinfo ? addinfo : "");
#endif
}
dr->diagnosticSetId =
odr_oiddup (assoc->encode, oid_ent_to_oid(&bib1, oid));
dr->condition = err;
- set_addinfo (dr, addinfo);
+ set_addinfo (dr, addinfo, assoc->encode);
return rec;
}
dr->diagnosticSetId = odr_oiddup (assoc->encode,
oid_ent_to_oid(&bib1, oid));
dr->condition = err;
- set_addinfo (dr, addinfo);
+ set_addinfo (dr, addinfo, assoc->encode);
return rec;
}
#ifdef ASN_COMPILED
rec->which = Z_DefaultDiagFormat_v2Addinfo;
- rec->u.v2Addinfo = addinfo ? addinfo : "";
+ rec->u.v2Addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : "");
#else
rec->which = Z_DiagForm_v2AddInfo;
- rec->addinfo = addinfo ? addinfo : "";
+ rec->addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : "");
#endif
return recs;
}
if (bdrr->num_setnames > 0)
{
int i;
- bdrr->statuses = odr_malloc(assoc->encode, sizeof(*bdrr->statuses) *
- bdrr->num_setnames);
+ bdrr->statuses = (int*)
+ odr_malloc(assoc->encode, sizeof(*bdrr->statuses) *
+ bdrr->num_setnames);
for (i = 0; i < bdrr->num_setnames; i++)
bdrr->statuses[i] = 0;
}
if (bdrr->num_setnames > 0)
{
int i;
- res->deleteListStatuses = odr_malloc(assoc->encode,
- sizeof(*res->deleteListStatuses));
+ res->deleteListStatuses = (Z_ListStatuses *)
+ odr_malloc(assoc->encode, sizeof(*res->deleteListStatuses));
res->deleteListStatuses->num = bdrr->num_setnames;
res->deleteListStatuses->elements =
- odr_malloc (assoc->encode,
+ (Z_ListStatus **)
+ odr_malloc (assoc->encode,
sizeof(*res->deleteListStatuses->elements) *
bdrr->num_setnames);
for (i = 0; i<bdrr->num_setnames; i++)
{
res->deleteListStatuses->elements[i] =
+ (Z_ListStatus *)
odr_malloc (assoc->encode,
sizeof(**res->deleteListStatuses->elements));
res->deleteListStatuses->elements[i]->status = bdrr->statuses+i;
# See the file LICENSE for details.
#
# $Log: yaz-comp,v $
-# Revision 1.1 2000-03-02 08:48:20 adam
+# Revision 1.2 2001-02-21 13:46:54 adam
+# C++ fixes.
+#
+# Revision 1.1 2000/03/02 08:48:20 adam
# Renamed ASN.1 compiler to yaz-comp (used to be yc.tcl).
#
# Revision 1.6 2000/02/10 13:44:02 adam
if {$inf(verbose)} {
puts " mapping member $name,$val to $nval"
}
- lex
+ if {![string match {[A-Z]*} $val]} {
+ lex
+ }
} else {
set nval $val
if {![string match {[A-Z]*} $val]} {
lappend l "\tif (!odr_constructed_begin (o, p, $tagtype, $tag, name))"
lappend l "\t\treturn opt && odr_ok(o);"
lappend l "\tif (o->direction == ODR_DECODE)"
- lappend l "\t\t*p = odr_malloc (o, sizeof(**p));"
+ lappend l "\t\t*p = ($inf(vprefix)$name *) odr_malloc (o, sizeof(**p));"
lappend l "\tif (!odr_sequence_begin (o, p, sizeof(**p), 0))"
lappend l "\t\{"
# YC Sample Config File for Z39.50
-# $Id: z.tcl,v 1.3 2000-03-14 09:22:15 ian Exp $
+# $Id: z.tcl,v 1.4 2001-02-21 13:46:54 adam Exp $
# ----------------------------------------------------------
# Prefix Specifications
#
# Type Name overrides
set map($m,PDU) APDU
+set membermap($m,Operator,and) {Operator_and op_and}
+set membermap($m,Operator,or) {Operator_or op_or}
+set membermap($m,Operator,and-not) {Operator_and_not op_and_not}
set map($m,AttributeElement_complex) ComplexAttribute
set map($m,DeleteSetStatus) DeleteStatus
set membermap($m,ProximityOperator,private) {ProximityOperator_private zprivate}
* Chas Woodfield, Fretwell Downing Datasystems.
*
* $Log: ztest.c,v $
- * Revision 1.37 2001-02-20 11:25:32 adam
+ * Revision 1.38 2001-02-21 13:46:54 adam
+ * C++ fixes.
+ *
+ * Revision 1.37 2001/02/20 11:25:32 adam
* Added ill_get_APDU and ill_get_Cancel.
*
* Revision 1.36 2001/01/30 21:34:18 adam
if (r->which == ODR_EXTERNAL_single)
{
odr_setbuf(rr->decode,
- r->u.single_ASN1_type->buf,
+ (char *) r->u.single_ASN1_type->buf,
r->u.single_ASN1_type->len, 0);
if (!ill_ItemRequest (rr->decode, &item_req, 0, 0))
{
yaz_log (LOG_LOG, "Decode ILL APDU begin");
odr_setbuf(rr->decode,
- r->u.single_ASN1_type->buf,
+ (char*) r->u.single_ASN1_type->buf,
r->u.single_ASN1_type->len, 0);
if (!ill_APDU (rr->decode, &ill_apdu, 0, 0))
odr_offset(rr->decode));
yaz_log(LOG_LOG, "PDU dump:");
odr_dumpBER(yaz_log_file(),
- r->u.single_ASN1_type->buf,
+ (char *) r->u.single_ASN1_type->buf,
r->u.single_ASN1_type->len);
}
else
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: pquery.c,v $
- * Revision 1.4 1999-12-21 16:25:20 adam
+ * Revision 1.5 2001-02-21 13:46:54 adam
+ * C++ fixes.
+ *
+ * Revision 1.4 1999/12/21 16:25:20 adam
* Fixed handling of default/inherited attributes.
*
* Revision 1.3 1999/12/20 15:20:13 adam
{
case 'a':
zo->which = Z_Operator_and;
- zo->u.and = odr_nullval();
+ zo->u.op_and = odr_nullval();
break;
case 'o':
zo->which = Z_Operator_or;
- zo->u.and = odr_nullval();
+ zo->u.op_or = odr_nullval();
break;
case 'n':
zo->which = Z_Operator_and_not;
- zo->u.and = odr_nullval();
+ zo->u.op_and_not = odr_nullval();
break;
case 'p':
zo->which = Z_Operator_prox;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: yaz-ccl.c,v $
- * Revision 1.10 2001-02-20 11:23:50 adam
+ * Revision 1.11 2001-02-21 13:46:54 adam
+ * C++ fixes.
+ *
+ * Revision 1.10 2001/02/20 11:23:50 adam
* Updated ccl_pquery to consider local attribute set too.
*
* Revision 1.9 2000/11/27 14:16:55 adam
ident.oclass = CLASS_ATTSET;
ident.proto = PROTO_Z3950;
- ident.value = value;
+ ident.value = (oid_value) value;
elements[i]->attributeSet =
odr_oiddup (o, oid_ent_to_oid (&ident, oid));
}
{
case CCL_RPN_AND:
zo->which = Z_Operator_and;
- zo->u.and = odr_nullval();
+ zo->u.op_and = odr_nullval();
break;
case CCL_RPN_OR:
zo->which = Z_Operator_or;
- zo->u.and = odr_nullval();
+ zo->u.op_or = odr_nullval();
break;
case CCL_RPN_NOT:
zo->which = Z_Operator_and_not;
- zo->u.and = odr_nullval();
+ zo->u.op_and_not = odr_nullval();
break;
case CCL_RPN_PROX:
zo->which = Z_Operator_prox;
*zo->u.prox->relationType = Z_ProximityOperator_Prox_lessThan;
zo->u.prox->which = Z_ProximityOperator_known;
zo->u.prox->u.known =
- odr_malloc (o, sizeof(*zo->u.prox->u.known));
+ (Z_ProxUnit *) odr_malloc (o, sizeof(*zo->u.prox->u.known));
*zo->u.prox->u.known = Z_ProxUnit_word;
#else
*zo->u.prox->relationType = Z_Prox_lessThan;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zget.c,v $
- * Revision 1.3 2000-03-20 19:06:25 adam
+ * Revision 1.4 2001-02-21 13:46:54 adam
+ * C++ fixes.
+ *
+ * Revision 1.3 2000/03/20 19:06:25 adam
* Added Segment request for fronend server. Work on admin for client.
*
* Revision 1.2 1999/11/30 13:47:12 adam
r->numberOfRecordsReturned = (int *)odr_malloc(o, sizeof(int));
*r->numberOfRecordsReturned = 0;
r->num_segmentRecords = 0;
- r->segmentRecords = odr_nullval();
+ r->segmentRecords = (Z_NamePlusRecord **) odr_nullval();
r->otherInfo = 0;
return r;
}