Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 26 Feb 2001 14:32:36 +0000 (14:32 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 26 Feb 2001 14:32:36 +0000 (14:32 +0000)
33 files changed:
CHANGELOG.email
CHANGELOG.web
Makefile.email
Makefile.web
doc/Makefile
doc/egate.sgml
doc/web.sgml
fml/fmlmarc.c
fml/fmlstr.c
fml/fmlsym.c
include/zaccess.h
kernel/bagel.res [new file with mode: 0644]
kernel/default.res
kernel/dimitris.res [deleted file]
kernel/loc.bib
kernel/loc.res
kernel/main.c
kernel/urp.c
www/egwindex.html
www/egwscript
www/mquery.egw
www/mtargets.egw
www/nwi.egw
www/query.egw
www/search.egw
www/showfull.egw
www/targets.egw
www/tform.egw
www/wcgi.c
www/wsh.c
www/z39util.tcl
www/ztargets.conf
zlayer-yaz/zaccess.c

index a21a5d1..2f91775 100644 (file)
@@ -1,4 +1,6 @@
-$Id: CHANGELOG.email,v 1.1 1996/09/03 14:06:37 adam Exp $
+$Id: CHANGELOG.email,v 1.2 2001/02/26 14:32:36 adam Exp $
 
 09/03/96 Release: 1.0.
 ---------------------------------------------------------------------
 
 09/03/96 Release: 1.0.
 ---------------------------------------------------------------------
+
+02/26/01 Updated gateway for YAZ version 1.7.
index e66d8e4..dc8683b 100644 (file)
@@ -1,4 +1,4 @@
-$Id: CHANGELOG.web,v 1.6 1997/12/15 15:05:14 adam Exp $
+$Id: CHANGELOG.web,v 1.7 2001/02/26 14:32:36 adam Exp $
 
 09/03/96 Release: 1.0.
 ---------------------------------------------------------------------
 
 09/03/96 Release: 1.0.
 ---------------------------------------------------------------------
@@ -27,3 +27,5 @@ $Id: CHANGELOG.web,v 1.6 1997/12/15 15:05:14 adam Exp $
 
 12/15/97 Limit of form variables set to 4K instead of 512 bytes, and the
          code truncates larger buffers.
 
 12/15/97 Limit of form variables set to 4K instead of 512 bytes, and the
          code truncates larger buffers.
+
+02/26/01 Updated for YAZ version 1.7.
index f7fc784..b751f19 100644 (file)
@@ -1,14 +1,14 @@
 # Top level Makefile for the Email - Z39.50 gateway
 # Europagate, 1995-1996.
 #
 # Top level Makefile for the Email - Z39.50 gateway
 # Europagate, 1995-1996.
 #
-# $Id: Makefile.email,v 1.7 1997/02/19 16:47:03 adam Exp $
+# $Id: Makefile.email,v 1.8 2001/02/26 14:32:36 adam Exp $
 #
 SHELL=/bin/sh
 MAKE=make
 #CC=cc
 CPP=$(CC) -E
 
 #
 SHELL=/bin/sh
 MAKE=make
 #CC=cc
 CPP=$(CC) -E
 
-VERSION=1.1
+VERSION=1.2
 
 # Email gateway settings --------------------------------------
 
 
 # Email gateway settings --------------------------------------
 
@@ -25,7 +25,7 @@ EMAILLIBDIR=/usr/local/lib/emailgw
 # If you are using YAZ uncomment these lines
 ZACC=zlayer-yaz
 ZINC=-I../../yaz/include
 # If you are using YAZ uncomment these lines
 ZACC=zlayer-yaz
 ZINC=-I../../yaz/include
-ZLIB=../../yaz/lib/libyaz.a
+ZLIB=../../yaz/lib/.libs/libyaz.a
 ZDEFS=
 
 # If you are using Zdist uncomment these lines
 ZDEFS=
 
 # If you are using Zdist uncomment these lines
@@ -102,4 +102,4 @@ distribution:
        cd tmp/email-z39-$(VERSION)/doc; rm web.sgml; make egate
        cd tmp; tar zcf ../email-z39-$(VERSION).tar.gz email-z39-$(VERSION)
        rm -fr tmp
        cd tmp/email-z39-$(VERSION)/doc; rm web.sgml; make egate
        cd tmp; tar zcf ../email-z39-$(VERSION).tar.gz email-z39-$(VERSION)
        rm -fr tmp
-       
+
index 98e5bbb..8ebd048 100644 (file)
@@ -1,23 +1,23 @@
 # Top level Makefile for the Web - Z39.50 gateway
 # Europagate, 1995-1996.
 #
 # Top level Makefile for the Web - Z39.50 gateway
 # Europagate, 1995-1996.
 #
-# $Id: Makefile.web,v 1.9 2001/02/26 10:35:39 adam Exp $
+# $Id: Makefile.web,v 1.10 2001/02/26 14:32:36 adam Exp $
 #
 SHELL=/bin/sh
 MAKE=make
 #CC=cc
 CPP=$(CC) -E
 
 #
 SHELL=/bin/sh
 MAKE=make
 #CC=cc
 CPP=$(CC) -E
 
-VERSION=1.1
+VERSION=1.2
 
 # Install directories
 
 # Install directories
-HTTPDDIR=/var/lib/httpd
+HTTPDDIR=/home/adam/proj/apache
 CGIDIR=$(HTTPDDIR)/cgi-bin
 HTDOCS=$(HTTPDDIR)/htdocs
 EGWDIR=$(HTTPDDIR)/egw
 GIFDIR=$(HTDOCS)/egwgif
 
 CGIDIR=$(HTTPDDIR)/cgi-bin
 HTDOCS=$(HTTPDDIR)/htdocs
 EGWDIR=$(HTTPDDIR)/egw
 GIFDIR=$(HTDOCS)/egwgif
 
-EGWUSER=nobody
+EGWUSER=adam
 
 # Location of Tcl
 TCLLIB=-ltcl8.3 -lm
 
 # Location of Tcl
 TCLLIB=-ltcl8.3 -lm
@@ -95,4 +95,3 @@ distribution:
        cd tmp/web-z39-$(VERSION)/doc; rm egate.sgml; make web
        cd tmp; tar zcf ../web-z39-$(VERSION).tar.gz web-z39-$(VERSION)
        rm -fr tmp
        cd tmp/web-z39-$(VERSION)/doc; rm egate.sgml; make web
        cd tmp; tar zcf ../web-z39-$(VERSION).tar.gz web-z39-$(VERSION)
        rm -fr tmp
-       
index fefba82..206759e 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 1996/08/28 08:23:26 adam Exp $
+# $Id: Makefile,v 1.6 2001/02/26 14:32:36 adam Exp $
 all: egate.ps egate.txt egate.html
 
 egate: egate.txt egate.ps egate.html
 all: egate.ps egate.txt egate.html
 
 egate: egate.txt egate.ps egate.html
@@ -7,10 +7,10 @@ egate.txt: egate.sgml
        sgml2txt egate.sgml
 
 egate.dvi: egate.sgml
        sgml2txt egate.sgml
 
 egate.dvi: egate.sgml
-       sgml2ps -d egate.sgml
+       sgml2latex egate
 
 
-egate.ps: egate.sgml
-       sgml2ps egate.sgml
+egate.ps: egate.dvi
+       dvips -t a4 egate -o egate.ps
 
 egate.html: egate.sgml
        sgml2html egate.sgml
 
 egate.html: egate.sgml
        sgml2html egate.sgml
@@ -21,10 +21,10 @@ web.txt: web.sgml
        sgml2txt web.sgml
 
 web.dvi: web.sgml
        sgml2txt web.sgml
 
 web.dvi: web.sgml
-       sgml2ps -d web.sgml
+       sgml2latex web.sgml
 
 web.ps: web.sgml
 
 web.ps: web.sgml
-       sgml2ps web.sgml
+       dvips -t a4 web -o web.ps
 
 web.html: web.sgml
        sgml2html web.sgml
 
 web.html: web.sgml
        sgml2html web.sgml
index 230c1e3..acc7860 100644 (file)
@@ -1,14 +1,14 @@
         <!doctype linuxdoc system>
         
 <!--    
         <!doctype linuxdoc system>
         
 <!--    
-  $Id: egate.sgml,v 1.13 1996/08/28 09:35:53 adam Exp $
+  $Id: egate.sgml,v 1.14 2001/02/26 14:32:36 adam Exp $
 -->
 
 <article>
 <title>Email - Z39.50 gateway guide 
 <author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
  name="http://europagate.dtv.dk">
 -->
 
 <article>
 <title>Email - Z39.50 gateway guide 
 <author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
  name="http://europagate.dtv.dk">
-<date>$Revision: 1.13 $
+<date>$Revision: 1.14 $
 <abstract>
 This document describes a Email server that provides access to the
 Z39.50 protocol.
 <abstract>
 This document describes a Email server that provides access to the
 Z39.50 protocol.
@@ -52,8 +52,8 @@ to build the zdist software in the directory <tt/libz3950/.
 
 YAZ can be found at the FTP host:
 
 
 YAZ can be found at the FTP host:
 
-<htmlurl url="ftp://ftp.indexdata.dk/index/yaz"
- name="ftp://ftp.indexdata.dk/index/yaz">
+<htmlurl url="ftp://ftp.indexdata.dk/pub/yaz/"
+ name="ftp://ftp.indexdata.dk/pub/yaz/">
 
 The ES also uses GNU's regex package to parse regular expressions. 
 The ES has been tested with regex-0.12. Some systems, such as Linux,
 
 The ES also uses GNU's regex package to parse regular expressions. 
 The ES has been tested with regex-0.12. Some systems, such as Linux,
@@ -109,10 +109,10 @@ The mail system needs to know about the ES. Pick some name that serves
 as the ES user and edit <tt/aliases/ used by your mail system (usually 
 <tt>usr/lib/aliases</tt>). Now add the following line:
 
 as the ES user and edit <tt/aliases/ used by your mail system (usually 
 <tt>usr/lib/aliases</tt>). Now add the following line:
 
-<tt>es:"|/usr/local/lib/es/eti </tt><em>options</em><tt>"</tt>
+<tt>es:"|/usr/local/lib/emailgw/eti </tt><em>options</em><tt>"</tt>
 
 In this example the mail user name is <tt/es/ and the EMAILLIBDIR is
 
 In this example the mail user name is <tt/es/ and the EMAILLIBDIR is
-<tt>/usr/local/lib/es</tt>.
+<tt>/usr/local/lib/emailgw</tt>.
 
 The ES system can operate with or without the monitor. When using
 the monitor the number of simultanous running kernels can be
 
 The ES system can operate with or without the monitor. When using
 the monitor the number of simultanous running kernels can be
@@ -129,7 +129,7 @@ start the monitor in one of your boot scripts (rc). For example this
 might be put in a boot script:
 
 <tscreen><verb>
 might be put in a boot script:
 
 <tscreen><verb>
-(cd /usr/local/lib/es; ./monitor -d -l mon.log -- -d -l kernel.log &)
+(cd /usr/local/lib/emailgw; ./monitor -d -l mon.log -- -d -l kernel.log &)
 </verb></tscreen>
 
 Here the monitor is started with the options <tt>-d -l mon.log</tt>
 </verb></tscreen>
 
 Here the monitor is started with the options <tt>-d -l mon.log</tt>
@@ -138,7 +138,7 @@ kernel. In this mode, the eti should contact the monitor (and not
 the kernel), so the following might be put in the aliases file:
 
 <tscreen><verb>
 the kernel), so the following might be put in the aliases file:
 
 <tscreen><verb>
