From a9684752c5a4988a2cce42ef8ad080302b9d54a3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 21 Feb 1995 12:11:59 +0000 Subject: [PATCH] Diagnostic record with error info. observed. --- kernel/Makefile | 13 ++++++++++--- kernel/urp.c | 25 ++++++++++++++++++++----- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 69b3a28..a7a02b8 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -2,7 +2,10 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.4 1995/02/20 21:16:16 adam +# Revision 1.5 1995/02/21 12:11:59 adam +# Diagnostic record with error info. observed. +# +# Revision 1.4 1995/02/20 21:16:16 adam # FML support. Bug fixes. Profile for drewdb. # # Revision 1.3 1995/02/17 09:08:35 adam @@ -19,14 +22,18 @@ # # SHELL=/bin/sh + +ZPRE=/home/proj/zdist/zdist102b1-1/libz3950 +ZINC=-I$(ZPRE) +ZLIB=$(ZPRE)/libz3950.a + INCLUDE=-I../include CFLAGS=-g -Wall -#CC=gcc TPROG1=kernel O=main.o urp.o CPP=cc -E USELIBS1=../lib/ccl.a ../lib/fml.a ../lib/libzass.a ../lib/libres+log.a \ -../lib/util.a /home/proj/zdist/zdist102b1-1/libz3950/libz3950.a +../lib/util.a $(ZLIB) DEFS=$(INCLUDE) -DUSE_FML=1 all: $(TPROG1) diff --git a/kernel/urp.c b/kernel/urp.c index 0f6e61a..740d43e 100644 --- a/kernel/urp.c +++ b/kernel/urp.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: urp.c,v $ - * Revision 1.7 1995/02/20 21:16:20 adam + * Revision 1.8 1995/02/21 12:12:00 adam + * Diagnostic record with error info. observed. + * + * Revision 1.7 1995/02/20 21:16:20 adam * FML support. Bug fixes. Profile for drewdb. * * Revision 1.6 1995/02/17 14:41:14 quinn @@ -397,7 +400,7 @@ static int exec_show (struct ccl_token *list) gw_log (GW_LOG_DEBUG, "urp", "zass_present of %d records from" " offset %d in set %s", number, offset, num_str); zp = zass_present(info.zass, num_str, offset, number); - if (zp && zp->presentstatus == ZASS_PRES_SUCCESS) + if (zp) { int i; zass_record *pp; @@ -407,15 +410,27 @@ static int exec_show (struct ccl_token *list) "Got %d records"), zp->num); fprintf (reply_fd, "\n"); - for (i = 1, pp = zp->records; pp; pp = pp->next, i++) + for (i = 0, pp = zp->records; pp; pp = pp->next, i++) { Iso2709Rec rec; #if USE_FML const char *arg_ar[5]; #endif - + fprintf (reply_fd, "--- %d/%d ---\n", + i+offset, offset+zp->num); + if (pp->which == ZASS_REC_DIAG) + { + fprintf (reply_fd, "Record error %d: %s\n", + pp->errcode, pp->errstring); + continue; + } + else if (pp->which != ZASS_REC_USMARC) + { + fprintf (reply_fd, "Unknown record kind %d\n", + pp->which); + continue; + } rec = iso2709_cvt (pp->record); - fprintf (reply_fd, "--- %d/%d ---\n", i, zp->num); #if USE_FML if (format_token) { -- 1.7.10.4