From bc33b8b53697bcc10a02f7e7456fd75b2c3473ef Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Sat, 6 Jul 1996 19:58:23 +0000 Subject: [PATCH] System headerfiles gathered in yconfig --- CHANGELOG | 4 ++++ asn/proto.c | 7 +++++-- client/client.c | 33 ++++++++++++++++++++++++--------- client/default.bib | 7 ++++++- comstack/tcpip.c | 9 ++++----- comstack/xmosi.c | 12 ++++++------ include/comstack.h | 6 +++++- include/data1.h | 6 +++++- include/tcpip.h | 15 +++++---------- include/yconfig.h | 32 ++++++++++++++++++++++++++++++++ odr/ber_int.c | 14 ++++++-------- retrieval/d1_doespec.c | 22 ++++++++++++++++++---- retrieval/d1_espec.c | 11 ++++++++++- retrieval/d1_grs.c | 19 +++++++++++++++---- retrieval/d1_read.c | 7 ++++++- server/eventl.c | 11 +++++------ server/seshigh.c | 7 +++++-- server/statserv.c | 9 +++++---- tab/gils-b.est | 3 +-- tab/gils-g.est | 7 ------- tab/gils.abs | 10 +--------- 21 files changed, 168 insertions(+), 83 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8776ffb..2c295ea 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ Possible compatibility problems with earlier versions marked with '*'. +--- XXXXXXXXXXXXX + +Fixed tagging bug in ResourceReportResponse PDU encoder/decode. + --- 1.2 1996/6/10 (1st anniversary release) Added Summary record syntax. Lightly tested. diff --git a/asn/proto.c b/asn/proto.c index 53791b3..ebf29a5 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.48 1996-06-10 08:53:33 quinn + * Revision 1.49 1996-07-06 19:58:28 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.48 1996/06/10 08:53:33 quinn * Added Summary,OPAC,ResourceReport * * Revision 1.47 1996/05/29 15:47:50 quinn @@ -1759,7 +1762,7 @@ int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt) z_ReferenceId(o, &(*p)->referenceId, 1) && odr_implicit(o, odr_integer, &(*p)->resourceReportStatus, ODR_CONTEXT, 50, 0) && - odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, + odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, 51, 1) && z_OtherInformation(o, &(*p)->otherInfo, 1) && odr_sequence_end(o); diff --git a/client/client.c b/client/client.c index ee7f97f..3c8a898 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.36 1996-06-10 08:53:47 quinn + * Revision 1.37 1996-07-06 19:58:29 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.36 1996/06/10 08:53:47 quinn * Added Summary * * Revision 1.35 1996/06/03 09:45:50 quinn @@ -121,17 +124,11 @@ * to illustrate the use of the YAZ service-level API. */ +#include #include #include -#ifdef WINDOWS #include -#else -#include -#endif #include -#ifdef _AIX -#include -#endif #include #include @@ -653,7 +650,7 @@ static int send_searchRequest(char *arg) assert((RPNquery = ccl_rpn_query(rpn))); bib1.proto = protocol; bib1.oclass = CLASS_ATTSET; - bib1.value = VAL_BIB1; + bib1.value = attributeset; RPNquery->attributeSetId = oid_getoidbyent(&bib1); query.u.type_1 = RPNquery; break; @@ -781,6 +778,24 @@ static int send_presentRequest(char *arg) sprintf(setstring, "%d", setnumber); req->resultSetId = setstring; } + + +#if 0 + if (1) + { + static Z_Range range; + static Z_Range *rangep = ⦥ + req->num_ranges = 1; +#endif + + + + + + + + + req->resultSetStartPoint = &setno; req->numberOfRecordsRequested = &nos; prefsyn.proto = protocol; diff --git a/client/default.bib b/client/default.bib index ee67074..198f81b 100644 --- a/client/default.bib +++ b/client/default.bib @@ -1,5 +1,5 @@ # Subset of bib-1 attributes map to CCL qualifiers -# $Id: default.bib,v 1.2 1995-05-22 14:44:53 quinn Exp $ +# $Id: default.bib,v 1.3 1996-07-06 19:58:30 quinn Exp $ # term t=l,r s=pw clean t=l @@ -16,3 +16,8 @@ la u=54 s=pw ab u=62 s=pw note u=63 s=pw af u=1006 s=pw + +north u=2040 r=o +south u=2041 r=o +east u=2038 r=o +west u=2039 r=o diff --git a/comstack/tcpip.c b/comstack/tcpip.c index 426f3ff..f9c48c0 100644 --- a/comstack/tcpip.c +++ b/comstack/tcpip.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tcpip.c,v $ - * Revision 1.11 1996-02-23 10:00:39 quinn + * Revision 1.12 1996-07-06 19:58:30 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.11 1996/02/23 10:00:39 quinn * WAIS Work * * Revision 1.10 1996/02/20 12:52:11 quinn @@ -113,10 +116,6 @@ #include #include -#ifndef WINDOWS -#include -#endif - int tcpip_close(COMSTACK h); int tcpip_put(COMSTACK h, char *buf, int size); int tcpip_get(COMSTACK h, char **buf, int *bufsize); diff --git a/comstack/xmosi.c b/comstack/xmosi.c index b6de3a7..b769d26 100644 --- a/comstack/xmosi.c +++ b/comstack/xmosi.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: xmosi.c,v $ - * Revision 1.12 1996-05-22 08:34:44 adam + * Revision 1.13 1996-07-06 19:58:30 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.12 1996/05/22 08:34:44 adam * Added ifdef USE_XTIMOSI; so that 'make depend' works. * * Revision 1.11 1996/02/23 10:00:41 quinn @@ -102,11 +105,8 @@ #include #include -#include -#include -#include -#include -#include +#define YNETINCLUDE +#include #include #include diff --git a/include/comstack.h b/include/comstack.h index 2c8b4bd..e9cda33 100644 --- a/include/comstack.h +++ b/include/comstack.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: comstack.h,v $ - * Revision 1.14 1996-02-10 12:23:41 quinn + * Revision 1.15 1996-07-06 19:58:32 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.14 1996/02/10 12:23:41 quinn * Enable inetd operations fro TCP/IP stack * * Revision 1.13 1995/11/01 13:54:33 quinn @@ -108,6 +111,7 @@ #ifndef COMSTACK_H #define COMSTACK_H +#define YNETINCLUDE #include #include #include diff --git a/include/data1.h b/include/data1.h index c72d9d7..5238c88 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.16 1996-06-10 08:55:34 quinn + * Revision 1.17 1996-07-06 19:58:32 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.16 1996/06/10 08:55:34 quinn * Added Summary. Unfinished work * * Revision 1.15 1996/06/03 09:46:03 quinn @@ -312,6 +315,7 @@ typedef struct data1_node int node_selected; int make_variantlist; int no_data_requested; + int get_bytes; } tag; struct diff --git a/include/tcpip.h b/include/tcpip.h index 4a898ac..44efb12 100644 --- a/include/tcpip.h +++ b/include/tcpip.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: tcpip.h,v $ - * Revision 1.6 1996-02-10 12:23:42 quinn + * Revision 1.7 1996-07-06 19:58:32 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.6 1996/02/10 12:23:42 quinn * Enable inetd operations fro TCP/IP stack * * Revision 1.5 1995/09/29 17:12:13 quinn @@ -57,16 +60,8 @@ #ifndef TCPIP_H #define TCPIP_H +#define YNETINCLUDE #include -#include -#ifdef WINDOWS -#include -#else -#include -#include -#include -#include -#endif struct sockaddr_in *tcpip_strtoaddr(const char *str); diff --git a/include/yconfig.h b/include/yconfig.h index 78550c8..b8d1fab 100644 --- a/include/yconfig.h +++ b/include/yconfig.h @@ -1,6 +1,38 @@ #ifndef YCONFIG_H #define YCONFIG_H +/* System includes */ + +#ifdef _VMS_ + +#elif WINDOWS + +#ifdef YNETINCLUDE +#include +#endif + +#else +/* + * Standard Unix headers + */ + +#include +#include +#include + +#ifdef YNETINCLUDE +#include +#include +#include +#include +#endif + +#ifdef _AIX +#include +#endif + +#endif + #include #ifdef WINDOWS diff --git a/odr/ber_int.c b/odr/ber_int.c index 49ef264..8b5ea7d 100644 --- a/odr/ber_int.c +++ b/odr/ber_int.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_int.c,v $ - * Revision 1.11 1995-09-29 17:12:16 quinn + * Revision 1.12 1996-07-06 19:58:33 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.11 1995/09/29 17:12:16 quinn * Smallish * * Revision 1.10 1995/09/29 17:01:50 quinn @@ -41,13 +44,8 @@ */ -#include - -#ifdef WINDOWS -#include -#else -#include /* for htons... */ -#endif +#define YNETINCLUDE +#include #include diff --git a/retrieval/d1_doespec.c b/retrieval/d1_doespec.c index 413d9b7..31f357f 100644 --- a/retrieval/d1_doespec.c +++ b/retrieval/d1_doespec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_doespec.c,v $ - * Revision 1.4 1996-06-07 11:04:32 quinn + * Revision 1.5 1996-07-06 19:58:34 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.4 1996/06/07 11:04:32 quinn * Fixed tag->tagset dependency * * Revision 1.3 1995/11/13 09:27:33 quinn @@ -61,7 +64,7 @@ static Z_Triple *find_triple(Z_Variant *var, oid_value universalset, } static void mark_subtree(data1_node *n, int make_variantlist, int no_data, - Z_Variant *vreq) + int get_bytes, Z_Variant *vreq) { data1_node *c; @@ -70,6 +73,7 @@ static void mark_subtree(data1_node *n, int make_variantlist, int no_data, n->u.tag.node_selected = 1; n->u.tag.make_variantlist = make_variantlist; n->u.tag.no_data_requested = no_data; + n->u.tag.get_bytes = get_bytes; } for (c = n->child; c; c = c->next) @@ -80,8 +84,9 @@ static void mark_subtree(data1_node *n, int make_variantlist, int no_data, c->u.tag.node_selected = 1; c->u.tag.make_variantlist = make_variantlist; c->u.tag.no_data_requested = no_data; + c->u.tag.get_bytes = get_bytes; } - mark_subtree(c, make_variantlist, no_data, vreq); + mark_subtree(c, make_variantlist, no_data, get_bytes, vreq); } } @@ -153,6 +158,8 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, { int show_variantlist = 0; int no_data = 0; + int get_bytes = -1; + Z_Variant *vreq = e->elements[i]->u.simpleElement->variantRequest; oident *defset = oid_getentbyoid(e->defaultVariantSetId); @@ -164,6 +171,8 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, if (vreq) { + Z_Triple *r; + /* * 6,5: meta-data requested, variant list. */ @@ -174,8 +183,13 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, */ if (find_triple(vreq, defsetval, var1, 9, 1)) no_data = 1; + + /* howmuch */ + if ((r = find_triple(vreq, defsetval, var1, 5, 5))) + if (r->which == Z_Triple_integer) + get_bytes = *r->value.integer; } - mark_subtree(c, show_variantlist, no_data, vreq); + mark_subtree(c, show_variantlist, no_data, get_bytes, vreq); } hits++; /* diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index 9758079..c157ad2 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_espec.c,v $ - * Revision 1.5 1996-01-02 08:57:44 quinn + * Revision 1.6 1996-07-06 19:58:34 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.5 1996/01/02 08:57:44 quinn * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass * * Revision 1.4 1995/12/05 11:16:10 quinn @@ -78,6 +81,12 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) t->which = Z_Triple_null; t->value.null = ODR_NULLVAL; } + else if (isdigit(*value)) + { + t->which = Z_Triple_integer; + t->value.integer = odr_malloc(o, sizeof(*t->value.integer)); + *t->value.integer = atoi(value); + } else { t->which = Z_Triple_internationalString; diff --git a/retrieval/d1_grs.c b/retrieval/d1_grs.c index f990323..9033c4d 100644 --- a/retrieval/d1_grs.c +++ b/retrieval/d1_grs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_grs.c,v $ - * Revision 1.5 1996-06-03 09:46:42 quinn + * Revision 1.6 1996-07-06 19:58:34 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.5 1996/06/03 09:46:42 quinn * Added OID data type. * * Revision 1.4 1996/05/01 12:45:30 quinn @@ -137,6 +140,10 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, ODR o) { Z_ElementData *res = odr_malloc(o, sizeof(*res)); + data1_node *p; + + for (p = n->parent; p && p->which != DATA1N_tag; p = p->parent) + ; if (!n) { @@ -146,6 +153,7 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, else if (n->which == DATA1N_data && (leaf || n->parent->num_children == 1)) { char str[512]; + int toget; switch (n->u.data.what) { @@ -155,10 +163,13 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, *res->u.numeric = atoi(n->u.data.data); break; case DATA1I_text: + toget = n->u.data.len; + if (p->u.tag.get_bytes > 0 && p->u.tag.get_bytes < toget) + toget = p->u.tag.get_bytes; res->which = Z_ElementData_string; - res->u.string = odr_malloc(o, n->u.data.len+1); - memcpy(res->u.string, n->u.data.data, n->u.data.len); - res->u.string[n->u.data.len] = '\0'; + res->u.string = odr_malloc(o, toget+1); + memcpy(res->u.string, n->u.data.data, toget); + res->u.string[toget] = '\0'; break; case DATA1I_oid: res->which = Z_ElementData_oid; diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index 1762248..e4b8d23 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_read.c,v $ - * Revision 1.10 1996-01-19 15:41:47 quinn + * Revision 1.11 1996-07-06 19:58:35 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.10 1996/01/19 15:41:47 quinn * Fixed uninitialized boolean. * * Revision 1.9 1996/01/17 14:52:47 adam @@ -170,6 +173,7 @@ data1_node *data1_insert_taggeddata(data1_node *root, data1_node *at, tagn->u.tag.node_selected = 0; tagn->u.tag.make_variantlist = 0; tagn->u.tag.no_data_requested = 0; + tagn->u.tag.get_bytes = -1; if (!(tagn->u.tag.element = data1_getelementbytagname(root->u.root.absyn, 0, tagname))) return 0; @@ -360,6 +364,7 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line, res->u.tag.node_selected = 0; res->u.tag.make_variantlist = 0; res->u.tag.no_data_requested = 0; + res->u.tag.get_bytes = -1; res->root = parent->root; *buf = t + 1; } diff --git a/server/eventl.c b/server/eventl.c index b3dc6b8..cd5aa48 100644 --- a/server/eventl.c +++ b/server/eventl.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: eventl.c,v $ - * Revision 1.21 1996-02-21 12:55:51 quinn + * Revision 1.22 1996-07-06 19:58:35 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.21 1996/02/21 12:55:51 quinn * small * * Revision 1.20 1996/02/21 12:52:55 quinn @@ -70,17 +73,13 @@ * */ +#include #include #include -#include -#include #include #include #include #include -#ifdef _AIX -#include -#endif #include diff --git a/server/seshigh.c b/server/seshigh.c index b420bbc..fd4b2f3 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.61 1996-06-10 08:56:16 quinn + * Revision 1.62 1996-07-06 19:58:35 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.61 1996/06/10 08:56:16 quinn * Work on Summary. * * Revision 1.60 1996/05/30 11:03:10 quinn @@ -217,11 +220,11 @@ * */ +#include #include #include #include #include -#include #include #include diff --git a/server/statserv.c b/server/statserv.c index 766a873..3f86861 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: statserv.c,v $ - * Revision 1.35 1996-05-29 10:03:28 quinn + * Revision 1.36 1996-07-06 19:58:36 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.35 1996/05/29 10:03:28 quinn * Options work * * Revision 1.34 1996/02/21 13:12:07 quinn @@ -118,15 +121,13 @@ * really have to, but it's great for debugging memory management. :) */ +#include #include #include #include -#include #include #include -#include #include -#include #include #include diff --git a/tab/gils-b.est b/tab/gils-b.est index d44d1b4..aff86b0 100644 --- a/tab/gils-b.est +++ b/tab/gils-b.est @@ -1,4 +1,4 @@ -# $Id: gils-b.est,v 1.5 1996-06-05 08:53:50 adam Exp $ +# $Id: gils-b.est,v 1.6 1996-07-06 19:58:36 quinn Exp $ simpleelement (1,1) simpleelement (1,10) simpleelement (1,12) @@ -7,4 +7,3 @@ simpleelement (1,14) simpleelement (1,16) simpleelement (4,1) simpleelement (4,52) -simpleelement (4,70)/(4,17) diff --git a/tab/gils-g.est b/tab/gils-g.est index 01624c0..ba35172 100644 --- a/tab/gils-g.est +++ b/tab/gils-g.est @@ -7,10 +7,3 @@ simpleelement (1,16) simpleelement (4,1) simpleelement (4,52) simpleelement (4,98) - -# -# These are not formally required by GILS -# -simpleelement (4,59) -simpleelement (4,70) -simpleelement (4,97) diff --git a/tab/gils.abs b/tab/gils.abs index a2f513a..cab3f82 100644 --- a/tab/gils.abs +++ b/tab/gils.abs @@ -18,7 +18,7 @@ esetname VARIANT gils-variant.est # for WAIS-compliance esetname B gils-b.est esetname G gils-g.est esetname W gils-b.est # We don't really do bodyOfDisplay yet. -esetname F @ +esetname F gils-f.est elm (1,1) schemaIdentifier - elm (1,10) rank - @@ -94,11 +94,3 @@ elm (4,98)/(4,17) crossReferenceLinkage ! elm (4,98)/(4,18) crossReferenceType ! elm (4,23) originalControlIdentifier ! elm (4,59) supplementalInformation ! - -elm (2,9) bodyOfDisplay Any - -# -# Local tags - testing only -# - -elm sampleText bodyOfText ! -- 1.7.10.4