-es:"|/usr/local/lib/es/eti -c /usr/local/lib/es"
+es:"|/usr/local/lib/emailgw/eti -c /usr/local/lib/emailgw"
 </verb></tscreen>
 
 The eti sets current directory to the path specified by option <tt>-c</tt>.
 </verb></tscreen>
 
 The eti sets current directory to the path specified by option <tt>-c</tt>.
@@ -151,7 +151,7 @@ The eti will contact the kernel directly. The following line could
 be put in your aliases file:
 
 <tscreen><verb>
 be put in your aliases file:
 
 <tscreen><verb>
-es:"|/usr/local/lib/es/eti -c /usr/local/lib/es -- -d -l kernel.log"
+es:"|/usr/local/lib/emailgw/eti -c /usr/local/lib/emailgw -- -d -l kernel.log"
 </verb></tscreen>
 
 <sect1>eti
 </verb></tscreen>
 
 <sect1>eti
index 6433017..c56f103 100644 (file)
@@ -1,14 +1,14 @@
 <!doctype linuxdoc system>
 
 <!--
 <!doctype linuxdoc system>
 
 <!--
-  $Id: web.sgml,v 1.5 1997/02/19 16:47:07 adam Exp $
+  $Id: web.sgml,v 1.6 2001/02/26 14:32:36 adam Exp $
 -->
 
 <article>
 <title>Web/Z39.50 gateway guide
 <author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
  name="http://europagate.dtv.dk">
 -->
 
 <article>
 <title>Web/Z39.50 gateway guide
 <author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
  name="http://europagate.dtv.dk">
-<date>$Revision: 1.5 $
+<date>$Revision: 1.6 $
 <abstract>
 This document describes a Web server that provides access to the
 Z39.50 protocol.
 <abstract>
 This document describes a Web server that provides access to the
 Z39.50 protocol.
@@ -34,13 +34,18 @@ Z39.50 protocol.
 
 YAZ and IrTcl can be found at the FTP host:
 
 
 YAZ and IrTcl can be found at the FTP host:
 
-<htmlurl url="ftp://ftp.indexdata.dk/index/yaz"
- name="ftp://ftp.indexdata.dk/index/yaz">
+<htmlurl url="ftp://ftp.indexdata.dk/pub/yaz/"
+ name="ftp://ftp.indexdata.dk/pub/yaz/">
+
+or via HTTP at:
+
+<htmlurl url="http://ftp.indexdata.dk/pub/yaz/"
+ name="http://ftp.indexdata.dk/pub/yaz/">
 
 You also need the Tcl package which can be found at:
 
 <htmlurl url="ftp://ftp.sunlabs.com/pub/tcl"
 
 You also need the Tcl package which can be found at:
 
 <htmlurl url="ftp://ftp.sunlabs.com/pub/tcl"
- name="ftp://ftp.sunlabs.com/pub/tcl">
+ name="http://dev.scriptics.com/">
 
 Unpack <tt>web-z39-...tar.gz</tt> and edit the top level
 <tt/Makefile/. Specify where the YAZ package can be found by setting
 
 Unpack <tt>web-z39-...tar.gz</tt> and edit the top level
 <tt/Makefile/. Specify where the YAZ package can be found by setting
index efce9b2..9992e7c 100644 (file)
@@ -45,6 +45,9 @@
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlmarc.c,v $
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlmarc.c,v $
+ * Revision 1.7  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.6  1995/05/16 09:39:33  adam
  * LICENSE.
  *
  * Revision 1.6  1995/05/16 09:39:33  adam
  * LICENSE.
  *
@@ -68,6 +71,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include <fmlmarc.h>
 #include <iso2709.h>
 
 #include <fmlmarc.h>
 #include <iso2709.h>
index 44b8d04..3ae3b9e 100644 (file)
@@ -45,6 +45,9 @@
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlstr.c,v $
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlstr.c,v $
+ * Revision 1.8  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.7  1995/05/16 09:39:34  adam
  * LICENSE.
  *
  * Revision 1.7  1995/05/16 09:39:34  adam
  * LICENSE.
  *
@@ -71,6 +74,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "fmlp.h"
 
 
 #include "fmlp.h"
 
index adbd0af..39a6700 100644 (file)
@@ -45,6 +45,9 @@
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlsym.c,v $
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmlsym.c,v $
+ * Revision 1.6  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.5  1995/05/16 09:39:34  adam
  * LICENSE.
  *
  * Revision 1.5  1995/05/16 09:39:34  adam
  * LICENSE.
  *
@@ -63,6 +66,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
+#include <string.h>
 
 #include "fmlp.h"
 
 
 #include "fmlp.h"
 
index 4a61968..27fdd06 100644 (file)
@@ -45,6 +45,9 @@
  * Europagate, 1995
  *
  * $Log: zaccess.h,v $
  * Europagate, 1995
  *
  * $Log: zaccess.h,v $
