From: Adam Dickmeiss Date: Fri, 3 Sep 2004 18:55:59 +0000 (+0000) Subject: Manually test for OCLC UI OID and print X-Git-Tag: YAZ.2.0.24~28 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=0ef85492914ba31cc19d4ca65682c4d61fd69145;p=yaz-moved-to-github.git Manually test for OCLC UI OID and print --- diff --git a/client/client.c b/client/client.c index 6b86e8c..0389070 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.247 2004-08-13 11:36:48 adam Exp $ + * $Id: client.c,v 1.248 2004-09-03 18:55:59 adam Exp $ */ #include @@ -379,9 +379,25 @@ static int process_initResponse(Z_InitResponse *res) printf("Guessing visiblestring:\n"); printf("'%s'\n", uif->u. octet_aligned->buf); } else if (uif->which == Z_External_single) { - /* Peek at any private Init-diagnostic APDUs */ Odr_any *sat = uif->u.single_ASN1_type; - printf("### NAUGHTY: External is '%s'\n", sat->buf); + oident *oid = oid_getentbyoid(uif->direct_reference); + if (oid->value == VAL_OCLCUI) { + Z_OCLC_UserInformation *oclc_ui; + ODR decode = odr_createmem(ODR_DECODE); + odr_setbuf(decode, sat->buf, sat->len, 0); + if (!z_OCLC_UserInformation(decode, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation:\n"); + else + printf ("OCLC UserInformation:\n"); + if (!z_OCLC_UserInformation(print, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation spec\n"); + odr_destroy(decode); + } + else + { + /* Peek at any private Init-diagnostic APDUs */ + printf("### NAUGHTY: External is '%.*s'\n", sat->len, sat->buf); + } } odr_reset (print); }