From: Adam Dickmeiss Date: Wed, 16 Apr 2014 15:44:14 +0000 (+0200) Subject: Bib-1 and SRU diagnostics in manual (appendix) YAZ-748 X-Git-Tag: v5.1.0~7 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=0a479be82be90639f4e37c4ead12baca543e88bf;p=yaz-moved-to-github.git Bib-1 and SRU diagnostics in manual (appendix) YAZ-748 Tables in manual pages don't work well. So no man entry at this time. --- diff --git a/doc/Makefile.am b/doc/Makefile.am index b6edb89..a6efd8e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -8,7 +8,7 @@ XMLFILES=bookinfo.xml introduction.xml installation.xml \ asn.xml tools.xml odr.xml comstack.xml server.xml license.xml \ future.xml zoom.xml credits.xml gfs-options.xml \ yaz.xml soap.xml gfs-virtual.xml gfs-synopsis.xml \ - std-oid-table.xml manref.xml local.ent + std-oid-table.xml bib1-diag-table.xml srw-diag-table.xml manref.xml local.ent HTMLFILES = index.html @@ -34,6 +34,12 @@ EXTRA_DIST = $(XMLFILES) $(SUPPORTFILES) $(man_MANS) $(REFFILES) \ std-oid-table.xml: $(srcdir)/../src/oid.csv $(TCLSH) $(srcdir)/../src/oidtoc.tcl $(srcdir) $(srcdir)/../src/oid.csv std-oid-table.xml +bib1-diag-table.xml: $(srcdir)/../src/bib1.csv + $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/bib1.csv bib1-diag-table.xml bib1-diag-table + +srw-diag-table.xml: $(srcdir)/../src/srw.csv + $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/srw.csv srw-diag-table.xml srw-diag-table + yaz-client.1: $(srcdir)/yaz-client-man.xml $(MAN_COMPILE) $(srcdir)/yaz-client-man.xml diff --git a/doc/entities.ent b/doc/entities.ent index eabcb33..4007fd4 100644 --- a/doc/entities.ent +++ b/doc/entities.ent @@ -11,6 +11,8 @@ + + diff --git a/doc/yaz.xml b/doc/yaz.xml index 17989c6..e3445a4 100644 --- a/doc/yaz.xml +++ b/doc/yaz.xml @@ -40,6 +40,20 @@ &std-oid-table; + Bib-1 diagnostics + + List of Bib-1 diagnostics that are known to YAZ. + + &bib1-diag-table; + + + SRU diagnostics + + List of SRU diagnostics that are known to YAZ. + + &srw-diag-table; + + &app-license; &app-indexdata; &app-credits; diff --git a/src/Makefile.am b/src/Makefile.am index 3987081..07e125b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,7 @@ illdata_DATA=ill9702.asn item-req.asn ill.tcl oclc-ill-req-ext.asn EXTRA_DIST=$(tabdata_DATA) $(illdata_DATA) \ charconv.tcl codetables.xml codetables-iso5426.xml \ - csvtodiag.tcl csvtobib1.tcl csvtosrw.tcl bib1.csv srw.csv \ + csvtodiag.tcl bib1.csv srw.csv \ csvtosru_update.tcl sru_update.csv mk_version.tcl \ oidtoc.tcl oid.csv sc_test.c @@ -50,11 +50,11 @@ oid_std.c $(top_srcdir)/include/yaz/oid_std.h: oidtoc.tcl oid.csv $(TCLSH) $(srcdir)/oidtoc.tcl $(srcdir) $(srcdir)/oid.csv oid_std.c oid_std.h # Generate diagnostics from CSVs -diagbib1.c $(top_srcdir)/include/yaz/diagbib1.h: csvtobib1.tcl bib1.csv - $(TCLSH) $(srcdir)/csvtobib1.tcl $(srcdir) +diagbib1.c $(top_srcdir)/include/yaz/diagbib1.h: bib1.csv + $(TCLSH) $(srcdir)/csvtodiag.tcl $(srcdir)/bib1.csv $(srcdir)/diagbib1.c $(top_srcdir)/include/yaz/diagbib1.h bib1 diagbib1_str -diagsrw.c $(top_srcdir)/include/yaz/diagsrw.h: csvtosrw.tcl srw.csv - $(TCLSH) $(srcdir)/csvtosrw.tcl $(srcdir) +diagsrw.c $(top_srcdir)/include/yaz/diagsrw.h: srw.csv + $(TCLSH) $(srcdir)/csvtodiag.tcl $(srcdir)/srw.csv $(srcdir)/diagsrw.c $(top_srcdir)/include/yaz/diagsrw.h srw diagsru_update.c $(top_srcdir)/include/yaz/diagsru_update.h: csvtosru_update.tcl sru_update.csv $(TCLSH) $(srcdir)/csvtosru_update.tcl $(srcdir) diff --git a/src/csvtobib1.tcl b/src/csvtobib1.tcl deleted file mode 100644 index 3cfcd28..0000000 --- a/src/csvtobib1.tcl +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/tclsh -# -# This file is part of the YAZ toolkit -# Copyright (C) Index Data -# See the file LICENSE for details. -# -# -# Converts a CSV file with Bib-1 diagnostics to C+H file for easy -# maintenance -# - -source [lindex $argv 0]/csvtodiag.tcl - -csvtodiag [list [lindex $argv 0]/bib1.csv diagbib1.c [lindex $argv 0]/../include/yaz/diagbib1.h] bib1 diagbib1_str diff --git a/src/csvtodiag.tcl b/src/csvtodiag.tcl index 6dcd1be..12e263c 100644 --- a/src/csvtodiag.tcl +++ b/src/csvtodiag.tcl @@ -94,3 +94,55 @@ YAZ_END_CDECL close $hfile } +proc csvto_xml {csvfname xmlfname id} { + set xfile [open $xmlfname w] + set csv [open $csvfname r] + + puts $xfile "" + puts $xfile "" + puts $xfile {} + puts $xfile {} + puts $xfile {} + puts $xfile {} + puts $xfile {} + puts $xfile {Code} + puts $xfile {Text} + puts $xfile {} + puts $xfile {} + puts $xfile {} + + set lineno 0 + while {1} { + incr lineno + set cnt [gets $csv line] + if {$cnt < 0} { + break + } + if {[regexp {([0-9]+)[^\"]*"([^\"]*)"} $line s code msg]} { + puts $xfile {} + puts $xfile {} + puts $xfile $code + puts $xfile {} + puts $xfile $msg + puts $xfile {} + puts $xfile {} + } + } + puts $xfile {} + puts $xfile {} + puts $xfile {} + + close $xfile + close $csv +} + +if {[llength $argv] >= 4} { + set alias {} + if {[llength $argv] >= 5} { + set alias [lindex $argv 4] + } + csvtodiag [list [lindex $argv 0] [lindex $argv 1] [lindex $argv 2]] \ + [lindex $argv 3] $alias +} elseif {[llength $argv] == 3} { + csvto_xml [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] +} \ No newline at end of file diff --git a/src/csvtosrw.tcl b/src/csvtosrw.tcl deleted file mode 100644 index 699eea6..0000000 --- a/src/csvtosrw.tcl +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/tclsh -# -# This file is part of the YAZ toolkit -# Copyright (C) Index Data -# See the file LICENSE for details. -# -# -# Converts a CSV file with SRW diagnostics to C+H file for easy -# maintenance -# - -source [lindex $argv 0]/csvtodiag.tcl - -csvtodiag [list [lindex $argv 0]/srw.csv diagsrw.c [lindex $argv 0]/../include/yaz/diagsrw.h] srw {} diff --git a/win/makefile b/win/makefile index fd1b194..9d9395d 100644 --- a/win/makefile +++ b/win/makefile @@ -862,11 +862,11 @@ $(SRCDIR)\oid_std.c: $(SRCDIR)\oid.csv $(SRCDIR)\diagbib1.c: $(SRCDIR)\bib1.csv @cd $(SRCDIR) - $(TCL) csvtobib1.tcl $(SRCDIR) + $(TCL) csvtodiag.tcl bib1.csv diagbib1.c $(INCLDIR)\yaz\diagbib1.h bib1 diagbib1_str $(SRCDIR)\diagsrw.c: $(SRCDIR)\srw.csv @cd $(SRCDIR) - $(TCL) csvtosrw.tcl $(SRCDIR) + $(TCL) csvtodiag.tcl srw.csv diagsrw.c $(INCLDIR)\yaz\diagsrw.h srw $(SRCDIR)\diagsru_update.c: $(SRCDIR)\sru_update.csv @cd $(SRCDIR)