+ * Revision 1.14  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.13  1995/05/16 09:39:40  adam
  * LICENSE.
  *
  * Revision 1.13  1995/05/16 09:39:40  adam
  * LICENSE.
  *
@@ -108,7 +111,8 @@ typedef struct zass_record
     {
        ZASS_REC_UNKNOWN=-1,
        ZASS_REC_DIAG=0,
     {
        ZASS_REC_UNKNOWN=-1,
        ZASS_REC_DIAG=0,
-       ZASS_REC_USMARC=10
+       ZASS_REC_USMARC=10,
+       ZASS_REC_DANMARC=11
     } which;      /* 0 = diagnostic, others according to z3950v3 */
     char *record;   /* marc or other */
 
     } which;      /* 0 = diagnostic, others according to z3950v3 */
     char *record;   /* marc or other */
 
diff --git a/kernel/bagel.res b/kernel/bagel.res
new file mode 100644 (file)
index 0000000..38a182c
--- /dev/null
@@ -0,0 +1,7 @@
+# Email gateway - resource for a specific target
+# $Id: bagel.res,v 1.1 2001/02/26 14:32:36 adam Exp $
+gw.portno: 210
+gw.hostname: bagel.indexdata.dk
+gw.description: Index Data Z39.50 server
+gw.databases: gils marc
+
index 8dcd8a6..4981f71 100644 (file)
@@ -1,5 +1,5 @@
 # Email gateway - general kernel resources
 # Email gateway - general kernel resources
-# $Id: default.res,v 1.31 1996/02/12 10:04:51 adam Exp $
+# $Id: default.res,v 1.32 2001/02/26 14:32:36 adam Exp $
 #
 # Important directories, programs, etc.
 gw.reply.mta: /usr/lib/sendmail
 #
 # Important directories, programs, etc.
 gw.reply.mta: /usr/lib/sendmail
@@ -23,8 +23,7 @@ gw.hostname: localhost
 gw.bibset: default.bib
 gw.target.loc: loc.res
 gw.target.drewdb: drewdb.res
 gw.bibset: default.bib
 gw.target.loc: loc.res
 gw.target.drewdb: drewdb.res
-gw.target.dimitris: dimitris.res
-gw.target.danbib: dimitris.res
+gw.target.bagel: bagel.res
 gw.databases:
 
 # Language definitions
 gw.databases:
 
 # Language definitions
diff --git a/kernel/dimitris.res b/kernel/dimitris.res
deleted file mode 100644 (file)
index e2ee296..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Email gateway - resource for a specific target
-# $Id: dimitris.res,v 1.1 1995/04/19 16:03:24 adam Exp $
-gw.portno: 210
-gw.hostname: dagwood.ucd.ie
-gw.account: <<denmark>>
-gw.description: Z39.50/SR Gateway to Danbib
-gw.databases: danbib
-
index 884abbe..b22b51e 100644 (file)
@@ -1,7 +1,7 @@
 # Subset of bib-1 attributes map to CCL qualifiers for a target
 # Subset of bib-1 attributes map to CCL qualifiers for a target
-# $Id: loc.bib,v 1.4 1995/02/23 08:32:16 adam Exp $
+# $Id: loc.bib,v 1.5 2001/02/26 14:32:36 adam Exp $
 #
 #
-term s=pw
+term s=pw u=1016
 au   u=1    s=pw 
 pn   u=1    s=pw
 cn   u=2    s=pw
 au   u=1    s=pw 
 pn   u=1    s=pw
 cn   u=2    s=pw
index dc54ea2..75f6331 100644 (file)
@@ -1,9 +1,9 @@
 # Email gateway - resource for a specific target
 # Email gateway - resource for a specific target
-# $Id: loc.res,v 1.4 1995/02/23 08:32:17 adam Exp $
+# $Id: loc.res,v 1.5 2001/02/26 14:32:36 adam Exp $
 # See p. 40-43 in Europagate, Background Study, Part II
 # See p. 40-43 in Europagate, Background Study, Part II
-gw.portno: 210
-gw.hostname: IBM2.LOC.gov
+gw.portno: 7090
+gw.hostname: z3950.loc.gov
 gw.description: LC Z39.50 Test Server Information, Library of Congress
 gw.bibset: loc.bib
 gw.description: LC Z39.50 Test Server Information, Library of Congress
 gw.bibset: loc.bib
-gw.databases: BOOKS NAMES
+gw.databases: voyager
 
 
index f1f1694..aa00fce 100644 (file)
@@ -45,6 +45,9 @@
  * Europagate, 1995
  *
  * $Log: main.c,v $
  * Europagate, 1995
  *
  * $Log: main.c,v $
+ * Revision 1.31  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.30  1996/02/12 10:04:54  adam
  * The gateway doesn't try to reconnect if it is already known that
  * it will fail (connect_fail flag introduced).
  * Revision 1.30  1996/02/12 10:04:54  adam
  * The gateway doesn't try to reconnect if it is already known that
  * it will fail (connect_fail flag introduced).
 #include <strqueue.h>
 #include "kernel.h"
 
 #include <strqueue.h>
 #include "kernel.h"
 
-FILE *reply_fd = stdout;
+FILE *reply_fd;
 
 struct gw_kernel_info info;
 
 
 struct gw_kernel_info info;
 
@@ -180,6 +183,8 @@ static void kernel_events (struct str_queue *queue)
     int persist_flag;
     int stop_flag = 0;
 
     int persist_flag;
     int stop_flag = 0;
 
+    reply_fd = stdout;
+
     persist_flag = gw_res_bool (info.kernel_res, "gw.persist", 0);
     timeout = gw_res_int (info.kernel_res, "gw.timeout", 600);
     gw_log (GW_LOG_DEBUG, KERNEL_LOG, "event loop");
     persist_flag = gw_res_bool (info.kernel_res, "gw.persist", 0);
     timeout = gw_res_int (info.kernel_res, "gw.timeout", 600);
     gw_log (GW_LOG_DEBUG, KERNEL_LOG, "event loop");
index d472c26..914e279 100644 (file)
@@ -45,6 +45,9 @@
  * Europagate, 1995
  *
  * $Log: urp.c,v $
  * Europagate, 1995
  *
  * $Log: urp.c,v $
+ * Revision 1.51  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.50  1996/03/01 16:09:30  adam
  * New setting: gw.msg.replyto that sets Reply-To in user response.
  *
  * Revision 1.50  1996/03/01 16:09:30  adam
  * New setting: gw.msg.replyto that sets Reply-To in user response.
  *
@@ -747,40 +750,45 @@ static void present (const char *set, int offset, int number,
                     continue;
                 }
             }
                     continue;
                 }
             }
-            if (record_log_fd != -1)
-                write (record_log_fd, pp->record, strlen(pp->record));
-            rec = iso2709_cvt (pp->record);
-            if (rec)
-            {
+           if (pp->record)
+           {
+               if (record_log_fd != -1)
+                   write (record_log_fd, pp->record, strlen(pp->record));
+               rec = iso2709_cvt (pp->record);
+               if (rec)
+               {
 #if USE_FML
 #if USE_FML
-                strcpy (format_str,
-                        gw_res_get (info.kernel_res,
-                                    "gw.display.format", ""));
-                if (format_token)
-                {
-                    len = format_token->len;
-                   if (len >= sizeof(format_str))
-                       len = sizeof(format_str)-1;
-                    memcpy (format_str, format_token->name, len);
-                    format_str[len] = '\0';
-                }
-                if (info.fml && *format_str && 
-                    (!strcmp (format_str, "0") || !strcmp (format_str, "1")
-                    || !strcmp(format_str, "2")))
-                {
-                    arg_ar[0] = "\\f";
-                    arg_ar[1] = format_str;
-                    arg_ar[2] = " \\list";
-                    arg_ar[3] = marc_to_str (info.fml, rec);
-                    arg_ar[4] = NULL;
-                    fml_exec_call_argv (info.fml, arg_ar);
-                }
-                else
-                    iso2709_display (rec, reply_fd);
+                   strcpy (format_str,
+                           gw_res_get (info.kernel_res,
+                                       "gw.display.format", ""));
+                   if (format_token)
+                   {
+                       len = format_token->len;
+                       if (len >= sizeof(format_str))
+                           len = sizeof(format_str)-1;
+                       memcpy (format_str, format_token->name, len);
+                       format_str[len] = '\0';
+                   }
+                   if (info.fml && *format_str && 
+                       (!strcmp (format_str, "0") || !strcmp (format_str, "1")
+                        || !strcmp(format_str, "2")))
+                   {
+                       arg_ar[0] = "\\f";
+                       arg_ar[1] = format_str;
+                       arg_ar[2] = " \\list";
+                       arg_ar[3] = marc_to_str (info.fml, rec);
+                       arg_ar[4] = NULL;
+                       fml_exec_call_argv (info.fml, arg_ar);
+                   }
+                   else
+                       iso2709_display (rec, reply_fd);
 #else
 #else
-                iso2709_display (rec, reply_fd);
+                   iso2709_display (rec, reply_fd);
 #endif
 #endif
-                iso2709_rm (rec);
+                   iso2709_rm (rec);
+               }
+               else
+                   fprintf (reply_fd, "Record type not supported\n");
             }
             else
                 fprintf (reply_fd, "Not a MARC record\n");
             }
             else
                 fprintf (reply_fd, "Not a MARC record\n");
