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
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
<!ENTITY chap-server SYSTEM "server.xml">
<!ENTITY chap-future SYSTEM "future.xml">
<!ENTITY std-oid-table SYSTEM "std-oid-table.xml">
+<!ENTITY bib1-diag-table SYSTEM "bib1-diag-table.xml">
+<!ENTITY srw-diag-table SYSTEM "srw-diag-table.xml">
<!ENTITY app-license SYSTEM "license.xml">
<!ENTITY app-indexdata SYSTEM "indexdata.xml">
<!ENTITY app-credits SYSTEM "credits.xml">
&std-oid-table;
</appendix>
+ <appendix id="bib1-diagnostics"><title>Bib-1 diagnostics</title>
+ <para>
+ List of Bib-1 diagnostics that are known to YAZ.
+ </para>
+ &bib1-diag-table;
+ </appendix>
+
+ <appendix id="sru-diagnostics"><title>SRU diagnostics</title>
+ <para>
+ List of SRU diagnostics that are known to YAZ.
+ </para>
+ &srw-diag-table;
+ </appendix>
+
&app-license;
&app-indexdata;
&app-credits;
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
$(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)
+++ /dev/null
-#!/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
close $hfile
}
+proc csvto_xml {csvfname xmlfname id} {
+ set xfile [open $xmlfname w]
+ set csv [open $csvfname r]
+
+ puts $xfile "<!-- Generated by csvtodiag.tcl from $csvfname -->"
+ puts $xfile "<informaltable id=\"${id}\">"
+ puts $xfile {<tgroup cols="2">}
+ puts $xfile {<colspec colwidth="1*" colname="code"></colspec>}
+ puts $xfile {<colspec colwidth="4*" colname="text"></colspec>}
+ puts $xfile {<thead>}
+ puts $xfile {<row>}
+ puts $xfile {<entry>Code</entry>}
+ puts $xfile {<entry>Text</entry>}
+ puts $xfile {</row>}
+ puts $xfile {</thead>}
+ puts $xfile {<tbody>}
+
+ 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 {<row>}
+ puts $xfile {<entry>}
+ puts $xfile $code
+ puts $xfile {</entry><entry>}
+ puts $xfile $msg
+ puts $xfile {</entry>}
+ puts $xfile {</row>}
+ }
+ }
+ puts $xfile {</tbody>}
+ puts $xfile {</tgroup>}
+ puts $xfile {</informaltable>}
+
+ 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
+++ /dev/null
-#!/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 {}
$(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)