index 0923f4b..75ad988 100644 (file)
@@ -3,28 +3,28 @@
 <title>Europagate WWW index test page</title>
 </head>
 <body>
 <title>Europagate WWW index test page</title>
 </head>
 <body>
-<h2>Europagate WWW index test page, $Revision: 1.14 $</h2>
+<h2>Europagate WWW index test page, $Revision: 1.15 $</h2>
 <p>
 <ul>
 <li>
 <p>
 <ul>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw">
+    <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw">
       single target</a>
 <li>
       single target</a>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw/1+1">
+    <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw/1+1">
       single target with debug and html3</a>
 <li>
       single target with debug and html3</a>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw/0+1">
+    <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw/0+1">
       single target with debug and html2</a>
 </ul>
 <ul>
 <li>
       single target with debug and html2</a>
 </ul>
 <ul>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw">
+    <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw">
       multiple targets</a>
 <li>
       multiple targets</a>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
+    <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
       multiple targets with debug and html3</a>
 <li>
       multiple targets with debug and html3</a>
 <li>
-    <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
+    <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
       multiple targets with debug and html2</a>
 </ul>
 </body>
       multiple targets with debug and html2</a>
 </ul>
 </body>
index 4a192ee..eb7257d 100644 (file)
@@ -1,5 +1,5 @@
 <html>
 <html>
-<head><title>Europgate WWW gateway test script $Id: egwscript,v 1.2 1995/10/23 16:55:35 adam Exp $</title></head>
+<head><title>Europgate WWW gateway test script $Id: egwscript,v 1.3 2001/02/26 14:32:36 adam Exp $</title></head>
 <body>
 Test script with embedded Tcl. <p>
 {
 <body>
 Test script with embedded Tcl. <p>
 {
@@ -10,7 +10,7 @@ Test script with embedded Tcl. <p>
 session Id: {html $sessionId}<br>
 session Parms: {html $sessionParms}<br>
 Click 
 session Id: {html $sessionId}<br>
 session Parms: {html $sessionParms}<br>
 Click 
-<a href="http:/cgi-bin/egwcgi/{html $sessionId}/egwscript/{html $count}">
+<a href="/cgi-bin/egwcgi/{html $sessionId}/egwscript/{html $count}">
 here</a> to go to this page again. <br>
 Number of times this page has been referenced: {html $count} <p>
 </body>
 here</a> to go to this page again. <br>
 Number of times this page has been referenced: {html $count} <p>
 </body>
index 849afba..ba50759 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: mquery.egw,v 1.17 1996/10/11 13:16:34 adam Exp $
+# $Id: mquery.egw,v 1.18 2001/02/26 14:32:36 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -26,7 +26,7 @@
     button-main
     button-new-target
 
     button-main
     button-new-target
 
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
     set phost {}
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
     set phost {}
index a1f9341..8fd11f2 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: mtargets.egw,v 1.23 1996/08/28 09:36:02 adam Exp $
+# $Id: mtargets.egw,v 1.24 2001/02/26 14:32:36 adam Exp $
     set setNo 1
     source ztargets.conf
     if {![info exists debug]} {
     set setNo 1
     source ztargets.conf
     if {![info exists debug]} {
@@ -40,7 +40,7 @@
     button-define-target
 
     html "<h2>Choose one or more targets</h2>\n"
     button-define-target
 
     html "<h2>Choose one or more targets</h2>\n"
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId / $scriptQuery {;/} -1 {" method=get><br>} \n
     html "<dl>\n"
 
     html / $sessionId / $scriptQuery {;/} -1 {" method=get><br>} \n
     html "<dl>\n"
 
index c7eaecb..c8f26fa 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: nwi.egw,v 1.7 1996/05/22 16:50:26 adam Exp $
+# $Id: nwi.egw,v 1.8 2001/02/26 14:32:36 adam Exp $
     source ztargets.conf
 
     set scriptQuery nwi.egw
     source ztargets.conf
 
     set scriptQuery nwi.egw
@@ -68,7 +68,7 @@
             set curEntry $hist($initSet,form,entry1)
         }
     }
             set curEntry $hist($initSet,form,entry1)
         }
     }
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
     html "<dl>"
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
     html "<dl>"
     html "\n<br><p><hr>\n"
 
     if {0} {
     html "\n<br><p><hr>\n"
 
     if {0} {
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
     }
 
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
     }
 
index b421710..cd40d69 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: query.egw,v 1.40 1996/05/24 11:16:01 adam Exp $
+# $Id: query.egw,v 1.41 2001/02/26 14:32:36 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -118,7 +118,7 @@ proc ok-response {} {
         set databaseDefault $hist($oSetNo,0,database)
     }
     
         set databaseDefault $hist($oSetNo,0,database)
     }
     
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + 0 {" method=get>} \n
     set nodb [llength $databases]
     if {$nodb > 1} {
     html / $sessionId {/search.egw/} $setNo + 0 {" method=get>} \n
     set nodb [llength $databases]
     if {$nodb > 1} {
index a4416d7..e526ebd 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: search.egw,v 1.40 1996/05/15 18:43:38 adam Exp $
+# $Id: search.egw,v 1.41 2001/02/26 14:32:36 adam Exp $
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
@@ -42,7 +42,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
         if {!$useIcons} {
            html "\n | "
         }
         if {!$useIcons} {
            html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $scanNo - 1] + b {">}
         if {$useIcons} {
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $scanNo - 1] + b {">}
         if {$useIcons} {
@@ -55,7 +55,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
         if {!$useIcons} {
            html "\n | "
         }
         if {!$useIcons} {
            html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo +
         html [expr $scanNo + 1] + f {">}
         if {$useIcons} {
         html / $sessionId {/search.egw/} $setNo + $targetNo +
         html [expr $scanNo + 1] + f {">}
         if {$useIcons} {
@@ -78,7 +78,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
         set databaseDefault $hist($oSetNo,$targetNo,database)
     }
     
         set databaseDefault $hist($oSetNo,$targetNo,database)
     }
     
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo {+1" method=get>} \n
     set nodb [llength $databases]
     if {$nodb > 1} {
     html / $sessionId {/search.egw/} $setNo + $targetNo {+1" method=get>} \n
     set nodb [llength $databases]
     if {$nodb > 1} {
@@ -140,7 +140,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo - 1] + b {">}
     if {$useIcons} {
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo - 1] + b {">}
     if {$useIcons} {
@@ -153,7 +153,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo + 1] + f {">}
     if {$useIcons} {
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo + 1] + f {">}
     if {$useIcons} {
index abd1277..191e1aa 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: showfull.egw,v 1.24 1996/03/14 11:50:49 adam Exp $
+# $Id: showfull.egw,v 1.25 2001/02/26 14:32:36 adam Exp $
 
 proc buttons {setNo tno no format count host after} {
     global sessionId
 
 proc buttons {setNo tno no format count host after} {
     global sessionId
@@ -14,7 +14,7 @@ proc buttons {setNo tno no format count host after} {
         if {!$useIcons} {
             html "\n | "
         }
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + $tno + 
         html [expr $no + 1] + $format
         if {$useIcons} {
         html / $sessionId {/showfull.egw/} $setNo + $tno + 
         html [expr $no + 1] + $format
         if {$useIcons} {
@@ -28,7 +28,7 @@ proc buttons {setNo tno no format count host after} {
         if {!$useIcons} {
             html "\n | "
         }
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + $tno +
         html [expr $no - 1] + $format
         if {$useIcons} {
         html / $sessionId {/showfull.egw/} $setNo + $tno +
         html [expr $no - 1] + $format
         if {$useIcons} {
@@ -42,7 +42,7 @@ proc buttons {setNo tno no format count host after} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
     if {$format == "full"} {
         html raw 
     html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
     if {$format == "full"} {
         html raw 
index 6ed311d..e23d1ed 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: targets.egw,v 1.27 1996/08/28 09:36:02 adam Exp $
+# $Id: targets.egw,v 1.28 2001/02/26 14:32:36 adam Exp $
     source ztargets.conf
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
     source ztargets.conf
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
@@ -52,7 +52,7 @@
         global env
         global sessionId
 
         global env
         global sessionId
 
-        html {<dt><b><a href="http:} $env(SCRIPT_NAME) /
+        html {<dt><b><a href="} $env(SCRIPT_NAME) /
         html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
         html {</a></b>}
 
         html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
         html {</a></b>}
 
index bd0639f..8f2bd1a 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: tform.egw,v 1.7 1996/08/28 09:36:03 adam Exp $
+# $Id: tform.egw,v 1.8 2001/02/26 14:32:36 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -17,7 +17,7 @@
     button-new-target
 
     html "<h2>Target definition form</h2><br>\n"
     button-new-target
 
     html "<h2>Target definition form</h2><br>\n"
-    html {<form action="http:} $env(SCRIPT_NAME)
+    html {<form action="} $env(SCRIPT_NAME)
     html / $sessionId {/tdefine.egw} {" method=post>} \n
 
     html "<dl>"
     html / $sessionId {/tdefine.egw} {" method=post>} \n
 
     html "<dl>"
index a16fc6f..b97bbd4 100644 (file)
@@ -41,6 +41,9 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wcgi.c,v $
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wcgi.c,v $
+ * Revision 1.20  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.19  1997/01/24 13:13:10  adam
  * Implemnted egw_source and added a "raw" option to the URL.
  * Fixed a bug in the buffering system of wproto; the macro wo_putc could
  * Revision 1.19  1997/01/24 13:13:10  adam
  * Implemnted egw_source and added a "raw" option to the URL.
  * Fixed a bug in the buffering system of wproto; the macro wo_putc could
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
index 9ee4a14..9992464 100644 (file)
--- a/www/wsh.c
+++ b/www/wsh.c
@@ -41,6 +41,9 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wsh.c,v $
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wsh.c,v $
+ * Revision 1.14  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.13  1996/02/29 15:36:34  adam
  * Main shell loop implemented as a separate function called wshmain.
  *
  * Revision 1.13  1996/02/29 15:36:34  adam
  * Main shell loop implemented as a separate function called wshmain.
  *
@@ -91,6 +94,8 @@
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include "whtml.h"
 #include "wtcl.h"
 #include "wirtcl.h"
 #include "whtml.h"
 #include "wtcl.h"
 #include "wirtcl.h"
index 5186f29..08398cf 100644 (file)
@@ -1,5 +1,5 @@
 #
 #
-# $Id: z39util.tcl,v 1.49 1997/11/19 13:29:13 adam Exp $
+# $Id: z39util.tcl,v 1.50 2001/02/26 14:32:36 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
 #
 proc saveState {} {
     uplevel #0 {
@@ -87,7 +87,7 @@ proc display-medium {zset no setNo targetNo} {
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
-            html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+            html { <a href="} $env(SCRIPT_NAME) / $sessionId
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [join [$zset getSutrs $no]]
             html "</a><br>\n"
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [join [$zset getSutrs $no]]
             html "</a><br>\n"
@@ -109,7 +109,7 @@ proc display-medium {zset no setNo targetNo} {
         set year [$zset getMarc $no field 260 * c]
         set score [$zset getMarc $no field 999 * r]
     } dispError ] } {
         set year [$zset getMarc $no field 260 * c]
         set score [$zset getMarc $no field 999 * r]
     } dispError ] } {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
@@ -153,7 +153,7 @@ proc display-medium {zset no setNo targetNo} {
             html "; Score " $nscore
         }
     } else {
             html "; Score " $nscore
         }
     } else {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
@@ -184,7 +184,7 @@ proc display-brief {zset no setNo targetNo} {
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
-            html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+            html { <a href="} $env(SCRIPT_NAME) / $sessionId
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [string range [join [$zset getSutrs $no]] 0 70]
             html "</a><br>\n"
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [string range [join [$zset getSutrs $no]] 0 70]
             html "</a><br>\n"
@@ -205,7 +205,7 @@ proc display-brief {zset no setNo targetNo} {
        set publisher [$zset getMarc $no field 260 * b]
         set year [$zset getMarc $no field 260 * c]
     } dispError ] } {
        set publisher [$zset getMarc $no field 260 * b]
         set year [$zset getMarc $no field 260 * c]
     } dispError ] } {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
@@ -253,7 +253,7 @@ proc display-brief {zset no setNo targetNo} {
        }
         html {</a> }
     } else {
        }
         html {</a> }
     } else {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
@@ -726,12 +726,12 @@ proc display-scan {setNo scanNo tno} {
         html {<td align=left>}
         if {0} {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
         html {<td align=left>}
         if {0} {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
-            html {<a href="http:} $env(SCRIPT_NAME)
+            html {<a href="} $env(SCRIPT_NAME)
             html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,host) +
             html $hist($setNo,scan) +  $tterm {">}
         } else {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
             html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,host) +
             html $hist($setNo,scan) +  $tterm {">}
         } else {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
-            html {<a href="http:} $env(SCRIPT_NAME)
+            html {<a href="} $env(SCRIPT_NAME)
             html / $sessionId {/search.egw/} $setNo + $tno +
             html hyper + $tterm {">}
         }
             html / $sessionId {/search.egw/} $setNo + $tno +
             html hyper + $tterm {">}
         }
@@ -1190,7 +1190,7 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
         if {!$useIcons} {
             html "\n | "
         }
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $setMax + 1] + [expr $setMax + $hist($setNo,maxPresent)]
         if {$useIcons} {
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $setMax + 1] + [expr $setMax + $hist($setNo,maxPresent)]
         if {$useIcons} {
@@ -1204,7 +1204,7 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
         if {!$useIcons} {
             html "\n | "
         }
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo
         html + [expr $startPos - $hist($setNo,maxPresent)]
         html + [expr $startPos - 1]
         html / $sessionId {/search.egw/} $setNo + $targetNo
         html + [expr $startPos - $hist($setNo,maxPresent)]
         html + [expr $startPos - 1]
@@ -1303,7 +1303,7 @@ proc display-result-set-m-server {setNo} {
             set addinfo [lindex $status 3]
             html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
         } else {
             set addinfo [lindex $status 3]
             html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
         } else {
-            html {<dt><a href="http:} $env(SCRIPT_NAME)
+            html {<dt><a href="} $env(SCRIPT_NAME)
             html / $sessionId {/search.egw/} $setNo + $i + 1
             html + $hist($setNo,maxPresent) {">}
             html "<h3>" [lindex $targets($hist($setNo,$i,host)) 0] "</a>: "
             html / $sessionId {/search.egw/} $setNo + $i + 1
             html + $hist($setNo,maxPresent) {">}
             html "<h3>" [lindex $targets($hist($setNo,$i,host)) 0] "</a>: "
@@ -1458,7 +1458,7 @@ proc z39history {} {
                 html {<td align=right>}
             }
             if {[info exists hist($setNo,$i,hits)]} {
                 html {<td align=right>}
             }
             if {[info exists hist($setNo,$i,hits)]} {
-                html { <a href="http:} $env(SCRIPT_NAME)
+                html { <a href="} $env(SCRIPT_NAME)
                 html / $sessionId {/search.egw/} $setNo + $i + 1
                 html + $hist($setNo,maxPresent)
                 html {">} $hist($setNo,$i,hits) {</a>}
                 html / $sessionId {/search.egw/} $setNo + $i + 1
                 html + $hist($setNo,maxPresent)
                 html {">} $hist($setNo,$i,hits) {</a>}
@@ -1474,7 +1474,7 @@ proc z39history {} {
             } else {
                 html "<dd>\n"
             }
             } else {
                 html "<dd>\n"
             }
-            html { <a href="http:} $env(SCRIPT_NAME)
+            html { <a href="} $env(SCRIPT_NAME)
             html / $sessionId / $scriptQuery {;/} $setNo + $host
             if {$html3} {
                 html {">}
             html / $sessionId / $scriptQuery {;/} $setNo + $host
             if {$html3} {
                 html {">}
@@ -1550,7 +1550,7 @@ proc button-define-target {} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/tform.egw}
     if {$useIcons} {
         html {"><img src="/egwgif/button-define-target.gif" }
     html / $sessionId {/tform.egw}
     if {$useIcons} {
         html {"><img src="/egwgif/button-define-target.gif" }
@@ -1571,7 +1571,7 @@ proc button-new-target {} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId / $scriptTarget
     if {$useIcons} {
         html {"><img src="/egwgif/button-new-target.gif" }
     html / $sessionId / $scriptTarget
     if {$useIcons} {
         html {"><img src="/egwgif/button-new-target.gif" }
@@ -1590,7 +1590,7 @@ proc button-view-history {} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/history.egw;}
     catch { html "/" $nextSetNo}
     if {$useIcons} {
     html / $sessionId {/history.egw;}
     catch { html "/" $nextSetNo}
     if {$useIcons} {
@@ -1611,7 +1611,7 @@ proc button-new-query {setNo} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
 
     if {$useIcons} {
     html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
 
     if {$useIcons} {
@@ -1631,7 +1631,7 @@ proc button-result-set {setNo tno} {
     if {!$useIcons} {
         html "\n | "
     }
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
+    html {<a href="} $env(SCRIPT_NAME) / $sessionId 
     if {$tno > 0} {
         html {/msearch.egw/} $setNo
     } else {
     if {$tno > 0} {
         html {/msearch.egw/} $setNo
     } else {
@@ -1656,7 +1656,7 @@ proc button-scan-window {setNo} {
         html "\n | "
     }
     set targetNo 0
         html "\n | "
     }
     set targetNo 0
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
     if {$useIcons} {
         html {<img src="/egwgif/button-scan-window.gif" }
     html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
     if {$useIcons} {
         html {<img src="/egwgif/button-scan-window.gif" }
index ff5dd87..cd884e4 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ztargets.conf,v 1.38 1997/02/24 10:05:23 adam Exp $
+# $Id: ztargets.conf,v 1.39 2001/02/26 14:32:36 adam Exp $
 #
 # This file contains the predefined targets in the WWW-Z39.50 gateway
 # Each target is an entry in the associative array "targets". The
 #
 # This file contains the predefined targets in the WWW-Z39.50 gateway
 # Each target is an entry in the associative array "targets". The
@@ -87,24 +87,19 @@ set targets(ir.dbc.bib.dk:2008/danbib) {
     union
 }
 
     union
 }
 
-set targets(dtbsun.dtv.dk:9999/usgs-esdd-iah) {
+set targets(bagel.indexdata.dk:210/marc-gils) {
     Zebra
     USMARC
  {
  { Title {@attr 1=4} }
  { Author {@attr 1=1003} }
  { Abstract {@attr 1=62} }
     Zebra
     USMARC
  {
  { Title {@attr 1=4} }
  { Author {@attr 1=1003} }
  { Abstract {@attr 1=62} }
- { Date {@attr 1=30} }
  { {Doc ID} {@attr 1=1032} }
  { All {@attr 1=1016} }
  { Free-text {@attr 1=1016 @attr 4=105} }
  }
     {}
  { {Doc ID} {@attr 1=1032} }
  { All {@attr 1=1016} }
  { Free-text {@attr 1=1016 @attr 4=105} }
  }
     {}
-    {Zebra Z39.50 test server with GILS records. Databases: <br>
-     usgs: sample of USGS data directory <br>
-     esdd: additional Earch Science Data Directory records <br>
-     iah: data directory for the International Association of Hydrologists
-    }
+    {Zebra Z39.50 test server with GILS and MARC records <br>}
     1
     gils
 }
     1
     gils
 }
@@ -149,8 +144,8 @@ set targets(161.253.225.10/UNICORN) [ list \
     assorted \
 ]
 
     assorted \
 ]
 
-set targets(IBM2.LOC.GOV:2210/BOOKS) [ list \
-    LOC,BOOKS \
+set targets(z3950.loc.gov:7090/voyager) [ list \
+    LOCS \
     {} \
     $locFields \
     {} \
     {} \
     $locFields \
     {} \
@@ -159,16 +154,6 @@ set targets(IBM2.LOC.GOV:2210/BOOKS) [ list \
     union \
 ]
 
     union \
 ]
 
-set targets(IBM2.LOC.GOV:2210/NAMES) [ list \
-    LOC,NAMES \
-    USMARC \
-    $locFields \
-    {} \
-    {Library of Congress: Production file of name authority records} \
-    1 \
-    union \
-]
-
 set targets(199.92.147.99/Baystate) [list \
     Baystate \
     USMARC \
 set targets(199.92.147.99/Baystate) [list \
     Baystate \
     USMARC \
index 8d07fa6..e50435e 100644 (file)
@@ -47,6 +47,9 @@
  * Z39.50 API for the Email gateway - YAZ version
  *
  * $Log: zaccess.c,v $
  * Z39.50 API for the Email gateway - YAZ version
  *
  * $Log: zaccess.c,v $
+ * Revision 1.6  2001/02/26 14:32:36  adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
  * Revision 1.5  1996/01/03 08:58:12  adam
  * Updated to use new version of Yaz (some names changed to avoid C++ conflict).
  *
  * Revision 1.5  1996/01/03 08:58:12  adam
  * Updated to use new version of Yaz (some names changed to avoid C++ conflict).
  *
 #include <ctype.h>
 
 #include <gw-log.h>
 #include <ctype.h>
 
 #include <gw-log.h>
-#include <proto.h>
-#include <comstack.h>
-#include <tcpip.h>
+#include <yaz/proto.h>
+#include <yaz/comstack.h>
+#include <yaz/tcpip.h>
 #ifdef USE_XTIMOSI
 #include <xmosi.h>
 #endif
 #ifdef USE_XTIMOSI
 #include <xmosi.h>
 #endif
-#include <oid.h>
+#include <yaz/oid.h>
 
 #include <ccl.h>
 #include <zaccess.h>
 
 #include <ccl.h>
 #include <zaccess.h>
@@ -148,7 +151,7 @@ static Z_APDU *get_apdu(struct zass *z, int *complete)
     }
     odr_reset(z->decode);
     odr_setbuf(z->decode, z->inbuf, res, 0);
     }
     odr_reset(z->decode);
     odr_setbuf(z->decode, z->inbuf, res, 0);
-    if (!z_APDU(z->decode, &ap, 0))
+    if (!z_APDU(z->decode, &ap, 0, 0))
     {
        gw_log(GW_LOG_WARN, ZASS_TYPE, "decode: %s",
            odr_errlist[odr_geterror(z->decode)]);
     {
        gw_log(GW_LOG_WARN, ZASS_TYPE, "decode: %s",
            odr_errlist[odr_geterror(z->decode)]);
@@ -166,7 +169,7 @@ static int send_apdu(struct zass *z, Z_APDU *a)
     char *buf;
     int len;
 
     char *buf;
     int len;
 
-    if (!z_APDU(z->encode, &a, 0))
+    if (!z_APDU(z->encode, &a, 0, 0))
     {
        gw_log(GW_LOG_FATAL, ZASS_TYPE, "encoding initreq");
        return -1;
     {
        gw_log(GW_LOG_FATAL, ZASS_TYPE, "encoding initreq");
        return -1;
@@ -326,65 +329,72 @@ static Z_RPNStructure *rpn2rpn(ODR o, struct ccl_rpn_node *q)
     struct ccl_rpn_attr *i;
     int len;
     static int op[] = { Z_Operator_and, Z_Operator_or, Z_Operator_and_not };
     struct ccl_rpn_attr *i;
     int len;
     static int op[] = { Z_Operator_and, Z_Operator_or, Z_Operator_and_not };
+    Z_AttributeElement **elements;
+    int num_attributes = 0;
 
     switch (q->kind)
     {
 
     switch (q->kind)
     {
-       case CCL_RPN_TERM:
-           r->which = Z_RPNStructure_simple;
-           r->u.simple = odr_malloc(o, sizeof(Z_Operand));
-           r->u.simple->which = Z_Operand_APT;
-           r->u.simple->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t));
-           t->term = odr_malloc(o, sizeof(Z_Term));
-           t->term->which = Z_Term_general;
-           t->term->u.general = odr_malloc(o, sizeof(Odr_oct));
-           t->term->u.general->len = t->term->u.general->size =
-               strlen(q->u.t.term);
-           t->term->u.general->buf = odr_malloc(o, t->term->u.general->size);
-           memcpy(t->term->u.general->buf, q->u.t.term,
-               t->term->u.general->len);
-           t->num_attributes = 0;
-           t->attributeList = odr_malloc(o, sizeof(Z_AttributeElement*) * 100);
-           for (i = q->u.t.attr_list; i && t->num_attributes < 100;
-               i = i->next)
-           {
-               Z_AttributeElement *a;
-               
-               t->attributeList[t->num_attributes++] = a =
-                   odr_malloc(o, sizeof(*a));
-               a->attributeType = odr_malloc(o, sizeof(int));
-               *a->attributeType = i->type;
-#ifdef Z_95
-               a->attributeSet = 0;
-               a->which = Z_AttributeValue_numeric;
-               a->value.numeric = odr_malloc(o, sizeof(*a->value.numeric));
-                *a->value.numeric = i->value;
+    case CCL_RPN_TERM:
+       r->which = Z_RPNStructure_simple;
+       r->u.simple = odr_malloc(o, sizeof(Z_Operand));
+       r->u.simple->which = Z_Operand_APT;
+       r->u.simple->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t));
+       t->term = odr_malloc(o, sizeof(Z_Term));
+       t->term->which = Z_Term_general;
+       t->term->u.general = odr_malloc(o, sizeof(Odr_oct));
+       t->term->u.general->len = t->term->u.general->size =
+           strlen(q->u.t.term);
+       t->term->u.general->buf = odr_malloc(o, t->term->u.general->size);
+       memcpy(t->term->u.general->buf, q->u.t.term,
+              t->term->u.general->len);
+       elements = odr_malloc(o, sizeof(Z_AttributeElement*) * 100);
+#ifdef ASN_COMPILED
+       t->attributes = (Z_AttributeList *)
+           odr_malloc (o, sizeof(*t->attributes));
+       t->attributes->attributes = elements;
 #else
 #else
-               a->attributeValue = odr_malloc(o, sizeof(*a->attributeValue));
-               *a->attributeValue = i->value;
+       t->attributeList = elements;
 #endif
 #endif
-           }
-           return r;
-       case CCL_RPN_SET:
-           r->which = Z_RPNStructure_simple;
-           r->u.simple = odr_malloc(o, sizeof(Z_Operand));
-           r->u.simple->which = Z_Operand_resultSetId;
-           r->u.simple->u.resultSetId = odr_malloc(o, len =
-               strlen(q->u.setname) + 1);
-           memcpy(r->u.simple->u.resultSetId, q->u.setname, len);
-           return r;
-       case CCL_RPN_AND: case CCL_RPN_OR: case CCL_RPN_NOT:
-           r->which = Z_RPNStructure_complex;
-           r->u.complex = odr_malloc(o, sizeof(Z_Complex));
-           if (!(r->u.complex->s1 = rpn2rpn(o, q->u.p[0])) ||
-               !(r->u.complex->s2 = rpn2rpn(o, q->u.p[1])))
-                   return 0;
-           r->u.complex->roperator = odr_malloc(o, sizeof(Z_Operator));
-           r->u.complex->roperator->which = op[q->kind];
-           r->u.complex->roperator->u.and = "";
-           return r;
-       default:
-           gw_log(GW_LOG_FATAL, ZASS_TYPE, "Bad operator in RPN");
+       for (i = q->u.t.attr_list; i && num_attributes < 100; i = i->next)
+       {
+           Z_AttributeElement *a;
+           
+           elements[num_attributes++] = a =
+               odr_malloc(o, sizeof(*a));
+           a->attributeType = odr_malloc(o, sizeof(int));
+           *a->attributeType = i->type;
+           a->attributeSet = 0;
+           a->which = Z_AttributeValue_numeric;
+           a->value.numeric = odr_malloc(o, sizeof(*a->value.numeric));
+           *a->value.numeric = i->value;
+       }
+#ifdef ASN_COMPILED
+       t->attributes->num_attributes = num_attributes;
+#else
+       t->num_attributes = num_attributes;
+#endif
+       return r;
+    case CCL_RPN_SET:
+       r->which = Z_RPNStructure_simple;
+       r->u.simple = odr_malloc(o, sizeof(Z_Operand));
+       r->u.simple->which = Z_Operand_resultSetId;
+       r->u.simple->u.resultSetId = odr_malloc(o, len =
+                                               strlen(q->u.setname) + 1);
+       memcpy(r->u.simple->u.resultSetId, q->u.setname, len);
+       return r;
+    case CCL_RPN_AND: case CCL_RPN_OR: case CCL_RPN_NOT:
+       r->which = Z_RPNStructure_complex;
+       r->u.complex = odr_malloc(o, sizeof(Z_Complex));
+       if (!(r->u.complex->s1 = rpn2rpn(o, q->u.p[0])) ||
+           !(r->u.complex->s2 = rpn2rpn(o, q->u.p[1])))
            return 0;
            return 0;
+       r->u.complex->roperator = odr_malloc(o, sizeof(Z_Operator));
+       r->u.complex->roperator->which = op[q->kind];
+       r->u.complex->roperator->u.op_and = "";
+       return r;
+    default:
+       gw_log(GW_LOG_FATAL, ZASS_TYPE, "Bad operator in RPN");
+       return 0;
     }
 }
 
     }
 }
 
@@ -415,9 +425,14 @@ const struct zass_searchent *zass_searchresult(ZASS a, int *complete)
        else
        {
            oident *id;
        else
        {
            oident *id;
+#ifdef ASN_COMPILED
+           Z_DiagRec dr_info;
+           Z_DiagRec *dr = &dr_info;
+           dr_info.which = Z_DiagRec_defaultFormat;
+           dr_info.u.defaultFormat = res->records->u.nonSurrogateDiagnostic;
+#else
            Z_DiagRec *dr = res->records->u.nonSurrogateDiagnostic;
            Z_DiagRec *dr = res->records->u.nonSurrogateDiagnostic;
-
-#ifdef Z_95
+#endif
             if (dr->which != Z_DiagRec_defaultFormat || 
                 !(id = oid_getentbyoid 
                        (dr->u.defaultFormat->diagnosticSetId)) ||
             if (dr->which != Z_DiagRec_defaultFormat || 
                 !(id = oid_getentbyoid 
                        (dr->u.defaultFormat->diagnosticSetId)) ||
@@ -428,27 +443,28 @@ const struct zass_searchent *zass_searchresult(ZASS a, int *complete)
             else
             {
                r.errcode = *dr->u.defaultFormat->condition;
             else
             {
                r.errcode = *dr->u.defaultFormat->condition;
-               if (dr->u.defaultFormat->addinfo)
+#ifdef ASN_COMPILED
+               switch (dr->u.defaultFormat->which)
                {
                {
-                   strncpy(r.errstring, dr->u.defaultFormat->addinfo, 512);
+               case Z_DefaultDiagFormat_v2Addinfo:
+                   strncpy(r.errstring, dr->u.defaultFormat->u.v2Addinfo,
+                           512);
                    r.errstring[511] = '\0';
                    r.errstring[511] = '\0';
+                   break;
+               case Z_DefaultDiagFormat_v3Addinfo:
+                   strncpy(r.errstring, dr->u.defaultFormat->u.v3Addinfo,
+                           512);
+                   r.errstring[511] = '\0';
+                   break;
                }
                }
-           }
 #else
 #else
-           if (!(id = oid_getentbyoid(dr->diagnosticSetId)) ||
-               id->class != CLASS_DIAGSET || id->value != VAL_BIB1)
-                   gw_log(GW_LOG_WARN, ZASS_TYPE,
-                       "Missing or unknown diagset - ignoring error!");
-           else
-           {
-               r.errcode = *dr->condition;
-               if (dr->addinfo)
+               if (dr->u.defaultFormat->addinfo)
                {
                {
-                   strncpy(r.errstring, dr->addinfo, 512);
+                   strncpy(r.errstring, dr->u.defaultFormat->addinfo, 512);
                    r.errstring[511] = '\0';
                }
                    r.errstring[511] = '\0';
                }
-           }
 #endif
 #endif
+           }
        }
     }
     return &r;
        }
     }
     return &r;
@@ -526,33 +542,37 @@ const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
  * Triple indirection - that's kinda heavy. We'll fix it later.
  * There are worse things around, though. Like ZDist.
  */
  * Triple indirection - that's kinda heavy. We'll fix it later.
  * There are worse things around, though. Like ZDist.
  */
-void get_diagrec(zass_record ***p, Z_DiagRec *r)
+void get_diagrecs(zass_record ***p, Z_DiagRec **r, int num)
 {
     **p = malloc(sizeof(***p));
     (**p)->next = 0;
 {
     **p = malloc(sizeof(***p));
     (**p)->next = 0;
-#ifdef Z_95
+
     (**p)->errstring[0] = '\0';
     (**p)->errstring[0] = '\0';
-    if (r->which == Z_DiagRec_defaultFormat)
+    if ((*r)->which == Z_DiagRec_defaultFormat)
     {
     {
-        (**p)->errcode = *r->u.defaultFormat->condition;
-        if (r->u.defaultFormat->addinfo)
+        (**p)->errcode = *(*r)->u.defaultFormat->condition;
+#ifdef ASN_COMPILED
+       switch ((*r)->u.defaultFormat->which)
+       {
+       case Z_DefaultDiagFormat_v2Addinfo:
+           strncpy((**p)->errstring, (*r)->u.defaultFormat->u.v2Addinfo, 200);
+           (**p)->errstring[200] = 0;
+           break;
+       case Z_DefaultDiagFormat_v3Addinfo:
+           strncpy((**p)->errstring, (*r)->u.defaultFormat->u.v3Addinfo, 200);
+           (**p)->errstring[200] = 0;
+           break;
+       }
+#else
+        if ((*r)->u.defaultFormat->addinfo)
         {
         {
-           strncpy((**p)->errstring, r->u.defaultFormat->addinfo, 200);
+           strncpy((**p)->errstring, (*r)->u.defaultFormat->addinfo, 200);
            (**p)->errstring[200] = 0;
         }
            (**p)->errstring[200] = 0;
         }
+#endif
     }
     else
         (**p)->errcode = -1;
     }
     else
         (**p)->errcode = -1;
-#else
-    (**p)->errcode = *r->condition;
-    if (r->addinfo)
-    {
-       strncpy((**p)->errstring, r->addinfo, 200);
-       (**p)->errstring[200] = 0;
-    }
-    else
-       (**p)->errstring[0] = '\0';
-#endif
     (**p)->which = ZASS_REC_DIAG;
     *p = &(**p)->next;
 }
     (**p)->which = ZASS_REC_DIAG;
     *p = &(**p)->next;
 }
@@ -567,7 +587,7 @@ void get_responserecords(zass_record ***p, Z_NamePlusRecordList *recs)
 
        record = recs->records[i];
        if (record->which == Z_NamePlusRecord_surrogateDiagnostic)
 
        record = recs->records[i];
        if (record->which == Z_NamePlusRecord_surrogateDiagnostic)
-           get_diagrec(p, record->u.surrogateDiagnostic);
+           get_diagrecs(p, &record->u.surrogateDiagnostic, 1);
        else
        {
            Z_DatabaseRecord *r = record->u.databaseRecord;
        else
        {
            Z_DatabaseRecord *r = record->u.databaseRecord;
@@ -585,10 +605,11 @@ void get_responserecords(zass_record ***p, Z_NamePlusRecordList *recs)
            else
                switch (recform->value)
                {
            else
                switch (recform->value)
                {
-                   case VAL_USMARC: (**p)->which = ZASS_REC_USMARC; break;
-                   default:
-                       gw_log(GW_LOG_WARN, ZASS_TYPE, "Unknown recsyn");
-                       (**p)->which = ZASS_REC_UNKNOWN;
+               case VAL_USMARC: (**p)->which = ZASS_REC_USMARC; break;
+               case VAL_DANMARC: (**p)->which = ZASS_REC_DANMARC; break;
+               default:
+                   gw_log(GW_LOG_WARN, ZASS_TYPE, "Unknown recsyn");
+                   (**p)->which = ZASS_REC_UNKNOWN;
                }
            if (r->which != ODR_EXTERNAL_octet)
            {
                }
            if (r->which != ODR_EXTERNAL_octet)
            {
@@ -622,7 +643,7 @@ static int send_present(ZASS a, char *name, int start, int num,
 {
     Z_APDU *apdu;
     Z_PresentRequest *req;
 {
     Z_APDU *apdu;
     Z_PresentRequest *req;
-#if 0
+#if 1
     oident recsyn;
 #endif
 
     oident recsyn;
 #endif
 
@@ -632,9 +653,9 @@ static int send_present(ZASS a, char *name, int start, int num,
     req->resultSetId = name;
     req->resultSetStartPoint = &start;
     req->numberOfRecordsRequested = &num;
     req->resultSetId = name;
     req->resultSetStartPoint = &start;
     req->numberOfRecordsRequested = &num;
-#if 0
+#if 1
     recsyn.proto = PROTO_Z3950;
     recsyn.proto = PROTO_Z3950;
-    recsyn.class = CLASS_RECSYN;
+    recsyn.oclass = CLASS_RECSYN;
     recsyn.value = form;
     req->preferredRecordSyntax = oid_getoidbyent(&recsyn);
 #else
     recsyn.value = form;
     req->preferredRecordSyntax = oid_getoidbyent(&recsyn);
 #else
@@ -665,6 +686,9 @@ const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
     {
        Z_APDU *apdu;
        Z_PresentResponse *res;
     {
        Z_APDU *apdu;
        Z_PresentResponse *res;
+#ifdef ASN_COMPILED
+       Z_DiagRec dr, *dr_p = &dr;
+#endif
 
        gw_log(ZASS_DEBUG, ZASS_TYPE,
            "Fetching %d records from # %d", num - r.num, start);
 
        gw_log(ZASS_DEBUG, ZASS_TYPE,
            "Fetching %d records from # %d", num - r.num, start);
@@ -694,16 +718,22 @@ const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
        start = r.nextpos;
        switch (res->records->which)
        {
        start = r.nextpos;
        switch (res->records->which)
        {
-           case Z_Records_DBOSD:
-               get_responserecords(&rec,
-                   res->records->u.databaseOrSurDiagnostics);
-               break;
-           case Z_Records_NSD:
-               get_diagrec(&rec, res->records->u.nonSurrogateDiagnostic);
-               break;
-           default:
-               gw_log(GW_LOG_WARN, ZASS_TYPE, "Bad tag in response rec.");
-               return 0;
+       case Z_Records_DBOSD:
+           get_responserecords(&rec,
+                               res->records->u.databaseOrSurDiagnostics);
+           break;
+       case Z_Records_NSD:
+#ifdef ASN_COMPILED
+           dr.which = Z_DiagRec_defaultFormat;
+           dr.u.defaultFormat = res->records->u.nonSurrogateDiagnostic;
+           get_diagrecs(&rec, &dr_p, 1);
+#else
+           get_diagrecs(&rec, &res->records->u.nonSurrogateDiagnostic, 1);
+#endif
+           break;
+       default:
+           gw_log(GW_LOG_WARN, ZASS_TYPE, "Bad tag in response rec.");
+           return 0;
        }
     }
     while (num - r.num && start);
        }
     }
     while (num - r.num && start);